Documentation update

This commit is contained in:
Mat Groves 2013-02-20 19:05:51 +00:00
parent 7a977ace5c
commit 18dca7aee1
88 changed files with 21329 additions and 331 deletions

View file

@ -14,13 +14,12 @@ Also its fast.
### Current features ### ### Current features ###
- webGL renderer (with automatic smart batching allowing for REALLY fast performance) - webGL renderer (with automatic smart batching allowing for REALLY fast performance)
- canvas renderer - canvas renderer
- full scene graph - 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 - support for texture atlas's
- asset loader / sprite sheet loader - asset loader / sprite sheet loader
- auto detect which renderer should be used - auto detect which renderer should be used
- handles device context loss
### Coming soon ### ### Coming soon ###
@ -48,8 +47,8 @@ Also its fast.
var stage = new PIXI.Stage; var stage = new PIXI.Stage;
var bunnyTexture = new PIXI.Texture("bunny.png"); var bunnyTexture = new PIXI.Texture.fromImage("bunny.png");
var bunny = new PIXI.Sprite(rabbitTexture); var bunny = new PIXI.Sprite(bunnyTexture);
bunny.position.x = 400; bunny.position.x = 400;
bunny.position.y = 300; bunny.position.y = 300;

View file

@ -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<b.length;c++)try{return new ActiveXObject(b[c])}catch(f){}else return window.XMLHttpRequest?new XMLHttpRequest:!1};var PIXI=PIXI||{};PIXI.EventTarget=function(){var b={};this.addEventListener=function(c,f){void 0===b[c]&&(b[c]=[]);-1===b[c].indexOf(f)&&b[c].push(f)};this.dispatchEvent=function(c){for(var f in b[c.type])b[c.type][f](c)};this.removeEventListener=function(c,f){var e=b[c].indexOf(f);-1!==e&&b[c].splice(e,1)}};(function(b,c){"object"===typeof exports?module.exports=c(global):"function"===typeof define&&define.amd?define([],function(){return c(b)}):c(b)})(this,function(b){function c(a){return k=a}function f(){return k="undefined"!==typeof Float32Array?Float32Array:Array}var e={};if("undefined"!=typeof Float32Array){var g=new Float32Array(1),h=new Int32Array(g.buffer);e.invsqrt=function(a){g[0]=a;h[0]=1597463007-(h[0]>>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<b.length;c++)try{return new ActiveXObject(b[c])}catch(f){}else return window.XMLHttpRequest?new XMLHttpRequest:!1};PIXI=PIXI||{};PIXI.EventTarget=function(){var b={};this.addEventListener=function(c,f){void 0===b[c]&&(b[c]=[]);-1===b[c].indexOf(f)&&b[c].push(f)};this.dispatchEvent=function(c){for(var f in b[c.type])b[c.type][f](c)};this.removeEventListener=function(c,f){var e=b[c].indexOf(f);-1!==e&&b[c].splice(e,1)}};(function(b,c){"object"===typeof exports?module.exports=c(global):"function"===typeof define&&define.amd?define([],function(){return c(b)}):c(b)})(this,function(b){function c(a){return k=a}function f(){return k="undefined"!==typeof Float32Array?Float32Array:Array}var e={};if("undefined"!=typeof Float32Array){var g=new Float32Array(1),h=new Int32Array(g.buffer);e.invsqrt=function(a){g[0]=a;h[0]=1597463007-(h[0]>>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, 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* d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[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= 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,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
(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= (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;","}"]; 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.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;e<c.length;e++)f+=c[e];e=b.createShader(b.VERTEX_SHADER);b.shaderSource(e,f);b.compileShader(e);return!b.getShaderParameter(e,b.COMPILE_STATUS)?(alert(b.getShaderInfoLog(e)),null):e};PIXI.CompileFragmentShader=function(b,c){for(var f="",e=0;e<c.length;e++)f+=c[e];e=b.createShader(b.FRAGMENT_SHADER);b.shaderSource(e,f);b.compileShader(e);return!b.getShaderParameter(e,b.COMPILE_STATUS)?(alert(b.getShaderInfoLog(e)),null):e};PIXI=PIXI||{};PIXI._defaultFrame={x:0,y:0,width:1,height:1}; PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;e<c.length;e++)f+=c[e];e=b.createShader(b.VERTEX_SHADER);b.shaderSource(e,f);b.compileShader(e);return!b.getShaderParameter(e,b.COMPILE_STATUS)?(alert(b.getShaderInfoLog(e)),null):e};PIXI.CompileFragmentShader=function(b,c){for(var f="",e=0;e<c.length;e++)f+=c[e];e=b.createShader(b.FRAGMENT_SHADER);b.shaderSource(e,f);b.compileShader(e);return!b.getShaderParameter(e,b.COMPILE_STATUS)?(alert(b.getShaderInfoLog(e)),null):e};PIXI=PIXI||{};PIXI._defaultFrame=new PIXI.Rectangle(0,0,1,1);
PIXI.WebGLRenderer=function(b,c){this.width=b?b:800;this.height=c?c:600;this.view=document.createElement("canvas");this.view.width=this.width;this.view.height=this.height;this.view.background="#FF0000";var f=this;this.view.addEventListener("webglcontextlost",function(b){f.handleContextLost(b)},!1);this.view.addEventListener("webglcontextrestored",function(b){f.handleContextRestored(b)},!1);this.batchs=[];try{this.gl=this.view.getContext("experimental-webgl",{alpha:!1})}catch(e){throw Error(" This browser does not support webGL. Try using the canvas renderer"+ PIXI.WebGLRenderer=function(b,c){this.width=b?b:800;this.height=c?c:600;this.view=document.createElement("canvas");this.view.width=this.width;this.view.height=this.height;this.view.background="#FF0000";var f=this;this.view.addEventListener("webglcontextlost",function(b){f.handleContextLost(b)},!1);this.view.addEventListener("webglcontextrestored",function(b){f.handleContextRestored(b)},!1);this.batchs=[];try{this.gl=this.view.getContext("experimental-webgl",{alpha:!1})}catch(e){throw Error(" This browser does not support webGL. Try using the canvas renderer"+
this);}this.initShaders();var g=this.gl;this.batch=new PIXI.WebGLBatch(g);g.disable(g.DEPTH_TEST);g.enable(g.BLEND);g.colorMask(!0,!0,!0,!1);this.projectionMatrix=mat4.create();this.resize(this.width,this.height);this.contextLost=!1};PIXI.WebGLRenderer.constructor=PIXI.WebGLRenderer; this);}this.initShaders();var g=this.gl;this.batch=new PIXI.WebGLBatch(g);g.disable(g.DEPTH_TEST);g.enable(g.BLEND);g.colorMask(!0,!0,!0,!1);this.projectionMatrix=mat4.create();this.resize(this.width,this.height);this.contextLost=!1};PIXI.WebGLRenderer.constructor=PIXI.WebGLRenderer;
PIXI.WebGLRenderer.prototype.initShaders=function(){var b=this.gl,c=PIXI.CompileFragmentShader(b,PIXI.shaderFragmentSrc),f=PIXI.CompileVertexShader(b,PIXI.shaderVertexSrc),e=this.shaderProgram=b.createProgram();b.attachShader(e,f);b.attachShader(e,c);b.linkProgram(e);b.getProgramParameter(e,b.LINK_STATUS)||alert("Could not initialise shaders");b.useProgram(e);e.vertexPositionAttribute=b.getAttribLocation(e,"aVertexPosition");b.enableVertexAttribArray(e.vertexPositionAttribute);e.textureCoordAttribute= PIXI.WebGLRenderer.prototype.initShaders=function(){var b=this.gl,c=PIXI.CompileFragmentShader(b,PIXI.shaderFragmentSrc),f=PIXI.CompileVertexShader(b,PIXI.shaderVertexSrc),e=this.shaderProgram=b.createProgram();b.attachShader(e,f);b.attachShader(e,c);b.linkProgram(e);b.getProgramParameter(e,b.LINK_STATUS)||alert("Could not initialise shaders");b.useProgram(e);e.vertexPositionAttribute=b.getAttribLocation(e,"aVertexPosition");b.enableVertexAttribArray(e.vertexPositionAttribute);e.textureCoordAttribute=
@ -62,20 +62,12 @@ c.init(b);e?(e=this.batchs.indexOf(e),this.batchs.splice(e+1,0,c)):this.batchs.p
PIXI.WebGLRenderer.prototype.removeDisplayObject=function(b){b.cacheVisible=b.visible;if(b.renderable){var c;if(b instanceof PIXI.Sprite){var f=b.batch;if(!f)return;f.remove(b);0==f.size&&(c=f)}else c=b;c&&(b=this.batchs.indexOf(c),-1!=b&&(!(0==b||b==this.batchs.length-1)&&this.batchs[b-1]instanceof PIXI.WebGLBatch&&this.batchs[b+1]instanceof PIXI.WebGLBatch&&this.batchs[b-1].texture==this.batchs[b+1].texture?(this.batchs[b-1].merge(this.batchs[b+1]),c instanceof PIXI.WebGLBatch&&PIXI._returnBatch(c), PIXI.WebGLRenderer.prototype.removeDisplayObject=function(b){b.cacheVisible=b.visible;if(b.renderable){var c;if(b instanceof PIXI.Sprite){var f=b.batch;if(!f)return;f.remove(b);0==f.size&&(c=f)}else c=b;c&&(b=this.batchs.indexOf(c),-1!=b&&(!(0==b||b==this.batchs.length-1)&&this.batchs[b-1]instanceof PIXI.WebGLBatch&&this.batchs[b+1]instanceof PIXI.WebGLBatch&&this.batchs[b-1].texture==this.batchs[b+1].texture?(this.batchs[b-1].merge(this.batchs[b+1]),c instanceof PIXI.WebGLBatch&&PIXI._returnBatch(c),
PIXI._returnBatch(this.batchs[b+1]),this.batchs.splice(b,2)):(this.batchs.splice(b,1),c instanceof PIXI.WebGLBatch&&PIXI._returnBatch(c))))}};PIXI.WebGLRenderer.prototype.resize=function(b,c){this.width=b;this.height=c;this.view.width=b;this.view.height=c;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])}; PIXI._returnBatch(this.batchs[b+1]),this.batchs.splice(b,2)):(this.batchs.splice(b,1),c instanceof PIXI.WebGLBatch&&PIXI._returnBatch(c))))}};PIXI.WebGLRenderer.prototype.resize=function(b,c){this.width=b;this.height=c;this.view.width=b;this.view.height=c;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])};
PIXI.WebGLRenderer.prototype.initStrip=function(b){var c=this.gl;b._vertexBuffer=c.createBuffer();b._indexBuffer=c.createBuffer();b._uvBuffer=c.createBuffer();b._colorBuffer=c.createBuffer();c.bindBuffer(c.ARRAY_BUFFER,b._vertexBuffer);c.bufferData(c.ARRAY_BUFFER,b.verticies,c.DYNAMIC_DRAW);c.bindBuffer(c.ARRAY_BUFFER,b._uvBuffer);c.bufferData(c.ARRAY_BUFFER,b.uvs,c.STATIC_DRAW);c.bindBuffer(c.ARRAY_BUFFER,b._colorBuffer);c.bufferData(c.ARRAY_BUFFER,b.colors,c.STATIC_DRAW);c.bindBuffer(c.ELEMENT_ARRAY_BUFFER, PIXI.WebGLRenderer.prototype.initStrip=function(b){var c=this.gl;b._vertexBuffer=c.createBuffer();b._indexBuffer=c.createBuffer();b._uvBuffer=c.createBuffer();b._colorBuffer=c.createBuffer();c.bindBuffer(c.ARRAY_BUFFER,b._vertexBuffer);c.bufferData(c.ARRAY_BUFFER,b.verticies,c.DYNAMIC_DRAW);c.bindBuffer(c.ARRAY_BUFFER,b._uvBuffer);c.bufferData(c.ARRAY_BUFFER,b.uvs,c.STATIC_DRAW);c.bindBuffer(c.ARRAY_BUFFER,b._colorBuffer);c.bufferData(c.ARRAY_BUFFER,b.colors,c.STATIC_DRAW);c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,
b._indexBuffer);c.bufferData(c.ELEMENT_ARRAY_BUFFER,b.indices,c.STATIC_DRAW)};var bloop=!0; b._indexBuffer);c.bufferData(c.ELEMENT_ARRAY_BUFFER,b.indices,c.STATIC_DRAW)};
PIXI.WebGLRenderer.prototype.renderStrip=function(b){var c=this.gl,f=this.shaderProgram,e=mat3.toMat4(b.worldTransform);mat4.transpose(e);mat4.multiply(this.projectionMatrix,e,e);c.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform,!1,e);b.blendMode==PIXI.blendModes.NORMAL?c.blendFunc(c.ONE,c.ONE_MINUS_SRC_ALPHA):c.blendFunc(c.ONE,c.ONE_MINUS_SRC_COLOR);b.dirty?(b.dirty=!1,c.bindBuffer(c.ARRAY_BUFFER,b._vertexBuffer),c.bufferData(c.ARRAY_BUFFER,b.verticies,c.STATIC_DRAW),c.vertexAttribPointer(f.vertexPositionAttribute, PIXI.WebGLRenderer.prototype.renderStrip=function(b){var c=this.gl,f=this.shaderProgram,e=mat3.toMat4(b.worldTransform);mat4.transpose(e);mat4.multiply(this.projectionMatrix,e,e);c.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform,!1,e);b.blendMode==PIXI.blendModes.NORMAL?c.blendFunc(c.ONE,c.ONE_MINUS_SRC_ALPHA):c.blendFunc(c.ONE,c.ONE_MINUS_SRC_COLOR);b.dirty?(b.dirty=!1,c.bindBuffer(c.ARRAY_BUFFER,b._vertexBuffer),c.bufferData(c.ARRAY_BUFFER,b.verticies,c.STATIC_DRAW),c.vertexAttribPointer(f.vertexPositionAttribute,
2,c.FLOAT,!1,0,0),c.bindBuffer(c.ARRAY_BUFFER,b._uvBuffer),c.bufferData(c.ARRAY_BUFFER,b.uvs,c.STATIC_DRAW),c.vertexAttribPointer(f.textureCoordAttribute,2,c.FLOAT,!1,0,0),c.activeTexture(c.TEXTURE0),c.bindTexture(c.TEXTURE_2D,b.texture.baseTexture._glTexture),c.bindBuffer(c.ARRAY_BUFFER,b._colorBuffer),c.bufferData(c.ARRAY_BUFFER,b.colors,c.STATIC_DRAW),c.vertexAttribPointer(f.colorAttribute,1,c.FLOAT,!1,0,0),c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,b._indexBuffer),c.bufferData(c.ELEMENT_ARRAY_BUFFER, 2,c.FLOAT,!1,0,0),c.bindBuffer(c.ARRAY_BUFFER,b._uvBuffer),c.bufferData(c.ARRAY_BUFFER,b.uvs,c.STATIC_DRAW),c.vertexAttribPointer(f.textureCoordAttribute,2,c.FLOAT,!1,0,0),c.activeTexture(c.TEXTURE0),c.bindTexture(c.TEXTURE_2D,b.texture.baseTexture._glTexture),c.bindBuffer(c.ARRAY_BUFFER,b._colorBuffer),c.bufferData(c.ARRAY_BUFFER,b.colors,c.STATIC_DRAW),c.vertexAttribPointer(f.colorAttribute,1,c.FLOAT,!1,0,0),c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,b._indexBuffer),c.bufferData(c.ELEMENT_ARRAY_BUFFER,
b.indices,c.STATIC_DRAW)):(c.bindBuffer(c.ARRAY_BUFFER,b._vertexBuffer),c.bufferSubData(c.ARRAY_BUFFER,0,b.verticies),c.vertexAttribPointer(f.vertexPositionAttribute,2,c.FLOAT,!1,0,0),c.bindBuffer(c.ARRAY_BUFFER,b._uvBuffer),c.vertexAttribPointer(f.textureCoordAttribute,2,c.FLOAT,!1,0,0),c.activeTexture(c.TEXTURE0),c.bindTexture(c.TEXTURE_2D,b.texture.baseTexture._glTexture),c.bindBuffer(c.ARRAY_BUFFER,b._colorBuffer),c.vertexAttribPointer(f.colorAttribute,1,c.FLOAT,!1,0,0),c.bindBuffer(c.ELEMENT_ARRAY_BUFFER, b.indices,c.STATIC_DRAW)):(c.bindBuffer(c.ARRAY_BUFFER,b._vertexBuffer),c.bufferSubData(c.ARRAY_BUFFER,0,b.verticies),c.vertexAttribPointer(f.vertexPositionAttribute,2,c.FLOAT,!1,0,0),c.bindBuffer(c.ARRAY_BUFFER,b._uvBuffer),c.vertexAttribPointer(f.textureCoordAttribute,2,c.FLOAT,!1,0,0),c.activeTexture(c.TEXTURE0),c.bindTexture(c.TEXTURE_2D,b.texture.baseTexture._glTexture),c.bindBuffer(c.ARRAY_BUFFER,b._colorBuffer),c.vertexAttribPointer(f.colorAttribute,1,c.FLOAT,!1,0,0),c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,
b._indexBuffer));c.drawElements(c.TRIANGLE_STRIP,b.indices.length,c.UNSIGNED_SHORT,0);c.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform,!1,this.projectionMatrix)};PIXI.WebGLRenderer.prototype.handleContextLost=function(b){b.preventDefault();this.contextLost=!0}; b._indexBuffer));c.drawElements(c.TRIANGLE_STRIP,b.indices.length,c.UNSIGNED_SHORT,0);c.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform,!1,this.projectionMatrix)};PIXI.WebGLRenderer.prototype.handleContextLost=function(b){b.preventDefault();this.contextLost=!0};
PIXI.WebGLRenderer.prototype.handleContextRestored=function(){this.gl=this.view.getContext("experimental-webgl",{alpha:!0});this.initShaders();for(var b=0;b<PIXI.TextureCache.length;b++)this.updateTexture(PIXI.TextureCache[b]);for(b=0;b<this.batchs.length;b++)this.batchs[b].restoreLostContext(this.gl),this.batchs[b].dirty=!0;PIXI._restoreBatchs(this.gl);this.contextLost=!1};PIXI=PIXI||{};PIXI.CanvasRenderer=function(b,c){this.width=b?b:800;this.height=c?c:600;this.refresh=!0;this.view=document.createElement("canvas");this.view.width=this.width;this.view.height=this.height;this.view.background="#FF0000";this.count=0;this.context=this.view.getContext("2d")};PIXI.CanvasRenderer.constructor=PIXI.CanvasRenderer; PIXI.WebGLRenderer.prototype.handleContextRestored=function(){this.gl=this.view.getContext("experimental-webgl",{alpha:!0});this.initShaders();for(var b=0;b<PIXI.TextureCache.length;b++)this.updateTexture(PIXI.TextureCache[b]);for(b=0;b<this.batchs.length;b++)this.batchs[b].restoreLostContext(this.gl),this.batchs[b].dirty=!0;PIXI._restoreBatchs(this.gl);this.contextLost=!1};PIXI=PIXI||{};PIXI._batchs=[];PIXI._getBatch=function(b){return 0==PIXI._batchs.length?new PIXI.WebGLBatch(b):PIXI._batchs.pop()};PIXI._returnBatch=function(b){b.clean();PIXI._batchs.push(b)};PIXI._restoreBatchs=function(b){for(var c=0;c<PIXI._batchs.length;c++)PIXI._batchs[c].restoreLostContext(b)};
PIXI.CanvasRenderer.prototype.render=function(b){b.__childrenAdded=[];b.__childrenRemoved=[];PIXI.texturesToUpdate=[];this.context.setTransform(1,0,0,1,0,0);b.updateTransform();this.context.setTransform(1,0,0,1,0,0);this.context.clearRect(0,0,this.width,this.height);this.renderDisplayObject(b)};PIXI.CanvasRenderer.prototype.resize=function(b,c){this.width=b;this.height=c;this.view.width=b;this.view.height=c};
PIXI.CanvasRenderer.prototype.renderDisplayObject=function(b){var c=b.worldTransform,f=this.context;f.globalCompositeOperation="source-over";if(b.visible){if(b instanceof PIXI.Sprite){var e=b.texture.frame;e&&(f.globalAlpha=b.worldAlpha,0==b.rotation?(this.context.setTransform(1,0,0,1,0,0),f.drawImage(b.texture.baseTexture.image,e.x,e.y,e.width,e.height,c[2]+b.anchor.x*-e.width+0.5|0,c[5]+b.anchor.y*-e.height+0.5|0,e.width*c[0],e.height*c[4])):(f.setTransform(c[0],c[3],c[1],c[4],c[2],c[5]),f.drawImage(b.texture.baseTexture.image,
e.x,e.y,e.width,e.height,b.anchor.x*-e.width,b.anchor.y*-e.height,e.width,e.height)))}else b instanceof PIXI.Strip&&(f.setTransform(c[0],c[3],c[1],c[4],c[2],c[5]),this.renderStrip(b));for(c=0;c<b.children.length;c++)this.renderDisplayObject(b.children[c])}};
PIXI.CanvasRenderer.prototype.renderStripFlat=function(b){var c=this.context;b=b.verticies;var f=b.length/2;this.count++;c.beginPath();for(var e=1;e<f-2;e++){var g=2*e,h=b[g+2],k=b[g+4],l=b[g+3],p=b[g+5];c.moveTo(b[g],b[g+1]);c.lineTo(h,l);c.lineTo(k,p)}c.fillStyle="#FF0000";c.fill();c.closePath()};
PIXI.CanvasRenderer.prototype.renderStrip=function(b){var c=this.context,f=b.verticies,e=b.uvs,g=f.length/2;this.count++;for(var h=1;h<g-2;h++){var k=2*h,l=f[k],p=f[k+2],q=f[k+4],C=f[k+1],F=f[k+3],u=f[k+5],w=e[k]*b.texture.width,x=e[k+2]*b.texture.width,t=e[k+4]*b.texture.width,m=e[k+1]*b.texture.height,H=e[k+3]*b.texture.height,k=e[k+5]*b.texture.height;c.save();c.beginPath();c.moveTo(l,C);c.lineTo(p,F);c.lineTo(q,u);c.closePath();c.clip();var B=w*H+m*t+x*k-H*t-m*x-w*k;c.transform((l*H+m*q+p*k-H*
q-m*p-l*k)/B,(C*H+m*u+F*k-H*u-m*F-C*k)/B,(w*p+l*t+x*q-p*t-l*x-w*q)/B,(w*F+C*t+x*u-F*t-C*x-w*u)/B,(w*H*q+m*p*t+l*x*k-l*H*t-m*x*q-w*p*k)/B,(w*H*u+m*F*t+C*x*k-C*H*t-m*x*u-w*F*k)/B);c.drawImage(b.texture.baseTexture.image,0,0);c.restore()}};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;PIXI=PIXI||{};PIXI.DisplayObject=function(){this.position=new PIXI.Point;this.scale=new PIXI.Point(1,1);this.rotation=0;this.alpha=1;this.visible=!0;this.stage=this.parent=null;this.worldAlpha=1;this.color=[];this.worldTransform=mat3.identity();this.localTransform=mat3.identity();this.dynamic=!0;this._sr=0;this._cr=1;this.renderable=!1};PIXI.DisplayObject.constructor=PIXI.DisplayObject;
PIXI.DisplayObject.prototype.updateTransform=function(){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;this.localTransform[2]=this.position.x;this.localTransform[5]=this.position.y;mat3.multiply(this.localTransform,this.parent.worldTransform,
this.worldTransform);this.worldAlpha=this.alpha*this.parent.worldAlpha};PIXI=PIXI||{};PIXI._batchs=[];PIXI._getBatch=function(b){return 0==PIXI._batchs.length?new PIXI.WebGLBatch(b):PIXI._batchs.pop()};PIXI._returnBatch=function(b){b.clean();PIXI._batchs.push(b)};PIXI._restoreBatchs=function(b){for(var c=0;c<PIXI._batchs.length;c++)PIXI._batchs[c].restoreLostContext(b)};
PIXI.WebGLBatch=function(b){this.gl=b;this.size=0;this.vertexBuffer=b.createBuffer();this.indexBuffer=b.createBuffer();this.uvBuffer=b.createBuffer();this.colorBuffer=b.createBuffer();this.blendMode=PIXI.blendModes.NORMAL;this.dynamicSize=1};PIXI.WebGLBatch.constructor=PIXI.WebGLBatch;PIXI.WebGLBatch.prototype.clean=function(){this.verticies=[];this.uvs=[];this.indices=[];this.colors=[];this.dynamicSize=1;this.last=this.texture=null;this.size=0;this.head;this.tail}; PIXI.WebGLBatch=function(b){this.gl=b;this.size=0;this.vertexBuffer=b.createBuffer();this.indexBuffer=b.createBuffer();this.uvBuffer=b.createBuffer();this.colorBuffer=b.createBuffer();this.blendMode=PIXI.blendModes.NORMAL;this.dynamicSize=1};PIXI.WebGLBatch.constructor=PIXI.WebGLBatch;PIXI.WebGLBatch.prototype.clean=function(){this.verticies=[];this.uvs=[];this.indices=[];this.colors=[];this.dynamicSize=1;this.last=this.texture=null;this.size=0;this.head;this.tail};
PIXI.WebGLBatch.prototype.restoreLostContext=function(b){this.gl=b;this.vertexBuffer=b.createBuffer();this.indexBuffer=b.createBuffer();this.uvBuffer=b.createBuffer();this.colorBuffer=b.createBuffer()};PIXI.WebGLBatch.prototype.init=function(b){b.batch=this;this.dirty=!0;this.blendMode=b.blendMode;this.texture=b.texture.baseTexture;this.tail=this.head=b;this.size=1;this.growBatch()}; PIXI.WebGLBatch.prototype.restoreLostContext=function(b){this.gl=b;this.vertexBuffer=b.createBuffer();this.indexBuffer=b.createBuffer();this.uvBuffer=b.createBuffer();this.colorBuffer=b.createBuffer()};PIXI.WebGLBatch.prototype.init=function(b){b.batch=this;this.dirty=!0;this.blendMode=b.blendMode;this.texture=b.texture.baseTexture;this.tail=this.head=b;this.size=1;this.growBatch()};
PIXI.WebGLBatch.prototype.insertBefore=function(b,c){this.size++;b.batch=this;this.dirty=!0;var f=c.__prev;c.__prev=b;b.__next=c;f?(b.__prev=f,f.__next=b):this.head=b};PIXI.WebGLBatch.prototype.insertAfter=function(b,c){this.size++;b.batch=this;this.dirty=!0;var f=c.__next;c.__next=b;b.__prev=c;f?(b.__next=f,f.__prev=b):this.tail=b}; PIXI.WebGLBatch.prototype.insertBefore=function(b,c){this.size++;b.batch=this;this.dirty=!0;var f=c.__prev;c.__prev=b;b.__next=c;f?(b.__prev=f,f.__next=b):this.head=b};PIXI.WebGLBatch.prototype.insertAfter=function(b,c){this.size++;b.batch=this;this.dirty=!0;var f=c.__next;c.__next=b;b.__prev=c;f?(b.__next=f,f.__prev=b):this.tail=b};
@ -88,7 +80,15 @@ PIXI.WebGLBatch.prototype.refresh=function(){this.dynamicSize<this.size&&this.gr
PIXI.WebGLBatch.prototype.update=function(){for(var b,c,f,e,g,h,k,l,p,q,C,F=0,u=this.head;u;)c=u.width,f=u.height,e=u.anchor.x,g=u.anchor.y,h=c*(1-e),c*=-e,e=f*(1-g),g=f*-g,f=8*F,b=u.worldTransform,k=b[0],l=b[3],p=b[1],q=b[4],C=b[2],b=b[5],this.verticies[f+0]=k*c+p*g+C,this.verticies[f+1]=q*g+l*c+b,this.verticies[f+2]=k*h+p*g+C,this.verticies[f+3]=q*g+l*h+b,this.verticies[f+4]=k*h+p*e+C,this.verticies[f+5]=q*e+l*h+b,this.verticies[f+6]=k*c+p*e+C,this.verticies[f+7]=q*e+l*c+b,u.updateFrame&&(this.dirtyUVS= PIXI.WebGLBatch.prototype.update=function(){for(var b,c,f,e,g,h,k,l,p,q,C,F=0,u=this.head;u;)c=u.width,f=u.height,e=u.anchor.x,g=u.anchor.y,h=c*(1-e),c*=-e,e=f*(1-g),g=f*-g,f=8*F,b=u.worldTransform,k=b[0],l=b[3],p=b[1],q=b[4],C=b[2],b=b[5],this.verticies[f+0]=k*c+p*g+C,this.verticies[f+1]=q*g+l*c+b,this.verticies[f+2]=k*h+p*g+C,this.verticies[f+3]=q*g+l*h+b,this.verticies[f+4]=k*h+p*e+C,this.verticies[f+5]=q*e+l*h+b,this.verticies[f+6]=k*c+p*e+C,this.verticies[f+7]=q*e+l*c+b,u.updateFrame&&(this.dirtyUVS=
!0,e=u.texture,h=e.frame,c=e.baseTexture.width,e=e.baseTexture.height,this.uvs[f+0]=h.x/c,this.uvs[f+1]=h.y/e,this.uvs[f+2]=(h.x+h.width)/c,this.uvs[f+3]=h.y/e,this.uvs[f+4]=(h.x+h.width)/c,this.uvs[f+5]=(h.y+h.height)/e,this.uvs[f+6]=h.x/c,this.uvs[f+7]=(h.y+h.height)/e,u.updateFrame=!1),u.cacheAlpha!=u.alpha&&(u.cacheAlpha=u.alpha,h=4*F,this.colors[void 0]=this.colors[h+1]=this.colors[h+2]=this.colors[h+3]=u.worldAlpha,this.dirtyColors=!0),F++,u=u.__next}; !0,e=u.texture,h=e.frame,c=e.baseTexture.width,e=e.baseTexture.height,this.uvs[f+0]=h.x/c,this.uvs[f+1]=h.y/e,this.uvs[f+2]=(h.x+h.width)/c,this.uvs[f+3]=h.y/e,this.uvs[f+4]=(h.x+h.width)/c,this.uvs[f+5]=(h.y+h.height)/e,this.uvs[f+6]=h.x/c,this.uvs[f+7]=(h.y+h.height)/e,u.updateFrame=!1),u.cacheAlpha!=u.alpha&&(u.cacheAlpha=u.alpha,h=4*F,this.colors[void 0]=this.colors[h+1]=this.colors[h+2]=this.colors[h+3]=u.worldAlpha,this.dirtyColors=!0),F++,u=u.__next};
PIXI.WebGLBatch.prototype.render=function(){this.dirty&&(this.refresh(),this.dirty=!1);if(0!=this.size){this.update();var b=this.gl;this.blendMode==PIXI.blendModes.NORMAL?b.blendFunc(b.ONE,b.ONE_MINUS_SRC_ALPHA):b.blendFunc(b.ONE,b.ONE_MINUS_SRC_COLOR);var c=PIXI.shaderProgram;b.bindBuffer(b.ARRAY_BUFFER,this.vertexBuffer);b.bufferSubData(b.ARRAY_BUFFER,0,this.verticies);b.vertexAttribPointer(c.vertexPositionAttribute,2,b.FLOAT,!1,0,0);b.bindBuffer(b.ARRAY_BUFFER,this.uvBuffer);this.dirtyUVS&&(this.dirtyUVS= PIXI.WebGLBatch.prototype.render=function(){this.dirty&&(this.refresh(),this.dirty=!1);if(0!=this.size){this.update();var b=this.gl;this.blendMode==PIXI.blendModes.NORMAL?b.blendFunc(b.ONE,b.ONE_MINUS_SRC_ALPHA):b.blendFunc(b.ONE,b.ONE_MINUS_SRC_COLOR);var c=PIXI.shaderProgram;b.bindBuffer(b.ARRAY_BUFFER,this.vertexBuffer);b.bufferSubData(b.ARRAY_BUFFER,0,this.verticies);b.vertexAttribPointer(c.vertexPositionAttribute,2,b.FLOAT,!1,0,0);b.bindBuffer(b.ARRAY_BUFFER,this.uvBuffer);this.dirtyUVS&&(this.dirtyUVS=
!1,b.bufferSubData(b.ARRAY_BUFFER,0,this.uvs));b.vertexAttribPointer(c.textureCoordAttribute,2,b.FLOAT,!1,0,0);b.activeTexture(b.TEXTURE0);b.bindTexture(b.TEXTURE_2D,this.texture._glTexture);b.bindBuffer(b.ARRAY_BUFFER,this.colorBuffer);this.dirtyColors&&(this.dirtyColors=!1,b.bufferSubData(b.ARRAY_BUFFER,0,this.colors));b.vertexAttribPointer(c.colorAttribute,1,b.FLOAT,!1,0,0);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,this.indexBuffer);b.drawElements(b.TRIANGLES,6*this.size,b.UNSIGNED_SHORT,0)}};PIXI=PIXI||{};PIXI.DisplayObjectContainer=function(){PIXI.DisplayObject.call(this);this.children=[];this.renderable=!1};PIXI.DisplayObjectContainer.constructor=PIXI.DisplayObjectContainer;PIXI.DisplayObjectContainer.prototype=Object.create(PIXI.DisplayObject.prototype);PIXI.DisplayObjectContainer.prototype.addChild=function(b){void 0!=b.parent&&b.parent.removeChild(b);b.parent=this;b.childIndex=this.children.length;this.children.push(b);this.stage&&this.stage.__addChild(b)}; !1,b.bufferSubData(b.ARRAY_BUFFER,0,this.uvs));b.vertexAttribPointer(c.textureCoordAttribute,2,b.FLOAT,!1,0,0);b.activeTexture(b.TEXTURE0);b.bindTexture(b.TEXTURE_2D,this.texture._glTexture);b.bindBuffer(b.ARRAY_BUFFER,this.colorBuffer);this.dirtyColors&&(this.dirtyColors=!1,b.bufferSubData(b.ARRAY_BUFFER,0,this.colors));b.vertexAttribPointer(c.colorAttribute,1,b.FLOAT,!1,0,0);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,this.indexBuffer);b.drawElements(b.TRIANGLES,6*this.size,b.UNSIGNED_SHORT,0)}};PIXI=PIXI||{};PIXI.CanvasRenderer=function(b,c){this.width=b?b:800;this.height=c?c:600;this.refresh=!0;this.view=document.createElement("canvas");this.view.width=this.width;this.view.height=this.height;this.view.background="#FF0000";this.count=0;this.context=this.view.getContext("2d")};PIXI.CanvasRenderer.constructor=PIXI.CanvasRenderer;
PIXI.CanvasRenderer.prototype.render=function(b){b.__childrenAdded=[];b.__childrenRemoved=[];PIXI.texturesToUpdate=[];this.context.setTransform(1,0,0,1,0,0);b.updateTransform();this.context.setTransform(1,0,0,1,0,0);this.context.clearRect(0,0,this.width,this.height);this.renderDisplayObject(b)};PIXI.CanvasRenderer.prototype.resize=function(b,c){this.width=b;this.height=c;this.view.width=b;this.view.height=c};
PIXI.CanvasRenderer.prototype.renderDisplayObject=function(b){var c=b.worldTransform,f=this.context;f.globalCompositeOperation="source-over";if(b.visible){if(b instanceof PIXI.Sprite){var e=b.texture.frame;e&&(f.globalAlpha=b.worldAlpha,0==b.rotation?(this.context.setTransform(1,0,0,1,0,0),f.drawImage(b.texture.baseTexture.image,e.x,e.y,e.width,e.height,c[2]+b.anchor.x*-e.width+0.5|0,c[5]+b.anchor.y*-e.height+0.5|0,e.width*c[0],e.height*c[4])):(f.setTransform(c[0],c[3],c[1],c[4],c[2],c[5]),f.drawImage(b.texture.baseTexture.image,
e.x,e.y,e.width,e.height,b.anchor.x*-e.width,b.anchor.y*-e.height,e.width,e.height)))}else b instanceof PIXI.Strip&&(f.setTransform(c[0],c[3],c[1],c[4],c[2],c[5]),this.renderStrip(b));for(c=0;c<b.children.length;c++)this.renderDisplayObject(b.children[c])}};
PIXI.CanvasRenderer.prototype.renderStripFlat=function(b){var c=this.context;b=b.verticies;var f=b.length/2;this.count++;c.beginPath();for(var e=1;e<f-2;e++){var g=2*e,h=b[g+2],k=b[g+4],l=b[g+3],p=b[g+5];c.moveTo(b[g],b[g+1]);c.lineTo(h,l);c.lineTo(k,p)}c.fillStyle="#FF0000";c.fill();c.closePath()};
PIXI.CanvasRenderer.prototype.renderStrip=function(b){var c=this.context,f=b.verticies,e=b.uvs,g=f.length/2;this.count++;for(var h=1;h<g-2;h++){var k=2*h,l=f[k],p=f[k+2],q=f[k+4],C=f[k+1],F=f[k+3],u=f[k+5],w=e[k]*b.texture.width,x=e[k+2]*b.texture.width,t=e[k+4]*b.texture.width,m=e[k+1]*b.texture.height,H=e[k+3]*b.texture.height,k=e[k+5]*b.texture.height;c.save();c.beginPath();c.moveTo(l,C);c.lineTo(p,F);c.lineTo(q,u);c.closePath();c.clip();var B=w*H+m*t+x*k-H*t-m*x-w*k;c.transform((l*H+m*q+p*k-H*
q-m*p-l*k)/B,(C*H+m*u+F*k-H*u-m*F-C*k)/B,(w*p+l*t+x*q-p*t-l*x-w*q)/B,(w*F+C*t+x*u-F*t-C*x-w*u)/B,(w*H*q+m*p*t+l*x*k-l*H*t-m*x*q-w*p*k)/B,(w*H*u+m*F*t+C*x*k-C*H*t-m*x*u-w*F*k)/B);c.drawImage(b.texture.baseTexture.image,0,0);c.restore()}};PIXI=PIXI||{};PIXI.DisplayObject=function(){this.position=new PIXI.Point;this.scale=new PIXI.Point(1,1);this.rotation=0;this.alpha=1;this.visible=!0;this.stage=this.parent=null;this.worldAlpha=1;this.color=[];this.worldTransform=mat3.identity();this.localTransform=mat3.identity();this.dynamic=!0;this._sr=0;this._cr=1;this.renderable=!1};PIXI.DisplayObject.constructor=PIXI.DisplayObject;
PIXI.DisplayObject.prototype.updateTransform=function(){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;this.localTransform[2]=this.position.x;this.localTransform[5]=this.position.y;mat3.multiply(this.localTransform,this.parent.worldTransform,
this.worldTransform);this.worldAlpha=this.alpha*this.parent.worldAlpha};PIXI=PIXI||{};PIXI.DisplayObjectContainer=function(){PIXI.DisplayObject.call(this);this.children=[];this.renderable=!1};PIXI.DisplayObjectContainer.constructor=PIXI.DisplayObjectContainer;PIXI.DisplayObjectContainer.prototype=Object.create(PIXI.DisplayObject.prototype);PIXI.DisplayObjectContainer.prototype.addChild=function(b){void 0!=b.parent&&b.parent.removeChild(b);b.parent=this;b.childIndex=this.children.length;this.children.push(b);this.stage&&this.stage.__addChild(b)};
PIXI.DisplayObjectContainer.prototype.addChildAt=function(b,c){if(0<=c&&c<=this.children.length){void 0!=b.parent&&b.parent.removeChild(b);c==this.children.length?this.children.push(b):this.children.splice(c,0,b);b.parent=this;b.childIndex=c;for(var f=this.children.length,e=c;e<f;e++)this.children[e].childIndex=e;this.stage&&this.stage.__addChild(b)}else throw Error(b+" The index supplied is out of bounds "+this);}; PIXI.DisplayObjectContainer.prototype.addChildAt=function(b,c){if(0<=c&&c<=this.children.length){void 0!=b.parent&&b.parent.removeChild(b);c==this.children.length?this.children.push(b):this.children.splice(c,0,b);b.parent=this;b.childIndex=c;for(var f=this.children.length,e=c;e<f;e++)this.children[e].childIndex=e;this.stage&&this.stage.__addChild(b)}else throw Error(b+" The index supplied is out of bounds "+this);};
PIXI.DisplayObjectContainer.prototype.removeChild=function(b){var c=this.children.indexOf(b);if(-1!==c){this.stage&&this.stage.__removeChild(b);b.parent=void 0;this.children.splice(c,1);b=c;for(c=this.children.length;b<c;b++)this.children[b].childIndex-=1}else throw Error(b+" The supplied DisplayObject must be a child of the caller "+this);}; PIXI.DisplayObjectContainer.prototype.removeChild=function(b){var c=this.children.indexOf(b);if(-1!==c){this.stage&&this.stage.__removeChild(b);b.parent=void 0;this.children.splice(c,1);b=c;for(c=this.children.length;b<c;b++)this.children[b].childIndex-=1}else throw Error(b+" The supplied DisplayObject must be a child of the caller "+this);};
PIXI.DisplayObjectContainer.prototype.updateTransform=function(){if(this.visible){PIXI.DisplayObject.prototype.updateTransform.call(this);for(var b=0,c=this.children.length;b<c;b++)this.children[b].updateTransform()}};PIXI=PIXI||{};PIXI.Stage=function(){PIXI.DisplayObjectContainer.call(this);this.worldTransform=mat3.identity();this.__childrenAdded=[];this.__childrenRemoved=[];this.childIndex=0;this.stage=this};PIXI.Stage.constructor=PIXI.Stage;PIXI.Stage.prototype=Object.create(PIXI.DisplayObjectContainer.prototype);PIXI.Stage.prototype.updateTransform=function(){this.worldAlpha=1;for(var b=0,c=this.children.length;b<c;b++)this.children[b].updateTransform()}; PIXI.DisplayObjectContainer.prototype.updateTransform=function(){if(this.visible){PIXI.DisplayObject.prototype.updateTransform.call(this);for(var b=0,c=this.children.length;b<c;b++)this.children[b].updateTransform()}};PIXI=PIXI||{};PIXI.Stage=function(){PIXI.DisplayObjectContainer.call(this);this.worldTransform=mat3.identity();this.__childrenAdded=[];this.__childrenRemoved=[];this.childIndex=0;this.stage=this};PIXI.Stage.constructor=PIXI.Stage;PIXI.Stage.prototype=Object.create(PIXI.DisplayObjectContainer.prototype);PIXI.Stage.prototype.updateTransform=function(){this.worldAlpha=1;for(var b=0,c=this.children.length;b<c;b++)this.children[b].updateTransform()};
@ -97,7 +97,7 @@ PIXI.Sprite=function(b){PIXI.DisplayObjectContainer.call(this);this.anchor=new P
PIXI.Sprite.prototype.setTexture=function(b){this.texture.baseTexture!=b.baseTexture&&(this.textureChange=!0);this.texture=b;this.width=b.frame.width;this.height=b.frame.height;this.updateFrame=!0};PIXI.Sprite.prototype.onTextureUpdate=function(){this.width=this.texture.frame.width;this.height=this.texture.frame.height;this.updateFrame=!0};PIXI.Sprite.fromFrame=function(b){var c=PIXI.TextureCache[b];if(!c)throw Error("The frameId '"+b+"' does not exist in the texture cache"+this);return new PIXI.Sprite(c)}; PIXI.Sprite.prototype.setTexture=function(b){this.texture.baseTexture!=b.baseTexture&&(this.textureChange=!0);this.texture=b;this.width=b.frame.width;this.height=b.frame.height;this.updateFrame=!0};PIXI.Sprite.prototype.onTextureUpdate=function(){this.width=this.texture.frame.width;this.height=this.texture.frame.height;this.updateFrame=!0};PIXI.Sprite.fromFrame=function(b){var c=PIXI.TextureCache[b];if(!c)throw Error("The frameId '"+b+"' does not exist in the texture cache"+this);return new PIXI.Sprite(c)};
PIXI.Sprite.fromImage=function(b){b=PIXI.Texture.fromImage(b);return new PIXI.Sprite(b)};PIXI=PIXI||{}; PIXI.Sprite.fromImage=function(b){b=PIXI.Texture.fromImage(b);return new PIXI.Sprite(b)};PIXI=PIXI||{};
PIXI.Strip=function(b,c,f){PIXI.DisplayObjectContainer.call(this);this.texture=b;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(e){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.width=c;this.height=f;b.baseTexture.hasLoaded?(this.width=this.texture.frame.width,this.height= PIXI.Strip=function(b,c,f){PIXI.DisplayObjectContainer.call(this);this.texture=b;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(e){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.width=c;this.height=f;b.baseTexture.hasLoaded?(this.width=this.texture.frame.width,this.height=
this.texture.frame.height,this.updateFrame=!0):(this.onTextureUpdateBind=this.onTextureUpdate.bind(this),this.texture.addEventListener("update",this.onTextureUpdateBind));this.renderable=!0};PIXI.Strip.constructor=PIXI.Strip;PIXI.Strip.prototype=Object.create(PIXI.DisplayObjectContainer.prototype);PIXI.Strip.prototype.setTexture=function(b){this.texture=b;this.width=b.frame.width;this.height=b.frame.height;this.updateFrame=!0};PIXI.Strip.prototype.onTextureUpdate=function(){this.updateFrame=!0};PIXI=PIXI||{};PIXI.Rope=function(b,c){PIXI.Strip.call(this,b);this.points=c;try{this.verticies=new Float32Array(4*c.length),this.uvs=new Float32Array(4*c.length),this.colors=new Float32Array(2*c.length),this.indices=new Uint16Array(2*c.length)}catch(f){this.verticies=verticies,this.uvs=uvs,this.colors=colors,this.indices=indices}this.refresh()};PIXI.Rope.constructor=GAME.Rope;PIXI.Rope.prototype=Object.create(PIXI.Strip.prototype); this.texture.frame.height,this.updateFrame=!0):(this.onTextureUpdateBind=this.onTextureUpdate.bind(this),this.texture.addEventListener("update",this.onTextureUpdateBind));this.renderable=!0};PIXI.Strip.constructor=PIXI.Strip;PIXI.Strip.prototype=Object.create(PIXI.DisplayObjectContainer.prototype);PIXI.Strip.prototype.setTexture=function(b){this.texture=b;this.width=b.frame.width;this.height=b.frame.height;this.updateFrame=!0};PIXI.Strip.prototype.onTextureUpdate=function(){this.updateFrame=!0};PIXI=PIXI||{};PIXI.Rope=function(b,c){PIXI.Strip.call(this,b);this.points=c;try{this.verticies=new Float32Array(4*c.length),this.uvs=new Float32Array(4*c.length),this.colors=new Float32Array(2*c.length),this.indices=new Uint16Array(2*c.length)}catch(f){this.verticies=verticies,this.uvs=uvs,this.colors=colors,this.indices=indices}this.refresh()};PIXI.Rope.constructor=PIXI.Rope;PIXI.Rope.prototype=Object.create(PIXI.Strip.prototype);
PIXI.Rope.prototype.refresh=function(){var b=this.points;if(!(1>b.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;g<b;g++){var h=4*g,k=g/(b-1);c[h]=k;c[h+1]=0;c[h+2]=k;c[h+3]=1;h=2*g;e[h]=1;e[h+1]=1;h=2*g;f[h]=h;f[h+1]=h+1}}}; PIXI.Rope.prototype.refresh=function(){var b=this.points;if(!(1>b.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;g<b;g++){var h=4*g,k=g/(b-1);c[h]=k;c[h+1]=0;c[h+2]=k;c[h+3]=1;h=2*g;e[h]=1;e[h+1]=1;h=2*g;f[h]=h;f[h+1]=h+1}}};
PIXI.Rope.prototype.updateTransform=function(){var b=this.points;if(!(1>b.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<k;l++){var h=b[l],p=4*l;e=l<b.length-1?b[l+1]:h;g=-(e.x-f.x);e=e.y-f.y;var f=Math.sqrt(e*e+g*g),q=this.texture.height/2;e/=f;g/=f;e*=q;g*=q;c[p]=h.x+e;c[p+1]=h.y+g;c[p+2]=h.x-e;c[p+3]=h.y-g;f=h}PIXI.DisplayObjectContainer.prototype.updateTransform.call(this)}}; PIXI.Rope.prototype.updateTransform=function(){var b=this.points;if(!(1>b.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<k;l++){var h=b[l],p=4*l;e=l<b.length-1?b[l+1]:h;g=-(e.x-f.x);e=e.y-f.y;var f=Math.sqrt(e*e+g*g),q=this.texture.height/2;e/=f;g/=f;e*=q;g*=q;c[p]=h.x+e;c[p+1]=h.y+g;c[p+2]=h.x-e;c[p+3]=h.y-g;f=h}PIXI.DisplayObjectContainer.prototype.updateTransform.call(this)}};
PIXI.Rope.prototype.setTexture=function(b){this.texture=b;this.updateFrame=!0};PIXI=PIXI||{};PIXI.MovieClip=function(b){PIXI.Sprite.call(this,b[0]);this.textures=b;this.currentFrame=0;this.animationSpeed=1};PIXI.MovieClip.constructor=PIXI.MovieClip;PIXI.MovieClip.prototype=Object.create(PIXI.Sprite.prototype);PIXI.MovieClip.prototype.stop=function(){this.playing=!1};PIXI.MovieClip.prototype.play=function(){this.playing=!0};PIXI.MovieClip.prototype.gotoAndStop=function(b){this.playing=!1;this.currentFrame=b;this.setTexture(this.textures[(this.currentFrame+0.5|0)%this.textures.length])}; PIXI.Rope.prototype.setTexture=function(b){this.texture=b;this.updateFrame=!0};PIXI=PIXI||{};PIXI.MovieClip=function(b){PIXI.Sprite.call(this,b[0]);this.textures=b;this.currentFrame=0;this.animationSpeed=1};PIXI.MovieClip.constructor=PIXI.MovieClip;PIXI.MovieClip.prototype=Object.create(PIXI.Sprite.prototype);PIXI.MovieClip.prototype.stop=function(){this.playing=!1};PIXI.MovieClip.prototype.play=function(){this.playing=!0};PIXI.MovieClip.prototype.gotoAndStop=function(b){this.playing=!1;this.currentFrame=b;this.setTexture(this.textures[(this.currentFrame+0.5|0)%this.textures.length])};

View file

@ -10,32 +10,40 @@
<target name="run"> <target name="run">
<jscomp compilationLevel="simple" debug="false" output="../bin/pixi.js"> <jscomp compilationLevel="simple" debug="false" output="../../Flash vs HTML/js/pixi.js">
<sources dir="../src/pixi/"> <sources dir="../src/pixi/">
<file name="Point.js"/>
<file name="Rectangle.js"/>
<file name="utils/Utils.js"/> <file name="utils/Utils.js"/>
<file name="utils/EventTarget.js"/> <file name="utils/EventTarget.js"/>
<file name="utils/gl-matrix-min.js"/> <file name="utils/gl-matrix-min.js"/>
<file name="renderers/WebGLShaders.js"/> <file name="renderers/WebGLShaders.js"/>
<file name="renderers/WebGLRenderer.js"/> <file name="renderers/WebGLRenderer.js"/>
<file name="renderers/CanvasRenderer.js"/>
<file name="Point.js"/>
<file name="Rectangle.js"/>
<file name="DisplayObject.js"/>
<file name="renderers/WebGLBatch.js"/> <file name="renderers/WebGLBatch.js"/>
<file name="renderers/CanvasRenderer.js"/>
<file name="DisplayObject.js"/>
<file name="DisplayObjectContainer.js"/> <file name="DisplayObjectContainer.js"/>
<file name="Stage.js"/> <file name="Stage.js"/>
<file name="Sprite.js"/> <file name="Sprite.js"/>
<file name="extras/Strip.js"/> <file name="extras/Strip.js"/>
<file name="extras/Rope.js"/> <file name="extras/Rope.js"/>
<file name="MovieClip.js"/> <file name="MovieClip.js"/>
<file name="textures/BaseTexture.js"/> <file name="textures/BaseTexture.js"/>
<file name="textures/Texture.js"/> <file name="textures/Texture.js"/>
<file name="utils/Detector.js"/> <file name="utils/Detector.js"/>
<file name="loaders/SpriteSheetLoader.js"/> <file name="loaders/SpriteSheetLoader.js"/>
<file name="loaders/AssetLoader.js"/> <file name="loaders/AssetLoader.js"/>
</sources> </sources>
</jscomp> </jscomp>

29
docs/api.js Normal file
View file

@ -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"
}
]
} };
});

Binary file not shown.

After

Width:  |  Height:  |  Size: 491 B

BIN
docs/assets/css/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

782
docs/assets/css/main.css Normal file
View file

@ -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 <code>/<kbd>/<samp> elements inside <pre>
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;
}

BIN
docs/assets/favicon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 740 B

BIN
docs/assets/img/spinner.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

10
docs/assets/index.html Normal file
View file

@ -0,0 +1,10 @@
<!doctype html>
<html>
<head>
<title>Redirector</title>
<meta http-equiv="refresh" content="0;url=../">
</head>
<body>
<a href="../">Click here to redirect</a>
</body>
</html>

View file

@ -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'
]});

251
docs/assets/js/api-list.js Normal file
View file

@ -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 =
'<li class="api-list-item {typeSingular}">' +
'<a href="{rootPath}{typePlural}/{name}.html">{displayName}</a>' +
'</li>';
// -- 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(
'<li class="message">' +
'No ' + typePlural + ' found.' +
'</li>'
);
}
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(
'<li class="message">' +
'No results found. Maybe you\'ll have better luck with a ' +
'different query?' +
'</li>'
);
}
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'
]});

View file

@ -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:
'<li class="result {resultType}">' +
'<a href="{url}">' +
'<h3 class="title">{name}</h3>' +
'<span class="type">{resultType}</span>' +
'<div class="description">{description}</div>' +
'<span class="className">{class}</span>' +
'</a>' +
'</li>',
// -- 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('<div>' + desc + '</div>').get('text');
if (desc.length > 65) {
desc = Y.Escape.html(desc.substr(0, 65)) + ' &hellip;';
} 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'
]});

365
docs/assets/js/apidocs.js Normal file
View file

@ -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(
'<div class="no-visible-items">' +
'<p>' +
'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.' +
'</p>' +
'</div>'
);
} else {
panelNode.append(
'<div class="no-visible-items">' +
'<p>' +
'This class doesn\'t provide any methods, properties, ' +
'attributes, or events.' +
'</p>' +
'</div>'
);
}
}
// 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);
});

17
docs/assets/js/yui-prettify.js vendored Normal file
View file

@ -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('<a name="LINENUM_' + l + '"></a>');
l++;
});
});
var h = location.hash;
location.hash = '';
h = h.replace('LINE_', 'LINENUM_');
location.hash = h;
}
});

130
docs/assets/vendor/prettify/CHANGES.html vendored Normal file
View file

@ -0,0 +1,130 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Change Log</title>
</head>
<body bgcolor="white">
<a style="float:right" href="README.html">README</a>
<h1>Known Issues</h1>
<ul>
<li>Perl formatting is really crappy. Partly because the author is lazy and
partly because Perl is
<a href="http://www.perlmonks.org/?node_id=663393">hard</a> to parse.
<li>On some browsers, <code>&lt;code&gt;</code> elements with newlines in the text
which use CSS to specify <code>white-space:pre</code> 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>&lt;code&gt;</code> elements because of the way IE6 produces
<code>innerHTML</code>. Workaround: use <code>&lt;pre&gt;</code> for code with
newlines.
</ul>
<h1>Change Log</h1>
<h2>29 March 2007</h2>
<ul>
<li>Added <a href="tests/prettify_test.html#PHP">tests</a> for PHP support
to address
<a href="http://code.google.com/p/google-code-prettify/issues/detail?id=3"
>issue 3</a>.
<li>Fixed
<a href="http://code.google.com/p/google-code-prettify/issues/detail?id=6"
>bug</a>: <code>prettyPrintOne</code> was not halting. This was not
reachable through the normal entry point.
<li>Fixed
<a href="http://code.google.com/p/google-code-prettify/issues/detail?id=4"
>bug</a>: recursing into a script block or PHP tag that was not properly
closed would not silently drop the content.
(<a href="tests/prettify_test.html#issue4">test</a>)
<li>Fixed
<a href="http://code.google.com/p/google-code-prettify/issues/detail?id=8"
>bug</a>: was eating tabs
(<a href="tests/prettify_test.html#issue8">test</a>)
<li>Fixed entity handling so that the caveat
<blockquote>
<p>Caveats: please properly escape less-thans. <tt>x&amp;lt;y</tt>
instead of <tt>x&lt;y</tt>, and use <tt>&quot;</tt> instead of
<tt>&amp;quot;</tt> for string delimiters.</p>
</blockquote>
is no longer applicable.
<li>Added noisefree's C#
<a href="http://code.google.com/p/google-code-prettify/issues/detail?id=4"
>patch</a>
<li>Added a <a href="http://google-code-prettify.googlecode.com/files/prettify-small.zip">distribution</a> that has comments and
whitespace removed to reduce download size from 45.5kB to 12.8kB.
</ul>
<h2>4 Jul 2008</h2>
<ul>
<li>Added <a href="http://code.google.com/p/google-code-prettify/issues/detail?id=17">language specific formatters</a> that are triggered by the presence
of a <code>lang-&lt;language-file-extension&gt;</code></li>
<li>Fixed <a href="http://code.google.com/p/google-code-prettify/issues/detail?id=29">bug</a>: python handling of <code>'''string'''</code>
<li>Fixed bug: <code>/</code> in regex <code>[charsets] should not end regex</code>
</ul>
<h2>5 Jul 2008</h2>
<ul>
<li>Defined language extensions for Lisp and Lua</code>
</ul>
<h2>14 Jul 2008</h2>
<ul>
<li>Language handlers for F#, OCAML, SQL</code>
<li>Support for <code>nocode</code> 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
<a href="tests/prettify_test.html#issue22">testcase</a>.</code>
</ul>
<h2>6 Jan 2009</h2>
<ul>
<li>Language handlers for Visual Basic, Haskell, CSS, and WikiText</li>
<li>Added <tt>.mxml</tt> extension to the markup style handler for
Flex <a href="http://en.wikipedia.org/wiki/MXML">MXML files</a>. See
<a
href="http://code.google.com/p/google-code-prettify/issues/detail?id=37"
>issue 37</a>.
<li>Added <tt>.m</tt> extension to the C style handler so that Objective
C source files properly highlight. See
<a
href="http://code.google.com/p/google-code-prettify/issues/detail?id=58"
>issue 58</a>.
<li>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.
</ul>
<h2>21 May 2009</h2>
<ul>
<li>Rewrote to improve performance on large files.
See <a href="http://mikesamuel.blogspot.com/2009/05/efficient-parsing-in-javascript.html">benchmarks</a>.</li>
<li>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.</li>
</ul>
<h2>14 August 2009</h2>
<ul>
<li>Fixed prettifying of <code>&lt;code&gt;</code> blocks with embedded newlines.
</ul>
<h2>3 October 2009</h2>
<ul>
<li>Fixed prettifying of XML/HTML tags that contain uppercase letters.
</ul>
<h2>19 July 2010</h2>
<ul>
<li>Added support for line numbers. Bug
<a href="http://code.google.com/p/google-code-prettify/issues/detail?id=22"
>22</a></li>
<li>Added YAML support. Bug
<a href="http://code.google.com/p/google-code-prettify/issues/detail?id=123"
>123</a></li>
<li>Added VHDL support courtesy Le Poussin.</li>
<li>IE performance improvements. Bug
<a href="http://code.google.com/p/google-code-prettify/issues/detail?id=102"
>102</a> courtesy jacobly.</li>
<li>A variety of markup formatting fixes courtesy smain and thezbyg.</li>
<li>Fixed copy and paste in IE[678].
<li>Changed output to use <code>&amp;#160;</code> instead of
<code>&amp;nbsp;</code> so that the output works when embedded in XML.
Bug
<a href="http://code.google.com/p/google-code-prettify/issues/detail?id=108"
>108</a>.</li>
</ul>
</body>
</html>

202
docs/assets/vendor/prettify/COPYING vendored Normal file
View file

@ -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.

203
docs/assets/vendor/prettify/README.html vendored Normal file
View file

@ -0,0 +1,203 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Javascript code prettifier</title>
<link href="src/prettify.css" type="text/css" rel="stylesheet" />
<script src="src/prettify.js" type="text/javascript"></script>
<style type="text/css">
body { margin-left: .5in }
h1, h2, h3, h4, .footer { margin-left: -.4in; }
</style>
</head>
<body onload="prettyPrint()" bgcolor="white">
<small style="float: right">Languages : <a href="README-zh-Hans.html">CH</a></small>
<h1>Javascript code prettifier</h1>
<h2>Setup</h2>
<ol>
<li><a href="http://code.google.com/p/google-code-prettify/downloads/list">Download</a> a distribution
<li>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 <tt>script</tt> and <tt>link</tt> tag)
<pre class="prettyprint">
&lt;link href="prettify.css" type="text/css" rel="stylesheet" />
&lt;script type="text/javascript" src="prettify.js">&lt;/script></pre>
<li>Add <code class="prettyprint lang-html">onload="prettyPrint()"</code> to your
document's body tag.
<li>Modify the stylesheet to get the coloring you prefer</li>
</ol>
<h2>Usage</h2>
<p>Put code snippets in
<tt>&lt;pre class="prettyprint"&gt;...&lt;/pre&gt;</tt>
or <tt>&lt;code class="prettyprint"&gt;...&lt;/code&gt;</tt>
and it will automatically be pretty printed.
<table summary="code examples">
<tr>
<th>The original
<th>Prettier
<tr>
<td><pre style="border: 1px solid #888;padding: 2px"
><a name="voila1"></a>class Voila {
public:
// Voila
static const string VOILA = "Voila";
// will not interfere with embedded <a href="#voila1">tags</a>.
}</pre>
<td><pre class="prettyprint"><a name="voila2"></a>class Voila {
public:
// Voila
static const string VOILA = "Voila";
// will not interfere with embedded <a href="#voila2">tags</a>.
}</pre>
</table>
<h2>FAQ</h2>
<h3 id="langs">Which languages does it work for?</h3>
<p>The comments in <tt>prettify.js</tt> 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.</p>
<p>LISPy languages are supported via an extension:
<a href="http://code.google.com/p/google-code-prettify/source/browse/trunk/src/lang-lisp.js"
><code>lang-lisp.js</code></a>.</p>
<p>And similarly for
<a href="http://code.google.com/p/google-code-prettify/source/browse/trunk/src/lang-css.js"
><code>CSS</code></a>,
<a href="http://code.google.com/p/google-code-prettify/source/browse/trunk/src/lang-hs.js"
><code>Haskell</code></a>,
<a href="http://code.google.com/p/google-code-prettify/source/browse/trunk/src/lang-lua.js"
><code>Lua</code></a>,
<a href="http://code.google.com/p/google-code-prettify/source/browse/trunk/src/lang-ml.js"
><code>OCAML, SML, F#</code></a>,
<a href="http://code.google.com/p/google-code-prettify/source/browse/trunk/src/lang-vb.js"
><code>Visual Basic</code></a>,
<a href="http://code.google.com/p/google-code-prettify/source/browse/trunk/src/lang-sql.js"
><code>SQL</code></a>,
<a href="http://code.google.com/p/google-code-prettify/source/browse/trunk/src/lang-proto.js"
><code>Protocol Buffers</code></a>, and
<a href="http://code.google.com/p/google-code-prettify/source/browse/trunk/src/lang-wiki.js"
><code>WikiText</code></a>..
<p>If you'd like to add an extension for your favorite language, please
look at <tt>src/lang-lisp.js</tt> and file an
<a href="http://code.google.com/p/google-code-prettify/issues/list"
>issue</a> including your language extension, and a testcase.</p>
<h3>How do I specify which language my code is in?</h3>
<p>You don't need to specify the language since <code>prettyprint()</code>
will guess. You can specify a language by specifying the language extension
along with the <code>prettyprint</code> class like so:</p>
<pre class="prettyprint lang-html"
>&lt;pre class=&quot;prettyprint <b>lang-html</b>&quot;&gt;
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".
&lt;/pre&gt;</pre>
<h3>It doesn't work on <tt>&lt;obfuscated code sample&gt;</tt>?</h3>
<p>Yes. Prettifying obfuscated code is like putting lipstick on a pig
&mdash; i.e. outside the scope of this tool.</p>
<h3>Which browsers does it work with?</h3>
<p>It's been tested with IE 6, Firefox 1.5 &amp; 2, and Safari 2.0.4.
Look at <a href="tests/prettify_test.html">the test page</a> to see if it
works in your browser.</p>
<h3>What's changed?</h3>
<p>See the <a href="CHANGES.html">change log</a></p>
<h3>Why doesn't Prettyprinting of strings work on WordPress?</h3>
<p>Apparently wordpress does "smart quoting" which changes close quotes.
This causes end quotes to not match up with open quotes.
<p>This breaks prettifying as well as copying and pasting of code samples.
See
<a href="http://wordpress.org/support/topic/125038"
>WordPress's help center</a> for info on how to stop smart quoting of code
snippets.</p>
<h3 id="linenums">How do I put line numbers in my code?</h3>
<p>You can use the <code>linenums</code> 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
<code>linenums:52</code>.
<p>For example
<pre class="prettyprint">&lt;pre class="prettyprint linenums:<b>4</b>"
&gt;// This is line 4.
foo();
bar();
baz();
boo();
far();
faz();
&lt;pre&gt;</pre>
produces
<pre class="prettyprint linenums:4"
>// This is line 4.
foo();
bar();
baz();
boo();
far();
faz();
</pre>
<h3>How do I prevent a portion of markup from being marked as code?</h3>
<p>You can use the <code>nocode</code> class to identify a span of markup
that is not code.
<pre class="prettyprint">&lt;pre class=prettyprint&gt;
int x = foo(); /* This is a comment &lt;span class="nocode"&gt;This is not code&lt;/span&gt;
Continuation of comment */
int y = bar();
&lt;/pre&gt;</pre>
produces
<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>
<p>For a more complete example see the issue22
<a href="tests/prettify_test.html#issue22">testcase</a>.</p>
<h3>I get an error message "a is not a function" or "opt_whenDone is not a function"</h3>
<p>If you are calling <code>prettyPrint</code> via an event handler, wrap it in a function.
Instead of doing
<blockquote>
<code class="prettyprint lang-js"
>addEventListener('load', prettyPrint, false);</code>
</blockquote>
wrap it in a closure like
<blockquote>
<code class="prettyprint lang-js"
>addEventListener('load', function (event) { prettyPrint() }, false);</code>
</blockquote>
so that the browser does not pass an event object to <code>prettyPrint</code> which
will confuse it.
<br><br><br>
<div class="footer">
<!-- Created: Tue Oct 3 17:51:56 PDT 2006 -->
<!-- hhmts start -->
Last modified: Wed Jul 19 13:56:00 PST 2010
<!-- hhmts end -->
</div>
</body>
</html>

View file

@ -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}

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,353 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>AssetLoader - The Foo API</title>
<link rel="stylesheet" href="http:&#x2F;&#x2F;yui.yahooapis.com&#x2F;3.8.0pr2&#x2F;build&#x2F;cssgrids&#x2F;cssgrids-min.css">
<link rel="stylesheet" href="..&#x2F;assets/vendor/prettify/prettify-min.css">
<link rel="stylesheet" href="..&#x2F;assets/css/main.css" id="site_styles">
<link rel="shortcut icon" type="image/png" href="..&#x2F;assets/favicon.png">
<script src="http:&#x2F;&#x2F;yui.yahooapis.com&#x2F;combo?3.8.0pr2&#x2F;build&#x2F;yui&#x2F;yui-min.js"></script>
</head>
<body class="yui3-skin-sam">
<div id="doc">
<div id="hd" class="yui3-g header">
<div class="yui3-u-3-4">
<h1><img src="..&#x2F;assets/css/logo.png" title="The Foo API"></h1>
</div>
<div class="yui3-u-1-4 version">
<em>API Docs for: 1.2.1</em>
</div>
</div>
<div id="bd" class="yui3-g">
<div class="yui3-u-1-4">
<div id="docs-sidebar" class="sidebar apidocs">
<div id="api-list">
<h2 class="off-left">APIs</h2>
<div id="api-tabview" class="tabview">
<ul class="tabs">
<li><a href="#api-classes">Classes</a></li>
<li><a href="#api-modules">Modules</a></li>
</ul>
<div id="api-tabview-filter">
<input type="search" id="api-filter" placeholder="Type to filter APIs">
</div>
<div id="api-tabview-panel">
<ul id="api-classes" class="apis classes">
<li><a href="..&#x2F;classes/AssetLoader.html">AssetLoader</a></li>
<li><a href="..&#x2F;classes/BaseTexture.html">BaseTexture</a></li>
<li><a href="..&#x2F;classes/CanvasRenderer.html">CanvasRenderer</a></li>
<li><a href="..&#x2F;classes/DisplayObject.html">DisplayObject</a></li>
<li><a href="..&#x2F;classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
<li><a href="..&#x2F;classes/MovieClip.html">MovieClip</a></li>
<li><a href="..&#x2F;classes/Point.html">Point</a></li>
<li><a href="..&#x2F;classes/Rectangle.html">Rectangle</a></li>
<li><a href="..&#x2F;classes/Sprite.html">Sprite</a></li>
<li><a href="..&#x2F;classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
<li><a href="..&#x2F;classes/Stage.html">Stage</a></li>
<li><a href="..&#x2F;classes/Texture.html">Texture</a></li>
<li><a href="..&#x2F;classes/WebGLBatch.html">WebGLBatch</a></li>
<li><a href="..&#x2F;classes/WebGLRenderer.html">WebGLRenderer</a></li>
</ul>
<ul id="api-modules" class="apis modules">
<li><a href="..&#x2F;modules/PIXI.html">PIXI</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="yui3-u-3-4">
<div id="api-options">
Show:
<label for="api-show-inherited">
<input type="checkbox" id="api-show-inherited" checked>
Inherited
</label>
<label for="api-show-protected">
<input type="checkbox" id="api-show-protected">
Protected
</label>
<label for="api-show-private">
<input type="checkbox" id="api-show-private">
Private
</label>
<label for="api-show-deprecated">
<input type="checkbox" id="api-show-deprecated">
Deprecated
</label>
</div>
<div class="apidocs">
<div id="docs-main">
<div class="content">
<h1>AssetLoader Class</h1>
<div class="box meta">
<div class="extends">
Extends EventTarget
</div>
<div class="foundat">
Defined in: <a href="..&#x2F;files&#x2F;pixi_loaders_AssetLoader.js.html#l5"><code>pixi&#x2F;loaders&#x2F;AssetLoader.js:5</code></a>
</div>
Module: <a href="../modules/PIXI.html">PIXI</a>
</div>
<div class="box intro">
<p>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</p>
</div>
<div class="constructor">
<h2>Constructor</h2>
<div id="method_AssetLoader" class="method item">
<h3 class="name"><code>AssetLoader</code></h3>
<div class="args">
<span class="paren">(</span><ul class="args-list inline commas">
<li class="arg">
<code>assetURLs</code>
</li>
</ul><span class="paren">)</span>
</div>
<div class="meta">
<p>
Defined in
<a href="..&#x2F;files&#x2F;pixi_loaders_AssetLoader.js.html#l5"><code>pixi&#x2F;loaders&#x2F;AssetLoader.js:5</code></a>
</p>
</div>
<div class="description">
</div>
<div class="params">
<h4>Parameters:</h4>
<ul class="params-list">
<li class="param">
<code class="param-name">assetURLs</code>
<span class="type">Array</span>
<div class="param-description">
<p>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</p>
</div>
</li>
</ul>
</div>
</div>
</div>
<div id="classdocs" class="tabview">
<ul class="api-class-tabs">
<li class="api-class-tab index"><a href="#index">Index</a></li>
<li class="api-class-tab properties"><a href="#properties">Properties</a></li>
</ul>
<div>
<div id="index" class="api-class-tabpanel index">
<h2 class="off-left">Item Index</h2>
<div class="index-section properties">
<h3>Properties</h3>
<ul class="index-list properties extends">
<li class="index-item property">
<a href="#property_assetURLs">assetURLs</a>
</li>
</ul>
</div>
</div>
<div id="properties" class="api-class-tabpanel">
<h2 class="off-left">Properties</h2>
<div id="property_assetURLs" class="property item">
<h3 class="name"><code>assetURLs</code></h3>
<span class="type">Array</span>
<div class="meta">
<p>
Defined in
<a href="..&#x2F;files&#x2F;pixi_loaders_AssetLoader.js.html#l19"><code>pixi&#x2F;loaders&#x2F;AssetLoader.js:19</code></a>
</p>
</div>
<div class="description">
<p>The array of asset URLs that are going to be loaded</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="..&#x2F;assets/vendor/prettify/prettify-min.js"></script>
<script>prettyPrint();</script>
<script src="..&#x2F;assets/js/yui-prettify.js"></script>
<script src="..&#x2F;assets/../api.js"></script>
<script src="..&#x2F;assets/js/api-filter.js"></script>
<script src="..&#x2F;assets/js/api-list.js"></script>
<script src="..&#x2F;assets/js/api-search.js"></script>
<script src="..&#x2F;assets/js/apidocs.js"></script>
</body>
</html>

View file

@ -0,0 +1,504 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>BaseTexture - The Foo API</title>
<link rel="stylesheet" href="http:&#x2F;&#x2F;yui.yahooapis.com&#x2F;3.8.0pr2&#x2F;build&#x2F;cssgrids&#x2F;cssgrids-min.css">
<link rel="stylesheet" href="..&#x2F;assets/vendor/prettify/prettify-min.css">
<link rel="stylesheet" href="..&#x2F;assets/css/main.css" id="site_styles">
<link rel="shortcut icon" type="image/png" href="..&#x2F;assets/favicon.png">
<script src="http:&#x2F;&#x2F;yui.yahooapis.com&#x2F;combo?3.8.0pr2&#x2F;build&#x2F;yui&#x2F;yui-min.js"></script>
</head>
<body class="yui3-skin-sam">
<div id="doc">
<div id="hd" class="yui3-g header">
<div class="yui3-u-3-4">
<h1><img src="..&#x2F;assets/css/logo.png" title="The Foo API"></h1>
</div>
<div class="yui3-u-1-4 version">
<em>API Docs for: 1.2.1</em>
</div>
</div>
<div id="bd" class="yui3-g">
<div class="yui3-u-1-4">
<div id="docs-sidebar" class="sidebar apidocs">
<div id="api-list">
<h2 class="off-left">APIs</h2>
<div id="api-tabview" class="tabview">
<ul class="tabs">
<li><a href="#api-classes">Classes</a></li>
<li><a href="#api-modules">Modules</a></li>
</ul>
<div id="api-tabview-filter">
<input type="search" id="api-filter" placeholder="Type to filter APIs">
</div>
<div id="api-tabview-panel">
<ul id="api-classes" class="apis classes">
<li><a href="..&#x2F;classes/AssetLoader.html">AssetLoader</a></li>
<li><a href="..&#x2F;classes/BaseTexture.html">BaseTexture</a></li>
<li><a href="..&#x2F;classes/CanvasRenderer.html">CanvasRenderer</a></li>
<li><a href="..&#x2F;classes/DisplayObject.html">DisplayObject</a></li>
<li><a href="..&#x2F;classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
<li><a href="..&#x2F;classes/MovieClip.html">MovieClip</a></li>
<li><a href="..&#x2F;classes/Point.html">Point</a></li>
<li><a href="..&#x2F;classes/Rectangle.html">Rectangle</a></li>
<li><a href="..&#x2F;classes/Sprite.html">Sprite</a></li>
<li><a href="..&#x2F;classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
<li><a href="..&#x2F;classes/Stage.html">Stage</a></li>
<li><a href="..&#x2F;classes/Texture.html">Texture</a></li>
<li><a href="..&#x2F;classes/WebGLBatch.html">WebGLBatch</a></li>
<li><a href="..&#x2F;classes/WebGLRenderer.html">WebGLRenderer</a></li>
</ul>
<ul id="api-modules" class="apis modules">
<li><a href="..&#x2F;modules/PIXI.html">PIXI</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="yui3-u-3-4">
<div id="api-options">
Show:
<label for="api-show-inherited">
<input type="checkbox" id="api-show-inherited" checked>
Inherited
</label>
<label for="api-show-protected">
<input type="checkbox" id="api-show-protected">
Protected
</label>
<label for="api-show-private">
<input type="checkbox" id="api-show-private">
Private
</label>
<label for="api-show-deprecated">
<input type="checkbox" id="api-show-deprecated">
Deprecated
</label>
</div>
<div class="apidocs">
<div id="docs-main">
<div class="content">
<h1>BaseTexture Class</h1>
<div class="box meta">
<div class="extends">
Extends EventTarget
</div>
<div class="foundat">
Defined in: <a href="..&#x2F;files&#x2F;pixi_textures_BaseTexture.js.html#l8"><code>pixi&#x2F;textures&#x2F;BaseTexture.js:8</code></a>
</div>
Module: <a href="../modules/PIXI.html">PIXI</a>
</div>
<div class="box intro">
<p>A texture stores the information that represents an image. All textures have a base texture</p>
</div>
<div class="constructor">
<h2>Constructor</h2>
<div id="method_BaseTexture" class="method item">
<h3 class="name"><code>BaseTexture</code></h3>
<div class="args">
<span class="paren">(</span><ul class="args-list inline commas">
<li class="arg">
<code>imageUrl</code>
</li>
</ul><span class="paren">)</span>
</div>
<div class="meta">
<p>
Defined in
<a href="..&#x2F;files&#x2F;pixi_textures_BaseTexture.js.html#l8"><code>pixi&#x2F;textures&#x2F;BaseTexture.js:8</code></a>
</p>
</div>
<div class="description">
</div>
<div class="params">
<h4>Parameters:</h4>
<ul class="params-list">
<li class="param">
<code class="param-name">imageUrl</code>
<span class="type">String</span>
<div class="param-description">
<p>image url</p>
</div>
</li>
</ul>
</div>
</div>
</div>
<div id="classdocs" class="tabview">
<ul class="api-class-tabs">
<li class="api-class-tab index"><a href="#index">Index</a></li>
<li class="api-class-tab properties"><a href="#properties">Properties</a></li>
</ul>
<div>
<div id="index" class="api-class-tabpanel index">
<h2 class="off-left">Item Index</h2>
<div class="index-section properties">
<h3>Properties</h3>
<ul class="index-list properties extends">
<li class="index-item property">
<a href="#property_height">height</a>
</li>
<li class="index-item property">
<a href="#property_image">image</a>
</li>
<li class="index-item property">
<a href="#property_imageUrl">imageUrl</a>
</li>
<li class="index-item property">
<a href="#property_width">width</a>
</li>
</ul>
</div>
</div>
<div id="properties" class="api-class-tabpanel">
<h2 class="off-left">Properties</h2>
<div id="property_height" class="property item">
<h3 class="name"><code>height</code></h3>
<span class="type">Number</span>
<div class="meta">
<p>
Defined in
<a href="..&#x2F;files&#x2F;pixi_textures_BaseTexture.js.html#l54"><code>pixi&#x2F;textures&#x2F;BaseTexture.js:54</code></a>
</p>
</div>
<div class="description">
<p>[read only] The height of the base texture set when the image has loaded</p>
</div>
</div>
<div id="property_image" class="property item">
<h3 class="name"><code>image</code></h3>
<span class="type">Image</span>
<div class="meta">
<p>
Defined in
<a href="..&#x2F;files&#x2F;pixi_textures_BaseTexture.js.html#l26"><code>pixi&#x2F;textures&#x2F;BaseTexture.js:26</code></a>
</p>
</div>
<div class="description">
<p>The html image that is loaded to create the texture</p>
</div>
</div>
<div id="property_imageUrl" class="property item">
<h3 class="name"><code>imageUrl</code></h3>
<span class="type">String</span>
<div class="meta">
<p>
Defined in
<a href="..&#x2F;files&#x2F;pixi_textures_BaseTexture.js.html#l19"><code>pixi&#x2F;textures&#x2F;BaseTexture.js:19</code></a>
</p>
</div>
<div class="description">
<p>The url of the texture</p>
</div>
</div>
<div id="property_width" class="property item">
<h3 class="name"><code>width</code></h3>
<span class="type">Number</span>
<div class="meta">
<p>
Defined in
<a href="..&#x2F;files&#x2F;pixi_textures_BaseTexture.js.html#l48"><code>pixi&#x2F;textures&#x2F;BaseTexture.js:48</code></a>
</p>
</div>
<div class="description">
<p>[read only] The width of the base texture set when the image has loaded</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="..&#x2F;assets/vendor/prettify/prettify-min.js"></script>
<script>prettyPrint();</script>
<script src="..&#x2F;assets/js/yui-prettify.js"></script>
<script src="..&#x2F;assets/../api.js"></script>
<script src="..&#x2F;assets/js/api-filter.js"></script>
<script src="..&#x2F;assets/js/api-list.js"></script>
<script src="..&#x2F;assets/js/api-search.js"></script>
<script src="..&#x2F;assets/js/apidocs.js"></script>
</body>
</html>

View file

@ -0,0 +1,525 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>CanvasRenderer - The Foo API</title>
<link rel="stylesheet" href="http:&#x2F;&#x2F;yui.yahooapis.com&#x2F;3.8.0pr2&#x2F;build&#x2F;cssgrids&#x2F;cssgrids-min.css">
<link rel="stylesheet" href="..&#x2F;assets/vendor/prettify/prettify-min.css">
<link rel="stylesheet" href="..&#x2F;assets/css/main.css" id="site_styles">
<link rel="shortcut icon" type="image/png" href="..&#x2F;assets/favicon.png">
<script src="http:&#x2F;&#x2F;yui.yahooapis.com&#x2F;combo?3.8.0pr2&#x2F;build&#x2F;yui&#x2F;yui-min.js"></script>
</head>
<body class="yui3-skin-sam">
<div id="doc">
<div id="hd" class="yui3-g header">
<div class="yui3-u-3-4">
<h1><img src="..&#x2F;assets/css/logo.png" title="The Foo API"></h1>
</div>
<div class="yui3-u-1-4 version">
<em>API Docs for: 1.2.1</em>
</div>
</div>
<div id="bd" class="yui3-g">
<div class="yui3-u-1-4">
<div id="docs-sidebar" class="sidebar apidocs">
<div id="api-list">
<h2 class="off-left">APIs</h2>
<div id="api-tabview" class="tabview">
<ul class="tabs">
<li><a href="#api-classes">Classes</a></li>
<li><a href="#api-modules">Modules</a></li>
</ul>
<div id="api-tabview-filter">
<input type="search" id="api-filter" placeholder="Type to filter APIs">
</div>
<div id="api-tabview-panel">
<ul id="api-classes" class="apis classes">
<li><a href="..&#x2F;classes/AssetLoader.html">AssetLoader</a></li>
<li><a href="..&#x2F;classes/BaseTexture.html">BaseTexture</a></li>
<li><a href="..&#x2F;classes/CanvasRenderer.html">CanvasRenderer</a></li>
<li><a href="..&#x2F;classes/DisplayObject.html">DisplayObject</a></li>
<li><a href="..&#x2F;classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
<li><a href="..&#x2F;classes/MovieClip.html">MovieClip</a></li>
<li><a href="..&#x2F;classes/Point.html">Point</a></li>
<li><a href="..&#x2F;classes/Rectangle.html">Rectangle</a></li>
<li><a href="..&#x2F;classes/Sprite.html">Sprite</a></li>
<li><a href="..&#x2F;classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
<li><a href="..&#x2F;classes/Stage.html">Stage</a></li>
<li><a href="..&#x2F;classes/Texture.html">Texture</a></li>
<li><a href="..&#x2F;classes/WebGLBatch.html">WebGLBatch</a></li>
<li><a href="..&#x2F;classes/WebGLRenderer.html">WebGLRenderer</a></li>
</ul>
<ul id="api-modules" class="apis modules">
<li><a href="..&#x2F;modules/PIXI.html">PIXI</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="yui3-u-3-4">
<div id="api-options">
Show:
<label for="api-show-inherited">
<input type="checkbox" id="api-show-inherited" checked>
Inherited
</label>
<label for="api-show-protected">
<input type="checkbox" id="api-show-protected">
Protected
</label>
<label for="api-show-private">
<input type="checkbox" id="api-show-private">
Private
</label>
<label for="api-show-deprecated">
<input type="checkbox" id="api-show-deprecated">
Deprecated
</label>
</div>
<div class="apidocs">
<div id="docs-main">
<div class="content">
<h1>CanvasRenderer Class</h1>
<div class="box meta">
<div class="foundat">
Defined in: <a href="..&#x2F;files&#x2F;pixi_renderers_CanvasRenderer.js.html#l5"><code>pixi&#x2F;renderers&#x2F;CanvasRenderer.js:5</code></a>
</div>
Module: <a href="../modules/PIXI.html">PIXI</a>
</div>
<div class="box intro">
<p>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 :)</p>
</div>
<div id="classdocs" class="tabview">
<ul class="api-class-tabs">
<li class="api-class-tab index"><a href="#index">Index</a></li>
<li class="api-class-tab methods"><a href="#methods">Methods</a></li>
<li class="api-class-tab properties"><a href="#properties">Properties</a></li>
</ul>
<div>
<div id="index" class="api-class-tabpanel index">
<h2 class="off-left">Item Index</h2>
<div class="index-section methods">
<h3>Methods</h3>
<ul class="index-list methods">
<li class="index-item method">
<a href="#method_render">render</a>
</li>
</ul>
</div>
<div class="index-section properties">
<h3>Properties</h3>
<ul class="index-list properties">
<li class="index-item property">
<a href="#property_context">context</a>
</li>
<li class="index-item property">
<a href="#property_height">height</a>
</li>
<li class="index-item property">
<a href="#property_view">view</a>
</li>
<li class="index-item property">
<a href="#property_width">width</a>
</li>
</ul>
</div>
</div>
<div id="methods" class="api-class-tabpanel">
<h2 class="off-left">Methods</h2>
<div id="method_render" class="method item">
<h3 class="name"><code>render</code></h3>
<div class="args">
<span class="paren">(</span><ul class="args-list inline commas">
<li class="arg">
<code>stage</code>
</li>
</ul><span class="paren">)</span>
</div>
<div class="meta">
<p>
Defined in
<a href="..&#x2F;files&#x2F;pixi_renderers_CanvasRenderer.js.html#l54"><code>pixi&#x2F;renderers&#x2F;CanvasRenderer.js:54</code></a>
</p>
</div>
<div class="description">
<p>Renders the stage to its canvas view</p>
</div>
<div class="params">
<h4>Parameters:</h4>
<ul class="params-list">
<li class="param">
<code class="param-name">stage</code>
<span class="type"><a href="../classes/Stage.html" class="crosslink">Stage</a></span>
<div class="param-description">
<p>the Stage element to be rendered</p>
</div>
</li>
</ul>
</div>
</div>
</div>
<div id="properties" class="api-class-tabpanel">
<h2 class="off-left">Properties</h2>
<div id="property_context" class="property item">
<h3 class="name"><code>context</code></h3>
<span class="type">Canvas 2d Context</span>
<div class="meta">
<p>
Defined in
<a href="..&#x2F;files&#x2F;pixi_renderers_CanvasRenderer.js.html#l43"><code>pixi&#x2F;renderers&#x2F;CanvasRenderer.js:43</code></a>
</p>
</div>
<div class="description">
<p>The canvas context that the everything is drawn to</p>
</div>
</div>
<div id="property_height" class="property item">
<h3 class="name"><code>height</code></h3>
<span class="type">Number</span>
<div class="meta">
<p>
Defined in
<a href="..&#x2F;files&#x2F;pixi_renderers_CanvasRenderer.js.html#l21"><code>pixi&#x2F;renderers&#x2F;CanvasRenderer.js:21</code></a>
</p>
</div>
<div class="description">
<p>The height of the canvas view</p>
</div>
<p><strong>Default:</strong> 600</p>
</div>
<div id="property_view" class="property item">
<h3 class="name"><code>view</code></h3>
<span class="type">Canvas</span>
<div class="meta">
<p>
Defined in
<a href="..&#x2F;files&#x2F;pixi_renderers_CanvasRenderer.js.html#l31"><code>pixi&#x2F;renderers&#x2F;CanvasRenderer.js:31</code></a>
</p>
</div>
<div class="description">
<p>The canvas element that the everything is drawn to</p>
</div>
</div>
<div id="property_width" class="property item">
<h3 class="name"><code>width</code></h3>
<span class="type">Number</span>
<div class="meta">
<p>
Defined in
<a href="..&#x2F;files&#x2F;pixi_renderers_CanvasRenderer.js.html#l14"><code>pixi&#x2F;renderers&#x2F;CanvasRenderer.js:14</code></a>
</p>
</div>
<div class="description">
<p>The width of the canvas view</p>
</div>
<p><strong>Default:</strong> 800</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="..&#x2F;assets/vendor/prettify/prettify-min.js"></script>
<script>prettyPrint();</script>
<script src="..&#x2F;assets/js/yui-prettify.js"></script>
<script src="..&#x2F;assets/../api.js"></script>
<script src="..&#x2F;assets/js/api-filter.js"></script>
<script src="..&#x2F;assets/js/api-list.js"></script>
<script src="..&#x2F;assets/js/api-search.js"></script>
<script src="..&#x2F;assets/js/apidocs.js"></script>
</body>
</html>

View file

@ -0,0 +1,756 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>DisplayObject - The Foo API</title>
<link rel="stylesheet" href="http:&#x2F;&#x2F;yui.yahooapis.com&#x2F;3.8.0pr2&#x2F;build&#x2F;cssgrids&#x2F;cssgrids-min.css">
<link rel="stylesheet" href="..&#x2F;assets/vendor/prettify/prettify-min.css">
<link rel="stylesheet" href="..&#x2F;assets/css/main.css" id="site_styles">
<link rel="shortcut icon" type="image/png" href="..&#x2F;assets/favicon.png">
<script src="http:&#x2F;&#x2F;yui.yahooapis.com&#x2F;combo?3.8.0pr2&#x2F;build&#x2F;yui&#x2F;yui-min.js"></script>
</head>
<body class="yui3-skin-sam">
<div id="doc">
<div id="hd" class="yui3-g header">
<div class="yui3-u-3-4">
<h1><img src="..&#x2F;assets/css/logo.png" title="The Foo API"></h1>
</div>
<div class="yui3-u-1-4 version">
<em>API Docs for: 1.2.1</em>
</div>
</div>
<div id="bd" class="yui3-g">
<div class="yui3-u-1-4">
<div id="docs-sidebar" class="sidebar apidocs">
<div id="api-list">
<h2 class="off-left">APIs</h2>
<div id="api-tabview" class="tabview">
<ul class="tabs">
<li><a href="#api-classes">Classes</a></li>
<li><a href="#api-modules">Modules</a></li>
</ul>
<div id="api-tabview-filter">
<input type="search" id="api-filter" placeholder="Type to filter APIs">
</div>
<div id="api-tabview-panel">
<ul id="api-classes" class="apis classes">
<li><a href="..&#x2F;classes/AssetLoader.html">AssetLoader</a></li>
<li><a href="..&#x2F;classes/BaseTexture.html">BaseTexture</a></li>
<li><a href="..&#x2F;classes/CanvasRenderer.html">CanvasRenderer</a></li>
<li><a href="..&#x2F;classes/DisplayObject.html">DisplayObject</a></li>
<li><a href="..&#x2F;classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
<li><a href="..&#x2F;classes/MovieClip.html">MovieClip</a></li>
<li><a href="..&#x2F;classes/Point.html">Point</a></li>
<li><a href="..&#x2F;classes/Rectangle.html">Rectangle</a></li>
<li><a href="..&#x2F;classes/Sprite.html">Sprite</a></li>
<li><a href="..&#x2F;classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
<li><a href="..&#x2F;classes/Stage.html">Stage</a></li>
<li><a href="..&#x2F;classes/Texture.html">Texture</a></li>
<li><a href="..&#x2F;classes/WebGLBatch.html">WebGLBatch</a></li>
<li><a href="..&#x2F;classes/WebGLRenderer.html">WebGLRenderer</a></li>
</ul>
<ul id="api-modules" class="apis modules">
<li><a href="..&#x2F;modules/PIXI.html">PIXI</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="yui3-u-3-4">
<div id="api-options">
Show:
<label for="api-show-inherited">
<input type="checkbox" id="api-show-inherited" checked>
Inherited
</label>
<label for="api-show-protected">
<input type="checkbox" id="api-show-protected">
Protected
</label>
<label for="api-show-private">
<input type="checkbox" id="api-show-private">
Private
</label>
<label for="api-show-deprecated">
<input type="checkbox" id="api-show-deprecated">
Deprecated
</label>
</div>
<div class="apidocs">
<div id="docs-main">
<div class="content">
<h1>DisplayObject Class</h1>
<div class="box meta">
<div class="foundat">
Defined in: <a href="..&#x2F;files&#x2F;pixi_DisplayObject.js.html#l5"><code>pixi&#x2F;DisplayObject.js:5</code></a>
</div>
Module: <a href="../modules/PIXI.html">PIXI</a>
</div>
<div class="box intro">
<p>this is the base class for all objects that are rendered on the screen.</p>
</div>
<div class="constructor">
<h2>Constructor</h2>
<div id="method_DisplayObject" class="method item">
<h3 class="name"><code>DisplayObject</code></h3>
<span class="paren">()</span>
<div class="meta">
<p>
Defined in
<a href="..&#x2F;files&#x2F;pixi_DisplayObject.js.html#l5"><code>pixi&#x2F;DisplayObject.js:5</code></a>
</p>
</div>
<div class="description">
</div>
</div>
</div>
<div id="classdocs" class="tabview">
<ul class="api-class-tabs">
<li class="api-class-tab index"><a href="#index">Index</a></li>
<li class="api-class-tab methods"><a href="#methods">Methods</a></li>
<li class="api-class-tab properties"><a href="#properties">Properties</a></li>
</ul>
<div>
<div id="index" class="api-class-tabpanel index">
<h2 class="off-left">Item Index</h2>
<div class="index-section methods">
<h3>Methods</h3>
<ul class="index-list methods">
<li class="index-item method">
<a href="#method_autoDetectRenderer">autoDetectRenderer</a>
<span class="flag static">static</span>
</li>
</ul>
</div>
<div class="index-section properties">
<h3>Properties</h3>
<ul class="index-list properties">
<li class="index-item property">
<a href="#property_alpha">alpha</a>
</li>
<li class="index-item property">
<a href="#property_parent">parent</a>
</li>
<li class="index-item property">
<a href="#property_position">position</a>
</li>
<li class="index-item property">
<a href="#property_rotation">rotation</a>
</li>
<li class="index-item property">
<a href="#property_scale">scale</a>
</li>
<li class="index-item property">
<a href="#property_stage">stage</a>
</li>
<li class="index-item property">
<a href="#property_visible">visible</a>
</li>
</ul>
</div>
</div>
<div id="methods" class="api-class-tabpanel">
<h2 class="off-left">Methods</h2>
<div id="method_autoDetectRenderer" class="method item">
<h3 class="name"><code>autoDetectRenderer</code></h3>
<div class="args">
<span class="paren">(</span><ul class="args-list inline commas">
<li class="arg">
<code>width</code>
</li>
<li class="arg">
<code>height</code>
</li>
</ul><span class="paren">)</span>
</div>
<span class="flag static">static</span>
<div class="meta">
<p>
Defined in
<a href="..&#x2F;files&#x2F;pixi_utils_Detector.js.html#l5"><code>pixi&#x2F;utils&#x2F;Detector.js:5</code></a>
</p>
</div>
<div class="description">
<p>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</p>
</div>
<div class="params">
<h4>Parameters:</h4>
<ul class="params-list">
<li class="param">
<code class="param-name">width</code>
<span class="type">Number</span>
<div class="param-description">
<p>the width of the renderers view</p>
</div>
</li>
<li class="param">
<code class="param-name">height</code>
<span class="type">Number</span>
<div class="param-description">
<p>the height of the renderers view</p>
</div>
</li>
</ul>
</div>
</div>
</div>
<div id="properties" class="api-class-tabpanel">
<h2 class="off-left">Properties</h2>
<div id="property_alpha" class="property item">
<h3 class="name"><code>alpha</code></h3>
<span class="type">Number</span>
<div class="meta">
<p>
Defined in
<a href="..&#x2F;files&#x2F;pixi_DisplayObject.js.html#l33"><code>pixi&#x2F;DisplayObject.js:33</code></a>
</p>
</div>
<div class="description">
<p>The opacity of the object.</p>
</div>
</div>
<div id="property_parent" class="property item">
<h3 class="name"><code>parent</code></h3>
<span class="type"><a href="../classes/DisplayObjectContainer.html" class="crosslink">DisplayObjectContainer</a></span>
<div class="meta">
<p>
Defined in
<a href="..&#x2F;files&#x2F;pixi_DisplayObject.js.html#l48"><code>pixi&#x2F;DisplayObject.js:48</code></a>
</p>
</div>
<div class="description">
<p>[read-only] The display object container that contains this display object.</p>
</div>
</div>
<div id="property_position" class="property item">
<h3 class="name"><code>position</code></h3>
<span class="type"><a href="../classes/Point.html" class="crosslink">Point</a></span>
<div class="meta">
<p>
Defined in
<a href="..&#x2F;files&#x2F;pixi_DisplayObject.js.html#l12"><code>pixi&#x2F;DisplayObject.js:12</code></a>
</p>
</div>
<div class="description">
<p>The coordinate of the object relative to the local coordinates of the parent.</p>
</div>
</div>
<div id="property_rotation" class="property item">
<h3 class="name"><code>rotation</code></h3>
<span class="type">Number</span>
<div class="meta">
<p>
Defined in
<a href="..&#x2F;files&#x2F;pixi_DisplayObject.js.html#l26"><code>pixi&#x2F;DisplayObject.js:26</code></a>
</p>
</div>
<div class="description">
<p>The rotation of the object in radians.</p>
</div>
</div>
<div id="property_scale" class="property item">
<h3 class="name"><code>scale</code></h3>
<span class="type"><a href="../classes/Point.html" class="crosslink">Point</a></span>
<div class="meta">
<p>
Defined in
<a href="..&#x2F;files&#x2F;pixi_DisplayObject.js.html#l19"><code>pixi&#x2F;DisplayObject.js:19</code></a>
</p>
</div>
<div class="description">
<p>The scale factor of the object.</p>
</div>
</div>
<div id="property_stage" class="property item">
<h3 class="name"><code>stage</code></h3>
<span class="type"><a href="../classes/Stage.html" class="crosslink">Stage</a></span>
<div class="meta">
<p>
Defined in
<a href="..&#x2F;files&#x2F;pixi_DisplayObject.js.html#l55"><code>pixi&#x2F;DisplayObject.js:55</code></a>
</p>
</div>
<div class="description">
<p>[read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.</p>
</div>
</div>
<div id="property_visible" class="property item">
<h3 class="name"><code>visible</code></h3>
<span class="type">Boolean</span>
<div class="meta">
<p>
Defined in
<a href="..&#x2F;files&#x2F;pixi_DisplayObject.js.html#l40"><code>pixi&#x2F;DisplayObject.js:40</code></a>
</p>
</div>
<div class="description">
<p>The visibility of the object.</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="..&#x2F;assets/vendor/prettify/prettify-min.js"></script>
<script>prettyPrint();</script>
<script src="..&#x2F;assets/js/yui-prettify.js"></script>
<script src="..&#x2F;assets/../api.js"></script>
<script src="..&#x2F;assets/js/api-filter.js"></script>
<script src="..&#x2F;assets/js/api-list.js"></script>
<script src="..&#x2F;assets/js/api-search.js"></script>
<script src="..&#x2F;assets/js/apidocs.js"></script>
</body>
</html>

View file

@ -0,0 +1,973 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>DisplayObjectContainer - The Foo API</title>
<link rel="stylesheet" href="http:&#x2F;&#x2F;yui.yahooapis.com&#x2F;3.8.0pr2&#x2F;build&#x2F;cssgrids&#x2F;cssgrids-min.css">
<link rel="stylesheet" href="..&#x2F;assets/vendor/prettify/prettify-min.css">
<link rel="stylesheet" href="..&#x2F;assets/css/main.css" id="site_styles">
<link rel="shortcut icon" type="image/png" href="..&#x2F;assets/favicon.png">
<script src="http:&#x2F;&#x2F;yui.yahooapis.com&#x2F;combo?3.8.0pr2&#x2F;build&#x2F;yui&#x2F;yui-min.js"></script>
</head>
<body class="yui3-skin-sam">
<div id="doc">
<div id="hd" class="yui3-g header">
<div class="yui3-u-3-4">
<h1><img src="..&#x2F;assets/css/logo.png" title="The Foo API"></h1>
</div>
<div class="yui3-u-1-4 version">
<em>API Docs for: 1.2.1</em>
</div>
</div>
<div id="bd" class="yui3-g">
<div class="yui3-u-1-4">
<div id="docs-sidebar" class="sidebar apidocs">
<div id="api-list">
<h2 class="off-left">APIs</h2>
<div id="api-tabview" class="tabview">
<ul class="tabs">
<li><a href="#api-classes">Classes</a></li>
<li><a href="#api-modules">Modules</a></li>
</ul>
<div id="api-tabview-filter">
<input type="search" id="api-filter" placeholder="Type to filter APIs">
</div>
<div id="api-tabview-panel">
<ul id="api-classes" class="apis classes">
<li><a href="..&#x2F;classes/AssetLoader.html">AssetLoader</a></li>
<li><a href="..&#x2F;classes/BaseTexture.html">BaseTexture</a></li>
<li><a href="..&#x2F;classes/CanvasRenderer.html">CanvasRenderer</a></li>
<li><a href="..&#x2F;classes/DisplayObject.html">DisplayObject</a></li>
<li><a href="..&#x2F;classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
<li><a href="..&#x2F;classes/MovieClip.html">MovieClip</a></li>
<li><a href="..&#x2F;classes/Point.html">Point</a></li>
<li><a href="..&#x2F;classes/Rectangle.html">Rectangle</a></li>
<li><a href="..&#x2F;classes/Sprite.html">Sprite</a></li>
<li><a href="..&#x2F;classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
<li><a href="..&#x2F;classes/Stage.html">Stage</a></li>
<li><a href="..&#x2F;classes/Texture.html">Texture</a></li>
<li><a href="..&#x2F;classes/WebGLBatch.html">WebGLBatch</a></li>
<li><a href="..&#x2F;classes/WebGLRenderer.html">WebGLRenderer</a></li>
</ul>
<ul id="api-modules" class="apis modules">
<li><a href="..&#x2F;modules/PIXI.html">PIXI</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="yui3-u-3-4">
<div id="api-options">
Show:
<label for="api-show-inherited">
<input type="checkbox" id="api-show-inherited" checked>
Inherited
</label>
<label for="api-show-protected">
<input type="checkbox" id="api-show-protected">
Protected
</label>
<label for="api-show-private">
<input type="checkbox" id="api-show-private">
Private
</label>
<label for="api-show-deprecated">
<input type="checkbox" id="api-show-deprecated">
Deprecated
</label>
</div>
<div class="apidocs">
<div id="docs-main">
<div class="content">
<h1>DisplayObjectContainer Class</h1>
<div class="box meta">
<div class="extends">
Extends <a href="../classes/DisplayObject.html" class="crosslink">DisplayObject</a>
</div>
<div class="foundat">
Defined in: <a href="..&#x2F;files&#x2F;pixi_DisplayObjectContainer.js.html#l6"><code>pixi&#x2F;DisplayObjectContainer.js:6</code></a>
</div>
Module: <a href="../modules/PIXI.html">PIXI</a>
</div>
<div class="box intro">
<p>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.</p>
</div>
<div class="constructor">
<h2>Constructor</h2>
<div id="method_DisplayObjectContainer" class="method item">
<h3 class="name"><code>DisplayObjectContainer</code></h3>
<span class="paren">()</span>
<div class="meta">
<p>
Defined in
<a href="..&#x2F;files&#x2F;pixi_DisplayObjectContainer.js.html#l6"><code>pixi&#x2F;DisplayObjectContainer.js:6</code></a>
</p>
</div>
<div class="description">
</div>
</div>
</div>
<div id="classdocs" class="tabview">
<ul class="api-class-tabs">
<li class="api-class-tab index"><a href="#index">Index</a></li>
<li class="api-class-tab methods"><a href="#methods">Methods</a></li>
<li class="api-class-tab properties"><a href="#properties">Properties</a></li>
</ul>
<div>
<div id="index" class="api-class-tabpanel index">
<h2 class="off-left">Item Index</h2>
<div class="index-section methods">
<h3>Methods</h3>
<ul class="index-list methods extends">
<li class="index-item method">
<a href="#method_addChild">addChild</a>
</li>
<li class="index-item method">
<a href="#method_addChildAt">addChildAt</a>
</li>
<li class="index-item method">
<a href="#method_removeChild">removeChild</a>
</li>
</ul>
</div>
<div class="index-section properties">
<h3>Properties</h3>
<ul class="index-list properties extends">
<li class="index-item property inherited">
<a href="#property_alpha">alpha</a>
</li>
<li class="index-item property">
<a href="#property_children">children</a>
</li>
<li class="index-item property inherited">
<a href="#property_parent">parent</a>
</li>
<li class="index-item property inherited">
<a href="#property_position">position</a>
</li>
<li class="index-item property inherited">
<a href="#property_rotation">rotation</a>
</li>
<li class="index-item property inherited">
<a href="#property_scale">scale</a>
</li>
<li class="index-item property inherited">
<a href="#property_stage">stage</a>
</li>
<li class="index-item property inherited">
<a href="#property_visible">visible</a>
</li>
</ul>
</div>
</div>
<div id="methods" class="api-class-tabpanel">
<h2 class="off-left">Methods</h2>
<div id="method_addChild" class="method item">
<h3 class="name"><code>addChild</code></h3>
<div class="args">
<span class="paren">(</span><ul class="args-list inline commas">
<li class="arg">
<code>DisplayObject</code>
</li>
</ul><span class="paren">)</span>
</div>
<div class="meta">
<p>
Defined in
<a href="..&#x2F;files&#x2F;pixi_DisplayObjectContainer.js.html#l29"><code>pixi&#x2F;DisplayObjectContainer.js:29</code></a>
</p>
</div>
<div class="description">
<p>Adds a child to the container.</p>
</div>
<div class="params">
<h4>Parameters:</h4>
<ul class="params-list">
<li class="param">
<code class="param-name">DisplayObject</code>
<span class="type"><a href="../classes/DisplayObject.html" class="crosslink">DisplayObject</a></span>
<div class="param-description">
</div>
</li>
</ul>
</div>
</div>
<div id="method_addChildAt" class="method item">
<h3 class="name"><code>addChildAt</code></h3>
<div class="args">
<span class="paren">(</span><ul class="args-list inline commas">
<li class="arg">
<code>DisplayObject</code>
</li>
<li class="arg">
<code>index</code>
</li>
</ul><span class="paren">)</span>
</div>
<div class="meta">
<p>
Defined in
<a href="..&#x2F;files&#x2F;pixi_DisplayObjectContainer.js.html#l51"><code>pixi&#x2F;DisplayObjectContainer.js:51</code></a>
</p>
</div>
<div class="description">
<p>Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown</p>
</div>
<div class="params">
<h4>Parameters:</h4>
<ul class="params-list">
<li class="param">
<code class="param-name">DisplayObject</code>
<span class="type"><a href="../classes/DisplayObject.html" class="crosslink">DisplayObject</a></span>
<div class="param-description">
</div>
</li>
<li class="param">
<code class="param-name">index</code>
<span class="type">Number</span>
<div class="param-description">
</div>
</li>
</ul>
</div>
</div>
<div id="method_removeChild" class="method item">
<h3 class="name"><code>removeChild</code></h3>
<div class="args">
<span class="paren">(</span><ul class="args-list inline commas">
<li class="arg">
<code>DisplayObject</code>
</li>
</ul><span class="paren">)</span>
</div>
<div class="meta">
<p>
Defined in
<a href="..&#x2F;files&#x2F;pixi_DisplayObjectContainer.js.html#l97"><code>pixi&#x2F;DisplayObjectContainer.js:97</code></a>
</p>
</div>
<div class="description">
<p>Removes a child from the container.</p>
</div>
<div class="params">
<h4>Parameters:</h4>
<ul class="params-list">
<li class="param">
<code class="param-name">DisplayObject</code>
<span class="type"><a href="../classes/DisplayObject.html" class="crosslink">DisplayObject</a></span>
<div class="param-description">
</div>
</li>
</ul>
</div>
</div>
</div>
<div id="properties" class="api-class-tabpanel">
<h2 class="off-left">Properties</h2>
<div id="property_alpha" class="property item inherited">
<h3 class="name"><code>alpha</code></h3>
<span class="type">Number</span>
<div class="meta">
<p>Inherited from
<a href="..&#x2F;classes&#x2F;DisplayObject.html#property_alpha">DisplayObject</a>:
<a href="..&#x2F;files&#x2F;pixi_DisplayObject.js.html#l33"><code>pixi&#x2F;DisplayObject.js:33</code></a>
</p>
</div>
<div class="description">
<p>The opacity of the object.</p>
</div>
</div>
<div id="property_children" class="property item">
<h3 class="name"><code>children</code></h3>
<span class="type">Array</span>
<div class="meta">
<p>
Defined in
<a href="..&#x2F;files&#x2F;pixi_DisplayObjectContainer.js.html#l16"><code>pixi&#x2F;DisplayObjectContainer.js:16</code></a>
</p>
</div>
<div class="description">
<p>[read-only] The of children of this container.</p>
</div>
</div>
<div id="property_parent" class="property item inherited">
<h3 class="name"><code>parent</code></h3>
<span class="type"><a href="../classes/DisplayObjectContainer.html" class="crosslink">DisplayObjectContainer</a></span>
<div class="meta">
<p>Inherited from
<a href="..&#x2F;classes&#x2F;DisplayObject.html#property_parent">DisplayObject</a>:
<a href="..&#x2F;files&#x2F;pixi_DisplayObject.js.html#l48"><code>pixi&#x2F;DisplayObject.js:48</code></a>
</p>
</div>
<div class="description">
<p>[read-only] The display object container that contains this display object.</p>
</div>
</div>
<div id="property_position" class="property item inherited">
<h3 class="name"><code>position</code></h3>
<span class="type"><a href="../classes/Point.html" class="crosslink">Point</a></span>
<div class="meta">
<p>Inherited from
<a href="..&#x2F;classes&#x2F;DisplayObject.html#property_position">DisplayObject</a>:
<a href="..&#x2F;files&#x2F;pixi_DisplayObject.js.html#l12"><code>pixi&#x2F;DisplayObject.js:12</code></a>
</p>
</div>
<div class="description">
<p>The coordinate of the object relative to the local coordinates of the parent.</p>
</div>
</div>
<div id="property_rotation" class="property item inherited">
<h3 class="name"><code>rotation</code></h3>
<span class="type">Number</span>
<div class="meta">
<p>Inherited from
<a href="..&#x2F;classes&#x2F;DisplayObject.html#property_rotation">DisplayObject</a>:
<a href="..&#x2F;files&#x2F;pixi_DisplayObject.js.html#l26"><code>pixi&#x2F;DisplayObject.js:26</code></a>
</p>
</div>
<div class="description">
<p>The rotation of the object in radians.</p>
</div>
</div>
<div id="property_scale" class="property item inherited">
<h3 class="name"><code>scale</code></h3>
<span class="type"><a href="../classes/Point.html" class="crosslink">Point</a></span>
<div class="meta">
<p>Inherited from
<a href="..&#x2F;classes&#x2F;DisplayObject.html#property_scale">DisplayObject</a>:
<a href="..&#x2F;files&#x2F;pixi_DisplayObject.js.html#l19"><code>pixi&#x2F;DisplayObject.js:19</code></a>
</p>
</div>
<div class="description">
<p>The scale factor of the object.</p>
</div>
</div>
<div id="property_stage" class="property item inherited">
<h3 class="name"><code>stage</code></h3>
<span class="type"><a href="../classes/Stage.html" class="crosslink">Stage</a></span>
<div class="meta">
<p>Inherited from
<a href="..&#x2F;classes&#x2F;DisplayObject.html#property_stage">DisplayObject</a>:
<a href="..&#x2F;files&#x2F;pixi_DisplayObject.js.html#l55"><code>pixi&#x2F;DisplayObject.js:55</code></a>
</p>
</div>
<div class="description">
<p>[read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.</p>
</div>
</div>
<div id="property_visible" class="property item inherited">
<h3 class="name"><code>visible</code></h3>
<span class="type">Boolean</span>
<div class="meta">
<p>Inherited from
<a href="..&#x2F;classes&#x2F;DisplayObject.html#property_visible">DisplayObject</a>:
<a href="..&#x2F;files&#x2F;pixi_DisplayObject.js.html#l40"><code>pixi&#x2F;DisplayObject.js:40</code></a>
</p>
</div>
<div class="description">
<p>The visibility of the object.</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="..&#x2F;assets/vendor/prettify/prettify-min.js"></script>
<script>prettyPrint();</script>
<script src="..&#x2F;assets/js/yui-prettify.js"></script>
<script src="..&#x2F;assets/../api.js"></script>
<script src="..&#x2F;assets/js/api-filter.js"></script>
<script src="..&#x2F;assets/js/api-list.js"></script>
<script src="..&#x2F;assets/js/api-search.js"></script>
<script src="..&#x2F;assets/js/apidocs.js"></script>
</body>
</html>

826
docs/classes/MovieClip.html Normal file
View file

@ -0,0 +1,826 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>MovieClip - The Foo API</title>
<link rel="stylesheet" href="http:&#x2F;&#x2F;yui.yahooapis.com&#x2F;3.8.0pr2&#x2F;build&#x2F;cssgrids&#x2F;cssgrids-min.css">
<link rel="stylesheet" href="..&#x2F;assets/vendor/prettify/prettify-min.css">
<link rel="stylesheet" href="..&#x2F;assets/css/main.css" id="site_styles">
<link rel="shortcut icon" type="image/png" href="..&#x2F;assets/favicon.png">
<script src="http:&#x2F;&#x2F;yui.yahooapis.com&#x2F;combo?3.8.0pr2&#x2F;build&#x2F;yui&#x2F;yui-min.js"></script>
</head>
<body class="yui3-skin-sam">
<div id="doc">
<div id="hd" class="yui3-g header">
<div class="yui3-u-3-4">
<h1><img src="..&#x2F;assets/css/logo.png" title="The Foo API"></h1>
</div>
<div class="yui3-u-1-4 version">
<em>API Docs for: 1.2.1</em>
</div>
</div>
<div id="bd" class="yui3-g">
<div class="yui3-u-1-4">
<div id="docs-sidebar" class="sidebar apidocs">
<div id="api-list">
<h2 class="off-left">APIs</h2>
<div id="api-tabview" class="tabview">
<ul class="tabs">
<li><a href="#api-classes">Classes</a></li>
<li><a href="#api-modules">Modules</a></li>
</ul>
<div id="api-tabview-filter">
<input type="search" id="api-filter" placeholder="Type to filter APIs">
</div>
<div id="api-tabview-panel">
<ul id="api-classes" class="apis classes">
<li><a href="..&#x2F;classes/AssetLoader.html">AssetLoader</a></li>
<li><a href="..&#x2F;classes/BaseTexture.html">BaseTexture</a></li>
<li><a href="..&#x2F;classes/CanvasRenderer.html">CanvasRenderer</a></li>
<li><a href="..&#x2F;classes/DisplayObject.html">DisplayObject</a></li>
<li><a href="..&#x2F;classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
<li><a href="..&#x2F;classes/MovieClip.html">MovieClip</a></li>
<li><a href="..&#x2F;classes/Point.html">Point</a></li>
<li><a href="..&#x2F;classes/Rectangle.html">Rectangle</a></li>
<li><a href="..&#x2F;classes/Sprite.html">Sprite</a></li>
<li><a href="..&#x2F;classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
<li><a href="..&#x2F;classes/Stage.html">Stage</a></li>
<li><a href="..&#x2F;classes/Texture.html">Texture</a></li>
<li><a href="..&#x2F;classes/WebGLBatch.html">WebGLBatch</a></li>
<li><a href="..&#x2F;classes/WebGLRenderer.html">WebGLRenderer</a></li>
</ul>
<ul id="api-modules" class="apis modules">
<li><a href="..&#x2F;modules/PIXI.html">PIXI</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="yui3-u-3-4">
<div id="api-options">
Show:
<label for="api-show-inherited">
<input type="checkbox" id="api-show-inherited" checked>
Inherited
</label>
<label for="api-show-protected">
<input type="checkbox" id="api-show-protected">
Protected
</label>
<label for="api-show-private">
<input type="checkbox" id="api-show-private">
Private
</label>
<label for="api-show-deprecated">
<input type="checkbox" id="api-show-deprecated">
Deprecated
</label>
</div>
<div class="apidocs">
<div id="docs-main">
<div class="content">
<h1>MovieClip Class</h1>
<div class="box meta">
<div class="foundat">
Defined in: <a href="..&#x2F;files&#x2F;pixi_MovieClip.js.html#l5"><code>pixi&#x2F;MovieClip.js:5</code></a>
</div>
Module: <a href="../modules/PIXI.html">PIXI</a>
</div>
<div class="box intro">
<p>A MovieClip is a simple way to display an animation depicted by a list of textures.</p>
</div>
<div class="constructor">
<h2>Constructor</h2>
<div id="method_MovieClip" class="method item">
<h3 class="name"><code>MovieClip</code></h3>
<div class="args">
<span class="paren">(</span><ul class="args-list inline commas">
<li class="arg">
<code>textures</code>
</li>
</ul><span class="paren">)</span>
</div>
<div class="meta">
<p>
Defined in
<a href="..&#x2F;files&#x2F;pixi_MovieClip.js.html#l5"><code>pixi&#x2F;MovieClip.js:5</code></a>
</p>
</div>
<div class="description">
</div>
<div class="params">
<h4>Parameters:</h4>
<ul class="params-list">
<li class="param">
<code class="param-name">textures</code>
<span class="type">Array</span>
<div class="param-description">
<p>an array of {Texture} objects that make up the animation</p>
</div>
</li>
</ul>
</div>
</div>
</div>
<div id="classdocs" class="tabview">
<ul class="api-class-tabs">
<li class="api-class-tab index"><a href="#index">Index</a></li>
<li class="api-class-tab methods"><a href="#methods">Methods</a></li>
<li class="api-class-tab properties"><a href="#properties">Properties</a></li>
</ul>
<div>
<div id="index" class="api-class-tabpanel index">
<h2 class="off-left">Item Index</h2>
<div class="index-section methods">
<h3>Methods</h3>
<ul class="index-list methods">
<li class="index-item method">
<a href="#method_gotoAndPlay">gotoAndPlay</a>
</li>
<li class="index-item method">
<a href="#method_gotoAndStop">gotoAndStop</a>
</li>
<li class="index-item method">
<a href="#method_play">play</a>
</li>
<li class="index-item method">
<a href="#method_stop">stop</a>
</li>
</ul>
</div>
<div class="index-section properties">
<h3>Properties</h3>
<ul class="index-list properties">
<li class="index-item property">
<a href="#property_animationSpeed">animationSpeed</a>
</li>
<li class="index-item property">
<a href="#property_currentFrame">currentFrame</a>
</li>
<li class="index-item property">
<a href="#property_playing">playing</a>
</li>
<li class="index-item property">
<a href="#property_textures">textures</a>
</li>
</ul>
</div>
</div>
<div id="methods" class="api-class-tabpanel">
<h2 class="off-left">Methods</h2>
<div id="method_gotoAndPlay" class="method item">
<h3 class="name"><code>gotoAndPlay</code></h3>
<div class="args">
<span class="paren">(</span><ul class="args-list inline commas">
<li class="arg">
<code>frameNumber</code>
</li>
</ul><span class="paren">)</span>
</div>
<div class="meta">
<p>
Defined in
<a href="..&#x2F;files&#x2F;pixi_MovieClip.js.html#l79"><code>pixi&#x2F;MovieClip.js:79</code></a>
</p>
</div>
<div class="description">
<p>Goes to a specific frame and begins playing the MovieClip</p>
</div>
<div class="params">
<h4>Parameters:</h4>
<ul class="params-list">
<li class="param">
<code class="param-name">frameNumber</code>
<span class="type">Number</span>
<div class="param-description">
<p>frame index to start at</p>
</div>
</li>
</ul>
</div>
</div>
<div id="method_gotoAndStop" class="method item">
<h3 class="name"><code>gotoAndStop</code></h3>
<div class="args">
<span class="paren">(</span><ul class="args-list inline commas">
<li class="arg">
<code>frameNumber</code>
</li>
</ul><span class="paren">)</span>
</div>
<div class="meta">
<p>
Defined in
<a href="..&#x2F;files&#x2F;pixi_MovieClip.js.html#l66"><code>pixi&#x2F;MovieClip.js:66</code></a>
</p>
</div>
<div class="description">
<p>Stops the MovieClip and goes to a specific frame</p>
</div>
<div class="params">
<h4>Parameters:</h4>
<ul class="params-list">
<li class="param">
<code class="param-name">frameNumber</code>
<span class="type">Number</span>
<div class="param-description">
<p>frame index to stop at</p>
</div>
</li>
</ul>
</div>
</div>
<div id="method_play" class="method item">
<h3 class="name"><code>play</code></h3>
<span class="paren">()</span>
<div class="meta">
<p>
Defined in
<a href="..&#x2F;files&#x2F;pixi_MovieClip.js.html#l57"><code>pixi&#x2F;MovieClip.js:57</code></a>
</p>
</div>
<div class="description">
<p>Plays the MovieClip</p>
</div>
</div>
<div id="method_stop" class="method item">
<h3 class="name"><code>stop</code></h3>
<span class="paren">()</span>
<div class="meta">
<p>
Defined in
<a href="..&#x2F;files&#x2F;pixi_MovieClip.js.html#l48"><code>pixi&#x2F;MovieClip.js:48</code></a>
</p>
</div>
<div class="description">
<p>Stops the MovieClip</p>
</div>
</div>
</div>
<div id="properties" class="api-class-tabpanel">
<h2 class="off-left">Properties</h2>
<div id="property_animationSpeed" class="property item">
<h3 class="name"><code>animationSpeed</code></h3>
<span class="type">Number</span>
<div class="meta">
<p>
Defined in
<a href="..&#x2F;files&#x2F;pixi_MovieClip.js.html#l29"><code>pixi&#x2F;MovieClip.js:29</code></a>
</p>
</div>
<div class="description">
<p>The speed that the MovieClip will play at. Higher is faster, lower is slower</p>
</div>
</div>
<div id="property_currentFrame" class="property item">
<h3 class="name"><code>currentFrame</code></h3>
<span class="type">Number</span>
<div class="meta">
<p>
Defined in
<a href="..&#x2F;files&#x2F;pixi_MovieClip.js.html#l22"><code>pixi&#x2F;MovieClip.js:22</code></a>
</p>
</div>
<div class="description">
<p>[read only] The index MovieClips current frame (this may not have to be a whole number)</p>
</div>
</div>
<div id="property_playing" class="property item">
<h3 class="name"><code>playing</code></h3>
<span class="type">Boolean</span>
<div class="meta">
<p>
Defined in
<a href="..&#x2F;files&#x2F;pixi_MovieClip.js.html#l36"><code>pixi&#x2F;MovieClip.js:36</code></a>
</p>
</div>
<div class="description">
<p>[read only] indicates if the MovieClip is currently playing</p>
</div>
</div>
<div id="property_textures" class="property item">
<h3 class="name"><code>textures</code></h3>
<span class="type">Array</span>
<div class="meta">
<p>
Defined in
<a href="..&#x2F;files&#x2F;pixi_MovieClip.js.html#l15"><code>pixi&#x2F;MovieClip.js:15</code></a>
</p>
</div>
<div class="description">
<p>The array of textures that make up the animation</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="..&#x2F;assets/vendor/prettify/prettify-min.js"></script>
<script>prettyPrint();</script>
<script src="..&#x2F;assets/js/yui-prettify.js"></script>
<script src="..&#x2F;assets/../api.js"></script>
<script src="..&#x2F;assets/js/api-filter.js"></script>
<script src="..&#x2F;assets/js/api-list.js"></script>
<script src="..&#x2F;assets/js/api-search.js"></script>
<script src="..&#x2F;assets/js/apidocs.js"></script>
</body>
</html>

515
docs/classes/Point.html Normal file
View file

@ -0,0 +1,515 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Point - The Foo API</title>
<link rel="stylesheet" href="http:&#x2F;&#x2F;yui.yahooapis.com&#x2F;3.8.0pr2&#x2F;build&#x2F;cssgrids&#x2F;cssgrids-min.css">
<link rel="stylesheet" href="..&#x2F;assets/vendor/prettify/prettify-min.css">
<link rel="stylesheet" href="..&#x2F;assets/css/main.css" id="site_styles">
<link rel="shortcut icon" type="image/png" href="..&#x2F;assets/favicon.png">
<script src="http:&#x2F;&#x2F;yui.yahooapis.com&#x2F;combo?3.8.0pr2&#x2F;build&#x2F;yui&#x2F;yui-min.js"></script>
</head>
<body class="yui3-skin-sam">
<div id="doc">
<div id="hd" class="yui3-g header">
<div class="yui3-u-3-4">
<h1><img src="..&#x2F;assets/css/logo.png" title="The Foo API"></h1>
</div>
<div class="yui3-u-1-4 version">
<em>API Docs for: 1.2.1</em>
</div>
</div>
<div id="bd" class="yui3-g">
<div class="yui3-u-1-4">
<div id="docs-sidebar" class="sidebar apidocs">
<div id="api-list">
<h2 class="off-left">APIs</h2>
<div id="api-tabview" class="tabview">
<ul class="tabs">
<li><a href="#api-classes">Classes</a></li>
<li><a href="#api-modules">Modules</a></li>
</ul>
<div id="api-tabview-filter">
<input type="search" id="api-filter" placeholder="Type to filter APIs">
</div>
<div id="api-tabview-panel">
<ul id="api-classes" class="apis classes">
<li><a href="..&#x2F;classes/AssetLoader.html">AssetLoader</a></li>
<li><a href="..&#x2F;classes/BaseTexture.html">BaseTexture</a></li>
<li><a href="..&#x2F;classes/CanvasRenderer.html">CanvasRenderer</a></li>
<li><a href="..&#x2F;classes/DisplayObject.html">DisplayObject</a></li>
<li><a href="..&#x2F;classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
<li><a href="..&#x2F;classes/MovieClip.html">MovieClip</a></li>
<li><a href="..&#x2F;classes/Point.html">Point</a></li>
<li><a href="..&#x2F;classes/Rectangle.html">Rectangle</a></li>
<li><a href="..&#x2F;classes/Sprite.html">Sprite</a></li>
<li><a href="..&#x2F;classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
<li><a href="..&#x2F;classes/Stage.html">Stage</a></li>
<li><a href="..&#x2F;classes/Texture.html">Texture</a></li>
<li><a href="..&#x2F;classes/WebGLBatch.html">WebGLBatch</a></li>
<li><a href="..&#x2F;classes/WebGLRenderer.html">WebGLRenderer</a></li>
</ul>
<ul id="api-modules" class="apis modules">
<li><a href="..&#x2F;modules/PIXI.html">PIXI</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="yui3-u-3-4">
<div id="api-options">
Show:
<label for="api-show-inherited">
<input type="checkbox" id="api-show-inherited" checked>
Inherited
</label>
<label for="api-show-protected">
<input type="checkbox" id="api-show-protected">
Protected
</label>
<label for="api-show-private">
<input type="checkbox" id="api-show-private">
Private
</label>
<label for="api-show-deprecated">
<input type="checkbox" id="api-show-deprecated">
Deprecated
</label>
</div>
<div class="apidocs">
<div id="docs-main">
<div class="content">
<h1>Point Class</h1>
<div class="box meta">
<div class="foundat">
Defined in: <a href="..&#x2F;files&#x2F;pixi_Point.js.html#l5"><code>pixi&#x2F;Point.js:5</code></a>
</div>
Module: <a href="../modules/PIXI.html">PIXI</a>
</div>
<div class="box intro">
<p>The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.</p>
</div>
<div class="constructor">
<h2>Constructor</h2>
<div id="method_Point" class="method item">
<h3 class="name"><code>Point</code></h3>
<div class="args">
<span class="paren">(</span><ul class="args-list inline commas">
<li class="arg">
<code>x</code>
</li>
<li class="arg">
<code>y</code>
</li>
</ul><span class="paren">)</span>
</div>
<div class="meta">
<p>
Defined in
<a href="..&#x2F;files&#x2F;pixi_Point.js.html#l5"><code>pixi&#x2F;Point.js:5</code></a>
</p>
</div>
<div class="description">
</div>
<div class="params">
<h4>Parameters:</h4>
<ul class="params-list">
<li class="param">
<code class="param-name">x</code>
<span class="type">Number</span>
<div class="param-description">
<p>position of the point</p>
</div>
</li>
<li class="param">
<code class="param-name">y</code>
<span class="type">Number</span>
<div class="param-description">
<p>position of the point</p>
</div>
</li>
</ul>
</div>
</div>
</div>
<div id="classdocs" class="tabview">
<ul class="api-class-tabs">
<li class="api-class-tab index"><a href="#index">Index</a></li>
<li class="api-class-tab methods"><a href="#methods">Methods</a></li>
<li class="api-class-tab properties"><a href="#properties">Properties</a></li>
</ul>
<div>
<div id="index" class="api-class-tabpanel index">
<h2 class="off-left">Item Index</h2>
<div class="index-section methods">
<h3>Methods</h3>
<ul class="index-list methods">
<li class="index-item method">
<a href="#method_clone">clone</a>
</li>
</ul>
</div>
<div class="index-section properties">
<h3>Properties</h3>
<ul class="index-list properties">
<li class="index-item property">
<a href="#property_x">x</a>
</li>
<li class="index-item property">
<a href="#property_y">y</a>
</li>
</ul>
</div>
</div>
<div id="methods" class="api-class-tabpanel">
<h2 class="off-left">Methods</h2>
<div id="method_clone" class="method item">
<h3 class="name"><code>clone</code></h3>
<span class="paren">()</span>
<span class="returns-inline">
<span class="type"></span>
</span>
<div class="meta">
<p>
Defined in
<a href="..&#x2F;files&#x2F;pixi_Point.js.html#l29"><code>pixi&#x2F;Point.js:29</code></a>
</p>
</div>
<div class="description">
</div>
<div class="returns">
<h4>Returns:</h4>
<div class="returns-description">
a copy of the point
</div>
</div>
</div>
</div>
<div id="properties" class="api-class-tabpanel">
<h2 class="off-left">Properties</h2>
<div id="property_x" class="property item">
<h3 class="name"><code>x</code></h3>
<span class="type">Number</span>
<div class="meta">
<p>
Defined in
<a href="..&#x2F;files&#x2F;pixi_Point.js.html#l14"><code>pixi&#x2F;Point.js:14</code></a>
</p>
</div>
<div class="description">
</div>
<p><strong>Default:</strong> 0</p>
</div>
<div id="property_y" class="property item">
<h3 class="name"><code>y</code></h3>
<span class="type">Number</span>
<div class="meta">
<p>
Defined in
<a href="..&#x2F;files&#x2F;pixi_Point.js.html#l21"><code>pixi&#x2F;Point.js:21</code></a>
</p>
</div>
<div class="description">
</div>
<p><strong>Default:</strong> 0</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="..&#x2F;assets/vendor/prettify/prettify-min.js"></script>
<script>prettyPrint();</script>
<script src="..&#x2F;assets/js/yui-prettify.js"></script>
<script src="..&#x2F;assets/../api.js"></script>
<script src="..&#x2F;assets/js/api-filter.js"></script>
<script src="..&#x2F;assets/js/api-list.js"></script>
<script src="..&#x2F;assets/js/api-search.js"></script>
<script src="..&#x2F;assets/js/apidocs.js"></script>
</body>
</html>

663
docs/classes/Rectangle.html Normal file
View file

@ -0,0 +1,663 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Rectangle - The Foo API</title>
<link rel="stylesheet" href="http:&#x2F;&#x2F;yui.yahooapis.com&#x2F;3.8.0pr2&#x2F;build&#x2F;cssgrids&#x2F;cssgrids-min.css">
<link rel="stylesheet" href="..&#x2F;assets/vendor/prettify/prettify-min.css">
<link rel="stylesheet" href="..&#x2F;assets/css/main.css" id="site_styles">
<link rel="shortcut icon" type="image/png" href="..&#x2F;assets/favicon.png">
<script src="http:&#x2F;&#x2F;yui.yahooapis.com&#x2F;combo?3.8.0pr2&#x2F;build&#x2F;yui&#x2F;yui-min.js"></script>
</head>
<body class="yui3-skin-sam">
<div id="doc">
<div id="hd" class="yui3-g header">
<div class="yui3-u-3-4">
<h1><img src="..&#x2F;assets/css/logo.png" title="The Foo API"></h1>
</div>
<div class="yui3-u-1-4 version">
<em>API Docs for: 1.2.1</em>
</div>
</div>
<div id="bd" class="yui3-g">
<div class="yui3-u-1-4">
<div id="docs-sidebar" class="sidebar apidocs">
<div id="api-list">
<h2 class="off-left">APIs</h2>
<div id="api-tabview" class="tabview">
<ul class="tabs">
<li><a href="#api-classes">Classes</a></li>
<li><a href="#api-modules">Modules</a></li>
</ul>
<div id="api-tabview-filter">
<input type="search" id="api-filter" placeholder="Type to filter APIs">
</div>
<div id="api-tabview-panel">
<ul id="api-classes" class="apis classes">
<li><a href="..&#x2F;classes/AssetLoader.html">AssetLoader</a></li>
<li><a href="..&#x2F;classes/BaseTexture.html">BaseTexture</a></li>
<li><a href="..&#x2F;classes/CanvasRenderer.html">CanvasRenderer</a></li>
<li><a href="..&#x2F;classes/DisplayObject.html">DisplayObject</a></li>
<li><a href="..&#x2F;classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
<li><a href="..&#x2F;classes/MovieClip.html">MovieClip</a></li>
<li><a href="..&#x2F;classes/Point.html">Point</a></li>
<li><a href="..&#x2F;classes/Rectangle.html">Rectangle</a></li>
<li><a href="..&#x2F;classes/Sprite.html">Sprite</a></li>
<li><a href="..&#x2F;classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
<li><a href="..&#x2F;classes/Stage.html">Stage</a></li>
<li><a href="..&#x2F;classes/Texture.html">Texture</a></li>
<li><a href="..&#x2F;classes/WebGLBatch.html">WebGLBatch</a></li>
<li><a href="..&#x2F;classes/WebGLRenderer.html">WebGLRenderer</a></li>
</ul>
<ul id="api-modules" class="apis modules">
<li><a href="..&#x2F;modules/PIXI.html">PIXI</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="yui3-u-3-4">
<div id="api-options">
Show:
<label for="api-show-inherited">
<input type="checkbox" id="api-show-inherited" checked>
Inherited
</label>
<label for="api-show-protected">
<input type="checkbox" id="api-show-protected">
Protected
</label>
<label for="api-show-private">
<input type="checkbox" id="api-show-private">
Private
</label>
<label for="api-show-deprecated">
<input type="checkbox" id="api-show-deprecated">
Deprecated
</label>
</div>
<div class="apidocs">
<div id="docs-main">
<div class="content">
<h1>Rectangle Class</h1>
<div class="box meta">
<div class="foundat">
Defined in: <a href="..&#x2F;files&#x2F;pixi_Rectangle.js.html#l5"><code>pixi&#x2F;Rectangle.js:5</code></a>
</div>
Module: <a href="../modules/PIXI.html">PIXI</a>
</div>
<div class="box intro">
<p>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.</p>
</div>
<div class="constructor">
<h2>Constructor</h2>
<div id="method_Rectangle" class="method item">
<h3 class="name"><code>Rectangle</code></h3>
<div class="args">
<span class="paren">(</span><ul class="args-list inline commas">
<li class="arg">
<code>x</code>
</li>
<li class="arg">
<code>y</code>
</li>
<li class="arg">
<code>width</code>
</li>
<li class="arg">
<code>height</code>
</li>
</ul><span class="paren">)</span>
</div>
<div class="meta">
<p>
Defined in
<a href="..&#x2F;files&#x2F;pixi_Rectangle.js.html#l5"><code>pixi&#x2F;Rectangle.js:5</code></a>
</p>
</div>
<div class="description">
</div>
<div class="params">
<h4>Parameters:</h4>
<ul class="params-list">
<li class="param">
<code class="param-name">x</code>
<span class="type">Number</span>
<div class="param-description">
<p>position of the rectangle</p>
</div>
</li>
<li class="param">
<code class="param-name">y</code>
<span class="type">Number</span>
<div class="param-description">
<p>position of the rectangle</p>
</div>
</li>
<li class="param">
<code class="param-name">width</code>
<span class="type">Number</span>
<div class="param-description">
<p>of the rectangle</p>
</div>
</li>
<li class="param">
<code class="param-name">height</code>
<span class="type">Number</span>
<div class="param-description">
<p>of the rectangle</p>
</div>
</li>
</ul>
</div>
</div>
</div>
<div id="classdocs" class="tabview">
<ul class="api-class-tabs">
<li class="api-class-tab index"><a href="#index">Index</a></li>
<li class="api-class-tab methods"><a href="#methods">Methods</a></li>
<li class="api-class-tab properties"><a href="#properties">Properties</a></li>
</ul>
<div>
<div id="index" class="api-class-tabpanel index">
<h2 class="off-left">Item Index</h2>
<div class="index-section methods">
<h3>Methods</h3>
<ul class="index-list methods">
<li class="index-item method">
<a href="#method_clone">clone</a>
</li>
</ul>
</div>
<div class="index-section properties">
<h3>Properties</h3>
<ul class="index-list properties">
<li class="index-item property">
<a href="#property_height">height</a>
</li>
<li class="index-item property">
<a href="#property_width">width</a>
</li>
<li class="index-item property">
<a href="#property_x">x</a>
</li>
<li class="index-item property">
<a href="#property_y">y</a>
</li>
</ul>
</div>
</div>
<div id="methods" class="api-class-tabpanel">
<h2 class="off-left">Methods</h2>
<div id="method_clone" class="method item">
<h3 class="name"><code>clone</code></h3>
<span class="paren">()</span>
<span class="returns-inline">
<span class="type"></span>
</span>
<div class="meta">
<p>
Defined in
<a href="..&#x2F;files&#x2F;pixi_Rectangle.js.html#l45"><code>pixi&#x2F;Rectangle.js:45</code></a>
</p>
</div>
<div class="description">
</div>
<div class="returns">
<h4>Returns:</h4>
<div class="returns-description">
a copy of the rectangle
</div>
</div>
</div>
</div>
<div id="properties" class="api-class-tabpanel">
<h2 class="off-left">Properties</h2>
<div id="property_height" class="property item">
<h3 class="name"><code>height</code></h3>
<span class="type">Number</span>
<div class="meta">
<p>
Defined in
<a href="..&#x2F;files&#x2F;pixi_Rectangle.js.html#l37"><code>pixi&#x2F;Rectangle.js:37</code></a>
</p>
</div>
<div class="description">
</div>
<p><strong>Default:</strong> 0</p>
</div>
<div id="property_width" class="property item">
<h3 class="name"><code>width</code></h3>
<span class="type">Number</span>
<div class="meta">
<p>
Defined in
<a href="..&#x2F;files&#x2F;pixi_Rectangle.js.html#l30"><code>pixi&#x2F;Rectangle.js:30</code></a>
</p>
</div>
<div class="description">
</div>
<p><strong>Default:</strong> 0</p>
</div>
<div id="property_x" class="property item">
<h3 class="name"><code>x</code></h3>
<span class="type">Number</span>
<div class="meta">
<p>
Defined in
<a href="..&#x2F;files&#x2F;pixi_Rectangle.js.html#l16"><code>pixi&#x2F;Rectangle.js:16</code></a>
</p>
</div>
<div class="description">
</div>
<p><strong>Default:</strong> 0</p>
</div>
<div id="property_y" class="property item">
<h3 class="name"><code>y</code></h3>
<span class="type">Number</span>
<div class="meta">
<p>
Defined in
<a href="..&#x2F;files&#x2F;pixi_Rectangle.js.html#l23"><code>pixi&#x2F;Rectangle.js:23</code></a>
</p>
</div>
<div class="description">
</div>
<p><strong>Default:</strong> 0</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="..&#x2F;assets/vendor/prettify/prettify-min.js"></script>
<script>prettyPrint();</script>
<script src="..&#x2F;assets/js/yui-prettify.js"></script>
<script src="..&#x2F;assets/../api.js"></script>
<script src="..&#x2F;assets/js/api-filter.js"></script>
<script src="..&#x2F;assets/js/api-list.js"></script>
<script src="..&#x2F;assets/js/api-search.js"></script>
<script src="..&#x2F;assets/js/apidocs.js"></script>
</body>
</html>

1579
docs/classes/Sprite.html Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,290 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>SpriteSheetLoader - The Foo API</title>
<link rel="stylesheet" href="http:&#x2F;&#x2F;yui.yahooapis.com&#x2F;3.8.0pr2&#x2F;build&#x2F;cssgrids&#x2F;cssgrids-min.css">
<link rel="stylesheet" href="..&#x2F;assets/vendor/prettify/prettify-min.css">
<link rel="stylesheet" href="..&#x2F;assets/css/main.css" id="site_styles">
<link rel="shortcut icon" type="image/png" href="..&#x2F;assets/favicon.png">
<script src="http:&#x2F;&#x2F;yui.yahooapis.com&#x2F;combo?3.8.0pr2&#x2F;build&#x2F;yui&#x2F;yui-min.js"></script>
</head>
<body class="yui3-skin-sam">
<div id="doc">
<div id="hd" class="yui3-g header">
<div class="yui3-u-3-4">
<h1><img src="..&#x2F;assets/css/logo.png" title="The Foo API"></h1>
</div>
<div class="yui3-u-1-4 version">
<em>API Docs for: 1.2.1</em>
</div>
</div>
<div id="bd" class="yui3-g">
<div class="yui3-u-1-4">
<div id="docs-sidebar" class="sidebar apidocs">
<div id="api-list">
<h2 class="off-left">APIs</h2>
<div id="api-tabview" class="tabview">
<ul class="tabs">
<li><a href="#api-classes">Classes</a></li>
<li><a href="#api-modules">Modules</a></li>
</ul>
<div id="api-tabview-filter">
<input type="search" id="api-filter" placeholder="Type to filter APIs">
</div>
<div id="api-tabview-panel">
<ul id="api-classes" class="apis classes">
<li><a href="..&#x2F;classes/AssetLoader.html">AssetLoader</a></li>
<li><a href="..&#x2F;classes/BaseTexture.html">BaseTexture</a></li>
<li><a href="..&#x2F;classes/CanvasRenderer.html">CanvasRenderer</a></li>
<li><a href="..&#x2F;classes/DisplayObject.html">DisplayObject</a></li>
<li><a href="..&#x2F;classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
<li><a href="..&#x2F;classes/MovieClip.html">MovieClip</a></li>
<li><a href="..&#x2F;classes/Point.html">Point</a></li>
<li><a href="..&#x2F;classes/Rectangle.html">Rectangle</a></li>
<li><a href="..&#x2F;classes/Sprite.html">Sprite</a></li>
<li><a href="..&#x2F;classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
<li><a href="..&#x2F;classes/Stage.html">Stage</a></li>
<li><a href="..&#x2F;classes/Texture.html">Texture</a></li>
<li><a href="..&#x2F;classes/WebGLBatch.html">WebGLBatch</a></li>
<li><a href="..&#x2F;classes/WebGLRenderer.html">WebGLRenderer</a></li>
</ul>
<ul id="api-modules" class="apis modules">
<li><a href="..&#x2F;modules/PIXI.html">PIXI</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="yui3-u-3-4">
<div id="api-options">
Show:
<label for="api-show-inherited">
<input type="checkbox" id="api-show-inherited" checked>
Inherited
</label>
<label for="api-show-protected">
<input type="checkbox" id="api-show-protected">
Protected
</label>
<label for="api-show-private">
<input type="checkbox" id="api-show-private">
Private
</label>
<label for="api-show-deprecated">
<input type="checkbox" id="api-show-deprecated">
Deprecated
</label>
</div>
<div class="apidocs">
<div id="docs-main">
<div class="content">
<h1>SpriteSheetLoader Class</h1>
<div class="box meta">
<div class="extends">
Extends EventTarget
</div>
<div class="foundat">
Defined in: <a href="..&#x2F;files&#x2F;pixi_loaders_SpriteSheetLoader.js.html#l5"><code>pixi&#x2F;loaders&#x2F;SpriteSheetLoader.js:5</code></a>
</div>
Module: <a href="../modules/PIXI.html">PIXI</a>
</div>
<div class="box intro">
<p>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</p>
</div>
<div class="constructor">
<h2>Constructor</h2>
<div id="method_SpriteSheetLoader" class="method item">
<h3 class="name"><code>SpriteSheetLoader</code></h3>
<div class="args">
<span class="paren">(</span><ul class="args-list inline commas">
<li class="arg">
<code>url</code>
</li>
</ul><span class="paren">)</span>
</div>
<div class="meta">
<p>
Defined in
<a href="..&#x2F;files&#x2F;pixi_loaders_SpriteSheetLoader.js.html#l5"><code>pixi&#x2F;loaders&#x2F;SpriteSheetLoader.js:5</code></a>
</p>
</div>
<div class="description">
</div>
<div class="params">
<h4>Parameters:</h4>
<ul class="params-list">
<li class="param">
<code class="param-name">url</code>
<span class="type">String</span>
<div class="param-description">
<p>the url of the sprite sheet JSON file</p>
</div>
</li>
</ul>
</div>
</div>
</div>
<div id="classdocs" class="tabview">
<ul class="api-class-tabs">
<li class="api-class-tab index"><a href="#index">Index</a></li>
</ul>
<div>
<div id="index" class="api-class-tabpanel index">
<h2 class="off-left">Item Index</h2>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="..&#x2F;assets/vendor/prettify/prettify-min.js"></script>
<script>prettyPrint();</script>
<script src="..&#x2F;assets/js/yui-prettify.js"></script>
<script src="..&#x2F;assets/../api.js"></script>
<script src="..&#x2F;assets/js/api-filter.js"></script>
<script src="..&#x2F;assets/js/api-list.js"></script>
<script src="..&#x2F;assets/js/api-search.js"></script>
<script src="..&#x2F;assets/js/apidocs.js"></script>
</body>
</html>

1144
docs/classes/Stage.html Normal file

File diff suppressed because it is too large Load diff

966
docs/classes/Texture.html Normal file
View file

@ -0,0 +1,966 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Texture - The Foo API</title>
<link rel="stylesheet" href="http:&#x2F;&#x2F;yui.yahooapis.com&#x2F;3.8.0pr2&#x2F;build&#x2F;cssgrids&#x2F;cssgrids-min.css">
<link rel="stylesheet" href="..&#x2F;assets/vendor/prettify/prettify-min.css">
<link rel="stylesheet" href="..&#x2F;assets/css/main.css" id="site_styles">
<link rel="shortcut icon" type="image/png" href="..&#x2F;assets/favicon.png">
<script src="http:&#x2F;&#x2F;yui.yahooapis.com&#x2F;combo?3.8.0pr2&#x2F;build&#x2F;yui&#x2F;yui-min.js"></script>
</head>
<body class="yui3-skin-sam">
<div id="doc">
<div id="hd" class="yui3-g header">
<div class="yui3-u-3-4">
<h1><img src="..&#x2F;assets/css/logo.png" title="The Foo API"></h1>
</div>
<div class="yui3-u-1-4 version">
<em>API Docs for: 1.2.1</em>
</div>
</div>
<div id="bd" class="yui3-g">
<div class="yui3-u-1-4">
<div id="docs-sidebar" class="sidebar apidocs">
<div id="api-list">
<h2 class="off-left">APIs</h2>
<div id="api-tabview" class="tabview">
<ul class="tabs">
<li><a href="#api-classes">Classes</a></li>
<li><a href="#api-modules">Modules</a></li>
</ul>
<div id="api-tabview-filter">
<input type="search" id="api-filter" placeholder="Type to filter APIs">
</div>
<div id="api-tabview-panel">
<ul id="api-classes" class="apis classes">
<li><a href="..&#x2F;classes/AssetLoader.html">AssetLoader</a></li>
<li><a href="..&#x2F;classes/BaseTexture.html">BaseTexture</a></li>
<li><a href="..&#x2F;classes/CanvasRenderer.html">CanvasRenderer</a></li>
<li><a href="..&#x2F;classes/DisplayObject.html">DisplayObject</a></li>
<li><a href="..&#x2F;classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
<li><a href="..&#x2F;classes/MovieClip.html">MovieClip</a></li>
<li><a href="..&#x2F;classes/Point.html">Point</a></li>
<li><a href="..&#x2F;classes/Rectangle.html">Rectangle</a></li>
<li><a href="..&#x2F;classes/Sprite.html">Sprite</a></li>
<li><a href="..&#x2F;classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
<li><a href="..&#x2F;classes/Stage.html">Stage</a></li>
<li><a href="..&#x2F;classes/Texture.html">Texture</a></li>
<li><a href="..&#x2F;classes/WebGLBatch.html">WebGLBatch</a></li>
<li><a href="..&#x2F;classes/WebGLRenderer.html">WebGLRenderer</a></li>
</ul>
<ul id="api-modules" class="apis modules">
<li><a href="..&#x2F;modules/PIXI.html">PIXI</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="yui3-u-3-4">
<div id="api-options">
Show:
<label for="api-show-inherited">
<input type="checkbox" id="api-show-inherited" checked>
Inherited
</label>
<label for="api-show-protected">
<input type="checkbox" id="api-show-protected">
Protected
</label>
<label for="api-show-private">
<input type="checkbox" id="api-show-private">
Private
</label>
<label for="api-show-deprecated">
<input type="checkbox" id="api-show-deprecated">
Deprecated
</label>
</div>
<div class="apidocs">
<div id="docs-main">
<div class="content">
<h1>Texture Class</h1>
<div class="box meta">
<div class="extends">
Extends EventTarget
</div>
<div class="foundat">
Defined in: <a href="..&#x2F;files&#x2F;pixi_textures_Texture.js.html#l8"><code>pixi&#x2F;textures&#x2F;Texture.js:8</code></a>
</div>
Module: <a href="../modules/PIXI.html">PIXI</a>
</div>
<div class="box intro">
<p>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</p>
</div>
<div class="constructor">
<h2>Constructor</h2>
<div id="method_Texture" class="method item">
<h3 class="name"><code>Texture</code></h3>
<div class="args">
<span class="paren">(</span><ul class="args-list inline commas">
<li class="arg">
<code>baseTexture</code>
</li>
<li class="arg">
<code>frmae</code>
</li>
</ul><span class="paren">)</span>
</div>
<div class="meta">
<p>
Defined in
<a href="..&#x2F;files&#x2F;pixi_textures_Texture.js.html#l8"><code>pixi&#x2F;textures&#x2F;Texture.js:8</code></a>
</p>
</div>
<div class="description">
</div>
<div class="params">
<h4>Parameters:</h4>
<ul class="params-list">
<li class="param">
<code class="param-name">baseTexture</code>
<span class="type"><a href="../classes/BaseTexture.html" class="crosslink">BaseTexture</a></span>
<div class="param-description">
</div>
</li>
<li class="param">
<code class="param-name">frmae</code>
<span class="type"><a href="../classes/Rectangle.html" class="crosslink">Rectangle</a></span>
<div class="param-description">
</div>
</li>
</ul>
</div>
</div>
</div>
<div id="classdocs" class="tabview">
<ul class="api-class-tabs">
<li class="api-class-tab index"><a href="#index">Index</a></li>
<li class="api-class-tab methods"><a href="#methods">Methods</a></li>
<li class="api-class-tab properties"><a href="#properties">Properties</a></li>
</ul>
<div>
<div id="index" class="api-class-tabpanel index">
<h2 class="off-left">Item Index</h2>
<div class="index-section methods">
<h3>Methods</h3>
<ul class="index-list methods extends">
<li class="index-item method">
<a href="#method_addTextureToCache">addTextureToCache</a>
</li>
<li class="index-item method">
<a href="#method_fromFrameId">fromFrameId</a>
</li>
<li class="index-item method">
<a href="#method_fromImage">fromImage</a>
<span class="flag static">static</span>
</li>
<li class="index-item method">
<a href="#method_removeTextureFromCache">removeTextureFromCache</a>
</li>
<li class="index-item method">
<a href="#method_setFrame">setFrame</a>
</li>
</ul>
</div>
<div class="index-section properties">
<h3>Properties</h3>
<ul class="index-list properties extends">
<li class="index-item property">
<a href="#property_baseTexture">baseTexture</a>
</li>
<li class="index-item property">
<a href="#property_frame">frame</a>
</li>
</ul>
</div>
</div>
<div id="methods" class="api-class-tabpanel">
<h2 class="off-left">Methods</h2>
<div id="method_addTextureToCache" class="method item">
<h3 class="name"><code>addTextureToCache</code></h3>
<div class="args">
<span class="paren">(</span><ul class="args-list inline commas">
<li class="arg">
<code>texture</code>
</li>
<li class="arg">
<code>id</code>
</li>
</ul><span class="paren">)</span>
</div>
<div class="meta">
<p>
Defined in
<a href="..&#x2F;files&#x2F;pixi_textures_Texture.js.html#l127"><code>pixi&#x2F;textures&#x2F;Texture.js:127</code></a>
</p>
</div>
<div class="description">
<p>Adds a texture to the textureCache.</p>
</div>
<div class="params">
<h4>Parameters:</h4>
<ul class="params-list">
<li class="param">
<code class="param-name">texture</code>
<span class="type"><a href="../classes/Texture.html" class="crosslink">Texture</a></span>
<div class="param-description">
</div>
</li>
<li class="param">
<code class="param-name">id</code>
<span class="type">String</span>
<div class="param-description">
<p>the id that the texture will be stored against.</p>
</div>
</li>
</ul>
</div>
</div>
<div id="method_fromFrameId" class="method item">
<h3 class="name"><code>fromFrameId</code></h3>
<div class="args">
<span class="paren">(</span><ul class="args-list inline commas">
<li class="arg">
<code>frameId</code>
</li>
</ul><span class="paren">)</span>
</div>
<span class="returns-inline">
<span class="type"></span>
</span>
<div class="meta">
<p>
Defined in
<a href="..&#x2F;files&#x2F;pixi_textures_Texture.js.html#l112"><code>pixi&#x2F;textures&#x2F;Texture.js:112</code></a>
</p>
</div>
<div class="description">
<p>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</p>
</div>
<div class="params">
<h4>Parameters:</h4>
<ul class="params-list">
<li class="param">
<code class="param-name">frameId</code>
<span class="type">String</span>
<div class="param-description">
<p>The frame id of the texture</p>
</div>
</li>
</ul>
</div>
<div class="returns">
<h4>Returns:</h4>
<div class="returns-description">
Texture
</div>
</div>
</div>
<div id="method_fromImage" class="method item">
<h3 class="name"><code>fromImage</code></h3>
<div class="args">
<span class="paren">(</span><ul class="args-list inline commas">
<li class="arg">
<code>imageUrl</code>
</li>
</ul><span class="paren">)</span>
</div>
<span class="returns-inline">
<span class="type"></span>
</span>
<span class="flag static">static</span>
<div class="meta">
<p>
Defined in
<a href="..&#x2F;files&#x2F;pixi_textures_Texture.js.html#l88"><code>pixi&#x2F;textures&#x2F;Texture.js:88</code></a>
</p>
</div>
<div class="description">
<p>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</p>
</div>
<div class="params">
<h4>Parameters:</h4>
<ul class="params-list">
<li class="param">
<code class="param-name">imageUrl</code>
<span class="type">String</span>
<div class="param-description">
<p>The image url of the texture</p>
</div>
</li>
</ul>
</div>
<div class="returns">
<h4>Returns:</h4>
<div class="returns-description">
Texture
</div>
</div>
</div>
<div id="method_removeTextureFromCache" class="method item">
<h3 class="name"><code>removeTextureFromCache</code></h3>
<div class="args">
<span class="paren">(</span><ul class="args-list inline commas">
<li class="arg">
<code>id</code>
</li>
</ul><span class="paren">)</span>
</div>
<div class="meta">
<p>
Defined in
<a href="..&#x2F;files&#x2F;pixi_textures_Texture.js.html#l139"><code>pixi&#x2F;textures&#x2F;Texture.js:139</code></a>
</p>
</div>
<div class="description">
<p>Remove a texture from the textureCache.</p>
</div>
<div class="params">
<h4>Parameters:</h4>
<ul class="params-list">
<li class="param">
<code class="param-name">id</code>
<span class="type">String</span>
<div class="param-description">
<p>the id of the texture to be removed</p>
</div>
</li>
</ul>
</div>
</div>
<div id="method_setFrame" class="method item">
<h3 class="name"><code>setFrame</code></h3>
<div class="args">
<span class="paren">(</span><ul class="args-list inline commas">
<li class="arg">
<code>frame</code>
</li>
</ul><span class="paren">)</span>
</div>
<div class="meta">
<p>
Defined in
<a href="..&#x2F;files&#x2F;pixi_textures_Texture.js.html#l75"><code>pixi&#x2F;textures&#x2F;Texture.js:75</code></a>
</p>
</div>
<div class="description">
<p>Specifies the rectangle region of the baseTexture</p>
</div>
<div class="params">
<h4>Parameters:</h4>
<ul class="params-list">
<li class="param">
<code class="param-name">frame</code>
<span class="type"><a href="../classes/Rectangle.html" class="crosslink">Rectangle</a></span>
<div class="param-description">
</div>
</li>
</ul>
</div>
</div>
</div>
<div id="properties" class="api-class-tabpanel">
<h2 class="off-left">Properties</h2>
<div id="property_baseTexture" class="property item">
<h3 class="name"><code>baseTexture</code></h3>
<span class="type"><a href="../classes/BaseTexture.html" class="crosslink">BaseTexture</a></span>
<div class="meta">
<p>
Defined in
<a href="..&#x2F;files&#x2F;pixi_textures_Texture.js.html#l28"><code>pixi&#x2F;textures&#x2F;Texture.js:28</code></a>
</p>
</div>
<div class="description">
<p>The base texture of this texture</p>
</div>
</div>
<div id="property_frame" class="property item">
<h3 class="name"><code>frame</code></h3>
<span class="type">#Rectangle</span>
<div class="meta">
<p>
Defined in
<a href="..&#x2F;files&#x2F;pixi_textures_Texture.js.html#l37"><code>pixi&#x2F;textures&#x2F;Texture.js:37</code></a>
</p>
</div>
<div class="description">
<p>The frame specifies the region of the base texture that this texture uses</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="..&#x2F;assets/vendor/prettify/prettify-min.js"></script>
<script>prettyPrint();</script>
<script src="..&#x2F;assets/js/yui-prettify.js"></script>
<script src="..&#x2F;assets/../api.js"></script>
<script src="..&#x2F;assets/js/api-filter.js"></script>
<script src="..&#x2F;assets/js/api-list.js"></script>
<script src="..&#x2F;assets/js/api-search.js"></script>
<script src="..&#x2F;assets/js/apidocs.js"></script>
</body>
</html>

1013
docs/classes/WebGLBatch.html Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,416 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>WebGLRenderer - The Foo API</title>
<link rel="stylesheet" href="http:&#x2F;&#x2F;yui.yahooapis.com&#x2F;3.8.0pr2&#x2F;build&#x2F;cssgrids&#x2F;cssgrids-min.css">
<link rel="stylesheet" href="..&#x2F;assets/vendor/prettify/prettify-min.css">
<link rel="stylesheet" href="..&#x2F;assets/css/main.css" id="site_styles">
<link rel="shortcut icon" type="image/png" href="..&#x2F;assets/favicon.png">
<script src="http:&#x2F;&#x2F;yui.yahooapis.com&#x2F;combo?3.8.0pr2&#x2F;build&#x2F;yui&#x2F;yui-min.js"></script>
</head>
<body class="yui3-skin-sam">
<div id="doc">
<div id="hd" class="yui3-g header">
<div class="yui3-u-3-4">
<h1><img src="..&#x2F;assets/css/logo.png" title="The Foo API"></h1>
</div>
<div class="yui3-u-1-4 version">
<em>API Docs for: 1.2.1</em>
</div>
</div>
<div id="bd" class="yui3-g">
<div class="yui3-u-1-4">
<div id="docs-sidebar" class="sidebar apidocs">
<div id="api-list">
<h2 class="off-left">APIs</h2>
<div id="api-tabview" class="tabview">
<ul class="tabs">
<li><a href="#api-classes">Classes</a></li>
<li><a href="#api-modules">Modules</a></li>
</ul>
<div id="api-tabview-filter">
<input type="search" id="api-filter" placeholder="Type to filter APIs">
</div>
<div id="api-tabview-panel">
<ul id="api-classes" class="apis classes">
<li><a href="..&#x2F;classes/AssetLoader.html">AssetLoader</a></li>
<li><a href="..&#x2F;classes/BaseTexture.html">BaseTexture</a></li>
<li><a href="..&#x2F;classes/CanvasRenderer.html">CanvasRenderer</a></li>
<li><a href="..&#x2F;classes/DisplayObject.html">DisplayObject</a></li>
<li><a href="..&#x2F;classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
<li><a href="..&#x2F;classes/MovieClip.html">MovieClip</a></li>
<li><a href="..&#x2F;classes/Point.html">Point</a></li>
<li><a href="..&#x2F;classes/Rectangle.html">Rectangle</a></li>
<li><a href="..&#x2F;classes/Sprite.html">Sprite</a></li>
<li><a href="..&#x2F;classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
<li><a href="..&#x2F;classes/Stage.html">Stage</a></li>
<li><a href="..&#x2F;classes/Texture.html">Texture</a></li>
<li><a href="..&#x2F;classes/WebGLBatch.html">WebGLBatch</a></li>
<li><a href="..&#x2F;classes/WebGLRenderer.html">WebGLRenderer</a></li>
</ul>
<ul id="api-modules" class="apis modules">
<li><a href="..&#x2F;modules/PIXI.html">PIXI</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="yui3-u-3-4">
<div id="api-options">
Show:
<label for="api-show-inherited">
<input type="checkbox" id="api-show-inherited" checked>
Inherited
</label>
<label for="api-show-protected">
<input type="checkbox" id="api-show-protected">
Protected
</label>
<label for="api-show-private">
<input type="checkbox" id="api-show-private">
Private
</label>
<label for="api-show-deprecated">
<input type="checkbox" id="api-show-deprecated">
Deprecated
</label>
</div>
<div class="apidocs">
<div id="docs-main">
<div class="content">
<h1>WebGLRenderer Class</h1>
<div class="box meta">
<div class="foundat">
Defined in: <a href="..&#x2F;files&#x2F;pixi_renderers_WebGLRenderer.js.html#l7"><code>pixi&#x2F;renderers&#x2F;WebGLRenderer.js:7</code></a>
</div>
Module: <a href="../modules/PIXI.html">PIXI</a>
</div>
<div class="box intro">
<p>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 :)</p>
</div>
<div id="classdocs" class="tabview">
<ul class="api-class-tabs">
<li class="api-class-tab index"><a href="#index">Index</a></li>
<li class="api-class-tab methods"><a href="#methods">Methods</a></li>
</ul>
<div>
<div id="index" class="api-class-tabpanel index">
<h2 class="off-left">Item Index</h2>
<div class="index-section methods">
<h3>Methods</h3>
<ul class="index-list methods">
<li class="index-item method">
<a href="#method_render">render</a>
</li>
<li class="index-item method">
<a href="#method_resize">resize</a>
</li>
</ul>
</div>
</div>
<div id="methods" class="api-class-tabpanel">
<h2 class="off-left">Methods</h2>
<div id="method_render" class="method item">
<h3 class="name"><code>render</code></h3>
<div class="args">
<span class="paren">(</span><ul class="args-list inline commas">
<li class="arg">
<code>stage</code>
</li>
</ul><span class="paren">)</span>
</div>
<div class="meta">
<p>
Defined in
<a href="..&#x2F;files&#x2F;pixi_renderers_WebGLRenderer.js.html#l156"><code>pixi&#x2F;renderers&#x2F;WebGLRenderer.js:156</code></a>
</p>
</div>
<div class="description">
<p>Renders the stage to its webGL view</p>
</div>
<div class="params">
<h4>Parameters:</h4>
<ul class="params-list">
<li class="param">
<code class="param-name">stage</code>
<span class="type"><a href="../classes/Stage.html" class="crosslink">Stage</a></span>
<div class="param-description">
<p>the PIXI.Stage element to be rendered</p>
</div>
</li>
</ul>
</div>
</div>
<div id="method_resize" class="method item">
<h3 class="name"><code>resize</code></h3>
<div class="args">
<span class="paren">(</span><ul class="args-list inline commas">
<li class="arg">
<code>width</code>
</li>
<li class="arg">
<code>height</code>
</li>
</ul><span class="paren">)</span>
</div>
<div class="meta">
<p>
Defined in
<a href="..&#x2F;files&#x2F;pixi_renderers_WebGLRenderer.js.html#l525"><code>pixi&#x2F;renderers&#x2F;WebGLRenderer.js:525</code></a>
</p>
</div>
<div class="description">
<p>resizes the webGL view to the specified width and height</p>
</div>
<div class="params">
<h4>Parameters:</h4>
<ul class="params-list">
<li class="param">
<code class="param-name">width</code>
<span class="type">Number</span>
<div class="param-description">
<p>the new width of the webGL view</p>
</div>
</li>
<li class="param">
<code class="param-name">height</code>
<span class="type">Number</span>
<div class="param-description">
<p>the new height of the webGL view</p>
</div>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="..&#x2F;assets/vendor/prettify/prettify-min.js"></script>
<script>prettyPrint();</script>
<script src="..&#x2F;assets/js/yui-prettify.js"></script>
<script src="..&#x2F;assets/../api.js"></script>
<script src="..&#x2F;assets/js/api-filter.js"></script>
<script src="..&#x2F;assets/js/api-list.js"></script>
<script src="..&#x2F;assets/js/api-search.js"></script>
<script src="..&#x2F;assets/js/apidocs.js"></script>
</body>
</html>

10
docs/classes/index.html Normal file
View file

@ -0,0 +1,10 @@
<!doctype html>
<html>
<head>
<title>Redirector</title>
<meta http-equiv="refresh" content="0;url=../">
</head>
<body>
<a href="../">Click here to redirect</a>
</body>
</html>

1821
docs/data.json Normal file

File diff suppressed because it is too large Load diff

10
docs/files/index.html Normal file
View file

@ -0,0 +1,10 @@
<!doctype html>
<html>
<head>
<title>Redirector</title>
<meta http-equiv="refresh" content="0;url=../">
</head>
<body>
<a href="../">Click here to redirect</a>
</body>
</html>

View file

@ -0,0 +1,241 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>pixi&#x2F;DisplayObject.js - The Foo API</title>
<link rel="stylesheet" href="http:&#x2F;&#x2F;yui.yahooapis.com&#x2F;3.8.0pr2&#x2F;build&#x2F;cssgrids&#x2F;cssgrids-min.css">
<link rel="stylesheet" href="..&#x2F;assets/vendor/prettify/prettify-min.css">
<link rel="stylesheet" href="..&#x2F;assets/css/main.css" id="site_styles">
<link rel="shortcut icon" type="image/png" href="..&#x2F;assets/favicon.png">
<script src="http:&#x2F;&#x2F;yui.yahooapis.com&#x2F;combo?3.8.0pr2&#x2F;build&#x2F;yui&#x2F;yui-min.js"></script>
</head>
<body class="yui3-skin-sam">
<div id="doc">
<div id="hd" class="yui3-g header">
<div class="yui3-u-3-4">
<h1><img src="..&#x2F;assets/css/logo.png" title="The Foo API"></h1>
</div>
<div class="yui3-u-1-4 version">
<em>API Docs for: 1.2.1</em>
</div>
</div>
<div id="bd" class="yui3-g">
<div class="yui3-u-1-4">
<div id="docs-sidebar" class="sidebar apidocs">
<div id="api-list">
<h2 class="off-left">APIs</h2>
<div id="api-tabview" class="tabview">
<ul class="tabs">
<li><a href="#api-classes">Classes</a></li>
<li><a href="#api-modules">Modules</a></li>
</ul>
<div id="api-tabview-filter">
<input type="search" id="api-filter" placeholder="Type to filter APIs">
</div>
<div id="api-tabview-panel">
<ul id="api-classes" class="apis classes">
<li><a href="..&#x2F;classes/AssetLoader.html">AssetLoader</a></li>
<li><a href="..&#x2F;classes/BaseTexture.html">BaseTexture</a></li>
<li><a href="..&#x2F;classes/CanvasRenderer.html">CanvasRenderer</a></li>
<li><a href="..&#x2F;classes/DisplayObject.html">DisplayObject</a></li>
<li><a href="..&#x2F;classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
<li><a href="..&#x2F;classes/MovieClip.html">MovieClip</a></li>
<li><a href="..&#x2F;classes/Point.html">Point</a></li>
<li><a href="..&#x2F;classes/Rectangle.html">Rectangle</a></li>
<li><a href="..&#x2F;classes/Sprite.html">Sprite</a></li>
<li><a href="..&#x2F;classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
<li><a href="..&#x2F;classes/Stage.html">Stage</a></li>
<li><a href="..&#x2F;classes/Texture.html">Texture</a></li>
<li><a href="..&#x2F;classes/WebGLBatch.html">WebGLBatch</a></li>
<li><a href="..&#x2F;classes/WebGLRenderer.html">WebGLRenderer</a></li>
</ul>
<ul id="api-modules" class="apis modules">
<li><a href="..&#x2F;modules/PIXI.html">PIXI</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="yui3-u-3-4">
<div id="api-options">
Show:
<label for="api-show-inherited">
<input type="checkbox" id="api-show-inherited" checked>
Inherited
</label>
<label for="api-show-protected">
<input type="checkbox" id="api-show-protected">
Protected
</label>
<label for="api-show-private">
<input type="checkbox" id="api-show-private">
Private
</label>
<label for="api-show-deprecated">
<input type="checkbox" id="api-show-deprecated">
Deprecated
</label>
</div>
<div class="apidocs">
<div id="docs-main">
<div class="content">
<h1 class="file-heading">File: pixi&#x2F;DisplayObject.js</h1>
<div class="file">
<pre class="code prettyprint linenums">
&#x2F;**
* @author Mat Groves http:&#x2F;&#x2F;matgroves.com&#x2F;
*&#x2F;
&#x2F;**
* this is the base class for all objects that are rendered on the screen.
* @class DisplayObject
* @constructor
*&#x2F;
PIXI.DisplayObject = function()
{
&#x2F;**
* The coordinate of the object relative to the local coordinates of the parent.
* @property position
* @type Point
*&#x2F;
this.position = new PIXI.Point();
&#x2F;**
* The scale factor of the object.
* @property scale
* @type Point
*&#x2F;
this.scale = new PIXI.Point(1,1);&#x2F;&#x2F;{x:1, y:1};
&#x2F;**
* The rotation of the object in radians.
* @property rotation
* @type Number
*&#x2F;
this.rotation = 0;
&#x2F;**
* The opacity of the object.
* @property alpha
* @type Number
*&#x2F;
this.alpha = 1;
&#x2F;**
* The visibility of the object.
* @property visible
* @type Boolean
*&#x2F;
this.visible = true;
this.cacheVisible = false;
&#x2F;**
* [read-only] The display object container that contains this display object.
* @property parent
* @type DisplayObjectContainer
*&#x2F;
this.parent = null;
&#x2F;**
* [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.
* @property stage
* @type Stage
*&#x2F;
this.stage = null;
this.worldAlpha = 1;
this.color = [];
this.worldTransform = mat3.identity();
this.localTransform = mat3.identity();
this.dynamic = true;
&#x2F;&#x2F; chach that puppy!
this._sr = 0;
this._cr = 1;
this.renderable = false;
}
&#x2F;&#x2F; constructor
PIXI.DisplayObject.constructor = PIXI.DisplayObject;
&#x2F;**
* @private
*&#x2F;
PIXI.DisplayObject.prototype.updateTransform = function()
{
&#x2F;&#x2F; 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;
&#x2F;&#x2F;&#x2F;AAARR GETTER SETTTER!
this.localTransform[2] = this.position.x;
this.localTransform[5] = this.position.y;
&#x2F;&#x2F; TODO optimize?
mat3.multiply(this.localTransform, this.parent.worldTransform, this.worldTransform);
this.worldAlpha = this.alpha * this.parent.worldAlpha;
}
</pre>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="..&#x2F;assets/vendor/prettify/prettify-min.js"></script>
<script>prettyPrint();</script>
<script src="..&#x2F;assets/js/yui-prettify.js"></script>
<script src="..&#x2F;assets/../api.js"></script>
<script src="..&#x2F;assets/js/api-filter.js"></script>
<script src="..&#x2F;assets/js/api-list.js"></script>
<script src="..&#x2F;assets/js/api-search.js"></script>
<script src="..&#x2F;assets/js/apidocs.js"></script>
</body>
</html>

View file

@ -0,0 +1,275 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>pixi&#x2F;DisplayObjectContainer.js - The Foo API</title>
<link rel="stylesheet" href="http:&#x2F;&#x2F;yui.yahooapis.com&#x2F;3.8.0pr2&#x2F;build&#x2F;cssgrids&#x2F;cssgrids-min.css">
<link rel="stylesheet" href="..&#x2F;assets/vendor/prettify/prettify-min.css">
<link rel="stylesheet" href="..&#x2F;assets/css/main.css" id="site_styles">
<link rel="shortcut icon" type="image/png" href="..&#x2F;assets/favicon.png">
<script src="http:&#x2F;&#x2F;yui.yahooapis.com&#x2F;combo?3.8.0pr2&#x2F;build&#x2F;yui&#x2F;yui-min.js"></script>
</head>
<body class="yui3-skin-sam">
<div id="doc">
<div id="hd" class="yui3-g header">
<div class="yui3-u-3-4">
<h1><img src="..&#x2F;assets/css/logo.png" title="The Foo API"></h1>
</div>
<div class="yui3-u-1-4 version">
<em>API Docs for: 1.2.1</em>
</div>
</div>
<div id="bd" class="yui3-g">
<div class="yui3-u-1-4">
<div id="docs-sidebar" class="sidebar apidocs">
<div id="api-list">
<h2 class="off-left">APIs</h2>
<div id="api-tabview" class="tabview">
<ul class="tabs">
<li><a href="#api-classes">Classes</a></li>
<li><a href="#api-modules">Modules</a></li>
</ul>
<div id="api-tabview-filter">
<input type="search" id="api-filter" placeholder="Type to filter APIs">
</div>
<div id="api-tabview-panel">
<ul id="api-classes" class="apis classes">
<li><a href="..&#x2F;classes/AssetLoader.html">AssetLoader</a></li>
<li><a href="..&#x2F;classes/BaseTexture.html">BaseTexture</a></li>
<li><a href="..&#x2F;classes/CanvasRenderer.html">CanvasRenderer</a></li>
<li><a href="..&#x2F;classes/DisplayObject.html">DisplayObject</a></li>
<li><a href="..&#x2F;classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
<li><a href="..&#x2F;classes/MovieClip.html">MovieClip</a></li>
<li><a href="..&#x2F;classes/Point.html">Point</a></li>
<li><a href="..&#x2F;classes/Rectangle.html">Rectangle</a></li>
<li><a href="..&#x2F;classes/Sprite.html">Sprite</a></li>
<li><a href="..&#x2F;classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
<li><a href="..&#x2F;classes/Stage.html">Stage</a></li>
<li><a href="..&#x2F;classes/Texture.html">Texture</a></li>
<li><a href="..&#x2F;classes/WebGLBatch.html">WebGLBatch</a></li>
<li><a href="..&#x2F;classes/WebGLRenderer.html">WebGLRenderer</a></li>
</ul>
<ul id="api-modules" class="apis modules">
<li><a href="..&#x2F;modules/PIXI.html">PIXI</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="yui3-u-3-4">
<div id="api-options">
Show:
<label for="api-show-inherited">
<input type="checkbox" id="api-show-inherited" checked>
Inherited
</label>
<label for="api-show-protected">
<input type="checkbox" id="api-show-protected">
Protected
</label>
<label for="api-show-private">
<input type="checkbox" id="api-show-private">
Private
</label>
<label for="api-show-deprecated">
<input type="checkbox" id="api-show-deprecated">
Deprecated
</label>
</div>
<div class="apidocs">
<div id="docs-main">
<div class="content">
<h1 class="file-heading">File: pixi&#x2F;DisplayObjectContainer.js</h1>
<div class="file">
<pre class="code prettyprint linenums">
&#x2F;**
* @author Mat Groves http:&#x2F;&#x2F;matgroves.com&#x2F;
*&#x2F;
&#x2F;**
* 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
*&#x2F;
PIXI.DisplayObjectContainer = function()
{
PIXI.DisplayObject.call( this );
&#x2F;**
* [read-only] The of children of this container.
* @property children {Array}
*&#x2F;
this.children = [];
this.renderable = false;
}
&#x2F;&#x2F; constructor
PIXI.DisplayObjectContainer.constructor = PIXI.DisplayObjectContainer;
PIXI.DisplayObjectContainer.prototype = Object.create( PIXI.DisplayObject.prototype );
&#x2F;**
* Adds a child to the container.
* @method addChild
* @param DisplayObject {DisplayObject}
*&#x2F;
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);
}
}
&#x2F;**
* 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}
*&#x2F;
PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
{
if(index &gt;= 0 &amp;&amp; index &lt;= 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 &lt; length; i++)
{
this.children[i].childIndex = i;
}
if(this.stage)
{
this.stage.__addChild(child);
}
}
else
{
&#x2F;&#x2F; error!
throw new Error(child + &quot; The index &quot;+ index +&quot; supplied is out of bounds &quot; + this.children.length);
}
}
&#x2F;**
* Removes a child from the container.
* @method removeChild
* @param DisplayObject {DisplayObject}
*&#x2F;
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;
&#x2F;&#x2F;child.childIndex = 0
this.children.splice( index, 1 );
&#x2F;&#x2F; update in dexs!
for(var i=index,j=this.children.length; i&lt;j; i++)
{
this.children[i].childIndex -= 1;
}
}
else
{
throw new Error(child + &quot; The supplied DisplayObject must be a child of the caller &quot; + this);
}
}
&#x2F;**
* @private
*&#x2F;
PIXI.DisplayObjectContainer.prototype.updateTransform = function()
{
if(!this.visible)return;
PIXI.DisplayObject.prototype.updateTransform.call( this );
for(var i=0,j=this.children.length; i&lt;j; i++)
{
this.children[i].updateTransform();
}
}
</pre>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="..&#x2F;assets/vendor/prettify/prettify-min.js"></script>
<script>prettyPrint();</script>
<script src="..&#x2F;assets/js/yui-prettify.js"></script>
<script src="..&#x2F;assets/../api.js"></script>
<script src="..&#x2F;assets/js/api-filter.js"></script>
<script src="..&#x2F;assets/js/api-list.js"></script>
<script src="..&#x2F;assets/js/api-search.js"></script>
<script src="..&#x2F;assets/js/apidocs.js"></script>
</body>
</html>

View file

@ -0,0 +1,234 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>pixi&#x2F;MovieClip.js - The Foo API</title>
<link rel="stylesheet" href="http:&#x2F;&#x2F;yui.yahooapis.com&#x2F;3.8.0pr2&#x2F;build&#x2F;cssgrids&#x2F;cssgrids-min.css">
<link rel="stylesheet" href="..&#x2F;assets/vendor/prettify/prettify-min.css">
<link rel="stylesheet" href="..&#x2F;assets/css/main.css" id="site_styles">
<link rel="shortcut icon" type="image/png" href="..&#x2F;assets/favicon.png">
<script src="http:&#x2F;&#x2F;yui.yahooapis.com&#x2F;combo?3.8.0pr2&#x2F;build&#x2F;yui&#x2F;yui-min.js"></script>
</head>
<body class="yui3-skin-sam">
<div id="doc">
<div id="hd" class="yui3-g header">
<div class="yui3-u-3-4">
<h1><img src="..&#x2F;assets/css/logo.png" title="The Foo API"></h1>
</div>
<div class="yui3-u-1-4 version">
<em>API Docs for: 1.2.1</em>
</div>
</div>
<div id="bd" class="yui3-g">
<div class="yui3-u-1-4">
<div id="docs-sidebar" class="sidebar apidocs">
<div id="api-list">
<h2 class="off-left">APIs</h2>
<div id="api-tabview" class="tabview">
<ul class="tabs">
<li><a href="#api-classes">Classes</a></li>
<li><a href="#api-modules">Modules</a></li>
</ul>
<div id="api-tabview-filter">
<input type="search" id="api-filter" placeholder="Type to filter APIs">
</div>
<div id="api-tabview-panel">
<ul id="api-classes" class="apis classes">
<li><a href="..&#x2F;classes/AssetLoader.html">AssetLoader</a></li>
<li><a href="..&#x2F;classes/BaseTexture.html">BaseTexture</a></li>
<li><a href="..&#x2F;classes/CanvasRenderer.html">CanvasRenderer</a></li>
<li><a href="..&#x2F;classes/DisplayObject.html">DisplayObject</a></li>
<li><a href="..&#x2F;classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
<li><a href="..&#x2F;classes/MovieClip.html">MovieClip</a></li>
<li><a href="..&#x2F;classes/Point.html">Point</a></li>
<li><a href="..&#x2F;classes/Rectangle.html">Rectangle</a></li>
<li><a href="..&#x2F;classes/Sprite.html">Sprite</a></li>
<li><a href="..&#x2F;classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
<li><a href="..&#x2F;classes/Stage.html">Stage</a></li>
<li><a href="..&#x2F;classes/Texture.html">Texture</a></li>
<li><a href="..&#x2F;classes/WebGLBatch.html">WebGLBatch</a></li>
<li><a href="..&#x2F;classes/WebGLRenderer.html">WebGLRenderer</a></li>
</ul>
<ul id="api-modules" class="apis modules">
<li><a href="..&#x2F;modules/PIXI.html">PIXI</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="yui3-u-3-4">
<div id="api-options">
Show:
<label for="api-show-inherited">
<input type="checkbox" id="api-show-inherited" checked>
Inherited
</label>
<label for="api-show-protected">
<input type="checkbox" id="api-show-protected">
Protected
</label>
<label for="api-show-private">
<input type="checkbox" id="api-show-private">
Private
</label>
<label for="api-show-deprecated">
<input type="checkbox" id="api-show-deprecated">
Deprecated
</label>
</div>
<div class="apidocs">
<div id="docs-main">
<div class="content">
<h1 class="file-heading">File: pixi&#x2F;MovieClip.js</h1>
<div class="file">
<pre class="code prettyprint linenums">
&#x2F;**
* @author Mat Groves http:&#x2F;&#x2F;matgroves.com&#x2F;
*&#x2F;
&#x2F;**
* 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
*&#x2F;
PIXI.MovieClip = function(textures)
{
PIXI.Sprite.call( this, textures[0]);
&#x2F;**
* The array of textures that make up the animation
* @property textures
* @type Array
*&#x2F;
this.textures = textures;
&#x2F;**
* [read only] The index MovieClips current frame (this may not have to be a whole number)
* @property currentFrame
* @type Number
*&#x2F;
this.currentFrame = 0;
&#x2F;**
* The speed that the MovieClip will play at. Higher is faster, lower is slower
* @property animationSpeed
* @type Number
*&#x2F;
this.animationSpeed = 1;
&#x2F;**
* [read only] indicates if the MovieClip is currently playing
* @property playing
* @type Boolean
*&#x2F;
this.playing;
}
&#x2F;&#x2F; constructor
PIXI.MovieClip.constructor = PIXI.MovieClip;
PIXI.MovieClip.prototype = Object.create( PIXI.Sprite.prototype );
&#x2F;**
* Stops the MovieClip
* @method stop
*&#x2F;
PIXI.MovieClip.prototype.stop = function()
{
this.playing = false;
}
&#x2F;**
* Plays the MovieClip
* @method play
*&#x2F;
PIXI.MovieClip.prototype.play = function()
{
this.playing = true;
}
&#x2F;**
* Stops the MovieClip and goes to a specific frame
* @method gotoAndStop
* @param frameNumber {Number} frame index to stop at
*&#x2F;
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]);
}
&#x2F;**
* Goes to a specific frame and begins playing the MovieClip
* @method gotoAndPlay
* @param frameNumber {Number} frame index to start at
*&#x2F;
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]);
}
</pre>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="..&#x2F;assets/vendor/prettify/prettify-min.js"></script>
<script>prettyPrint();</script>
<script src="..&#x2F;assets/js/yui-prettify.js"></script>
<script src="..&#x2F;assets/../api.js"></script>
<script src="..&#x2F;assets/js/api-filter.js"></script>
<script src="..&#x2F;assets/js/api-list.js"></script>
<script src="..&#x2F;assets/js/api-search.js"></script>
<script src="..&#x2F;assets/js/apidocs.js"></script>
</body>
</html>

View file

@ -0,0 +1,144 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>pixi&#x2F;Pixi.js - The Foo API</title>
<link rel="stylesheet" href="http:&#x2F;&#x2F;yui.yahooapis.com&#x2F;3.8.0pr2&#x2F;build&#x2F;cssgrids&#x2F;cssgrids-min.css">
<link rel="stylesheet" href="..&#x2F;assets/vendor/prettify/prettify-min.css">
<link rel="stylesheet" href="..&#x2F;assets/css/main.css" id="site_styles">
<link rel="shortcut icon" type="image/png" href="..&#x2F;assets/favicon.png">
<script src="http:&#x2F;&#x2F;yui.yahooapis.com&#x2F;combo?3.8.0pr2&#x2F;build&#x2F;yui&#x2F;yui-min.js"></script>
</head>
<body class="yui3-skin-sam">
<div id="doc">
<div id="hd" class="yui3-g header">
<div class="yui3-u-3-4">
<h1><img src="..&#x2F;assets/css/logo.png" title="The Foo API"></h1>
</div>
<div class="yui3-u-1-4 version">
<em>API Docs for: 1.2.1</em>
</div>
</div>
<div id="bd" class="yui3-g">
<div class="yui3-u-1-4">
<div id="docs-sidebar" class="sidebar apidocs">
<div id="api-list">
<h2 class="off-left">APIs</h2>
<div id="api-tabview" class="tabview">
<ul class="tabs">
<li><a href="#api-classes">Classes</a></li>
<li><a href="#api-modules">Modules</a></li>
</ul>
<div id="api-tabview-filter">
<input type="search" id="api-filter" placeholder="Type to filter APIs">
</div>
<div id="api-tabview-panel">
<ul id="api-classes" class="apis classes">
<li><a href="..&#x2F;classes/AssetLoader.html">AssetLoader</a></li>
<li><a href="..&#x2F;classes/BaseTexture.html">BaseTexture</a></li>
<li><a href="..&#x2F;classes/CanvasRenderer.html">CanvasRenderer</a></li>
<li><a href="..&#x2F;classes/DisplayObject.html">DisplayObject</a></li>
<li><a href="..&#x2F;classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
<li><a href="..&#x2F;classes/MovieClip.html">MovieClip</a></li>
<li><a href="..&#x2F;classes/Point.html">Point</a></li>
<li><a href="..&#x2F;classes/Rectangle.html">Rectangle</a></li>
<li><a href="..&#x2F;classes/Sprite.html">Sprite</a></li>
<li><a href="..&#x2F;classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
<li><a href="..&#x2F;classes/Stage.html">Stage</a></li>
<li><a href="..&#x2F;classes/Texture.html">Texture</a></li>
<li><a href="..&#x2F;classes/WebGLBatch.html">WebGLBatch</a></li>
<li><a href="..&#x2F;classes/WebGLRenderer.html">WebGLRenderer</a></li>
</ul>
<ul id="api-modules" class="apis modules">
<li><a href="..&#x2F;modules/PIXI.html">PIXI</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="yui3-u-3-4">
<div id="api-options">
Show:
<label for="api-show-inherited">
<input type="checkbox" id="api-show-inherited" checked>
Inherited
</label>
<label for="api-show-protected">
<input type="checkbox" id="api-show-protected">
Protected
</label>
<label for="api-show-private">
<input type="checkbox" id="api-show-private">
Private
</label>
<label for="api-show-deprecated">
<input type="checkbox" id="api-show-deprecated">
Deprecated
</label>
</div>
<div class="apidocs">
<div id="docs-main">
<div class="content">
<h1 class="file-heading">File: pixi&#x2F;Pixi.js</h1>
<div class="file">
<pre class="code prettyprint linenums">
&#x2F;**
* @author Mat Groves http:&#x2F;&#x2F;matgroves.com&#x2F;
*&#x2F;
&#x2F;**
@module PIXI
*&#x2F;
var PIXI = PIXI || {};
</pre>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="..&#x2F;assets/vendor/prettify/prettify-min.js"></script>
<script>prettyPrint();</script>
<script src="..&#x2F;assets/js/yui-prettify.js"></script>
<script src="..&#x2F;assets/../api.js"></script>
<script src="..&#x2F;assets/js/api-filter.js"></script>
<script src="..&#x2F;assets/js/api-list.js"></script>
<script src="..&#x2F;assets/js/api-search.js"></script>
<script src="..&#x2F;assets/js/apidocs.js"></script>
</body>
</html>

View file

@ -0,0 +1,176 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>pixi&#x2F;Point.js - The Foo API</title>
<link rel="stylesheet" href="http:&#x2F;&#x2F;yui.yahooapis.com&#x2F;3.8.0pr2&#x2F;build&#x2F;cssgrids&#x2F;cssgrids-min.css">
<link rel="stylesheet" href="..&#x2F;assets/vendor/prettify/prettify-min.css">
<link rel="stylesheet" href="..&#x2F;assets/css/main.css" id="site_styles">
<link rel="shortcut icon" type="image/png" href="..&#x2F;assets/favicon.png">
<script src="http:&#x2F;&#x2F;yui.yahooapis.com&#x2F;combo?3.8.0pr2&#x2F;build&#x2F;yui&#x2F;yui-min.js"></script>
</head>
<body class="yui3-skin-sam">
<div id="doc">
<div id="hd" class="yui3-g header">
<div class="yui3-u-3-4">
<h1><img src="..&#x2F;assets/css/logo.png" title="The Foo API"></h1>
</div>
<div class="yui3-u-1-4 version">
<em>API Docs for: 1.2.1</em>
</div>
</div>
<div id="bd" class="yui3-g">
<div class="yui3-u-1-4">
<div id="docs-sidebar" class="sidebar apidocs">
<div id="api-list">
<h2 class="off-left">APIs</h2>
<div id="api-tabview" class="tabview">
<ul class="tabs">
<li><a href="#api-classes">Classes</a></li>
<li><a href="#api-modules">Modules</a></li>
</ul>
<div id="api-tabview-filter">
<input type="search" id="api-filter" placeholder="Type to filter APIs">
</div>
<div id="api-tabview-panel">
<ul id="api-classes" class="apis classes">
<li><a href="..&#x2F;classes/AssetLoader.html">AssetLoader</a></li>
<li><a href="..&#x2F;classes/BaseTexture.html">BaseTexture</a></li>
<li><a href="..&#x2F;classes/CanvasRenderer.html">CanvasRenderer</a></li>
<li><a href="..&#x2F;classes/DisplayObject.html">DisplayObject</a></li>
<li><a href="..&#x2F;classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
<li><a href="..&#x2F;classes/MovieClip.html">MovieClip</a></li>
<li><a href="..&#x2F;classes/Point.html">Point</a></li>
<li><a href="..&#x2F;classes/Rectangle.html">Rectangle</a></li>
<li><a href="..&#x2F;classes/Sprite.html">Sprite</a></li>
<li><a href="..&#x2F;classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
<li><a href="..&#x2F;classes/Stage.html">Stage</a></li>
<li><a href="..&#x2F;classes/Texture.html">Texture</a></li>
<li><a href="..&#x2F;classes/WebGLBatch.html">WebGLBatch</a></li>
<li><a href="..&#x2F;classes/WebGLRenderer.html">WebGLRenderer</a></li>
</ul>
<ul id="api-modules" class="apis modules">
<li><a href="..&#x2F;modules/PIXI.html">PIXI</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="yui3-u-3-4">
<div id="api-options">
Show:
<label for="api-show-inherited">
<input type="checkbox" id="api-show-inherited" checked>
Inherited
</label>
<label for="api-show-protected">
<input type="checkbox" id="api-show-protected">
Protected
</label>
<label for="api-show-private">
<input type="checkbox" id="api-show-private">
Private
</label>
<label for="api-show-deprecated">
<input type="checkbox" id="api-show-deprecated">
Deprecated
</label>
</div>
<div class="apidocs">
<div id="docs-main">
<div class="content">
<h1 class="file-heading">File: pixi&#x2F;Point.js</h1>
<div class="file">
<pre class="code prettyprint linenums">
&#x2F;**
* @author Mat Groves http:&#x2F;&#x2F;matgroves.com&#x2F;
*&#x2F;
&#x2F;**
* 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
*&#x2F;
PIXI.Point = function(x, y)
{
&#x2F;**
* @property x
* @type Number
* @default 0
*&#x2F;
this.x = x ? x : 0;
&#x2F;**
* @property y
* @type Number
* @default 0
*&#x2F;
this.y = y ? y : 0;
}
&#x2F;**
* @method clone
* @return a copy of the point
*&#x2F;
PIXI.Point.clone = function()
{
return new PIXI.Point(this.x, this.y);
}
&#x2F;&#x2F; constructor
PIXI.Point.constructor = PIXI.Point;
</pre>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="..&#x2F;assets/vendor/prettify/prettify-min.js"></script>
<script>prettyPrint();</script>
<script src="..&#x2F;assets/js/yui-prettify.js"></script>
<script src="..&#x2F;assets/../api.js"></script>
<script src="..&#x2F;assets/js/api-filter.js"></script>
<script src="..&#x2F;assets/js/api-list.js"></script>
<script src="..&#x2F;assets/js/api-search.js"></script>
<script src="..&#x2F;assets/js/apidocs.js"></script>
</body>
</html>

View file

@ -0,0 +1,192 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>pixi&#x2F;Rectangle.js - The Foo API</title>
<link rel="stylesheet" href="http:&#x2F;&#x2F;yui.yahooapis.com&#x2F;3.8.0pr2&#x2F;build&#x2F;cssgrids&#x2F;cssgrids-min.css">
<link rel="stylesheet" href="..&#x2F;assets/vendor/prettify/prettify-min.css">
<link rel="stylesheet" href="..&#x2F;assets/css/main.css" id="site_styles">
<link rel="shortcut icon" type="image/png" href="..&#x2F;assets/favicon.png">
<script src="http:&#x2F;&#x2F;yui.yahooapis.com&#x2F;combo?3.8.0pr2&#x2F;build&#x2F;yui&#x2F;yui-min.js"></script>
</head>
<body class="yui3-skin-sam">
<div id="doc">
<div id="hd" class="yui3-g header">
<div class="yui3-u-3-4">
<h1><img src="..&#x2F;assets/css/logo.png" title="The Foo API"></h1>
</div>
<div class="yui3-u-1-4 version">
<em>API Docs for: 1.2.1</em>
</div>
</div>
<div id="bd" class="yui3-g">
<div class="yui3-u-1-4">
<div id="docs-sidebar" class="sidebar apidocs">
<div id="api-list">
<h2 class="off-left">APIs</h2>
<div id="api-tabview" class="tabview">
<ul class="tabs">
<li><a href="#api-classes">Classes</a></li>
<li><a href="#api-modules">Modules</a></li>
</ul>
<div id="api-tabview-filter">
<input type="search" id="api-filter" placeholder="Type to filter APIs">
</div>
<div id="api-tabview-panel">
<ul id="api-classes" class="apis classes">
<li><a href="..&#x2F;classes/AssetLoader.html">AssetLoader</a></li>
<li><a href="..&#x2F;classes/BaseTexture.html">BaseTexture</a></li>
<li><a href="..&#x2F;classes/CanvasRenderer.html">CanvasRenderer</a></li>
<li><a href="..&#x2F;classes/DisplayObject.html">DisplayObject</a></li>
<li><a href="..&#x2F;classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
<li><a href="..&#x2F;classes/MovieClip.html">MovieClip</a></li>
<li><a href="..&#x2F;classes/Point.html">Point</a></li>
<li><a href="..&#x2F;classes/Rectangle.html">Rectangle</a></li>
<li><a href="..&#x2F;classes/Sprite.html">Sprite</a></li>
<li><a href="..&#x2F;classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
<li><a href="..&#x2F;classes/Stage.html">Stage</a></li>
<li><a href="..&#x2F;classes/Texture.html">Texture</a></li>
<li><a href="..&#x2F;classes/WebGLBatch.html">WebGLBatch</a></li>
<li><a href="..&#x2F;classes/WebGLRenderer.html">WebGLRenderer</a></li>
</ul>
<ul id="api-modules" class="apis modules">
<li><a href="..&#x2F;modules/PIXI.html">PIXI</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="yui3-u-3-4">
<div id="api-options">
Show:
<label for="api-show-inherited">
<input type="checkbox" id="api-show-inherited" checked>
Inherited
</label>
<label for="api-show-protected">
<input type="checkbox" id="api-show-protected">
Protected
</label>
<label for="api-show-private">
<input type="checkbox" id="api-show-private">
Private
</label>
<label for="api-show-deprecated">
<input type="checkbox" id="api-show-deprecated">
Deprecated
</label>
</div>
<div class="apidocs">
<div id="docs-main">
<div class="content">
<h1 class="file-heading">File: pixi&#x2F;Rectangle.js</h1>
<div class="file">
<pre class="code prettyprint linenums">
&#x2F;**
* @author Mat Groves http:&#x2F;&#x2F;matgroves.com&#x2F;
*&#x2F;
&#x2F;**
* 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
*&#x2F;
PIXI.Rectangle = function(x, y, width, height)
{
&#x2F;**
* @property x
* @type Number
* @default 0
*&#x2F;
this.x = x ? x : 0;
&#x2F;**
* @property y
* @type Number
* @default 0
*&#x2F;
this.y = y ? y : 0;
&#x2F;**
* @property width
* @type Number
* @default 0
*&#x2F;
this.width = width ? width : 0;
&#x2F;**
* @property height
* @type Number
* @default 0
*&#x2F;
this.height = height ? height : 0;
}
&#x2F;**
* @method clone
* @return a copy of the rectangle
*&#x2F;
PIXI.Point.clone = function()
{
return new PIXI.Rectangle(this.x, this.y, this.width, this.height);
}
&#x2F;&#x2F; constructor
PIXI.Rectangle.constructor = PIXI.Rectangle;
</pre>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="..&#x2F;assets/vendor/prettify/prettify-min.js"></script>
<script>prettyPrint();</script>
<script src="..&#x2F;assets/js/yui-prettify.js"></script>
<script src="..&#x2F;assets/../api.js"></script>
<script src="..&#x2F;assets/js/api-filter.js"></script>
<script src="..&#x2F;assets/js/api-list.js"></script>
<script src="..&#x2F;assets/js/api-search.js"></script>
<script src="..&#x2F;assets/js/apidocs.js"></script>
</body>
</html>

View file

@ -0,0 +1,277 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>pixi&#x2F;Sprite.js - The Foo API</title>
<link rel="stylesheet" href="http:&#x2F;&#x2F;yui.yahooapis.com&#x2F;3.8.0pr2&#x2F;build&#x2F;cssgrids&#x2F;cssgrids-min.css">
<link rel="stylesheet" href="..&#x2F;assets/vendor/prettify/prettify-min.css">
<link rel="stylesheet" href="..&#x2F;assets/css/main.css" id="site_styles">
<link rel="shortcut icon" type="image/png" href="..&#x2F;assets/favicon.png">
<script src="http:&#x2F;&#x2F;yui.yahooapis.com&#x2F;combo?3.8.0pr2&#x2F;build&#x2F;yui&#x2F;yui-min.js"></script>
</head>
<body class="yui3-skin-sam">
<div id="doc">
<div id="hd" class="yui3-g header">
<div class="yui3-u-3-4">
<h1><img src="..&#x2F;assets/css/logo.png" title="The Foo API"></h1>
</div>
<div class="yui3-u-1-4 version">
<em>API Docs for: 1.2.1</em>
</div>
</div>
<div id="bd" class="yui3-g">
<div class="yui3-u-1-4">
<div id="docs-sidebar" class="sidebar apidocs">
<div id="api-list">
<h2 class="off-left">APIs</h2>
<div id="api-tabview" class="tabview">
<ul class="tabs">
<li><a href="#api-classes">Classes</a></li>
<li><a href="#api-modules">Modules</a></li>
</ul>
<div id="api-tabview-filter">
<input type="search" id="api-filter" placeholder="Type to filter APIs">
</div>
<div id="api-tabview-panel">
<ul id="api-classes" class="apis classes">
<li><a href="..&#x2F;classes/AssetLoader.html">AssetLoader</a></li>
<li><a href="..&#x2F;classes/BaseTexture.html">BaseTexture</a></li>
<li><a href="..&#x2F;classes/CanvasRenderer.html">CanvasRenderer</a></li>
<li><a href="..&#x2F;classes/DisplayObject.html">DisplayObject</a></li>
<li><a href="..&#x2F;classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
<li><a href="..&#x2F;classes/MovieClip.html">MovieClip</a></li>
<li><a href="..&#x2F;classes/Point.html">Point</a></li>
<li><a href="..&#x2F;classes/Rectangle.html">Rectangle</a></li>
<li><a href="..&#x2F;classes/Sprite.html">Sprite</a></li>
<li><a href="..&#x2F;classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
<li><a href="..&#x2F;classes/Stage.html">Stage</a></li>
<li><a href="..&#x2F;classes/Texture.html">Texture</a></li>
<li><a href="..&#x2F;classes/WebGLBatch.html">WebGLBatch</a></li>
<li><a href="..&#x2F;classes/WebGLRenderer.html">WebGLRenderer</a></li>
</ul>
<ul id="api-modules" class="apis modules">
<li><a href="..&#x2F;modules/PIXI.html">PIXI</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="yui3-u-3-4">
<div id="api-options">
Show:
<label for="api-show-inherited">
<input type="checkbox" id="api-show-inherited" checked>
Inherited
</label>
<label for="api-show-protected">
<input type="checkbox" id="api-show-protected">
Protected
</label>
<label for="api-show-private">
<input type="checkbox" id="api-show-private">
Private
</label>
<label for="api-show-deprecated">
<input type="checkbox" id="api-show-deprecated">
Deprecated
</label>
</div>
<div class="apidocs">
<div id="docs-main">
<div class="content">
<h1 class="file-heading">File: pixi&#x2F;Sprite.js</h1>
<div class="file">
<pre class="code prettyprint linenums">
&#x2F;**
* @author Mat Groves http:&#x2F;&#x2F;matgroves.com&#x2F;
*&#x2F;
PIXI.blendModes = {};
PIXI.blendModes.NORMAL = 0;
PIXI.blendModes.SCREEN = 1;
&#x2F;**
@class Sprite
@extends DisplayObjectContainer
@constructor
@param texture {Texture}
@type String
*&#x2F;
PIXI.Sprite = function(texture)
{
PIXI.DisplayObjectContainer.call( this );
&#x2F;**
* 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
*&#x2F;
this.anchor = new PIXI.Point();
&#x2F;**
* The texture that the sprite is using
* @property texture
* @type Texture
*&#x2F;
this.texture = texture;
&#x2F;**
* The blend mode of sprite.
* currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN
* @property blendMode
* @type uint
*&#x2F;
this.blendMode = PIXI.blendModes.NORMAL;
&#x2F;**
* The width of the sprite (this is initially set by the texture)
* @property width
* @type #Number
*&#x2F;
this.width = 1;
&#x2F;**
* The height of the sprite (this is initially set by the texture)
* @property height
* @type #Number
*&#x2F;
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( &#x27;update&#x27;, this.onTextureUpdateBind );
}
this.renderable = true;
}
&#x2F;&#x2F; constructor
PIXI.Sprite.constructor = PIXI.Sprite;
PIXI.Sprite.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
&#x2F;**
@method setTexture
@param texture {Texture} The PIXI texture that is displayed by the sprite
*&#x2F;
PIXI.Sprite.prototype.setTexture = function(texture)
{
&#x2F;&#x2F; 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;
}
&#x2F;**
* @private
*&#x2F;
PIXI.Sprite.prototype.onTextureUpdate = function(event)
{
this.width = this.texture.frame.width;
this.height = this.texture.frame.height;
this.updateFrame = true;
}
&#x2F;&#x2F; some helper functions..
&#x2F;**
*
* 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
*&#x2F;
PIXI.Sprite.fromFrame = function(frameId)
{
var texture = PIXI.TextureCache[frameId];
if(!texture)throw new Error(&quot;The frameId &#x27;&quot;+ frameId +&quot;&#x27; does not exist in the texture cache&quot; + this);
return new PIXI.Sprite(texture);
}
&#x2F;**
*
* 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
*&#x2F;
PIXI.Sprite.fromImage = function(imageId)
{
var texture = PIXI.Texture.fromImage(imageId);
return new PIXI.Sprite(texture);
}
</pre>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="..&#x2F;assets/vendor/prettify/prettify-min.js"></script>
<script>prettyPrint();</script>
<script src="..&#x2F;assets/js/yui-prettify.js"></script>
<script src="..&#x2F;assets/../api.js"></script>
<script src="..&#x2F;assets/js/api-filter.js"></script>
<script src="..&#x2F;assets/js/api-list.js"></script>
<script src="..&#x2F;assets/js/api-search.js"></script>
<script src="..&#x2F;assets/js/apidocs.js"></script>
</body>
</html>

View file

@ -0,0 +1,215 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>pixi&#x2F;Stage.js - The Foo API</title>
<link rel="stylesheet" href="http:&#x2F;&#x2F;yui.yahooapis.com&#x2F;3.8.0pr2&#x2F;build&#x2F;cssgrids&#x2F;cssgrids-min.css">
<link rel="stylesheet" href="..&#x2F;assets/vendor/prettify/prettify-min.css">
<link rel="stylesheet" href="..&#x2F;assets/css/main.css" id="site_styles">
<link rel="shortcut icon" type="image/png" href="..&#x2F;assets/favicon.png">
<script src="http:&#x2F;&#x2F;yui.yahooapis.com&#x2F;combo?3.8.0pr2&#x2F;build&#x2F;yui&#x2F;yui-min.js"></script>
</head>
<body class="yui3-skin-sam">
<div id="doc">
<div id="hd" class="yui3-g header">
<div class="yui3-u-3-4">
<h1><img src="..&#x2F;assets/css/logo.png" title="The Foo API"></h1>
</div>
<div class="yui3-u-1-4 version">
<em>API Docs for: 1.2.1</em>
</div>
</div>
<div id="bd" class="yui3-g">
<div class="yui3-u-1-4">
<div id="docs-sidebar" class="sidebar apidocs">
<div id="api-list">
<h2 class="off-left">APIs</h2>
<div id="api-tabview" class="tabview">
<ul class="tabs">
<li><a href="#api-classes">Classes</a></li>
<li><a href="#api-modules">Modules</a></li>
</ul>
<div id="api-tabview-filter">
<input type="search" id="api-filter" placeholder="Type to filter APIs">
</div>
<div id="api-tabview-panel">
<ul id="api-classes" class="apis classes">
<li><a href="..&#x2F;classes/AssetLoader.html">AssetLoader</a></li>
<li><a href="..&#x2F;classes/BaseTexture.html">BaseTexture</a></li>
<li><a href="..&#x2F;classes/CanvasRenderer.html">CanvasRenderer</a></li>
<li><a href="..&#x2F;classes/DisplayObject.html">DisplayObject</a></li>
<li><a href="..&#x2F;classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
<li><a href="..&#x2F;classes/MovieClip.html">MovieClip</a></li>
<li><a href="..&#x2F;classes/Point.html">Point</a></li>
<li><a href="..&#x2F;classes/Rectangle.html">Rectangle</a></li>
<li><a href="..&#x2F;classes/Sprite.html">Sprite</a></li>
<li><a href="..&#x2F;classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
<li><a href="..&#x2F;classes/Stage.html">Stage</a></li>
<li><a href="..&#x2F;classes/Texture.html">Texture</a></li>
<li><a href="..&#x2F;classes/WebGLBatch.html">WebGLBatch</a></li>
<li><a href="..&#x2F;classes/WebGLRenderer.html">WebGLRenderer</a></li>
</ul>
<ul id="api-modules" class="apis modules">
<li><a href="..&#x2F;modules/PIXI.html">PIXI</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="yui3-u-3-4">
<div id="api-options">
Show:
<label for="api-show-inherited">
<input type="checkbox" id="api-show-inherited" checked>
Inherited
</label>
<label for="api-show-protected">
<input type="checkbox" id="api-show-protected">
Protected
</label>
<label for="api-show-private">
<input type="checkbox" id="api-show-private">
Private
</label>
<label for="api-show-deprecated">
<input type="checkbox" id="api-show-deprecated">
Deprecated
</label>
</div>
<div class="apidocs">
<div id="docs-main">
<div class="content">
<h1 class="file-heading">File: pixi&#x2F;Stage.js</h1>
<div class="file">
<pre class="code prettyprint linenums">
&#x2F;**
* @author Mat Groves http:&#x2F;&#x2F;matgroves.com&#x2F;
*&#x2F;
&#x2F;**
A Stage represents the root of the display tree. Everything connected to the stage is rendered
@class Stage
@extends DisplayObjectContainer
@constructor
*&#x2F;
PIXI.Stage = function()
{
PIXI.DisplayObjectContainer.call( this );
this.worldTransform = mat3.identity();
this.__childrenAdded = [];
this.__childrenRemoved = [];
this.childIndex = 0;
this.stage= this;
}
&#x2F;&#x2F; constructor
PIXI.Stage.constructor = PIXI.Stage;
PIXI.Stage.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
&#x2F;**
@method updateTransform
*&#x2F;
PIXI.Stage.prototype.updateTransform = function()
{
this.worldAlpha = 1;
for(var i=0,j=this.children.length; i&lt;j; i++)
{
this.children[i].updateTransform();
}
}
&#x2F;*
PIXI.Stage.prototype.setFilter = function(filters)
{
this.filters = filters;
}*&#x2F;
&#x2F;**
@method __addChild
*&#x2F;
PIXI.Stage.prototype.__addChild = function(child)
{
&#x2F;&#x2F;this.__childrenAdded.push(child);
child.stage = this;
if(child.children)
{
for (var i=0; i &lt; child.children.length; i++)
{
this.__addChild(child.children[i]);
};
}
}
&#x2F;**
@method __removeChild
*&#x2F;
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&lt;j; i++)
{
this.__removeChild(child.children[i])
}
}
}
</pre>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="..&#x2F;assets/vendor/prettify/prettify-min.js"></script>
<script>prettyPrint();</script>
<script src="..&#x2F;assets/js/yui-prettify.js"></script>
<script src="..&#x2F;assets/../api.js"></script>
<script src="..&#x2F;assets/js/api-filter.js"></script>
<script src="..&#x2F;assets/js/api-list.js"></script>
<script src="..&#x2F;assets/js/api-search.js"></script>
<script src="..&#x2F;assets/js/apidocs.js"></script>
</body>
</html>

View file

@ -0,0 +1,311 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>pixi&#x2F;extras&#x2F;Rope.js - The Foo API</title>
<link rel="stylesheet" href="http:&#x2F;&#x2F;yui.yahooapis.com&#x2F;3.8.0pr2&#x2F;build&#x2F;cssgrids&#x2F;cssgrids-min.css">
<link rel="stylesheet" href="..&#x2F;assets/vendor/prettify/prettify-min.css">
<link rel="stylesheet" href="..&#x2F;assets/css/main.css" id="site_styles">
<link rel="shortcut icon" type="image/png" href="..&#x2F;assets/favicon.png">
<script src="http:&#x2F;&#x2F;yui.yahooapis.com&#x2F;combo?3.8.0pr2&#x2F;build&#x2F;yui&#x2F;yui-min.js"></script>
</head>
<body class="yui3-skin-sam">
<div id="doc">
<div id="hd" class="yui3-g header">
<div class="yui3-u-3-4">
<h1><img src="..&#x2F;assets/css/logo.png" title="The Foo API"></h1>
</div>
<div class="yui3-u-1-4 version">
<em>API Docs for: 1.2.1</em>
</div>
</div>
<div id="bd" class="yui3-g">
<div class="yui3-u-1-4">
<div id="docs-sidebar" class="sidebar apidocs">
<div id="api-list">
<h2 class="off-left">APIs</h2>
<div id="api-tabview" class="tabview">
<ul class="tabs">
<li><a href="#api-classes">Classes</a></li>
<li><a href="#api-modules">Modules</a></li>
</ul>
<div id="api-tabview-filter">
<input type="search" id="api-filter" placeholder="Type to filter APIs">
</div>
<div id="api-tabview-panel">
<ul id="api-classes" class="apis classes">
<li><a href="..&#x2F;classes/AssetLoader.html">AssetLoader</a></li>
<li><a href="..&#x2F;classes/BaseTexture.html">BaseTexture</a></li>
<li><a href="..&#x2F;classes/CanvasRenderer.html">CanvasRenderer</a></li>
<li><a href="..&#x2F;classes/DisplayObject.html">DisplayObject</a></li>
<li><a href="..&#x2F;classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
<li><a href="..&#x2F;classes/MovieClip.html">MovieClip</a></li>
<li><a href="..&#x2F;classes/Point.html">Point</a></li>
<li><a href="..&#x2F;classes/Rectangle.html">Rectangle</a></li>
<li><a href="..&#x2F;classes/Sprite.html">Sprite</a></li>
<li><a href="..&#x2F;classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
<li><a href="..&#x2F;classes/Stage.html">Stage</a></li>
<li><a href="..&#x2F;classes/Texture.html">Texture</a></li>
<li><a href="..&#x2F;classes/WebGLBatch.html">WebGLBatch</a></li>
<li><a href="..&#x2F;classes/WebGLRenderer.html">WebGLRenderer</a></li>
</ul>
<ul id="api-modules" class="apis modules">
<li><a href="..&#x2F;modules/PIXI.html">PIXI</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="yui3-u-3-4">
<div id="api-options">
Show:
<label for="api-show-inherited">
<input type="checkbox" id="api-show-inherited" checked>
Inherited
</label>
<label for="api-show-protected">
<input type="checkbox" id="api-show-protected">
Protected
</label>
<label for="api-show-private">
<input type="checkbox" id="api-show-private">
Private
</label>
<label for="api-show-deprecated">
<input type="checkbox" id="api-show-deprecated">
Deprecated
</label>
</div>
<div class="apidocs">
<div id="docs-main">
<div class="content">
<h1 class="file-heading">File: pixi&#x2F;extras&#x2F;Rope.js</h1>
<div class="file">
<pre class="code prettyprint linenums">
&#x2F;**
* @author Mat Groves http:&#x2F;&#x2F;matgroves.com&#x2F;
*&#x2F;
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();
}
&#x2F;&#x2F; 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 &lt; 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 &lt; total; i++)
{
var point = points[i];
var index = i * 4;
&#x2F;&#x2F; time to do some smart drawing!
var amount = i&#x2F;(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 &lt; 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 &#x2F;&#x2F;+ 200
verticies[2] = point.x - perp.x
verticies[3] = point.y - perp.y&#x2F;&#x2F;+200
&#x2F;&#x2F; time to do some smart drawing!
var total = points.length;
for (var i = 1; i &lt; total; i++)
{
var point = points[i];
var index = i * 4;
if(i &lt; 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 &#x2F; (total-1))) * 10;
if(ratio &gt; 1)ratio = 1;
var perpLength = Math.sqrt(perp.x * perp.x + perp.y * perp.y);
var num = this.texture.height&#x2F;2&#x2F;&#x2F;(20 + Math.abs(Math.sin((i + this.count) * 0.3) * 50) )* ratio;
perp.x &#x2F;= perpLength;
perp.y &#x2F;= 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)
{
&#x2F;&#x2F; stop current texture
this.texture = texture;
this.updateFrame = true;
}
</pre>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="..&#x2F;assets/vendor/prettify/prettify-min.js"></script>
<script>prettyPrint();</script>
<script src="..&#x2F;assets/js/yui-prettify.js"></script>
<script src="..&#x2F;assets/../api.js"></script>
<script src="..&#x2F;assets/js/api-filter.js"></script>
<script src="..&#x2F;assets/js/api-list.js"></script>
<script src="..&#x2F;assets/js/api-search.js"></script>
<script src="..&#x2F;assets/js/apidocs.js"></script>
</body>
</html>

View file

@ -0,0 +1,225 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>pixi&#x2F;extras&#x2F;Strip.js - The Foo API</title>
<link rel="stylesheet" href="http:&#x2F;&#x2F;yui.yahooapis.com&#x2F;3.8.0pr2&#x2F;build&#x2F;cssgrids&#x2F;cssgrids-min.css">
<link rel="stylesheet" href="..&#x2F;assets/vendor/prettify/prettify-min.css">
<link rel="stylesheet" href="..&#x2F;assets/css/main.css" id="site_styles">
<link rel="shortcut icon" type="image/png" href="..&#x2F;assets/favicon.png">
<script src="http:&#x2F;&#x2F;yui.yahooapis.com&#x2F;combo?3.8.0pr2&#x2F;build&#x2F;yui&#x2F;yui-min.js"></script>
</head>
<body class="yui3-skin-sam">
<div id="doc">
<div id="hd" class="yui3-g header">
<div class="yui3-u-3-4">
<h1><img src="..&#x2F;assets/css/logo.png" title="The Foo API"></h1>
</div>
<div class="yui3-u-1-4 version">
<em>API Docs for: 1.2.1</em>
</div>
</div>
<div id="bd" class="yui3-g">
<div class="yui3-u-1-4">
<div id="docs-sidebar" class="sidebar apidocs">
<div id="api-list">
<h2 class="off-left">APIs</h2>
<div id="api-tabview" class="tabview">
<ul class="tabs">
<li><a href="#api-classes">Classes</a></li>
<li><a href="#api-modules">Modules</a></li>
</ul>
<div id="api-tabview-filter">
<input type="search" id="api-filter" placeholder="Type to filter APIs">
</div>
<div id="api-tabview-panel">
<ul id="api-classes" class="apis classes">
<li><a href="..&#x2F;classes/AssetLoader.html">AssetLoader</a></li>
<li><a href="..&#x2F;classes/BaseTexture.html">BaseTexture</a></li>
<li><a href="..&#x2F;classes/CanvasRenderer.html">CanvasRenderer</a></li>
<li><a href="..&#x2F;classes/DisplayObject.html">DisplayObject</a></li>
<li><a href="..&#x2F;classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
<li><a href="..&#x2F;classes/MovieClip.html">MovieClip</a></li>
<li><a href="..&#x2F;classes/Point.html">Point</a></li>
<li><a href="..&#x2F;classes/Rectangle.html">Rectangle</a></li>
<li><a href="..&#x2F;classes/Sprite.html">Sprite</a></li>
<li><a href="..&#x2F;classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
<li><a href="..&#x2F;classes/Stage.html">Stage</a></li>
<li><a href="..&#x2F;classes/Texture.html">Texture</a></li>
<li><a href="..&#x2F;classes/WebGLBatch.html">WebGLBatch</a></li>
<li><a href="..&#x2F;classes/WebGLRenderer.html">WebGLRenderer</a></li>
</ul>
<ul id="api-modules" class="apis modules">
<li><a href="..&#x2F;modules/PIXI.html">PIXI</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="yui3-u-3-4">
<div id="api-options">
Show:
<label for="api-show-inherited">
<input type="checkbox" id="api-show-inherited" checked>
Inherited
</label>
<label for="api-show-protected">
<input type="checkbox" id="api-show-protected">
Protected
</label>
<label for="api-show-private">
<input type="checkbox" id="api-show-private">
Private
</label>
<label for="api-show-deprecated">
<input type="checkbox" id="api-show-deprecated">
Deprecated
</label>
</div>
<div class="apidocs">
<div id="docs-main">
<div class="content">
<h1 class="file-heading">File: pixi&#x2F;extras&#x2F;Strip.js</h1>
<div class="file">
<pre class="code prettyprint linenums">
&#x2F;**
* @author Mat Groves http:&#x2F;&#x2F;matgroves.com&#x2F;
*&#x2F;
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];
}
&#x2F;*
this.uvs = new Float32Array()
this.verticies = new Float32Array()
this.colors = new Float32Array()
this.indices = new Uint16Array()
*&#x2F;
this.width = width;
this.height = height;
&#x2F;&#x2F; 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( &#x27;update&#x27;, this.onTextureUpdateBind );
}
this.renderable = true;
}
&#x2F;&#x2F; constructor
PIXI.Strip.constructor = PIXI.Strip;
PIXI.Strip.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
PIXI.Strip.prototype.setTexture = function(texture)
{
&#x2F;&#x2F;TODO SET THE TEXTURES
&#x2F;&#x2F;TODO VISIBILITY
&#x2F;&#x2F; 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;
}
&#x2F;&#x2F; some helper functions..
</pre>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="..&#x2F;assets/vendor/prettify/prettify-min.js"></script>
<script>prettyPrint();</script>
<script src="..&#x2F;assets/js/yui-prettify.js"></script>
<script src="..&#x2F;assets/../api.js"></script>
<script src="..&#x2F;assets/js/api-filter.js"></script>
<script src="..&#x2F;assets/js/api-list.js"></script>
<script src="..&#x2F;assets/js/api-search.js"></script>
<script src="..&#x2F;assets/js/apidocs.js"></script>
</body>
</html>

View file

@ -0,0 +1,262 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>pixi&#x2F;loaders&#x2F;AssetLoader.js - The Foo API</title>
<link rel="stylesheet" href="http:&#x2F;&#x2F;yui.yahooapis.com&#x2F;3.8.0pr2&#x2F;build&#x2F;cssgrids&#x2F;cssgrids-min.css">
<link rel="stylesheet" href="..&#x2F;assets/vendor/prettify/prettify-min.css">
<link rel="stylesheet" href="..&#x2F;assets/css/main.css" id="site_styles">
<link rel="shortcut icon" type="image/png" href="..&#x2F;assets/favicon.png">
<script src="http:&#x2F;&#x2F;yui.yahooapis.com&#x2F;combo?3.8.0pr2&#x2F;build&#x2F;yui&#x2F;yui-min.js"></script>
</head>
<body class="yui3-skin-sam">
<div id="doc">
<div id="hd" class="yui3-g header">
<div class="yui3-u-3-4">
<h1><img src="..&#x2F;assets/css/logo.png" title="The Foo API"></h1>
</div>
<div class="yui3-u-1-4 version">
<em>API Docs for: 1.2.1</em>
</div>
</div>
<div id="bd" class="yui3-g">
<div class="yui3-u-1-4">
<div id="docs-sidebar" class="sidebar apidocs">
<div id="api-list">
<h2 class="off-left">APIs</h2>
<div id="api-tabview" class="tabview">
<ul class="tabs">
<li><a href="#api-classes">Classes</a></li>
<li><a href="#api-modules">Modules</a></li>
</ul>
<div id="api-tabview-filter">
<input type="search" id="api-filter" placeholder="Type to filter APIs">
</div>
<div id="api-tabview-panel">
<ul id="api-classes" class="apis classes">
<li><a href="..&#x2F;classes/AssetLoader.html">AssetLoader</a></li>
<li><a href="..&#x2F;classes/BaseTexture.html">BaseTexture</a></li>
<li><a href="..&#x2F;classes/CanvasRenderer.html">CanvasRenderer</a></li>
<li><a href="..&#x2F;classes/DisplayObject.html">DisplayObject</a></li>
<li><a href="..&#x2F;classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
<li><a href="..&#x2F;classes/MovieClip.html">MovieClip</a></li>
<li><a href="..&#x2F;classes/Point.html">Point</a></li>
<li><a href="..&#x2F;classes/Rectangle.html">Rectangle</a></li>
<li><a href="..&#x2F;classes/Sprite.html">Sprite</a></li>
<li><a href="..&#x2F;classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
<li><a href="..&#x2F;classes/Stage.html">Stage</a></li>
<li><a href="..&#x2F;classes/Texture.html">Texture</a></li>
<li><a href="..&#x2F;classes/WebGLBatch.html">WebGLBatch</a></li>
<li><a href="..&#x2F;classes/WebGLRenderer.html">WebGLRenderer</a></li>
</ul>
<ul id="api-modules" class="apis modules">
<li><a href="..&#x2F;modules/PIXI.html">PIXI</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="yui3-u-3-4">
<div id="api-options">
Show:
<label for="api-show-inherited">
<input type="checkbox" id="api-show-inherited" checked>
Inherited
</label>
<label for="api-show-protected">
<input type="checkbox" id="api-show-protected">
Protected
</label>
<label for="api-show-private">
<input type="checkbox" id="api-show-private">
Private
</label>
<label for="api-show-deprecated">
<input type="checkbox" id="api-show-deprecated">
Deprecated
</label>
</div>
<div class="apidocs">
<div id="docs-main">
<div class="content">
<h1 class="file-heading">File: pixi&#x2F;loaders&#x2F;AssetLoader.js</h1>
<div class="file">
<pre class="code prettyprint linenums">
&#x2F;**
* @author Mat Groves http:&#x2F;&#x2F;matgroves.com&#x2F;
*&#x2F;
&#x2F;**
* A Class that loads a bunch of images &#x2F; 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 &#x27;loaded&#x27; event
* As each individual item is loaded this class will dispatch a &#x27;progress&#x27; event
* @class AssetLoader
* @constructor
* @extends EventTarget
* @param assetURLs {Array} an array of image&#x2F;sprite sheet urls that you would like loaded supported. Supported image formats include &quot;jpeg&quot;, &quot;jpg&quot;, &quot;png&quot;, &quot;gif&quot;. Supported sprite sheet data formats only include &quot;JSON&quot; at this time
*&#x2F;
PIXI.AssetLoader = function(assetURLs)
{
PIXI.EventTarget.call( this );
&#x2F;**
* The array of asset URLs that are going to be loaded
* @property assetURLs
* @type Array
*&#x2F;
this.assetURLs = assetURLs;
this.assets = [];
}
&#x2F;&#x2F; constructor
PIXI.AssetLoader.constructor = PIXI.AssetLoader;
&#x2F;**
* This will begin loading the assets sequentially
*&#x2F;
PIXI.AssetLoader.prototype.load = function()
{
this.loadCount = this.assetURLs.length;
var imageTypes = [&quot;jpeg&quot;, &quot;jpg&quot;, &quot;png&quot;, &quot;gif&quot;];
var spriteSheetTypes = [&quot;json&quot;];
for (var i=0; i &lt; this.assetURLs.length; i++)
{
var filename = this.assetURLs[i];
var fileType = filename.split(&#x27;.&#x27;).pop().toLowerCase();
&#x2F;&#x2F; what are we loading?
var type;
for (var j=0; j &lt; imageTypes.length; j++)
{
if(fileType == imageTypes[j])
{
type = &quot;img&quot;;
break;
}
}
if(!type)
{
for (var j=0; j &lt; spriteSheetTypes.length; j++)
{
if(fileType == spriteSheetTypes[j])
{
type = &quot;atlas&quot;;
break;
}
}
}
if(type == &quot;img&quot;)
{
var texture = PIXI.Texture.fromImage(filename);
if(!texture.hasLoaded)
{
var scope = this;
texture.baseTexture.addEventListener( &#x27;loaded&#x27;, function ( event )
{
scope.onAssetLoaded();
});
this.assets.push(texture);
}
else
{
&#x2F;&#x2F; already loaded!
this.loadCount--;
}
}
else if(type == &quot;atlas&quot;)
{
var spriteSheetLoader = new PIXI.SpriteSheetLoader(filename);
this.assets.push(spriteSheetLoader);
var scope = this;
spriteSheetLoader.addEventListener( &#x27;loaded&#x27;, function ( event )
{
scope.onAssetLoaded();
});
spriteSheetLoader.load();
}
else
{
&#x2F;&#x2F; dont know what the file is! :&#x2F;
&#x2F;&#x2F;this.loadCount--;
throw new Error(filename + &quot; is an unsupported file type &quot; + this);
}
&#x2F;&#x2F;this.assets[i].load();
};
}
PIXI.AssetLoader.prototype.onAssetLoaded = function()
{
this.loadCount--;
this.dispatchEvent( { type: &#x27;progress&#x27;, content: this } );
if(this.loadCount == 0)
{
this.dispatchEvent( { type: &#x27;loaded&#x27;, content: this } );
}
}
</pre>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="..&#x2F;assets/vendor/prettify/prettify-min.js"></script>
<script>prettyPrint();</script>
<script src="..&#x2F;assets/js/yui-prettify.js"></script>
<script src="..&#x2F;assets/../api.js"></script>
<script src="..&#x2F;assets/js/api-filter.js"></script>
<script src="..&#x2F;assets/js/api-list.js"></script>
<script src="..&#x2F;assets/js/api-search.js"></script>
<script src="..&#x2F;assets/js/apidocs.js"></script>
</body>
</html>

View file

@ -0,0 +1,236 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>pixi&#x2F;loaders&#x2F;SpriteSheetLoader.js - The Foo API</title>
<link rel="stylesheet" href="http:&#x2F;&#x2F;yui.yahooapis.com&#x2F;3.8.0pr2&#x2F;build&#x2F;cssgrids&#x2F;cssgrids-min.css">
<link rel="stylesheet" href="..&#x2F;assets/vendor/prettify/prettify-min.css">
<link rel="stylesheet" href="..&#x2F;assets/css/main.css" id="site_styles">
<link rel="shortcut icon" type="image/png" href="..&#x2F;assets/favicon.png">
<script src="http:&#x2F;&#x2F;yui.yahooapis.com&#x2F;combo?3.8.0pr2&#x2F;build&#x2F;yui&#x2F;yui-min.js"></script>
</head>
<body class="yui3-skin-sam">
<div id="doc">
<div id="hd" class="yui3-g header">
<div class="yui3-u-3-4">
<h1><img src="..&#x2F;assets/css/logo.png" title="The Foo API"></h1>
</div>
<div class="yui3-u-1-4 version">
<em>API Docs for: 1.2.1</em>
</div>
</div>
<div id="bd" class="yui3-g">
<div class="yui3-u-1-4">
<div id="docs-sidebar" class="sidebar apidocs">
<div id="api-list">
<h2 class="off-left">APIs</h2>
<div id="api-tabview" class="tabview">
<ul class="tabs">
<li><a href="#api-classes">Classes</a></li>
<li><a href="#api-modules">Modules</a></li>
</ul>
<div id="api-tabview-filter">
<input type="search" id="api-filter" placeholder="Type to filter APIs">
</div>
<div id="api-tabview-panel">
<ul id="api-classes" class="apis classes">
<li><a href="..&#x2F;classes/AssetLoader.html">AssetLoader</a></li>
<li><a href="..&#x2F;classes/BaseTexture.html">BaseTexture</a></li>
<li><a href="..&#x2F;classes/CanvasRenderer.html">CanvasRenderer</a></li>
<li><a href="..&#x2F;classes/DisplayObject.html">DisplayObject</a></li>
<li><a href="..&#x2F;classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
<li><a href="..&#x2F;classes/MovieClip.html">MovieClip</a></li>
<li><a href="..&#x2F;classes/Point.html">Point</a></li>
<li><a href="..&#x2F;classes/Rectangle.html">Rectangle</a></li>
<li><a href="..&#x2F;classes/Sprite.html">Sprite</a></li>
<li><a href="..&#x2F;classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
<li><a href="..&#x2F;classes/Stage.html">Stage</a></li>
<li><a href="..&#x2F;classes/Texture.html">Texture</a></li>
<li><a href="..&#x2F;classes/WebGLBatch.html">WebGLBatch</a></li>
<li><a href="..&#x2F;classes/WebGLRenderer.html">WebGLRenderer</a></li>
</ul>
<ul id="api-modules" class="apis modules">
<li><a href="..&#x2F;modules/PIXI.html">PIXI</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="yui3-u-3-4">
<div id="api-options">
Show:
<label for="api-show-inherited">
<input type="checkbox" id="api-show-inherited" checked>
Inherited
</label>
<label for="api-show-protected">
<input type="checkbox" id="api-show-protected">
Protected
</label>
<label for="api-show-private">
<input type="checkbox" id="api-show-private">
Private
</label>
<label for="api-show-deprecated">
<input type="checkbox" id="api-show-deprecated">
Deprecated
</label>
</div>
<div class="apidocs">
<div id="docs-main">
<div class="content">
<h1 class="file-heading">File: pixi&#x2F;loaders&#x2F;SpriteSheetLoader.js</h1>
<div class="file">
<pre class="code prettyprint linenums">
&#x2F;**
* @author Mat Groves http:&#x2F;&#x2F;matgroves.com&#x2F;
*&#x2F;
&#x2F;**
* The sprite sheet loader is used to load in JSON sprite sheet data
* To generate the data you can use http:&#x2F;&#x2F;www.codeandweb.com&#x2F;texturepacker and publish the &quot;JSON&quot; 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&#x27;) as it means sprite&#x27;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 &#x27;loaded&#x27; event
* @class SpriteSheetLoader
* @extends EventTarget
* @constructor
* @param url {String} the url of the sprite sheet JSON file
*&#x2F;
PIXI.SpriteSheetLoader = function(url)
{
&#x2F;*
* i use texture packer to load the assets..
* http:&#x2F;&#x2F;www.codeandweb.com&#x2F;texturepacker
* make sure to set the format as &quot;JSON&quot;
*&#x2F;
PIXI.EventTarget.call( this );
this.url = url;
this.baseUrl = url.replace(&#x2F;[^\&#x2F;]*$&#x2F;, &#x27;&#x27;);
this.texture;
this.frames = {};
}
&#x2F;&#x2F; constructor
PIXI.SpriteSheetLoader.constructor = PIXI.SpriteSheetLoader;
&#x2F;**
* This will begin loading the JSON file
*&#x2F;
PIXI.SpriteSheetLoader.prototype.load = function()
{
this.ajaxRequest = new AjaxRequest();
var scope = this;
this.ajaxRequest.onreadystatechange=function()
{
scope.onLoaded();
}
this.ajaxRequest.open(&quot;GET&quot;, 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(&quot;http&quot;)==-1)
{
var jsondata = eval(&quot;(&quot;+this.ajaxRequest.responseText+&quot;)&quot;);
var textureUrl = this.baseUrl + jsondata.meta.image;
this.texture = PIXI.Texture.fromImage(textureUrl).baseTexture;
&#x2F;&#x2F; 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)
{
&#x2F;&#x2F;var realSize = frameData[i].spriteSourceSize;
PIXI.TextureCache[i].realSize = frameData[i].spriteSourceSize;
PIXI.TextureCache[i].trim.x = 0&#x2F;&#x2F; (realSize.x &#x2F; rect.w)
&#x2F;&#x2F; calculate the offset!
}
&#x2F;&#x2F; this.frames[i] = ;
}
if(this.texture.hasLoaded)
{
this.dispatchEvent( { type: &#x27;loaded&#x27;, content: this } );
}
else
{
var scope = this;
&#x2F;&#x2F; wait for the texture to load..
this.texture.addEventListener(&#x27;loaded&#x27;, function(){
scope.dispatchEvent( { type: &#x27;loaded&#x27;, content: scope } );
});
}
}
}
}
</pre>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="..&#x2F;assets/vendor/prettify/prettify-min.js"></script>
<script>prettyPrint();</script>
<script src="..&#x2F;assets/js/yui-prettify.js"></script>
<script src="..&#x2F;assets/../api.js"></script>
<script src="..&#x2F;assets/js/api-filter.js"></script>
<script src="..&#x2F;assets/js/api-list.js"></script>
<script src="..&#x2F;assets/js/api-search.js"></script>
<script src="..&#x2F;assets/js/apidocs.js"></script>
</body>
</html>

View file

@ -0,0 +1,400 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>pixi&#x2F;renderers&#x2F;CanvasRenderer.js - The Foo API</title>
<link rel="stylesheet" href="http:&#x2F;&#x2F;yui.yahooapis.com&#x2F;3.8.0pr2&#x2F;build&#x2F;cssgrids&#x2F;cssgrids-min.css">
<link rel="stylesheet" href="..&#x2F;assets/vendor/prettify/prettify-min.css">
<link rel="stylesheet" href="..&#x2F;assets/css/main.css" id="site_styles">
<link rel="shortcut icon" type="image/png" href="..&#x2F;assets/favicon.png">
<script src="http:&#x2F;&#x2F;yui.yahooapis.com&#x2F;combo?3.8.0pr2&#x2F;build&#x2F;yui&#x2F;yui-min.js"></script>
</head>
<body class="yui3-skin-sam">
<div id="doc">
<div id="hd" class="yui3-g header">
<div class="yui3-u-3-4">
<h1><img src="..&#x2F;assets/css/logo.png" title="The Foo API"></h1>
</div>
<div class="yui3-u-1-4 version">
<em>API Docs for: 1.2.1</em>
</div>
</div>
<div id="bd" class="yui3-g">
<div class="yui3-u-1-4">
<div id="docs-sidebar" class="sidebar apidocs">
<div id="api-list">
<h2 class="off-left">APIs</h2>
<div id="api-tabview" class="tabview">
<ul class="tabs">
<li><a href="#api-classes">Classes</a></li>
<li><a href="#api-modules">Modules</a></li>
</ul>
<div id="api-tabview-filter">
<input type="search" id="api-filter" placeholder="Type to filter APIs">
</div>
<div id="api-tabview-panel">
<ul id="api-classes" class="apis classes">
<li><a href="..&#x2F;classes/AssetLoader.html">AssetLoader</a></li>
<li><a href="..&#x2F;classes/BaseTexture.html">BaseTexture</a></li>
<li><a href="..&#x2F;classes/CanvasRenderer.html">CanvasRenderer</a></li>
<li><a href="..&#x2F;classes/DisplayObject.html">DisplayObject</a></li>
<li><a href="..&#x2F;classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
<li><a href="..&#x2F;classes/MovieClip.html">MovieClip</a></li>
<li><a href="..&#x2F;classes/Point.html">Point</a></li>
<li><a href="..&#x2F;classes/Rectangle.html">Rectangle</a></li>
<li><a href="..&#x2F;classes/Sprite.html">Sprite</a></li>
<li><a href="..&#x2F;classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
<li><a href="..&#x2F;classes/Stage.html">Stage</a></li>
<li><a href="..&#x2F;classes/Texture.html">Texture</a></li>
<li><a href="..&#x2F;classes/WebGLBatch.html">WebGLBatch</a></li>
<li><a href="..&#x2F;classes/WebGLRenderer.html">WebGLRenderer</a></li>
</ul>
<ul id="api-modules" class="apis modules">
<li><a href="..&#x2F;modules/PIXI.html">PIXI</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="yui3-u-3-4">
<div id="api-options">
Show:
<label for="api-show-inherited">
<input type="checkbox" id="api-show-inherited" checked>
Inherited
</label>
<label for="api-show-protected">
<input type="checkbox" id="api-show-protected">
Protected
</label>
<label for="api-show-private">
<input type="checkbox" id="api-show-private">
Private
</label>
<label for="api-show-deprecated">
<input type="checkbox" id="api-show-deprecated">
Deprecated
</label>
</div>
<div class="apidocs">
<div id="docs-main">
<div class="content">
<h1 class="file-heading">File: pixi&#x2F;renderers&#x2F;CanvasRenderer.js</h1>
<div class="file">
<pre class="code prettyprint linenums">
&#x2F;**
* @author Mat Groves http:&#x2F;&#x2F;matgroves.com&#x2F;
*&#x2F;
&#x2F;**
* 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
*&#x2F;
PIXI.CanvasRenderer = function(width, height)
{
&#x2F;**
* The width of the canvas view
* @property width
* @type Number
* @default 800
*&#x2F;
this.width = width ? width : 800;
&#x2F;**
* The height of the canvas view
* @property height
* @type Number
* @default 600
*&#x2F;
this.height = height ? height : 600;
this.refresh = true;
&#x2F;**
* The canvas element that the everything is drawn to
* @property view
* @type Canvas
*&#x2F;
this.view = document.createElement( &#x27;canvas&#x27; );
this.view.width = this.width;
this.view.height = this.height;
this.view.background = &quot;#FF0000&quot;;
this.count = 0;
&#x2F;**
* The canvas context that the everything is drawn to
* @property context
* @type Canvas 2d Context
*&#x2F;
this.context = this.view.getContext(&quot;2d&quot;);
}
&#x2F;&#x2F; constructor
PIXI.CanvasRenderer.constructor = PIXI.CanvasRenderer;
&#x2F;**
* Renders the stage to its canvas view
* @method render
* @param stage {Stage} the Stage element to be rendered
*&#x2F;
PIXI.CanvasRenderer.prototype.render = function(stage)
{
&#x2F;&#x2F; update children if need be
stage.__childrenAdded = [];
stage.__childrenRemoved = [];
&#x2F;&#x2F; 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);
}
&#x2F;**
* 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
*&#x2F;
PIXI.CanvasRenderer.prototype.resize = function(width, height)
{
this.width = width;
this.height = height;
this.view.width = width;
this.view.height = height;
}
&#x2F;**
* @private
*&#x2F;
PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
{
var transform = displayObject.worldTransform;
var context = this.context;
context.globalCompositeOperation = &quot;source-over&quot;
var blit = false;
if(!displayObject.visible)return;
if(displayObject instanceof PIXI.Sprite)
{
var frame = displayObject.texture.frame;
if(frame)
{
context.globalAlpha = displayObject.worldAlpha;
&#x2F;&#x2F; BLITZ!!!
&#x2F;*
* 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!
*&#x2F;
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);
}
&#x2F;&#x2F; render!
for (var i=0; i &lt; displayObject.children.length; i++)
{
this.renderDisplayObject(displayObject.children[i]);
}
}
&#x2F;**
* @private
*&#x2F;
PIXI.CanvasRenderer.prototype.renderStripFlat = function(strip)
{
var context = this.context;
var verticies = strip.verticies;
var uvs = strip.uvs;
var length = verticies.length&#x2F;2;
this.count++;
context.beginPath();
for (var i=1; i &lt; length-2; i++)
{
&#x2F;&#x2F; 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);
};
&#x2F;&#x2F; context.globalCompositeOperation = &#x27;lighter&#x27;;
context.fillStyle = &quot;#FF0000&quot;;
context.fill();
context.closePath();
&#x2F;&#x2F;context.globalCompositeOperation = &#x27;source-over&#x27;;
}
&#x2F;**
* @private
*&#x2F;
PIXI.CanvasRenderer.prototype.renderStrip = function(strip)
{
var context = this.context;
&#x2F;&#x2F;context.globalCompositeOperation = &#x27;lighter&#x27;;
&#x2F;&#x2F; draw triangles!!
var verticies = strip.verticies;
var uvs = strip.uvs;
var length = verticies.length&#x2F;2;
this.count++;
for (var i=1; i &lt; length-2; i++)
{
&#x2F;&#x2F; 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();
&#x2F;&#x2F; context.fillStyle = &quot;white&quot;&#x2F;&#x2F;rgb(1, 1, 1,1));
&#x2F;&#x2F; context.fill();
context.clip();
&#x2F;&#x2F; 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&#x2F;delta, delta_d&#x2F;delta,
delta_b&#x2F;delta, delta_e&#x2F;delta,
delta_c&#x2F;delta, delta_f&#x2F;delta);
context.drawImage(strip.texture.baseTexture.image, 0, 0);
context.restore();
};
&#x2F;&#x2F; context.globalCompositeOperation = &#x27;source-over&#x27;;
}
</pre>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="..&#x2F;assets/vendor/prettify/prettify-min.js"></script>
<script>prettyPrint();</script>
<script src="..&#x2F;assets/js/yui-prettify.js"></script>
<script src="..&#x2F;assets/../api.js"></script>
<script src="..&#x2F;assets/js/api-filter.js"></script>
<script src="..&#x2F;assets/js/api-list.js"></script>
<script src="..&#x2F;assets/js/api-search.js"></script>
<script src="..&#x2F;assets/js/apidocs.js"></script>
</body>
</html>

View file

@ -0,0 +1,693 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>pixi&#x2F;renderers&#x2F;WebGLBatch.js - The Foo API</title>
<link rel="stylesheet" href="http:&#x2F;&#x2F;yui.yahooapis.com&#x2F;3.8.0pr2&#x2F;build&#x2F;cssgrids&#x2F;cssgrids-min.css">
<link rel="stylesheet" href="..&#x2F;assets/vendor/prettify/prettify-min.css">
<link rel="stylesheet" href="..&#x2F;assets/css/main.css" id="site_styles">
<link rel="shortcut icon" type="image/png" href="..&#x2F;assets/favicon.png">
<script src="http:&#x2F;&#x2F;yui.yahooapis.com&#x2F;combo?3.8.0pr2&#x2F;build&#x2F;yui&#x2F;yui-min.js"></script>
</head>
<body class="yui3-skin-sam">
<div id="doc">
<div id="hd" class="yui3-g header">
<div class="yui3-u-3-4">
<h1><img src="..&#x2F;assets/css/logo.png" title="The Foo API"></h1>
</div>
<div class="yui3-u-1-4 version">
<em>API Docs for: 1.2.1</em>
</div>
</div>
<div id="bd" class="yui3-g">
<div class="yui3-u-1-4">
<div id="docs-sidebar" class="sidebar apidocs">
<div id="api-list">
<h2 class="off-left">APIs</h2>
<div id="api-tabview" class="tabview">
<ul class="tabs">
<li><a href="#api-classes">Classes</a></li>
<li><a href="#api-modules">Modules</a></li>
</ul>
<div id="api-tabview-filter">
<input type="search" id="api-filter" placeholder="Type to filter APIs">
</div>
<div id="api-tabview-panel">
<ul id="api-classes" class="apis classes">
<li><a href="..&#x2F;classes/AssetLoader.html">AssetLoader</a></li>
<li><a href="..&#x2F;classes/BaseTexture.html">BaseTexture</a></li>
<li><a href="..&#x2F;classes/CanvasRenderer.html">CanvasRenderer</a></li>
<li><a href="..&#x2F;classes/DisplayObject.html">DisplayObject</a></li>
<li><a href="..&#x2F;classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
<li><a href="..&#x2F;classes/MovieClip.html">MovieClip</a></li>
<li><a href="..&#x2F;classes/Point.html">Point</a></li>
<li><a href="..&#x2F;classes/Rectangle.html">Rectangle</a></li>
<li><a href="..&#x2F;classes/Sprite.html">Sprite</a></li>
<li><a href="..&#x2F;classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
<li><a href="..&#x2F;classes/Stage.html">Stage</a></li>
<li><a href="..&#x2F;classes/Texture.html">Texture</a></li>
<li><a href="..&#x2F;classes/WebGLBatch.html">WebGLBatch</a></li>
<li><a href="..&#x2F;classes/WebGLRenderer.html">WebGLRenderer</a></li>
</ul>
<ul id="api-modules" class="apis modules">
<li><a href="..&#x2F;modules/PIXI.html">PIXI</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="yui3-u-3-4">
<div id="api-options">
Show:
<label for="api-show-inherited">
<input type="checkbox" id="api-show-inherited" checked>
Inherited
</label>
<label for="api-show-protected">
<input type="checkbox" id="api-show-protected">
Protected
</label>
<label for="api-show-private">
<input type="checkbox" id="api-show-private">
Private
</label>
<label for="api-show-deprecated">
<input type="checkbox" id="api-show-deprecated">
Deprecated
</label>
</div>
<div class="apidocs">
<div id="docs-main">
<div class="content">
<h1 class="file-heading">File: pixi&#x2F;renderers&#x2F;WebGLBatch.js</h1>
<div class="file">
<pre class="code prettyprint linenums">
&#x2F;**
* @author Mat Groves http:&#x2F;&#x2F;matgroves.com&#x2F;
*&#x2F;
PIXI._batchs = [];
&#x2F;**
* @private
*&#x2F;
PIXI._getBatch = function(gl)
{
if(PIXI._batchs.length == 0)
{
return new PIXI.WebGLBatch(gl);
}
else
{
return PIXI._batchs.pop();
}
}
&#x2F;**
* @private
*&#x2F;
PIXI._returnBatch = function(batch)
{
batch.clean();
PIXI._batchs.push(batch);
}
&#x2F;**
* @private
*&#x2F;
PIXI._restoreBatchs = function(gl)
{
for (var i=0; i &lt; PIXI._batchs.length; i++)
{
PIXI._batchs[i].restoreLostContext(gl);
};
}
&#x2F;**
* 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}
*&#x2F;
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;
}
&#x2F;&#x2F; constructor
PIXI.WebGLBatch.constructor = PIXI.WebGLBatch;
&#x2F;**
* Cleans the batch so that is can be returned to an object pool and reused
*&#x2F;
PIXI.WebGLBatch.prototype.clean = function()
{
this.verticies = [];
this.uvs = [];
this.indices = [];
this.colors = [];
&#x2F;&#x2F;this.sprites = [];
this.dynamicSize = 1;
this.texture = null;
this.last = null;
this.size = 0;
this.head;
this.tail;
}
&#x2F;*
* recreates the buffers in the event of a context loss
*&#x2F;
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();
}
&#x2F;**
* inits the batch&#x27;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
*&#x2F;
PIXI.WebGLBatch.prototype.init = function(sprite)
{
sprite.batch = this;
this.dirty = true;
this.blendMode = sprite.blendMode;
this.texture = sprite.texture.baseTexture;
&#x2F;&#x2F; this.sprites.push(sprite);
this.head = sprite;
this.tail = sprite;
this.size = 1;
this.growBatch();
}
&#x2F;**
* 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
*&#x2F;
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;
&#x2F;&#x2F;this.head.__prev = null
}
}
&#x2F;**
* 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
*&#x2F;
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
}
}
&#x2F;**
* removes a sprite from the batch
* @method remove
* @param sprite {Sprite} the sprite to be removed
*&#x2F;
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;
}
&#x2F;**
* 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
*&#x2F;
PIXI.WebGLBatch.prototype.split = function(sprite)
{
&#x2F;&#x2F;console.log(&quot;Splitting batch :&quot; + this.size)
&#x2F;&#x2F; console.log(sprite)
&#x2F;&#x2F; console.log(&quot;-------&quot;)
this.dirty = true;
&#x2F;&#x2F;var val = (this.tail == this.head)
&#x2F;&#x2F;console.log(val + &quot; SAME?&quot;);
var batch = new PIXI.WebGLBatch(this.gl)&#x2F;&#x2F;PIXI._getBatch(this.gl);
batch.init(sprite);
batch.tail = this.tail;
&#x2F;&#x2F;console.log(&quot;id is &quot; +batcheee.id)
this.tail = sprite.__prev;
this.tail.__next = null;
sprite.__prev = null;
&#x2F;&#x2F; return a splite batch!
&#x2F;&#x2F;sprite.__prev.__next = null;
&#x2F;&#x2F;sprite.__prev = null;
&#x2F;&#x2F; TODO this size is wrong!
&#x2F;&#x2F; need to recalculate :&#x2F; problem with a linked list!
&#x2F;&#x2F; unless it gets calculated in the &quot;clean&quot;?
&#x2F;&#x2F; need to loop through items as there is no way to know the length on a linked list :&#x2F;
var tempSize = 0;
while(sprite)
{
tempSize++;
sprite.batch = batch;
sprite = sprite.__next;
}
batch.size = tempSize;
this.size -= tempSize;
return batch;
}
&#x2F;**
* Merges two batchs together
* @method merge
* @param batch {WebGLBatch} the batch that will be merged
*&#x2F;
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;
}
}
&#x2F;**
* 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
*&#x2F;
PIXI.WebGLBatch.prototype.growBatch = function()
{
var gl = this.gl;
if( this.size == 1)
{
this.dynamicSize = 1;
}
else
{
this.dynamicSize = this.size * 1.5
}
&#x2F;&#x2F; 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&#x2F;6;
for (var i=0; i &lt; 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);
}
&#x2F;**
* Refresh&#x27;s all the data in the batch and sync&#x27;s it with the webGL buffers
* @method refresh
*&#x2F;
PIXI.WebGLBatch.prototype.refresh = function()
{
var gl = this.gl;
if (this.dynamicSize &lt; 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 &#x2F; tw;
this.uvs[index +1] = frame.y &#x2F; th;
this.uvs[index +2] = (frame.x + frame.width) &#x2F; tw;
this.uvs[index +3] = frame.y &#x2F; th;
this.uvs[index +4] = (frame.x + frame.width) &#x2F; tw;
this.uvs[index +5] = (frame.y + frame.height) &#x2F; th;
this.uvs[index +6] = frame.x &#x2F; tw;
this.uvs[index +7] = (frame.y + frame.height) &#x2F; 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;
}
&#x2F;**
* Updates all the relevant geometry and uploads the data to the GPU
* @method update
*&#x2F;
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 &#x2F; tw;
this.uvs[index +1] = frame.y &#x2F; th;
this.uvs[index +2] = (frame.x + frame.width) &#x2F; tw;
this.uvs[index +3] = frame.y &#x2F; th;
this.uvs[index +4] = (frame.x + frame.width) &#x2F; tw;
this.uvs[index +5] = (frame.y + frame.height) &#x2F; th;
this.uvs[index +6] = frame.x &#x2F; tw;
this.uvs[index +7] = (frame.y + frame.height) &#x2F; th;
displayObject.updateFrame = false;
}
&#x2F;&#x2F; 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;
}
}
&#x2F;**
* Draws the batch to the frame buffer
* @method render
*&#x2F;
PIXI.WebGLBatch.prototype.render = function()
{
if(this.dirty)
{
this.refresh();
this.dirty = false;
}
if (this.size == 0)return;
this.update();
var gl = this.gl;
&#x2F;&#x2F;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;
&#x2F;&#x2F; update the verts..
gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
&#x2F;&#x2F; ok..
gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.verticies)
gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
&#x2F;&#x2F; 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);
&#x2F;&#x2F; 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);
&#x2F;&#x2F; dont need to upload!
gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
&#x2F;&#x2F; DRAW THAT this!
gl.drawElements(gl.TRIANGLES, this.size * 6, gl.UNSIGNED_SHORT, 0);
}
</pre>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="..&#x2F;assets/vendor/prettify/prettify-min.js"></script>
<script>prettyPrint();</script>
<script src="..&#x2F;assets/js/yui-prettify.js"></script>
<script src="..&#x2F;assets/../api.js"></script>
<script src="..&#x2F;assets/js/api-filter.js"></script>
<script src="..&#x2F;assets/js/api-list.js"></script>
<script src="..&#x2F;assets/js/api-search.js"></script>
<script src="..&#x2F;assets/js/apidocs.js"></script>
</body>
</html>

View file

@ -0,0 +1,823 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>pixi&#x2F;renderers&#x2F;WebGLRenderer.js - The Foo API</title>
<link rel="stylesheet" href="http:&#x2F;&#x2F;yui.yahooapis.com&#x2F;3.8.0pr2&#x2F;build&#x2F;cssgrids&#x2F;cssgrids-min.css">
<link rel="stylesheet" href="..&#x2F;assets/vendor/prettify/prettify-min.css">
<link rel="stylesheet" href="..&#x2F;assets/css/main.css" id="site_styles">
<link rel="shortcut icon" type="image/png" href="..&#x2F;assets/favicon.png">
<script src="http:&#x2F;&#x2F;yui.yahooapis.com&#x2F;combo?3.8.0pr2&#x2F;build&#x2F;yui&#x2F;yui-min.js"></script>
</head>
<body class="yui3-skin-sam">
<div id="doc">
<div id="hd" class="yui3-g header">
<div class="yui3-u-3-4">
<h1><img src="..&#x2F;assets/css/logo.png" title="The Foo API"></h1>
</div>
<div class="yui3-u-1-4 version">
<em>API Docs for: 1.2.1</em>
</div>
</div>
<div id="bd" class="yui3-g">
<div class="yui3-u-1-4">
<div id="docs-sidebar" class="sidebar apidocs">
<div id="api-list">
<h2 class="off-left">APIs</h2>
<div id="api-tabview" class="tabview">
<ul class="tabs">
<li><a href="#api-classes">Classes</a></li>
<li><a href="#api-modules">Modules</a></li>
</ul>
<div id="api-tabview-filter">
<input type="search" id="api-filter" placeholder="Type to filter APIs">
</div>
<div id="api-tabview-panel">
<ul id="api-classes" class="apis classes">
<li><a href="..&#x2F;classes/AssetLoader.html">AssetLoader</a></li>
<li><a href="..&#x2F;classes/BaseTexture.html">BaseTexture</a></li>
<li><a href="..&#x2F;classes/CanvasRenderer.html">CanvasRenderer</a></li>
<li><a href="..&#x2F;classes/DisplayObject.html">DisplayObject</a></li>
<li><a href="..&#x2F;classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
<li><a href="..&#x2F;classes/MovieClip.html">MovieClip</a></li>
<li><a href="..&#x2F;classes/Point.html">Point</a></li>
<li><a href="..&#x2F;classes/Rectangle.html">Rectangle</a></li>
<li><a href="..&#x2F;classes/Sprite.html">Sprite</a></li>
<li><a href="..&#x2F;classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
<li><a href="..&#x2F;classes/Stage.html">Stage</a></li>
<li><a href="..&#x2F;classes/Texture.html">Texture</a></li>
<li><a href="..&#x2F;classes/WebGLBatch.html">WebGLBatch</a></li>
<li><a href="..&#x2F;classes/WebGLRenderer.html">WebGLRenderer</a></li>
</ul>
<ul id="api-modules" class="apis modules">
<li><a href="..&#x2F;modules/PIXI.html">PIXI</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="yui3-u-3-4">
<div id="api-options">
Show:
<label for="api-show-inherited">
<input type="checkbox" id="api-show-inherited" checked>
Inherited
</label>
<label for="api-show-protected">
<input type="checkbox" id="api-show-protected">
Protected
</label>
<label for="api-show-private">
<input type="checkbox" id="api-show-private">
Private
</label>
<label for="api-show-deprecated">
<input type="checkbox" id="api-show-deprecated">
Deprecated
</label>
</div>
<div class="apidocs">
<div id="docs-main">
<div class="content">
<h1 class="file-heading">File: pixi&#x2F;renderers&#x2F;WebGLRenderer.js</h1>
<div class="file">
<pre class="code prettyprint linenums">
&#x2F;**
* @author Mat Groves http:&#x2F;&#x2F;matgroves.com&#x2F;
*&#x2F;
PIXI._defaultFrame = new PIXI.Rectangle(0,0,1,1);
&#x2F;**
* 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&#x27;s or Sprite Cloud&#x27;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
*&#x2F;
PIXI.WebGLRenderer = function(width, height)
{
this.width = width ? width : 800;
this.height = height ? height : 600;
this.view = document.createElement( &#x27;canvas&#x27; );
this.view.width = this.width;
this.view.height = this.height;
this.view.background = &quot;#FF0000&quot;;
&#x2F;&#x2F; deal with losing context..
var scope = this;
this.view.addEventListener(&#x27;webglcontextlost&#x27;, function(event) { scope.handleContextLost(event); }, false)
this.view.addEventListener(&#x27;webglcontextrestored&#x27;, function(event) { scope.handleContextRestored(event); }, false)
this.batchs = [];
try
{
this.gl = this.view.getContext(&quot;experimental-webgl&quot;, {
alpha: false
});
}
catch (e)
{
throw new Error(&quot; This browser does not support webGL. Try using the canvas renderer&quot; + 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;
}
&#x2F;&#x2F; constructor
PIXI.WebGLRenderer.constructor = PIXI.WebGLRenderer;
&#x2F;**
* @private
*&#x2F;
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(&quot;Could not initialise shaders&quot;);
}
gl.useProgram(shaderProgram);
shaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, &quot;aVertexPosition&quot;);
gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);
shaderProgram.textureCoordAttribute = gl.getAttribLocation(shaderProgram, &quot;aTextureCoord&quot;);
gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute);
shaderProgram.colorAttribute = gl.getAttribLocation(shaderProgram, &quot;aColor&quot;);
gl.enableVertexAttribArray(shaderProgram.colorAttribute);
shaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, &quot;uMVMatrix&quot;);
shaderProgram.samplerUniform = gl.getUniformLocation(shaderProgram, &quot;uSampler&quot;);
PIXI.shaderProgram = this.shaderProgram;
}
&#x2F;**
* @private
*&#x2F;
PIXI.WebGLRenderer.prototype.checkVisibility = function(displayObject, globalVisible)
{
var children = displayObject.children;
for (var i=0; i &lt; children.length; i++)
{
var child = children[i];
&#x2F;&#x2F; TODO optimize... shouldt need to loop through everything all the time
var actualVisibility = child.visible &amp;&amp; globalVisible;
&#x2F;&#x2F; everything should have a batch!
&#x2F;&#x2F; time to see whats new!
if(child.textureChange)
{
child.textureChange = false;
if(actualVisibility)
{
this.removeDisplayObject(child)
this.addDisplayObject(child)
}
&#x2F;&#x2F; update texture!!
}
if(child.cacheVisible != actualVisibility)
{
child.cacheVisible = actualVisibility;
if(child.cacheVisible)
{
this.addDisplayObject(child);
}
else
{
this.removeDisplayObject(child);
}
}
if(child.children.length &gt; 0)
{
this.checkVisibility(child, actualVisibility);
}
};
}
&#x2F;**
* Renders the stage to its webGL view
* @method render
* @param stage {Stage} the PIXI.Stage element to be rendered
*&#x2F;
PIXI.WebGLRenderer.prototype.render = function(stage)
{
if(this.contextLost)return;
&#x2F;&#x2F; update children if need be
&#x2F;&#x2F; best to remove first!
for (var i=0; i &lt; stage.__childrenRemoved.length; i++)
{
this.removeDisplayObject(stage.__childrenRemoved[i]);
&#x2F;&#x2F; stage.__childrenRemoved[i].cacheVisible = false;
}
&#x2F;*
&#x2F;&#x2F; no add all new sprites
for (var i=0; i &lt; stage.__childrenAdded.length; i++)
{
stage.__childrenAdded[i].cacheVisible = false;
&#x2F;&#x2F; this.addDisplayObject(stage.__childrenAdded[i]);
}*&#x2F;
&#x2F;&#x2F; update any textures
for (var i=0; i &lt; PIXI.texturesToUpdate.length; i++) this.updateTexture(PIXI.texturesToUpdate[i]);
&#x2F;&#x2F; empty out the arrays
stage.__childrenRemoved = [];
stage.__childrenAdded = [];
PIXI.texturesToUpdate = [];
&#x2F;&#x2F; recursivly loop through all items!
this.checkVisibility(stage, true);
&#x2F;&#x2F; update the scen graph
stage.updateTransform();
var gl = this.gl;
gl.clear(gl.COLOR_BUFFER_BIT)
gl.clearColor(0, 0, 0, 1.0);
&#x2F;&#x2F; set the correct blend mode!
gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, this.projectionMatrix);
&#x2F;&#x2F; render all the batchs!
var renderable;
for (var i=0; i &lt; 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);
}
}
}
&#x2F;**
* @private
*&#x2F;
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);
&#x2F;&#x2F; gl.generateMipmap(gl.TEXTURE_2D);
gl.bindTexture(gl.TEXTURE_2D, null);
}
this.refreshBatchs = true;
}
&#x2F;**
* @private
*&#x2F;
PIXI.WebGLRenderer.prototype.addDisplayObject = function(displayObject)
{
if(!displayObject.stage)return; &#x2F;&#x2F; means it was removed
if(displayObject.__inWebGL)return; &#x2F;&#x2F;means it is already in webgL
&#x2F;&#x2F;displayObject.cacheVisible = displayObject.visible;
&#x2F;&#x2F; TODO if objects parent is not visible then dont add to stage!!!!
&#x2F;&#x2F;if(!displayObject.visible)return;
displayObject.batch = null;
&#x2F;&#x2F;displayObject.cacheVisible = true;
if(!displayObject.renderable)return;
&#x2F;&#x2F; while looping below THE OBJECT MAY NOT HAVE BEEN ADDED
displayObject.__inWebGL = true;
&#x2F;*
* 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
*&#x2F;
var previousSprite = displayObject;
do
{
if(previousSprite.childIndex == 0)
{
previousSprite = previousSprite.parent;
}
else
{
previousSprite = previousSprite.parent.children[previousSprite.childIndex-1];
&#x2F;&#x2F; what if the bloop has children???
while(previousSprite.children.length != 0)
{
&#x2F;&#x2F; 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)
&#x2F;&#x2F;while(!(previousSprite instanceof PIXI.Sprite))
&#x2F;*
* 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...
*&#x2F;
var nextSprite = displayObject;
do
{
&#x2F;&#x2F; moving forward!
&#x2F;&#x2F; if it has no children..
if(nextSprite.children.length == 0)
{
&#x2F;&#x2F; 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)
&#x2F;*
* so now we have the next renderable and the previous renderable
*
*&#x2F;
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 &amp;&amp; previousBatch.blendMode == displayObject.blendMode)
{
previousBatch.insertAfter(displayObject, previousSprite);
return;
}
}
}
else
{
&#x2F;&#x2F; TODO reword!
previousBatch = previousSprite;
}
if(nextSprite)
{
if(nextSprite instanceof PIXI.Sprite)
{
nextBatch = nextSprite.batch;
&#x2F;&#x2F;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 &amp;&amp; nextBatch.blendMode == displayObject.blendMode)
{
nextBatch.insertBefore(displayObject, nextSprite);
return;
}
else
{
if(nextBatch == previousBatch)
{
&#x2F;&#x2F; THERE IS A SPLIT IN THIS BATCH! &#x2F;&#x2F;
var splitBatch = previousBatch.split(nextSprite);
&#x2F;&#x2F; COOL!
&#x2F;&#x2F; add it back into the array
&#x2F;*
* OOPS!
* seems the new sprite is in the middle of a batch
* lets split it..
*&#x2F;
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
{
&#x2F;&#x2F; TODO re-word!
nextBatch = nextSprite;
}
}
&#x2F;*
* looks like it does not belong to any batch!
* but is also not intersecting one..
* time to create anew one!
*&#x2F;
var batch = PIXI._getBatch(this.gl);
batch.init(displayObject);
if(previousBatch) &#x2F;&#x2F; 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)
{
&#x2F;&#x2F; add to a batch!!
this.initStrip(displayObject);
this.batchs.push(displayObject);
}
&#x2F;&#x2F; if its somthing else... then custom codes!
this.batchUpdate = true;
}
&#x2F;**
* @private
*&#x2F;
PIXI.WebGLRenderer.prototype.removeDisplayObject = function(displayObject)
{
&#x2F;&#x2F;if(displayObject.stage)return;
displayObject.cacheVisible = false;&#x2F;&#x2F;displayObject.visible;
if(!displayObject.renderable)return;
displayObject.__inWebGL = false;
&#x2F;*
* removing is a lot quicker..
*
*&#x2F;
var batchToRemove;
if(displayObject instanceof PIXI.Sprite)
{
&#x2F;&#x2F; should always have a batch!
var batch = displayObject.batch;
if(!batch)return; &#x2F;&#x2F; this means the display list has been altered befre rendering
batch.remove(displayObject);
if(batch.size==0)
{
batchToRemove = batch
}
}
else
{
batchToRemove = displayObject;
}
&#x2F;*
* Looks like there is somthing that needs removing!
*&#x2F;
if(batchToRemove)
{
var index = this.batchs.indexOf( batchToRemove );
if(index == -1)return;&#x2F;&#x2F; this means it was added then removed before rendered
&#x2F;&#x2F; ok so.. check to see if you adjacent batchs should be joined.
&#x2F;&#x2F; TODO may optimise?
if(index == 0 || index == this.batchs.length-1)
{
&#x2F;&#x2F; 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 &amp;&amp; this.batchs[index+1] instanceof PIXI.WebGLBatch)
{
if(this.batchs[index-1].texture == this.batchs[index+1].texture)
{
&#x2F;&#x2F;console.log(&quot;MERGE&quot;)
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);
}
}
&#x2F;**
* 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
*&#x2F;
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&#x2F;this.width, -2&#x2F;this.height, 1]);
mat4.translate(this.projectionMatrix, [-this.width&#x2F;2, -this.height&#x2F;2, 0]);
}
&#x2F;**
* @private
*&#x2F;
PIXI.WebGLRenderer.prototype.initStrip = function(strip)
{
&#x2F;&#x2F; 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);
}
&#x2F;**
* @private
*&#x2F;
PIXI.WebGLRenderer.prototype.renderStrip = function(strip)
{
var gl = this.gl;
var shaderProgram = this.shaderProgram;
&#x2F;&#x2F; 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);
&#x2F;&#x2F; 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);
&#x2F;&#x2F; 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);
&#x2F;&#x2F; 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);
&#x2F;&#x2F; 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);
&#x2F;&#x2F; console.log(&quot;!!!&quot;)
}
&#x2F;**
* @private
*&#x2F;
PIXI.WebGLRenderer.prototype.handleContextLost = function(event)
{
event.preventDefault();
this.contextLost = true;
}
&#x2F;**
* @private
*&#x2F;
PIXI.WebGLRenderer.prototype.handleContextRestored = function(event)
{
this.gl = this.view.getContext(&quot;experimental-webgl&quot;, {
alpha: true
});
this.initShaders();
for (var i=0; i &lt; PIXI.TextureCache.length; i++)
{
this.updateTexture(PIXI.TextureCache[i]);
};
for (var i=0; i &lt; this.batchs.length; i++)
{
this.batchs[i].restoreLostContext(this.gl)&#x2F;&#x2F;
this.batchs[i].dirty = true;
};
PIXI._restoreBatchs(this.gl);
this.contextLost = false;
}
</pre>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="..&#x2F;assets/vendor/prettify/prettify-min.js"></script>
<script>prettyPrint();</script>
<script src="..&#x2F;assets/js/yui-prettify.js"></script>
<script src="..&#x2F;assets/../api.js"></script>
<script src="..&#x2F;assets/js/api-filter.js"></script>
<script src="..&#x2F;assets/js/api-list.js"></script>
<script src="..&#x2F;assets/js/api-search.js"></script>
<script src="..&#x2F;assets/js/apidocs.js"></script>
</body>
</html>

View file

@ -0,0 +1,204 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>pixi&#x2F;renderers&#x2F;WebGLShaders.js - The Foo API</title>
<link rel="stylesheet" href="http:&#x2F;&#x2F;yui.yahooapis.com&#x2F;3.8.0pr2&#x2F;build&#x2F;cssgrids&#x2F;cssgrids-min.css">
<link rel="stylesheet" href="..&#x2F;assets/vendor/prettify/prettify-min.css">
<link rel="stylesheet" href="..&#x2F;assets/css/main.css" id="site_styles">
<link rel="shortcut icon" type="image/png" href="..&#x2F;assets/favicon.png">
<script src="http:&#x2F;&#x2F;yui.yahooapis.com&#x2F;combo?3.8.0pr2&#x2F;build&#x2F;yui&#x2F;yui-min.js"></script>
</head>
<body class="yui3-skin-sam">
<div id="doc">
<div id="hd" class="yui3-g header">
<div class="yui3-u-3-4">
<h1><img src="..&#x2F;assets/css/logo.png" title="The Foo API"></h1>
</div>
<div class="yui3-u-1-4 version">
<em>API Docs for: 1.2.1</em>
</div>
</div>
<div id="bd" class="yui3-g">
<div class="yui3-u-1-4">
<div id="docs-sidebar" class="sidebar apidocs">
<div id="api-list">
<h2 class="off-left">APIs</h2>
<div id="api-tabview" class="tabview">
<ul class="tabs">
<li><a href="#api-classes">Classes</a></li>
<li><a href="#api-modules">Modules</a></li>
</ul>
<div id="api-tabview-filter">
<input type="search" id="api-filter" placeholder="Type to filter APIs">
</div>
<div id="api-tabview-panel">
<ul id="api-classes" class="apis classes">
<li><a href="..&#x2F;classes/AssetLoader.html">AssetLoader</a></li>
<li><a href="..&#x2F;classes/BaseTexture.html">BaseTexture</a></li>
<li><a href="..&#x2F;classes/CanvasRenderer.html">CanvasRenderer</a></li>
<li><a href="..&#x2F;classes/DisplayObject.html">DisplayObject</a></li>
<li><a href="..&#x2F;classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
<li><a href="..&#x2F;classes/MovieClip.html">MovieClip</a></li>
<li><a href="..&#x2F;classes/Point.html">Point</a></li>
<li><a href="..&#x2F;classes/Rectangle.html">Rectangle</a></li>
<li><a href="..&#x2F;classes/Sprite.html">Sprite</a></li>
<li><a href="..&#x2F;classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
<li><a href="..&#x2F;classes/Stage.html">Stage</a></li>
<li><a href="..&#x2F;classes/Texture.html">Texture</a></li>
<li><a href="..&#x2F;classes/WebGLBatch.html">WebGLBatch</a></li>
<li><a href="..&#x2F;classes/WebGLRenderer.html">WebGLRenderer</a></li>
</ul>
<ul id="api-modules" class="apis modules">
<li><a href="..&#x2F;modules/PIXI.html">PIXI</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="yui3-u-3-4">
<div id="api-options">
Show:
<label for="api-show-inherited">
<input type="checkbox" id="api-show-inherited" checked>
Inherited
</label>
<label for="api-show-protected">
<input type="checkbox" id="api-show-protected">
Protected
</label>
<label for="api-show-private">
<input type="checkbox" id="api-show-private">
Private
</label>
<label for="api-show-deprecated">
<input type="checkbox" id="api-show-deprecated">
Deprecated
</label>
</div>
<div class="apidocs">
<div id="docs-main">
<div class="content">
<h1 class="file-heading">File: pixi&#x2F;renderers&#x2F;WebGLShaders.js</h1>
<div class="file">
<pre class="code prettyprint linenums">
&#x2F;**
* @author Mat Groves http:&#x2F;&#x2F;matgroves.com&#x2F;
*&#x2F;
PIXI.shaderFragmentSrc = [ &quot;precision mediump float;&quot;,
&quot;varying vec2 vTextureCoord;&quot;,
&quot;varying float vColor;&quot;,
&quot;uniform sampler2D uSampler;&quot;,
&quot;void main(void) {&quot;,
&quot;gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));&quot;,
&quot;gl_FragColor = gl_FragColor * vColor;&quot;,
&quot;}&quot;];
PIXI.shaderVertexSrc = [ &quot;attribute vec2 aVertexPosition;&quot;,
&quot;attribute vec2 aTextureCoord;&quot;,
&quot;attribute float aColor;&quot;,
&quot;uniform mat4 uMVMatrix;&quot;,
&quot;varying vec2 vTextureCoord;&quot;,
&quot;varying float vColor;&quot;,
&quot;void main(void) {&quot;,
&quot;gl_Position = uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);&quot;,
&quot;vTextureCoord = aTextureCoord;&quot;,
&quot;vColor = aColor;&quot;,
&quot;}&quot;]
PIXI.CompileVertexShader = function(gl, shaderSrc)
{
var src = &quot;&quot;;
for (var i=0; i &lt; 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 = &quot;&quot;;
for (var i=0; i &lt; 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;
}
</pre>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="..&#x2F;assets/vendor/prettify/prettify-min.js"></script>
<script>prettyPrint();</script>
<script src="..&#x2F;assets/js/yui-prettify.js"></script>
<script src="..&#x2F;assets/../api.js"></script>
<script src="..&#x2F;assets/js/api-filter.js"></script>
<script src="..&#x2F;assets/js/api-list.js"></script>
<script src="..&#x2F;assets/js/api-search.js"></script>
<script src="..&#x2F;assets/js/apidocs.js"></script>
</body>
</html>

View file

@ -0,0 +1,206 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>pixi&#x2F;textures&#x2F;BaseTexture.js - The Foo API</title>
<link rel="stylesheet" href="http:&#x2F;&#x2F;yui.yahooapis.com&#x2F;3.8.0pr2&#x2F;build&#x2F;cssgrids&#x2F;cssgrids-min.css">
<link rel="stylesheet" href="..&#x2F;assets/vendor/prettify/prettify-min.css">
<link rel="stylesheet" href="..&#x2F;assets/css/main.css" id="site_styles">
<link rel="shortcut icon" type="image/png" href="..&#x2F;assets/favicon.png">
<script src="http:&#x2F;&#x2F;yui.yahooapis.com&#x2F;combo?3.8.0pr2&#x2F;build&#x2F;yui&#x2F;yui-min.js"></script>
</head>
<body class="yui3-skin-sam">
<div id="doc">
<div id="hd" class="yui3-g header">
<div class="yui3-u-3-4">
<h1><img src="..&#x2F;assets/css/logo.png" title="The Foo API"></h1>
</div>
<div class="yui3-u-1-4 version">
<em>API Docs for: 1.2.1</em>
</div>
</div>
<div id="bd" class="yui3-g">
<div class="yui3-u-1-4">
<div id="docs-sidebar" class="sidebar apidocs">
<div id="api-list">
<h2 class="off-left">APIs</h2>
<div id="api-tabview" class="tabview">
<ul class="tabs">
<li><a href="#api-classes">Classes</a></li>
<li><a href="#api-modules">Modules</a></li>
</ul>
<div id="api-tabview-filter">
<input type="search" id="api-filter" placeholder="Type to filter APIs">
</div>
<div id="api-tabview-panel">
<ul id="api-classes" class="apis classes">
<li><a href="..&#x2F;classes/AssetLoader.html">AssetLoader</a></li>
<li><a href="..&#x2F;classes/BaseTexture.html">BaseTexture</a></li>
<li><a href="..&#x2F;classes/CanvasRenderer.html">CanvasRenderer</a></li>
<li><a href="..&#x2F;classes/DisplayObject.html">DisplayObject</a></li>
<li><a href="..&#x2F;classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
<li><a href="..&#x2F;classes/MovieClip.html">MovieClip</a></li>
<li><a href="..&#x2F;classes/Point.html">Point</a></li>
<li><a href="..&#x2F;classes/Rectangle.html">Rectangle</a></li>
<li><a href="..&#x2F;classes/Sprite.html">Sprite</a></li>
<li><a href="..&#x2F;classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
<li><a href="..&#x2F;classes/Stage.html">Stage</a></li>
<li><a href="..&#x2F;classes/Texture.html">Texture</a></li>
<li><a href="..&#x2F;classes/WebGLBatch.html">WebGLBatch</a></li>
<li><a href="..&#x2F;classes/WebGLRenderer.html">WebGLRenderer</a></li>
</ul>
<ul id="api-modules" class="apis modules">
<li><a href="..&#x2F;modules/PIXI.html">PIXI</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="yui3-u-3-4">
<div id="api-options">
Show:
<label for="api-show-inherited">
<input type="checkbox" id="api-show-inherited" checked>
Inherited
</label>
<label for="api-show-protected">
<input type="checkbox" id="api-show-protected">
Protected
</label>
<label for="api-show-private">
<input type="checkbox" id="api-show-private">
Private
</label>
<label for="api-show-deprecated">
<input type="checkbox" id="api-show-deprecated">
Deprecated
</label>
</div>
<div class="apidocs">
<div id="docs-main">
<div class="content">
<h1 class="file-heading">File: pixi&#x2F;textures&#x2F;BaseTexture.js</h1>
<div class="file">
<pre class="code prettyprint linenums">
&#x2F;**
* @author Mat Groves http:&#x2F;&#x2F;matgroves.com&#x2F;
*&#x2F;
PIXI.BaseTextureCache = {};
PIXI.texturesToUpdate = [];
&#x2F;**
* 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
*&#x2F;
PIXI.BaseTexture = function(imageUrl)
{
PIXI.EventTarget.call( this );
&#x2F;**
* The url of the texture
* @property imageUrl
* @type String
*&#x2F;
this.imageUrl = imageUrl;
&#x2F;**
* The html image that is loaded to create the texture
* @property image
* @type Image
*&#x2F;
this.image = new Image();
var scope = this
this.image.onload = function(){
scope.hasLoaded = true;
scope.width = scope.image.width;
scope.height = scope.image.height;
&#x2F;&#x2F; add it to somewhere...
PIXI.texturesToUpdate.push(scope);
scope.dispatchEvent( { type: &#x27;loaded&#x27;, content: scope } );
}
$.proxy(this.onImageLoaded, this);
this.image.src = imageUrl;
&#x2F;**
* [read only] The width of the base texture set when the image has loaded
* @property width
* @type Number
*&#x2F;
this.width = 100;
&#x2F;**
* [read only] The height of the base texture set when the image has loaded
* @property height
* @type Number
*&#x2F;
this.height = 100;
PIXI.BaseTextureCache[imageUrl] = this;
}
PIXI.BaseTexture.constructor = PIXI.BaseTexture;
&#x2F;*
PIXI.BaseTexture.prototype.onImageLoaded = function(image)
{
}*&#x2F;
</pre>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="..&#x2F;assets/vendor/prettify/prettify-min.js"></script>
<script>prettyPrint();</script>
<script src="..&#x2F;assets/js/yui-prettify.js"></script>
<script src="..&#x2F;assets/../api.js"></script>
<script src="..&#x2F;assets/js/api-filter.js"></script>
<script src="..&#x2F;assets/js/api-list.js"></script>
<script src="..&#x2F;assets/js/api-search.js"></script>
<script src="..&#x2F;assets/js/apidocs.js"></script>
</body>
</html>

View file

@ -0,0 +1,285 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>pixi&#x2F;textures&#x2F;Texture.js - The Foo API</title>
<link rel="stylesheet" href="http:&#x2F;&#x2F;yui.yahooapis.com&#x2F;3.8.0pr2&#x2F;build&#x2F;cssgrids&#x2F;cssgrids-min.css">
<link rel="stylesheet" href="..&#x2F;assets/vendor/prettify/prettify-min.css">
<link rel="stylesheet" href="..&#x2F;assets/css/main.css" id="site_styles">
<link rel="shortcut icon" type="image/png" href="..&#x2F;assets/favicon.png">
<script src="http:&#x2F;&#x2F;yui.yahooapis.com&#x2F;combo?3.8.0pr2&#x2F;build&#x2F;yui&#x2F;yui-min.js"></script>
</head>
<body class="yui3-skin-sam">
<div id="doc">
<div id="hd" class="yui3-g header">
<div class="yui3-u-3-4">
<h1><img src="..&#x2F;assets/css/logo.png" title="The Foo API"></h1>
</div>
<div class="yui3-u-1-4 version">
<em>API Docs for: 1.2.1</em>
</div>
</div>
<div id="bd" class="yui3-g">
<div class="yui3-u-1-4">
<div id="docs-sidebar" class="sidebar apidocs">
<div id="api-list">
<h2 class="off-left">APIs</h2>
<div id="api-tabview" class="tabview">
<ul class="tabs">
<li><a href="#api-classes">Classes</a></li>
<li><a href="#api-modules">Modules</a></li>
</ul>
<div id="api-tabview-filter">
<input type="search" id="api-filter" placeholder="Type to filter APIs">
</div>
<div id="api-tabview-panel">
<ul id="api-classes" class="apis classes">
<li><a href="..&#x2F;classes/AssetLoader.html">AssetLoader</a></li>
<li><a href="..&#x2F;classes/BaseTexture.html">BaseTexture</a></li>
<li><a href="..&#x2F;classes/CanvasRenderer.html">CanvasRenderer</a></li>
<li><a href="..&#x2F;classes/DisplayObject.html">DisplayObject</a></li>
<li><a href="..&#x2F;classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
<li><a href="..&#x2F;classes/MovieClip.html">MovieClip</a></li>
<li><a href="..&#x2F;classes/Point.html">Point</a></li>
<li><a href="..&#x2F;classes/Rectangle.html">Rectangle</a></li>
<li><a href="..&#x2F;classes/Sprite.html">Sprite</a></li>
<li><a href="..&#x2F;classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
<li><a href="..&#x2F;classes/Stage.html">Stage</a></li>
<li><a href="..&#x2F;classes/Texture.html">Texture</a></li>
<li><a href="..&#x2F;classes/WebGLBatch.html">WebGLBatch</a></li>
<li><a href="..&#x2F;classes/WebGLRenderer.html">WebGLRenderer</a></li>
</ul>
<ul id="api-modules" class="apis modules">
<li><a href="..&#x2F;modules/PIXI.html">PIXI</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="yui3-u-3-4">
<div id="api-options">
Show:
<label for="api-show-inherited">
<input type="checkbox" id="api-show-inherited" checked>
Inherited
</label>
<label for="api-show-protected">
<input type="checkbox" id="api-show-protected">
Protected
</label>
<label for="api-show-private">
<input type="checkbox" id="api-show-private">
Private
</label>
<label for="api-show-deprecated">
<input type="checkbox" id="api-show-deprecated">
Deprecated
</label>
</div>
<div class="apidocs">
<div id="docs-main">
<div class="content">
<h1 class="file-heading">File: pixi&#x2F;textures&#x2F;Texture.js</h1>
<div class="file">
<pre class="code prettyprint linenums">
&#x2F;**
* @author Mat Groves http:&#x2F;&#x2F;matgroves.com&#x2F;
*&#x2F;
PIXI.TextureCache = {};
PIXI.FrameCache = {};
&#x2F;**
* 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}
*&#x2F;
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();
&#x2F;**
* The base texture of this texture
* @property baseTexture
* @type BaseTexture
*&#x2F;
this.baseTexture = baseTexture;
&#x2F;**
* The frame specifies the region of the base texture that this texture uses
* @property frame
* @type #Rectangle
*&#x2F;
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( &#x27;loaded&#x27;, function(){ scope.onBaseTextureLoaded()} );
}
}
PIXI.Texture.constructor = PIXI.Texture;
PIXI.Texture.prototype.onBaseTextureLoaded = function(event)
{
var baseTexture = this.baseTexture;
baseTexture.removeEventListener( &#x27;loaded&#x27;, 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: &#x27;update&#x27;, content: this } );
}
&#x2F;**
* Specifies the rectangle region of the baseTexture
* @method setFrame
* @param frame {Rectangle}
*&#x2F;
PIXI.Texture.prototype.setFrame = function(frame)
{
this.frame = frame;
this.width = frame.width;
this.height = frame.height;
&#x2F;&#x2F;this.updateFrame = true;
}
&#x2F;**
*
* 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
*&#x2F;
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;
}
&#x2F;**
*
* 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
*&#x2F;
PIXI.Texture.fromFrameId = function(frameId)
{
var texture = PIXI.TextureCache[frameId];
if(!texture)throw new Error(&quot;The frameId &#x27;&quot;+ frameId +&quot;&#x27; does not exist in the texture cache &quot; + this);
return texture;
}
&#x2F;**
*
* Adds a texture to the textureCache.
* @method addTextureToCache
* @param texture {Texture}
* @param id {String} the id that the texture will be stored against.
*&#x2F;
PIXI.Texture.addTextureToCache = function(texture, id)
{
PIXI.TextureCache[id] = texture;
}
&#x2F;**
*
* Remove a texture from the textureCache.
* @method removeTextureFromCache
* @param id {String} the id of the texture to be removed
*&#x2F;
PIXI.Texture.removeTextureFromCache = function(id)
{
PIXI.TextureCache[id] = texture;
}
</pre>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="..&#x2F;assets/vendor/prettify/prettify-min.js"></script>
<script>prettyPrint();</script>
<script src="..&#x2F;assets/js/yui-prettify.js"></script>
<script src="..&#x2F;assets/../api.js"></script>
<script src="..&#x2F;assets/js/api-filter.js"></script>
<script src="..&#x2F;assets/js/api-list.js"></script>
<script src="..&#x2F;assets/js/api-search.js"></script>
<script src="..&#x2F;assets/js/apidocs.js"></script>
</body>
</html>

View file

@ -0,0 +1,166 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>pixi&#x2F;utils&#x2F;Detector.js - The Foo API</title>
<link rel="stylesheet" href="http:&#x2F;&#x2F;yui.yahooapis.com&#x2F;3.8.0pr2&#x2F;build&#x2F;cssgrids&#x2F;cssgrids-min.css">
<link rel="stylesheet" href="..&#x2F;assets/vendor/prettify/prettify-min.css">
<link rel="stylesheet" href="..&#x2F;assets/css/main.css" id="site_styles">
<link rel="shortcut icon" type="image/png" href="..&#x2F;assets/favicon.png">
<script src="http:&#x2F;&#x2F;yui.yahooapis.com&#x2F;combo?3.8.0pr2&#x2F;build&#x2F;yui&#x2F;yui-min.js"></script>
</head>
<body class="yui3-skin-sam">
<div id="doc">
<div id="hd" class="yui3-g header">
<div class="yui3-u-3-4">
<h1><img src="..&#x2F;assets/css/logo.png" title="The Foo API"></h1>
</div>
<div class="yui3-u-1-4 version">
<em>API Docs for: 1.2.1</em>
</div>
</div>
<div id="bd" class="yui3-g">
<div class="yui3-u-1-4">
<div id="docs-sidebar" class="sidebar apidocs">
<div id="api-list">
<h2 class="off-left">APIs</h2>
<div id="api-tabview" class="tabview">
<ul class="tabs">
<li><a href="#api-classes">Classes</a></li>
<li><a href="#api-modules">Modules</a></li>
</ul>
<div id="api-tabview-filter">
<input type="search" id="api-filter" placeholder="Type to filter APIs">
</div>
<div id="api-tabview-panel">
<ul id="api-classes" class="apis classes">
<li><a href="..&#x2F;classes/AssetLoader.html">AssetLoader</a></li>
<li><a href="..&#x2F;classes/BaseTexture.html">BaseTexture</a></li>
<li><a href="..&#x2F;classes/CanvasRenderer.html">CanvasRenderer</a></li>
<li><a href="..&#x2F;classes/DisplayObject.html">DisplayObject</a></li>
<li><a href="..&#x2F;classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
<li><a href="..&#x2F;classes/MovieClip.html">MovieClip</a></li>
<li><a href="..&#x2F;classes/Point.html">Point</a></li>
<li><a href="..&#x2F;classes/Rectangle.html">Rectangle</a></li>
<li><a href="..&#x2F;classes/Sprite.html">Sprite</a></li>
<li><a href="..&#x2F;classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
<li><a href="..&#x2F;classes/Stage.html">Stage</a></li>
<li><a href="..&#x2F;classes/Texture.html">Texture</a></li>
<li><a href="..&#x2F;classes/WebGLBatch.html">WebGLBatch</a></li>
<li><a href="..&#x2F;classes/WebGLRenderer.html">WebGLRenderer</a></li>
</ul>
<ul id="api-modules" class="apis modules">
<li><a href="..&#x2F;modules/PIXI.html">PIXI</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="yui3-u-3-4">
<div id="api-options">
Show:
<label for="api-show-inherited">
<input type="checkbox" id="api-show-inherited" checked>
Inherited
</label>
<label for="api-show-protected">
<input type="checkbox" id="api-show-protected">
Protected
</label>
<label for="api-show-private">
<input type="checkbox" id="api-show-private">
Private
</label>
<label for="api-show-deprecated">
<input type="checkbox" id="api-show-deprecated">
Deprecated
</label>
</div>
<div class="apidocs">
<div id="docs-main">
<div class="content">
<h1 class="file-heading">File: pixi&#x2F;utils&#x2F;Detector.js</h1>
<div class="file">
<pre class="code prettyprint linenums">
&#x2F;**
* @author Mat Groves http:&#x2F;&#x2F;matgroves.com&#x2F;
*&#x2F;
&#x2F;**
* 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
*&#x2F;
PIXI.autoDetectRenderer = function(width, height)
{
if(!width)width = 800;
if(!height)height = 600;
&#x2F;&#x2F; BORROWED from Mr Doob (mrdoob.com)
var webgl = ( function () { try { return !! window.WebGLRenderingContext &amp;&amp; !! document.createElement( &#x27;canvas&#x27; ).getContext( &#x27;experimental-webgl&#x27; ); } catch( e ) { return false; } } )()
&#x2F;&#x2F;console.log(webgl);
if( webgl )
{
return new PIXI.WebGLRenderer(width, height)
}
return new PIXI.CanvasRenderer(width, height);
}
</pre>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="..&#x2F;assets/vendor/prettify/prettify-min.js"></script>
<script>prettyPrint();</script>
<script src="..&#x2F;assets/js/yui-prettify.js"></script>
<script src="..&#x2F;assets/../api.js"></script>
<script src="..&#x2F;assets/js/api-filter.js"></script>
<script src="..&#x2F;assets/js/api-list.js"></script>
<script src="..&#x2F;assets/js/api-search.js"></script>
<script src="..&#x2F;assets/js/apidocs.js"></script>
</body>
</html>

View file

@ -0,0 +1,184 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>pixi&#x2F;utils&#x2F;EventTarget.js - The Foo API</title>
<link rel="stylesheet" href="http:&#x2F;&#x2F;yui.yahooapis.com&#x2F;3.8.0pr2&#x2F;build&#x2F;cssgrids&#x2F;cssgrids-min.css">
<link rel="stylesheet" href="..&#x2F;assets/vendor/prettify/prettify-min.css">
<link rel="stylesheet" href="..&#x2F;assets/css/main.css" id="site_styles">
<link rel="shortcut icon" type="image/png" href="..&#x2F;assets/favicon.png">
<script src="http:&#x2F;&#x2F;yui.yahooapis.com&#x2F;combo?3.8.0pr2&#x2F;build&#x2F;yui&#x2F;yui-min.js"></script>
</head>
<body class="yui3-skin-sam">
<div id="doc">
<div id="hd" class="yui3-g header">
<div class="yui3-u-3-4">
<h1><img src="..&#x2F;assets/css/logo.png" title="The Foo API"></h1>
</div>
<div class="yui3-u-1-4 version">
<em>API Docs for: 1.2.1</em>
</div>
</div>
<div id="bd" class="yui3-g">
<div class="yui3-u-1-4">
<div id="docs-sidebar" class="sidebar apidocs">
<div id="api-list">
<h2 class="off-left">APIs</h2>
<div id="api-tabview" class="tabview">
<ul class="tabs">
<li><a href="#api-classes">Classes</a></li>
<li><a href="#api-modules">Modules</a></li>
</ul>
<div id="api-tabview-filter">
<input type="search" id="api-filter" placeholder="Type to filter APIs">
</div>
<div id="api-tabview-panel">
<ul id="api-classes" class="apis classes">
<li><a href="..&#x2F;classes/AssetLoader.html">AssetLoader</a></li>
<li><a href="..&#x2F;classes/BaseTexture.html">BaseTexture</a></li>
<li><a href="..&#x2F;classes/CanvasRenderer.html">CanvasRenderer</a></li>
<li><a href="..&#x2F;classes/DisplayObject.html">DisplayObject</a></li>
<li><a href="..&#x2F;classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
<li><a href="..&#x2F;classes/MovieClip.html">MovieClip</a></li>
<li><a href="..&#x2F;classes/Point.html">Point</a></li>
<li><a href="..&#x2F;classes/Rectangle.html">Rectangle</a></li>
<li><a href="..&#x2F;classes/Sprite.html">Sprite</a></li>
<li><a href="..&#x2F;classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
<li><a href="..&#x2F;classes/Stage.html">Stage</a></li>
<li><a href="..&#x2F;classes/Texture.html">Texture</a></li>
<li><a href="..&#x2F;classes/WebGLBatch.html">WebGLBatch</a></li>
<li><a href="..&#x2F;classes/WebGLRenderer.html">WebGLRenderer</a></li>
</ul>
<ul id="api-modules" class="apis modules">
<li><a href="..&#x2F;modules/PIXI.html">PIXI</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="yui3-u-3-4">
<div id="api-options">
Show:
<label for="api-show-inherited">
<input type="checkbox" id="api-show-inherited" checked>
Inherited
</label>
<label for="api-show-protected">
<input type="checkbox" id="api-show-protected">
Protected
</label>
<label for="api-show-private">
<input type="checkbox" id="api-show-private">
Private
</label>
<label for="api-show-deprecated">
<input type="checkbox" id="api-show-deprecated">
Deprecated
</label>
</div>
<div class="apidocs">
<div id="docs-main">
<div class="content">
<h1 class="file-heading">File: pixi&#x2F;utils&#x2F;EventTarget.js</h1>
<div class="file">
<pre class="code prettyprint linenums">
&#x2F;**
* https:&#x2F;&#x2F;github.com&#x2F;mrdoob&#x2F;eventtarget.js&#x2F;
* THankS mr DOob!
*&#x2F;
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 );
}
};
};
</pre>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="..&#x2F;assets/vendor/prettify/prettify-min.js"></script>
<script>prettyPrint();</script>
<script src="..&#x2F;assets/js/yui-prettify.js"></script>
<script src="..&#x2F;assets/../api.js"></script>
<script src="..&#x2F;assets/js/api-filter.js"></script>
<script src="..&#x2F;assets/js/api-list.js"></script>
<script src="..&#x2F;assets/js/api-search.js"></script>
<script src="..&#x2F;assets/js/apidocs.js"></script>
</body>
</html>

View file

@ -0,0 +1,182 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>pixi&#x2F;utils&#x2F;Utils.js - The Foo API</title>
<link rel="stylesheet" href="http:&#x2F;&#x2F;yui.yahooapis.com&#x2F;3.8.0pr2&#x2F;build&#x2F;cssgrids&#x2F;cssgrids-min.css">
<link rel="stylesheet" href="..&#x2F;assets/vendor/prettify/prettify-min.css">
<link rel="stylesheet" href="..&#x2F;assets/css/main.css" id="site_styles">
<link rel="shortcut icon" type="image/png" href="..&#x2F;assets/favicon.png">
<script src="http:&#x2F;&#x2F;yui.yahooapis.com&#x2F;combo?3.8.0pr2&#x2F;build&#x2F;yui&#x2F;yui-min.js"></script>
</head>
<body class="yui3-skin-sam">
<div id="doc">
<div id="hd" class="yui3-g header">
<div class="yui3-u-3-4">
<h1><img src="..&#x2F;assets/css/logo.png" title="The Foo API"></h1>
</div>
<div class="yui3-u-1-4 version">
<em>API Docs for: 1.2.1</em>
</div>
</div>
<div id="bd" class="yui3-g">
<div class="yui3-u-1-4">
<div id="docs-sidebar" class="sidebar apidocs">
<div id="api-list">
<h2 class="off-left">APIs</h2>
<div id="api-tabview" class="tabview">
<ul class="tabs">
<li><a href="#api-classes">Classes</a></li>
<li><a href="#api-modules">Modules</a></li>
</ul>
<div id="api-tabview-filter">
<input type="search" id="api-filter" placeholder="Type to filter APIs">
</div>
<div id="api-tabview-panel">
<ul id="api-classes" class="apis classes">
<li><a href="..&#x2F;classes/AssetLoader.html">AssetLoader</a></li>
<li><a href="..&#x2F;classes/BaseTexture.html">BaseTexture</a></li>
<li><a href="..&#x2F;classes/CanvasRenderer.html">CanvasRenderer</a></li>
<li><a href="..&#x2F;classes/DisplayObject.html">DisplayObject</a></li>
<li><a href="..&#x2F;classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
<li><a href="..&#x2F;classes/MovieClip.html">MovieClip</a></li>
<li><a href="..&#x2F;classes/Point.html">Point</a></li>
<li><a href="..&#x2F;classes/Rectangle.html">Rectangle</a></li>
<li><a href="..&#x2F;classes/Sprite.html">Sprite</a></li>
<li><a href="..&#x2F;classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
<li><a href="..&#x2F;classes/Stage.html">Stage</a></li>
<li><a href="..&#x2F;classes/Texture.html">Texture</a></li>
<li><a href="..&#x2F;classes/WebGLBatch.html">WebGLBatch</a></li>
<li><a href="..&#x2F;classes/WebGLRenderer.html">WebGLRenderer</a></li>
</ul>
<ul id="api-modules" class="apis modules">
<li><a href="..&#x2F;modules/PIXI.html">PIXI</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="yui3-u-3-4">
<div id="api-options">
Show:
<label for="api-show-inherited">
<input type="checkbox" id="api-show-inherited" checked>
Inherited
</label>
<label for="api-show-protected">
<input type="checkbox" id="api-show-protected">
Protected
</label>
<label for="api-show-private">
<input type="checkbox" id="api-show-private">
Private
</label>
<label for="api-show-deprecated">
<input type="checkbox" id="api-show-deprecated">
Deprecated
</label>
</div>
<div class="apidocs">
<div id="docs-main">
<div class="content">
<h1 class="file-heading">File: pixi&#x2F;utils&#x2F;Utils.js</h1>
<div class="file">
<pre class="code prettyprint linenums">
&#x2F;**
* Provides requestAnimationFrame in a cross browser way.
*&#x2F;
window.requestAnimFrame = (function() {
return window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame ||
window.oRequestAnimationFrame ||
window.msRequestAnimationFrame ||
function(&#x2F;* function FrameRequestCallback *&#x2F; callback, &#x2F;* DOMElement Element *&#x2F; element) {
window.setTimeout(callback, 1000&#x2F;60);
};
})();
var AjaxRequest = function()
{
var activexmodes = [&quot;Msxml2.XMLHTTP&quot;, &quot;Microsoft.XMLHTTP&quot;] &#x2F;&#x2F;activeX versions to check for in IE
if (window.ActiveXObject)
{ &#x2F;&#x2F;Test for support for ActiveXObject in IE first (as XMLHttpRequest in IE7 is broken)
for (var i=0; i&lt;activexmodes.length; i++)
{
try{
return new ActiveXObject(activexmodes[i])
}
catch(e){
&#x2F;&#x2F;suppress error
}
}
}
else if (window.XMLHttpRequest) &#x2F;&#x2F; if Mozilla, Safari etc
{
return new XMLHttpRequest()
}
else
{
return false;
}
}
</pre>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="..&#x2F;assets/vendor/prettify/prettify-min.js"></script>
<script>prettyPrint();</script>
<script src="..&#x2F;assets/js/yui-prettify.js"></script>
<script src="..&#x2F;assets/../api.js"></script>
<script src="..&#x2F;assets/js/api-filter.js"></script>
<script src="..&#x2F;assets/js/api-list.js"></script>
<script src="..&#x2F;assets/js/api-search.js"></script>
<script src="..&#x2F;assets/js/apidocs.js"></script>
</body>
</html>

150
docs/index.html Normal file
View file

@ -0,0 +1,150 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>The Foo API</title>
<link rel="stylesheet" href="http:&#x2F;&#x2F;yui.yahooapis.com&#x2F;3.8.0pr2&#x2F;build&#x2F;cssgrids&#x2F;cssgrids-min.css">
<link rel="stylesheet" href=".&#x2F;assets/vendor/prettify/prettify-min.css">
<link rel="stylesheet" href=".&#x2F;assets/css/main.css" id="site_styles">
<link rel="shortcut icon" type="image/png" href=".&#x2F;assets/favicon.png">
<script src="http:&#x2F;&#x2F;yui.yahooapis.com&#x2F;combo?3.8.0pr2&#x2F;build&#x2F;yui&#x2F;yui-min.js"></script>
</head>
<body class="yui3-skin-sam">
<div id="doc">
<div id="hd" class="yui3-g header">
<div class="yui3-u-3-4">
<h1><img src=".&#x2F;assets/css/logo.png" title="The Foo API"></h1>
</div>
<div class="yui3-u-1-4 version">
<em>API Docs for: 1.2.1</em>
</div>
</div>
<div id="bd" class="yui3-g">
<div class="yui3-u-1-4">
<div id="docs-sidebar" class="sidebar apidocs">
<div id="api-list">
<h2 class="off-left">APIs</h2>
<div id="api-tabview" class="tabview">
<ul class="tabs">
<li><a href="#api-classes">Classes</a></li>
<li><a href="#api-modules">Modules</a></li>
</ul>
<div id="api-tabview-filter">
<input type="search" id="api-filter" placeholder="Type to filter APIs">
</div>
<div id="api-tabview-panel">
<ul id="api-classes" class="apis classes">
<li><a href=".&#x2F;classes/AssetLoader.html">AssetLoader</a></li>
<li><a href=".&#x2F;classes/BaseTexture.html">BaseTexture</a></li>
<li><a href=".&#x2F;classes/CanvasRenderer.html">CanvasRenderer</a></li>
<li><a href=".&#x2F;classes/DisplayObject.html">DisplayObject</a></li>
<li><a href=".&#x2F;classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
<li><a href=".&#x2F;classes/MovieClip.html">MovieClip</a></li>
<li><a href=".&#x2F;classes/Point.html">Point</a></li>
<li><a href=".&#x2F;classes/Rectangle.html">Rectangle</a></li>
<li><a href=".&#x2F;classes/Sprite.html">Sprite</a></li>
<li><a href=".&#x2F;classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
<li><a href=".&#x2F;classes/Stage.html">Stage</a></li>
<li><a href=".&#x2F;classes/Texture.html">Texture</a></li>
<li><a href=".&#x2F;classes/WebGLBatch.html">WebGLBatch</a></li>
<li><a href=".&#x2F;classes/WebGLRenderer.html">WebGLRenderer</a></li>
</ul>
<ul id="api-modules" class="apis modules">
<li><a href=".&#x2F;modules/PIXI.html">PIXI</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="yui3-u-3-4">
<div id="api-options">
Show:
<label for="api-show-inherited">
<input type="checkbox" id="api-show-inherited" checked>
Inherited
</label>
<label for="api-show-protected">
<input type="checkbox" id="api-show-protected">
Protected
</label>
<label for="api-show-private">
<input type="checkbox" id="api-show-private">
Private
</label>
<label for="api-show-deprecated">
<input type="checkbox" id="api-show-deprecated">
Deprecated
</label>
</div>
<div class="apidocs">
<div id="docs-main">
<div class="content">
<div class="apidocs">
<div id="docs-main" class="content">
<p>
Browse to a module or class using the sidebar to view its API documentation.
</p>
<h2>Keyboard Shortcuts</h2>
<ul>
<li><p>Press <kbd>s</kbd> to focus the API search box.</p></li>
<li><p>Use <kbd>Up</kbd> and <kbd>Down</kbd> to select classes, modules, and search results.</p></li>
<li class="mac-only"><p>With the API search box or sidebar focused, use <kbd><span class="cmd">&#x2318;</span>-Left</kbd> or <kbd><span class="cmd">&#x2318;</span>-Right</kbd> to switch sidebar tabs.</p></li>
<li class="pc-only"><p>With the API search box or sidebar focused, use <kbd>Ctrl+Left</kbd> and <kbd>Ctrl+Right</kbd> to switch sidebar tabs.</p></li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src=".&#x2F;assets/vendor/prettify/prettify-min.js"></script>
<script>prettyPrint();</script>
<script src=".&#x2F;assets/js/yui-prettify.js"></script>
<script src=".&#x2F;assets/../api.js"></script>
<script src=".&#x2F;assets/js/api-filter.js"></script>
<script src=".&#x2F;assets/js/api-list.js"></script>
<script src=".&#x2F;assets/js/api-search.js"></script>
<script src=".&#x2F;assets/js/apidocs.js"></script>
</body>
</html>

251
docs/modules/PIXI.html Normal file
View file

@ -0,0 +1,251 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>PIXI - The Foo API</title>
<link rel="stylesheet" href="http:&#x2F;&#x2F;yui.yahooapis.com&#x2F;3.8.0pr2&#x2F;build&#x2F;cssgrids&#x2F;cssgrids-min.css">
<link rel="stylesheet" href="..&#x2F;assets/vendor/prettify/prettify-min.css">
<link rel="stylesheet" href="..&#x2F;assets/css/main.css" id="site_styles">
<link rel="shortcut icon" type="image/png" href="..&#x2F;assets/favicon.png">
<script src="http:&#x2F;&#x2F;yui.yahooapis.com&#x2F;combo?3.8.0pr2&#x2F;build&#x2F;yui&#x2F;yui-min.js"></script>
</head>
<body class="yui3-skin-sam">
<div id="doc">
<div id="hd" class="yui3-g header">
<div class="yui3-u-3-4">
<h1><img src="..&#x2F;assets/css/logo.png" title="The Foo API"></h1>
</div>
<div class="yui3-u-1-4 version">
<em>API Docs for: 1.2.1</em>
</div>
</div>
<div id="bd" class="yui3-g">
<div class="yui3-u-1-4">
<div id="docs-sidebar" class="sidebar apidocs">
<div id="api-list">
<h2 class="off-left">APIs</h2>
<div id="api-tabview" class="tabview">
<ul class="tabs">
<li><a href="#api-classes">Classes</a></li>
<li><a href="#api-modules">Modules</a></li>
</ul>
<div id="api-tabview-filter">
<input type="search" id="api-filter" placeholder="Type to filter APIs">
</div>
<div id="api-tabview-panel">
<ul id="api-classes" class="apis classes">
<li><a href="..&#x2F;classes/AssetLoader.html">AssetLoader</a></li>
<li><a href="..&#x2F;classes/BaseTexture.html">BaseTexture</a></li>
<li><a href="..&#x2F;classes/CanvasRenderer.html">CanvasRenderer</a></li>
<li><a href="..&#x2F;classes/DisplayObject.html">DisplayObject</a></li>
<li><a href="..&#x2F;classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
<li><a href="..&#x2F;classes/MovieClip.html">MovieClip</a></li>
<li><a href="..&#x2F;classes/Point.html">Point</a></li>
<li><a href="..&#x2F;classes/Rectangle.html">Rectangle</a></li>
<li><a href="..&#x2F;classes/Sprite.html">Sprite</a></li>
<li><a href="..&#x2F;classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
<li><a href="..&#x2F;classes/Stage.html">Stage</a></li>
<li><a href="..&#x2F;classes/Texture.html">Texture</a></li>
<li><a href="..&#x2F;classes/WebGLBatch.html">WebGLBatch</a></li>
<li><a href="..&#x2F;classes/WebGLRenderer.html">WebGLRenderer</a></li>
</ul>
<ul id="api-modules" class="apis modules">
<li><a href="..&#x2F;modules/PIXI.html">PIXI</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="yui3-u-3-4">
<div id="api-options">
Show:
<label for="api-show-inherited">
<input type="checkbox" id="api-show-inherited" checked>
Inherited
</label>
<label for="api-show-protected">
<input type="checkbox" id="api-show-protected">
Protected
</label>
<label for="api-show-private">
<input type="checkbox" id="api-show-private">
Private
</label>
<label for="api-show-deprecated">
<input type="checkbox" id="api-show-deprecated">
Deprecated
</label>
</div>
<div class="apidocs">
<div id="docs-main">
<div class="content">
<h1>PIXI Module</h1>
<div class="box clearfix meta">
<div class="foundat">
Defined in: <a href="..&#x2F;files&#x2F;pixi_Stage.js.html#l5"><code>pixi&#x2F;Stage.js:5</code></a>
</div>
</div>
<div class="box intro">
</div>
<div class="yui3-g">
<div class="yui3-u-1-2">
<p>This module provides the following classes:</p>
<ul class="module-classes">
<li class="module-class">
<a href="..&#x2F;classes/AssetLoader.html">
AssetLoader
</a>
</li>
<li class="module-class">
<a href="..&#x2F;classes/BaseTexture.html">
BaseTexture
</a>
</li>
<li class="module-class">
<a href="..&#x2F;classes/CanvasRenderer.html">
CanvasRenderer
</a>
</li>
<li class="module-class">
<a href="..&#x2F;classes/DisplayObject.html">
DisplayObject
</a>
</li>
<li class="module-class">
<a href="..&#x2F;classes/DisplayObjectContainer.html">
DisplayObjectContainer
</a>
</li>
<li class="module-class">
<a href="..&#x2F;classes/MovieClip.html">
MovieClip
</a>
</li>
<li class="module-class">
<a href="..&#x2F;classes/Point.html">
Point
</a>
</li>
<li class="module-class">
<a href="..&#x2F;classes/Rectangle.html">
Rectangle
</a>
</li>
<li class="module-class">
<a href="..&#x2F;classes/Sprite.html">
Sprite
</a>
</li>
<li class="module-class">
<a href="..&#x2F;classes/SpriteSheetLoader.html">
SpriteSheetLoader
</a>
</li>
<li class="module-class">
<a href="..&#x2F;classes/Stage.html">
Stage
</a>
</li>
<li class="module-class">
<a href="..&#x2F;classes/Texture.html">
Texture
</a>
</li>
<li class="module-class">
<a href="..&#x2F;classes/WebGLBatch.html">
WebGLBatch
</a>
</li>
<li class="module-class">
<a href="..&#x2F;classes/WebGLRenderer.html">
WebGLRenderer
</a>
</li>
</ul>
</div>
<div class="yui3-u-1-2">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="..&#x2F;assets/vendor/prettify/prettify-min.js"></script>
<script>prettyPrint();</script>
<script src="..&#x2F;assets/js/yui-prettify.js"></script>
<script src="..&#x2F;assets/../api.js"></script>
<script src="..&#x2F;assets/js/api-filter.js"></script>
<script src="..&#x2F;assets/js/api-list.js"></script>
<script src="..&#x2F;assets/js/api-search.js"></script>
<script src="..&#x2F;assets/js/apidocs.js"></script>
</body>
</html>

10
docs/modules/index.html Normal file
View file

@ -0,0 +1,10 @@
<!doctype html>
<html>
<head>
<title>Redirector</title>
<meta http-equiv="refresh" content="0;url=../">
</head>
<body>
<a href="../">Click here to redirect</a>
</body>
</html>

View file

@ -3,6 +3,7 @@ body{
border: 0; border: 0;
margin: 0; margin: 0;
} }
.counter { .counter {
background: #ccc; background: #ccc;
width: 74px; width: 74px;
@ -19,3 +20,15 @@ body{
} }
#pixi {
background: #ccc;
width: 204px;
height: 100px;
background-color:#105CB6;
color:#0ff;
position:absolute;
font-family: Helvetica, Arial;
font-size: 9px;
font-weight: bold;
}

View file

@ -9,9 +9,10 @@
<link rel="stylesheet" href="css/main.css"> <link rel="stylesheet" href="css/main.css">
</head> </head>
<body> <body>
<div id="pixi">Click to add more bunnys! Let me know how many you get on screen here @doormat23</div>
<script src="js/vendor/jquery-1.8.3.min.js"></script> <script src="js/vendor/jquery-1.8.3.min.js"></script>
<script src="js/stats.min.js"></script> <script src="js/stats.min.js"></script>
<script src="js/pixi.min.js"></script> <script src="js/pixi.js"></script>
<script src="js/bunnyBenchMark.js"></script> <script src="js/bunnyBenchMark.js"></script>
</body> </body>
</html> </html>

View file

@ -22,18 +22,13 @@ var isAdding = false;
var count = 0; var count = 0;
var container; var container;
var detail;
function onReady() 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 = PIXI.autoDetectRenderer();
{
renderer = new PIXI.WebGLRenderer();
}
else
{
renderer = new PIXI.CanvasRenderer(480, 320);
}
stage = new PIXI.Stage; stage = new PIXI.Stage;
@ -46,7 +41,7 @@ function onReady()
stats.domElement.style.top = "0px"; stats.domElement.style.top = "0px";
requestAnimFrame(update); requestAnimFrame(update);
wabbitTexture = new PIXI.Texture("wabbit.png") wabbitTexture = new PIXI.Texture.fromImage("wabbit.png")
counter = document.createElement("div"); counter = document.createElement("div");
counter.className = "counter"; counter.className = "counter";
@ -55,7 +50,6 @@ function onReady()
count = startBunnyCount; count = startBunnyCount;
counter.innerHTML = count + " BUNNIES"; counter.innerHTML = count + " BUNNIES";
container = new PIXI.DisplayObjectContainer(); container = new PIXI.DisplayObjectContainer();
stage.addChild(container); stage.addChild(container);
@ -114,7 +108,9 @@ function resize()
minX = 0; minX = 0;
maxY = height; maxY = height;
minY = 0; minY = 0;
detail.style.left = width - 204 + "px";
detail.style.top = height - 100 + "px";
renderer.resize(width, height); renderer.resize(width, height);
} }
@ -126,17 +122,17 @@ function update()
{ {
// add 10 at a time :) // 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.speedX = Math.random() * 10;
bunny.speedY = (Math.random() * 10) - 5; bunny.speedY = (Math.random() * 10) - 5;
bunny.anchor.x = 0.5; bunny.anchor.x = 0.5;
bunny.anchor.y = 1; bunny.anchor.y = 1;
bunny.alpha = 0.3 + Math.random() * 0.7; //bunny.alpha = 0.3 + Math.random() * 0.7;
bunnys.push(bunny); bunnys.push(bunny);
bunny.rotation = Math.random() - 0.5; //bunny.rotation = Math.random() - 0.5;
container.addChild(bunny); container.addChild(bunny);
count++; count++;

View file

@ -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<b.length;c++)try{return new ActiveXObject(b[c])}catch(f){}else return window.XMLHttpRequest?new XMLHttpRequest:!1};PIXI=PIXI||{};PIXI.EventTarget=function(){var b={};this.addEventListener=function(c,f){void 0===b[c]&&(b[c]=[]);-1===b[c].indexOf(f)&&b[c].push(f)};this.dispatchEvent=function(c){for(var f in b[c.type])b[c.type][f](c)};this.removeEventListener=function(c,f){var e=b[c].indexOf(f);-1!==e&&b[c].splice(e,1)}};(function(b,c){"object"===typeof exports?module.exports=c(global):"function"===typeof define&&define.amd?define([],function(){return c(b)}):c(b)})(this,function(b){function c(a){return k=a}function f(){return k="undefined"!==typeof Float32Array?Float32Array:Array}var e={};if("undefined"!=typeof Float32Array){var g=new Float32Array(1),h=new Int32Array(g.buffer);e.invsqrt=function(a){g[0]=a;h[0]=1597463007-(h[0]>>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)}1<j[3]?j[3]=1:-1>j[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(0<b)c=Math.sqrt(b+1),d[3]=0.5*c,c=0.5/c,d[0]=(a[7]-a[5])*c,d[1]=(a[2]-a[6])*c,d[2]=(a[3]-a[1])*c;else{c=m.fromRotationMatrix.s_iNext=m.fromRotationMatrix.s_iNext||[1,2,0];b=0;a[4]>a[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];0<b?(d[3]=2*Math.acos(a[3]),b=e.invsqrt(b),d[0]=a[0]*b,d[1]=a[1]*b,d[2]=a[2]*b):(d[3]=0,d[0]=1,d[1]=0,d[2]=0);return d};m.str=function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"};var M={create:function(a){var d=new k(2);a?(d[0]=a[0],d[1]=a[1]):(d[0]=0,d[1]=0);return d},createFrom:function(a,d){var b=new k(2);b[0]=a;b[1]=d;return b},add:function(a,b,c){c||(c=b);c[0]=a[0]+b[0];c[1]=a[1]+b[1];return c},subtract:function(a,
b,c){c||(c=b);c[0]=a[0]-b[0];c[1]=a[1]-b[1];return c},multiply:function(a,b,c){c||(c=b);c[0]=a[0]*b[0];c[1]=a[1]*b[1];return c},divide:function(a,b,c){c||(c=b);c[0]=a[0]/b[0];c[1]=a[1]/b[1];return c},scale:function(a,b,c){c||(c=a);c[0]=a[0]*b;c[1]=a[1]*b;return c},dist:function(a,b){var c=b[0]-a[0],e=b[1]-a[1];return Math.sqrt(c*c+e*e)},set:function(a,b){b[0]=a[0];b[1]=a[1];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])},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<c?(c=Math.sqrt(c),b[0]=a[0]/c,b[1]=a[1]/c):b[0]=b[1]=0;return b},cross:function(a,b,c){a=a[0]*b[1]-a[1]*b[0];if(!c)return a;c[0]=c[1]=0;c[2]=a;return c},length:function(a){var b=a[0];a=a[1];return Math.sqrt(b*b+a*a)},squaredLength:function(a){var b=a[0];a=a[1];return b*b+a*a},dot:function(a,b){return a[0]*b[0]+a[1]*b[1]},direction:function(a,b,c){c||(c=a);var e=a[0]-b[0];a=a[1]-b[1];b=e*e+a*a;if(!b)return c[0]=
0,c[1]=0,c[2]=0,c;b=1/Math.sqrt(b);c[0]=e*b;c[1]=a*b;return c},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]);return e},str:function(a){return"["+a[0]+", "+a[1]+"]"}},L={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]=b[1]=b[2]=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},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=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;e<c.length;e++)f+=c[e];e=b.createShader(b.VERTEX_SHADER);b.shaderSource(e,f);b.compileShader(e);return!b.getShaderParameter(e,b.COMPILE_STATUS)?(alert(b.getShaderInfoLog(e)),null):e};PIXI.CompileFragmentShader=function(b,c){for(var f="",e=0;e<c.length;e++)f+=c[e];e=b.createShader(b.FRAGMENT_SHADER);b.shaderSource(e,f);b.compileShader(e);return!b.getShaderParameter(e,b.COMPILE_STATUS)?(alert(b.getShaderInfoLog(e)),null):e};PIXI=PIXI||{};PIXI._defaultFrame=new PIXI.Rectangle(0,0,1,1);
PIXI.WebGLRenderer=function(b,c){this.width=b?b:800;this.height=c?c:600;this.view=document.createElement("canvas");this.view.width=this.width;this.view.height=this.height;this.view.background="#FF0000";var f=this;this.view.addEventListener("webglcontextlost",function(b){f.handleContextLost(b)},!1);this.view.addEventListener("webglcontextrestored",function(b){f.handleContextRestored(b)},!1);this.batchs=[];try{this.gl=this.view.getContext("experimental-webgl",{alpha:!1})}catch(e){throw Error(" This browser does not support webGL. Try using the canvas renderer"+
this);}this.initShaders();var g=this.gl;this.batch=new PIXI.WebGLBatch(g);g.disable(g.DEPTH_TEST);g.enable(g.BLEND);g.colorMask(!0,!0,!0,!1);this.projectionMatrix=mat4.create();this.resize(this.width,this.height);this.contextLost=!1};PIXI.WebGLRenderer.constructor=PIXI.WebGLRenderer;
PIXI.WebGLRenderer.prototype.initShaders=function(){var b=this.gl,c=PIXI.CompileFragmentShader(b,PIXI.shaderFragmentSrc),f=PIXI.CompileVertexShader(b,PIXI.shaderVertexSrc),e=this.shaderProgram=b.createProgram();b.attachShader(e,f);b.attachShader(e,c);b.linkProgram(e);b.getProgramParameter(e,b.LINK_STATUS)||alert("Could not initialise shaders");b.useProgram(e);e.vertexPositionAttribute=b.getAttribLocation(e,"aVertexPosition");b.enableVertexAttribArray(e.vertexPositionAttribute);e.textureCoordAttribute=
b.getAttribLocation(e,"aTextureCoord");b.enableVertexAttribArray(e.textureCoordAttribute);e.colorAttribute=b.getAttribLocation(e,"aColor");b.enableVertexAttribArray(e.colorAttribute);e.mvMatrixUniform=b.getUniformLocation(e,"uMVMatrix");e.samplerUniform=b.getUniformLocation(e,"uSampler");PIXI.shaderProgram=this.shaderProgram};
PIXI.WebGLRenderer.prototype.checkVisibility=function(b){b=b.children;for(var c=0;c<b.length;c++){var f=b[c];f.textureChange&&(f.textureChange=!1,f.visible&&(this.removeDisplayObject(f),this.addDisplayObject(f)));f.cacheVisible!=f.visible?((f.cacheVisible=f.visible)?this.addDisplayObject(f):this.removeDisplayObject(f),this.setGLVisible(f,f.visible)):0<f.children.length&&this.checkVisibility(f)}};
PIXI.WebGLRenderer.prototype.setGLVisible=function(b,c){for(var f=b.children,e=0;e<f.length;e++){var g=f[e];c?this.addDisplayObject(g):this.removeDisplayObject(g);0<g.children.length&&this.setGLVisible(g,c)}};
PIXI.WebGLRenderer.prototype.render=function(b){if(!this.contextLost){for(var c=0;c<b.__childrenRemoved.length;c++)this.removeDisplayObject(b.__childrenRemoved[c]);for(c=0;c<b.__childrenAdded.length;c++)this.addDisplayObject(b.__childrenAdded[c]);for(c=0;c<PIXI.texturesToUpdate.length;c++)this.updateTexture(PIXI.texturesToUpdate[c]);b.__childrenRemoved=[];b.__childrenAdded=[];PIXI.texturesToUpdate=[];this.checkVisibility(b);b.updateTransform();c=this.gl;c.clear(c.COLOR_BUFFER_BIT);c.clearColor(1,
1,1,1);c.blendFunc(c.ONE,c.ONE_MINUS_SRC_ALPHA);c.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform,!1,this.projectionMatrix);for(c=0;c<this.batchs.length;c++)b=this.batchs[c],b instanceof PIXI.WebGLBatch?this.batchs[c].render():b instanceof PIXI.Strip&&b.visible&&this.renderStrip(b)}};
PIXI.WebGLRenderer.prototype.updateTexture=function(b){var c=this.gl;b._glTexture||(b._glTexture=c.createTexture());b.hasLoaded&&(c.bindTexture(c.TEXTURE_2D,b._glTexture),c.pixelStorei(c.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),c.texImage2D(c.TEXTURE_2D,0,c.RGBA,c.RGBA,c.UNSIGNED_BYTE,b.image),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MAG_FILTER,c.LINEAR),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MIN_FILTER,c.LINEAR),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_S,c.CLAMP_TO_EDGE),c.texParameteri(c.TEXTURE_2D,
c.TEXTURE_WRAP_T,c.CLAMP_TO_EDGE),c.bindTexture(c.TEXTURE_2D,null));this.refreshBatchs=!0};
PIXI.WebGLRenderer.prototype.addDisplayObject=function(b){if(b.stage&&(b.cacheVisible=b.visible))if(b.batch=null,b.renderable){b.__inWebGL=!0;var c=b;do{if(0==c.childIndex)c=c.parent;else for(c=c.parent.children[c.childIndex-1];0!=c.children.length;)c=c.children[c.children.length-1];if(c==b.stage)break}while(!c.renderable||!c.__inWebGL);var f=b;do{if(0==f.children.length){for(;f.childIndex==f.parent.children.length-1;)if(f=f.parent,f==b.stage){f=null;break}f&&(f=f.parent.children[f.childIndex+1])}else f=
f.children[0];if(!f)break}while(!f.renderable||!f.__inWebGL);if(b instanceof PIXI.Sprite){var e;if(c instanceof PIXI.Sprite){if((e=c.batch)&&e.texture==b.texture.baseTexture&&e.blendMode==b.blendMode){e.insertAfter(b,c);return}}else e=c;if(f&&f instanceof PIXI.Sprite&&(c=f.batch)){if(c.texture==b.texture.baseTexture&&c.blendMode==b.blendMode){c.insertBefore(b,f);return}if(c==e){f=e.split(f);c=PIXI._getBatch(this.gl);e=this.batchs.indexOf(e);c.init(b);this.batchs.splice(e+1,0,c,f);return}}c=PIXI._getBatch(this.gl);
c.init(b);e?(e=this.batchs.indexOf(e),this.batchs.splice(e+1,0,c)):this.batchs.push(c)}else b instanceof PIXI.Strip&&(this.initStrip(b),this.batchs.push(b));this.batchUpdate=!0}};
PIXI.WebGLRenderer.prototype.removeDisplayObject=function(b){b.cacheVisible=b.visible;if(b.renderable){var c;if(b instanceof PIXI.Sprite){var f=b.batch;if(!f)return;f.remove(b);0==f.size&&(c=f)}else c=b;c&&(b=this.batchs.indexOf(c),-1!=b&&(!(0==b||b==this.batchs.length-1)&&this.batchs[b-1]instanceof PIXI.WebGLBatch&&this.batchs[b+1]instanceof PIXI.WebGLBatch&&this.batchs[b-1].texture==this.batchs[b+1].texture?(this.batchs[b-1].merge(this.batchs[b+1]),c instanceof PIXI.WebGLBatch&&PIXI._returnBatch(c),
PIXI._returnBatch(this.batchs[b+1]),this.batchs.splice(b,2)):(this.batchs.splice(b,1),c instanceof PIXI.WebGLBatch&&PIXI._returnBatch(c))))}};PIXI.WebGLRenderer.prototype.resize=function(b,c){this.width=b;this.height=c;this.view.width=b;this.view.height=c;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])};
PIXI.WebGLRenderer.prototype.initStrip=function(b){var c=this.gl;b._vertexBuffer=c.createBuffer();b._indexBuffer=c.createBuffer();b._uvBuffer=c.createBuffer();b._colorBuffer=c.createBuffer();c.bindBuffer(c.ARRAY_BUFFER,b._vertexBuffer);c.bufferData(c.ARRAY_BUFFER,b.verticies,c.DYNAMIC_DRAW);c.bindBuffer(c.ARRAY_BUFFER,b._uvBuffer);c.bufferData(c.ARRAY_BUFFER,b.uvs,c.STATIC_DRAW);c.bindBuffer(c.ARRAY_BUFFER,b._colorBuffer);c.bufferData(c.ARRAY_BUFFER,b.colors,c.STATIC_DRAW);c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,
b._indexBuffer);c.bufferData(c.ELEMENT_ARRAY_BUFFER,b.indices,c.STATIC_DRAW)};
PIXI.WebGLRenderer.prototype.renderStrip=function(b){var c=this.gl,f=this.shaderProgram,e=mat3.toMat4(b.worldTransform);mat4.transpose(e);mat4.multiply(this.projectionMatrix,e,e);c.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform,!1,e);b.blendMode==PIXI.blendModes.NORMAL?c.blendFunc(c.ONE,c.ONE_MINUS_SRC_ALPHA):c.blendFunc(c.ONE,c.ONE_MINUS_SRC_COLOR);b.dirty?(b.dirty=!1,c.bindBuffer(c.ARRAY_BUFFER,b._vertexBuffer),c.bufferData(c.ARRAY_BUFFER,b.verticies,c.STATIC_DRAW),c.vertexAttribPointer(f.vertexPositionAttribute,
2,c.FLOAT,!1,0,0),c.bindBuffer(c.ARRAY_BUFFER,b._uvBuffer),c.bufferData(c.ARRAY_BUFFER,b.uvs,c.STATIC_DRAW),c.vertexAttribPointer(f.textureCoordAttribute,2,c.FLOAT,!1,0,0),c.activeTexture(c.TEXTURE0),c.bindTexture(c.TEXTURE_2D,b.texture.baseTexture._glTexture),c.bindBuffer(c.ARRAY_BUFFER,b._colorBuffer),c.bufferData(c.ARRAY_BUFFER,b.colors,c.STATIC_DRAW),c.vertexAttribPointer(f.colorAttribute,1,c.FLOAT,!1,0,0),c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,b._indexBuffer),c.bufferData(c.ELEMENT_ARRAY_BUFFER,
b.indices,c.STATIC_DRAW)):(c.bindBuffer(c.ARRAY_BUFFER,b._vertexBuffer),c.bufferSubData(c.ARRAY_BUFFER,0,b.verticies),c.vertexAttribPointer(f.vertexPositionAttribute,2,c.FLOAT,!1,0,0),c.bindBuffer(c.ARRAY_BUFFER,b._uvBuffer),c.vertexAttribPointer(f.textureCoordAttribute,2,c.FLOAT,!1,0,0),c.activeTexture(c.TEXTURE0),c.bindTexture(c.TEXTURE_2D,b.texture.baseTexture._glTexture),c.bindBuffer(c.ARRAY_BUFFER,b._colorBuffer),c.vertexAttribPointer(f.colorAttribute,1,c.FLOAT,!1,0,0),c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,
b._indexBuffer));c.drawElements(c.TRIANGLE_STRIP,b.indices.length,c.UNSIGNED_SHORT,0);c.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform,!1,this.projectionMatrix)};PIXI.WebGLRenderer.prototype.handleContextLost=function(b){b.preventDefault();this.contextLost=!0};
PIXI.WebGLRenderer.prototype.handleContextRestored=function(){this.gl=this.view.getContext("experimental-webgl",{alpha:!0});this.initShaders();for(var b=0;b<PIXI.TextureCache.length;b++)this.updateTexture(PIXI.TextureCache[b]);for(b=0;b<this.batchs.length;b++)this.batchs[b].restoreLostContext(this.gl),this.batchs[b].dirty=!0;PIXI._restoreBatchs(this.gl);this.contextLost=!1};PIXI=PIXI||{};PIXI._batchs=[];PIXI._getBatch=function(b){return 0==PIXI._batchs.length?new PIXI.WebGLBatch(b):PIXI._batchs.pop()};PIXI._returnBatch=function(b){b.clean();PIXI._batchs.push(b)};PIXI._restoreBatchs=function(b){for(var c=0;c<PIXI._batchs.length;c++)PIXI._batchs[c].restoreLostContext(b)};
PIXI.WebGLBatch=function(b){this.gl=b;this.size=0;this.vertexBuffer=b.createBuffer();this.indexBuffer=b.createBuffer();this.uvBuffer=b.createBuffer();this.colorBuffer=b.createBuffer();this.blendMode=PIXI.blendModes.NORMAL;this.dynamicSize=1};PIXI.WebGLBatch.constructor=PIXI.WebGLBatch;PIXI.WebGLBatch.prototype.clean=function(){this.verticies=[];this.uvs=[];this.indices=[];this.colors=[];this.dynamicSize=1;this.last=this.texture=null;this.size=0;this.head;this.tail};
PIXI.WebGLBatch.prototype.restoreLostContext=function(b){this.gl=b;this.vertexBuffer=b.createBuffer();this.indexBuffer=b.createBuffer();this.uvBuffer=b.createBuffer();this.colorBuffer=b.createBuffer()};PIXI.WebGLBatch.prototype.init=function(b){b.batch=this;this.dirty=!0;this.blendMode=b.blendMode;this.texture=b.texture.baseTexture;this.tail=this.head=b;this.size=1;this.growBatch()};
PIXI.WebGLBatch.prototype.insertBefore=function(b,c){this.size++;b.batch=this;this.dirty=!0;var f=c.__prev;c.__prev=b;b.__next=c;f?(b.__prev=f,f.__next=b):this.head=b};PIXI.WebGLBatch.prototype.insertAfter=function(b,c){this.size++;b.batch=this;this.dirty=!0;var f=c.__next;c.__next=b;b.__prev=c;f?(b.__next=f,f.__prev=b):this.tail=b};
PIXI.WebGLBatch.prototype.remove=function(b){this.size--;0==this.size?(b.__prev=null,b.__next=null):(b.__prev?b.__prev.__next=b.__next:this.head=b.__next,b.__next?b.__next.__prev=b.__prev:this.tail=b.__prev,b.batch=null,b.__next=null,b.__prev=null,this.dirty=!0)};
PIXI.WebGLBatch.prototype.split=function(b){this.dirty=!0;var c=new PIXI.WebGLBatch(this.gl);c.init(b);c.tail=this.tail;this.tail=b.__prev;this.tail.__next=null;b.__prev=null;for(var f=0;b;)f++,b.batch=c,b=b.__next;c.size=f;this.size-=f;return c};PIXI.WebGLBatch.prototype.merge=function(b){this.dirty=!0;this.tail.__next=b.head;b.head.__prev=this.tail;this.size+=b.size;this.tail=b.tail;for(b=b.head;b;)b.batch=this,b=b.__next};
PIXI.WebGLBatch.prototype.growBatch=function(){var b=this.gl;this.dynamicSize=1==this.size?1:1.5*this.size;this.verticies=new Float32Array(8*this.dynamicSize);b.bindBuffer(b.ARRAY_BUFFER,this.vertexBuffer);b.bufferData(b.ARRAY_BUFFER,this.verticies,b.DYNAMIC_DRAW);this.uvs=new Float32Array(8*this.dynamicSize);b.bindBuffer(b.ARRAY_BUFFER,this.uvBuffer);b.bufferData(b.ARRAY_BUFFER,this.uvs,b.DYNAMIC_DRAW);this.dirtyUVS=!0;this.colors=new Float32Array(4*this.dynamicSize);b.bindBuffer(b.ARRAY_BUFFER,
this.colorBuffer);b.bufferData(b.ARRAY_BUFFER,this.colors,b.DYNAMIC_DRAW);this.dirtyColors=!0;this.indices=new Uint16Array(6*this.dynamicSize);for(var c=this.indices.length/6,f=0;f<c;f++){var e=6*f,g=4*f;this.indices[e+0]=g+0;this.indices[e+1]=g+1;this.indices[e+2]=g+2;this.indices[e+3]=g+0;this.indices[e+4]=g+2;this.indices[e+5]=g+3}b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,this.indexBuffer);b.bufferData(b.ELEMENT_ARRAY_BUFFER,this.indices,b.STATIC_DRAW)};
PIXI.WebGLBatch.prototype.refresh=function(){this.dynamicSize<this.size&&this.growBatch();for(var b=0,c,f=this.head;f;){c=8*b;var e=f.texture,g=e.frame,h=e.baseTexture.width,e=e.baseTexture.height;this.uvs[c+0]=g.x/h;this.uvs[c+1]=g.y/e;this.uvs[c+2]=(g.x+g.width)/h;this.uvs[c+3]=g.y/e;this.uvs[c+4]=(g.x+g.width)/h;this.uvs[c+5]=(g.y+g.height)/e;this.uvs[c+6]=g.x/h;this.uvs[c+7]=(g.y+g.height)/e;f.updateFrame=!1;colorIndex=4*b;this.colors[colorIndex]=this.colors[colorIndex+1]=this.colors[colorIndex+
2]=this.colors[colorIndex+3]=f.worldAlpha;f=f.__next;b++}this.dirtyColors=this.dirtyUVS=!0};
PIXI.WebGLBatch.prototype.update=function(){for(var b,c,f,e,g,h,k,l,p,q,C,F=0,u=this.head;u;)c=u.width,f=u.height,e=u.anchor.x,g=u.anchor.y,h=c*(1-e),c*=-e,e=f*(1-g),g=f*-g,f=8*F,b=u.worldTransform,k=b[0],l=b[3],p=b[1],q=b[4],C=b[2],b=b[5],this.verticies[f+0]=k*c+p*g+C,this.verticies[f+1]=q*g+l*c+b,this.verticies[f+2]=k*h+p*g+C,this.verticies[f+3]=q*g+l*h+b,this.verticies[f+4]=k*h+p*e+C,this.verticies[f+5]=q*e+l*h+b,this.verticies[f+6]=k*c+p*e+C,this.verticies[f+7]=q*e+l*c+b,u.updateFrame&&(this.dirtyUVS=
!0,e=u.texture,h=e.frame,c=e.baseTexture.width,e=e.baseTexture.height,this.uvs[f+0]=h.x/c,this.uvs[f+1]=h.y/e,this.uvs[f+2]=(h.x+h.width)/c,this.uvs[f+3]=h.y/e,this.uvs[f+4]=(h.x+h.width)/c,this.uvs[f+5]=(h.y+h.height)/e,this.uvs[f+6]=h.x/c,this.uvs[f+7]=(h.y+h.height)/e,u.updateFrame=!1),u.cacheAlpha!=u.alpha&&(u.cacheAlpha=u.alpha,h=4*F,this.colors[void 0]=this.colors[h+1]=this.colors[h+2]=this.colors[h+3]=u.worldAlpha,this.dirtyColors=!0),F++,u=u.__next};
PIXI.WebGLBatch.prototype.render=function(){this.dirty&&(this.refresh(),this.dirty=!1);if(0!=this.size){this.update();var b=this.gl;this.blendMode==PIXI.blendModes.NORMAL?b.blendFunc(b.ONE,b.ONE_MINUS_SRC_ALPHA):b.blendFunc(b.ONE,b.ONE_MINUS_SRC_COLOR);var c=PIXI.shaderProgram;b.bindBuffer(b.ARRAY_BUFFER,this.vertexBuffer);b.bufferSubData(b.ARRAY_BUFFER,0,this.verticies);b.vertexAttribPointer(c.vertexPositionAttribute,2,b.FLOAT,!1,0,0);b.bindBuffer(b.ARRAY_BUFFER,this.uvBuffer);this.dirtyUVS&&(this.dirtyUVS=
!1,b.bufferSubData(b.ARRAY_BUFFER,0,this.uvs));b.vertexAttribPointer(c.textureCoordAttribute,2,b.FLOAT,!1,0,0);b.activeTexture(b.TEXTURE0);b.bindTexture(b.TEXTURE_2D,this.texture._glTexture);b.bindBuffer(b.ARRAY_BUFFER,this.colorBuffer);this.dirtyColors&&(this.dirtyColors=!1,b.bufferSubData(b.ARRAY_BUFFER,0,this.colors));b.vertexAttribPointer(c.colorAttribute,1,b.FLOAT,!1,0,0);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,this.indexBuffer);b.drawElements(b.TRIANGLES,6*this.size,b.UNSIGNED_SHORT,0)}};PIXI=PIXI||{};PIXI.CanvasRenderer=function(b,c){this.width=b?b:800;this.height=c?c:600;this.refresh=!0;this.view=document.createElement("canvas");this.view.width=this.width;this.view.height=this.height;this.view.background="#FF0000";this.count=0;this.context=this.view.getContext("2d")};PIXI.CanvasRenderer.constructor=PIXI.CanvasRenderer;
PIXI.CanvasRenderer.prototype.render=function(b){b.__childrenAdded=[];b.__childrenRemoved=[];PIXI.texturesToUpdate=[];this.context.setTransform(1,0,0,1,0,0);b.updateTransform();this.context.setTransform(1,0,0,1,0,0);this.context.clearRect(0,0,this.width,this.height);this.renderDisplayObject(b)};PIXI.CanvasRenderer.prototype.resize=function(b,c){this.width=b;this.height=c;this.view.width=b;this.view.height=c};
PIXI.CanvasRenderer.prototype.renderDisplayObject=function(b){var c=b.worldTransform,f=this.context;f.globalCompositeOperation="source-over";if(b.visible){if(b instanceof PIXI.Sprite){var e=b.texture.frame;e&&(f.globalAlpha=b.worldAlpha,0==b.rotation?(this.context.setTransform(1,0,0,1,0,0),f.drawImage(b.texture.baseTexture.image,e.x,e.y,e.width,e.height,c[2]+b.anchor.x*-e.width+0.5|0,c[5]+b.anchor.y*-e.height+0.5|0,e.width*c[0],e.height*c[4])):(f.setTransform(c[0],c[3],c[1],c[4],c[2],c[5]),f.drawImage(b.texture.baseTexture.image,
e.x,e.y,e.width,e.height,b.anchor.x*-e.width,b.anchor.y*-e.height,e.width,e.height)))}else b instanceof PIXI.Strip&&(f.setTransform(c[0],c[3],c[1],c[4],c[2],c[5]),this.renderStrip(b));for(c=0;c<b.children.length;c++)this.renderDisplayObject(b.children[c])}};
PIXI.CanvasRenderer.prototype.renderStripFlat=function(b){var c=this.context;b=b.verticies;var f=b.length/2;this.count++;c.beginPath();for(var e=1;e<f-2;e++){var g=2*e,h=b[g+2],k=b[g+4],l=b[g+3],p=b[g+5];c.moveTo(b[g],b[g+1]);c.lineTo(h,l);c.lineTo(k,p)}c.fillStyle="#FF0000";c.fill();c.closePath()};
PIXI.CanvasRenderer.prototype.renderStrip=function(b){var c=this.context,f=b.verticies,e=b.uvs,g=f.length/2;this.count++;for(var h=1;h<g-2;h++){var k=2*h,l=f[k],p=f[k+2],q=f[k+4],C=f[k+1],F=f[k+3],u=f[k+5],w=e[k]*b.texture.width,x=e[k+2]*b.texture.width,t=e[k+4]*b.texture.width,m=e[k+1]*b.texture.height,H=e[k+3]*b.texture.height,k=e[k+5]*b.texture.height;c.save();c.beginPath();c.moveTo(l,C);c.lineTo(p,F);c.lineTo(q,u);c.closePath();c.clip();var B=w*H+m*t+x*k-H*t-m*x-w*k;c.transform((l*H+m*q+p*k-H*
q-m*p-l*k)/B,(C*H+m*u+F*k-H*u-m*F-C*k)/B,(w*p+l*t+x*q-p*t-l*x-w*q)/B,(w*F+C*t+x*u-F*t-C*x-w*u)/B,(w*H*q+m*p*t+l*x*k-l*H*t-m*x*q-w*p*k)/B,(w*H*u+m*F*t+C*x*k-C*H*t-m*x*u-w*F*k)/B);c.drawImage(b.texture.baseTexture.image,0,0);c.restore()}};PIXI=PIXI||{};PIXI.DisplayObject=function(){this.position=new PIXI.Point;this.scale=new PIXI.Point(1,1);this.rotation=0;this.alpha=1;this.visible=!0;this.stage=this.parent=null;this.worldAlpha=1;this.color=[];this.worldTransform=mat3.identity();this.localTransform=mat3.identity();this.dynamic=!0;this._sr=0;this._cr=1;this.renderable=!1};PIXI.DisplayObject.constructor=PIXI.DisplayObject;
PIXI.DisplayObject.prototype.updateTransform=function(){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;this.localTransform[2]=this.position.x;this.localTransform[5]=this.position.y;mat3.multiply(this.localTransform,this.parent.worldTransform,
this.worldTransform);this.worldAlpha=this.alpha*this.parent.worldAlpha};PIXI=PIXI||{};PIXI.DisplayObjectContainer=function(){PIXI.DisplayObject.call(this);this.children=[];this.renderable=!1};PIXI.DisplayObjectContainer.constructor=PIXI.DisplayObjectContainer;PIXI.DisplayObjectContainer.prototype=Object.create(PIXI.DisplayObject.prototype);PIXI.DisplayObjectContainer.prototype.addChild=function(b){void 0!=b.parent&&b.parent.removeChild(b);b.parent=this;b.childIndex=this.children.length;this.children.push(b);this.stage&&this.stage.__addChild(b)};
PIXI.DisplayObjectContainer.prototype.addChildAt=function(b,c){if(0<=c&&c<=this.children.length){void 0!=b.parent&&b.parent.removeChild(b);c==this.children.length?this.children.push(b):this.children.splice(c,0,b);b.parent=this;b.childIndex=c;for(var f=this.children.length,e=c;e<f;e++)this.children[e].childIndex=e;this.stage&&this.stage.__addChild(b)}else throw Error(b+" The index supplied is out of bounds "+this);};
PIXI.DisplayObjectContainer.prototype.removeChild=function(b){var c=this.children.indexOf(b);if(-1!==c){this.stage&&this.stage.__removeChild(b);b.parent=void 0;this.children.splice(c,1);b=c;for(c=this.children.length;b<c;b++)this.children[b].childIndex-=1}else throw Error(b+" The supplied DisplayObject must be a child of the caller "+this);};
PIXI.DisplayObjectContainer.prototype.updateTransform=function(){if(this.visible){PIXI.DisplayObject.prototype.updateTransform.call(this);for(var b=0,c=this.children.length;b<c;b++)this.children[b].updateTransform()}};PIXI=PIXI||{};PIXI.Stage=function(){PIXI.DisplayObjectContainer.call(this);this.worldTransform=mat3.identity();this.__childrenAdded=[];this.__childrenRemoved=[];this.childIndex=0;this.stage=this};PIXI.Stage.constructor=PIXI.Stage;PIXI.Stage.prototype=Object.create(PIXI.DisplayObjectContainer.prototype);PIXI.Stage.prototype.updateTransform=function(){this.worldAlpha=1;for(var b=0,c=this.children.length;b<c;b++)this.children[b].updateTransform()};
PIXI.Stage.prototype.__addChild=function(b){this.__childrenAdded.push(b);b.stage=this;if(b.children)for(var c=0;c<b.children.length;c++)this.__addChild(b.children[c])};PIXI.Stage.prototype.__removeChild=function(b){this.__childrenRemoved.push(b);b.stage=void 0;if(b.children)for(var c=0,f=b.children.length;c<f;c++)this.__removeChild(b.children[c])};PIXI=PIXI||{};PIXI.blendModes={};PIXI.blendModes.NORMAL=0;PIXI.blendModes.SCREEN=1;
PIXI.Sprite=function(b){PIXI.DisplayObjectContainer.call(this);this.anchor=new PIXI.Point;this.texture=b;this.blendMode=PIXI.blendModes.NORMAL;this.height=this.width=1;b.baseTexture.hasLoaded?(this.width=this.texture.frame.width,this.height=this.texture.frame.height,this.updateFrame=!0):(this.onTextureUpdateBind=this.onTextureUpdate.bind(this),this.texture.addEventListener("update",this.onTextureUpdateBind));this.renderable=!0};PIXI.Sprite.constructor=PIXI.Sprite;PIXI.Sprite.prototype=Object.create(PIXI.DisplayObjectContainer.prototype);
PIXI.Sprite.prototype.setTexture=function(b){this.texture.baseTexture!=b.baseTexture&&(this.textureChange=!0);this.texture=b;this.width=b.frame.width;this.height=b.frame.height;this.updateFrame=!0};PIXI.Sprite.prototype.onTextureUpdate=function(){this.width=this.texture.frame.width;this.height=this.texture.frame.height;this.updateFrame=!0};PIXI.Sprite.fromFrame=function(b){var c=PIXI.TextureCache[b];if(!c)throw Error("The frameId '"+b+"' does not exist in the texture cache"+this);return new PIXI.Sprite(c)};
PIXI.Sprite.fromImage=function(b){b=PIXI.Texture.fromImage(b);return new PIXI.Sprite(b)};PIXI=PIXI||{};
PIXI.Strip=function(b,c,f){PIXI.DisplayObjectContainer.call(this);this.texture=b;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(e){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.width=c;this.height=f;b.baseTexture.hasLoaded?(this.width=this.texture.frame.width,this.height=
this.texture.frame.height,this.updateFrame=!0):(this.onTextureUpdateBind=this.onTextureUpdate.bind(this),this.texture.addEventListener("update",this.onTextureUpdateBind));this.renderable=!0};PIXI.Strip.constructor=PIXI.Strip;PIXI.Strip.prototype=Object.create(PIXI.DisplayObjectContainer.prototype);PIXI.Strip.prototype.setTexture=function(b){this.texture=b;this.width=b.frame.width;this.height=b.frame.height;this.updateFrame=!0};PIXI.Strip.prototype.onTextureUpdate=function(){this.updateFrame=!0};PIXI=PIXI||{};PIXI.Rope=function(b,c){PIXI.Strip.call(this,b);this.points=c;try{this.verticies=new Float32Array(4*c.length),this.uvs=new Float32Array(4*c.length),this.colors=new Float32Array(2*c.length),this.indices=new Uint16Array(2*c.length)}catch(f){this.verticies=verticies,this.uvs=uvs,this.colors=colors,this.indices=indices}this.refresh()};PIXI.Rope.constructor=PIXI.Rope;PIXI.Rope.prototype=Object.create(PIXI.Strip.prototype);
PIXI.Rope.prototype.refresh=function(){var b=this.points;if(!(1>b.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;g<b;g++){var h=4*g,k=g/(b-1);c[h]=k;c[h+1]=0;c[h+2]=k;c[h+3]=1;h=2*g;e[h]=1;e[h+1]=1;h=2*g;f[h]=h;f[h+1]=h+1}}};
PIXI.Rope.prototype.updateTransform=function(){var b=this.points;if(!(1>b.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<k;l++){var h=b[l],p=4*l;e=l<b.length-1?b[l+1]:h;g=-(e.x-f.x);e=e.y-f.y;var f=Math.sqrt(e*e+g*g),q=this.texture.height/2;e/=f;g/=f;e*=q;g*=q;c[p]=h.x+e;c[p+1]=h.y+g;c[p+2]=h.x-e;c[p+3]=h.y-g;f=h}PIXI.DisplayObjectContainer.prototype.updateTransform.call(this)}};
PIXI.Rope.prototype.setTexture=function(b){this.texture=b;this.updateFrame=!0};PIXI=PIXI||{};PIXI.MovieClip=function(b){PIXI.Sprite.call(this,b[0]);this.textures=b;this.currentFrame=0;this.animationSpeed=1};PIXI.MovieClip.constructor=PIXI.MovieClip;PIXI.MovieClip.prototype=Object.create(PIXI.Sprite.prototype);PIXI.MovieClip.prototype.stop=function(){this.playing=!1};PIXI.MovieClip.prototype.play=function(){this.playing=!0};PIXI.MovieClip.prototype.gotoAndStop=function(b){this.playing=!1;this.currentFrame=b;this.setTexture(this.textures[(this.currentFrame+0.5|0)%this.textures.length])};
PIXI.MovieClip.prototype.gotoAndPlay=function(b){this.currentFrame=b;this.playing=!0};PIXI.MovieClip.prototype.updateTransform=function(){PIXI.Sprite.prototype.updateTransform.call(this);this.playing&&(this.currentFrame+=this.animationSpeed,this.setTexture(this.textures[(this.currentFrame+0.5|0)%this.textures.length]))};PIXI=PIXI||{};PIXI.BaseTextureCache={};PIXI.texturesToUpdate=[];PIXI.BaseTexture=function(b){PIXI.EventTarget.call(this);this.imageUrl=b;this.image=new Image;var c=this;this.image.onload=function(){c.hasLoaded=!0;c.width=c.image.width;c.height=c.image.height;PIXI.texturesToUpdate.push(c);c.dispatchEvent({type:"loaded",content:c})};$.proxy(this.onImageLoaded,this);this.image.src=b;this.height=this.width=100;PIXI.BaseTextureCache[b]=this};PIXI.BaseTexture.constructor=PIXI.BaseTexture;PIXI=PIXI||{};PIXI.TextureCache={};PIXI.FrameCache={};PIXI.Texture=function(b,c){PIXI.EventTarget.call(this);c||(this.noFrame=!0,c=new PIXI.Rectangle(0,0,1,1));this.baseTexture=b;this.frame=c;this.scope=this;if(b.hasLoaded)c||(c=new PIXI.Rectangle(0,0,b.width,b.height)),this.setFrame(c);else{var f=this;b.addEventListener("loaded",function(){f.onBaseTextureLoaded()})}};PIXI.Texture.constructor=PIXI.Texture;
PIXI.Texture.prototype.onBaseTextureLoaded=function(){var b=this.baseTexture;b.removeEventListener("loaded",this.onLoaded);this.noFrame&&(this.frame=new PIXI.Rectangle(0,0,b.width,b.height));this.noFrame=!1;this.width=this.frame.width;this.height=this.frame.height;this.scope.dispatchEvent({type:"update",content:this})};PIXI.Texture.prototype.setFrame=function(b){this.frame=b;this.width=b.width;this.height=b.height};
PIXI.Texture.fromImage=function(b){var c=PIXI.TextureCache[b];c||((c=PIXI.BaseTextureCache[b])||(c=new PIXI.BaseTexture(b)),c=new PIXI.Texture(c),PIXI.TextureCache[b]=c);return c};PIXI.Texture.fromFrameId=function(b){var c=PIXI.TextureCache[b];if(!c)throw Error("The frameId '"+b+"' does not exist in the texture cache"+this);return c};PIXI.Texture.addTextureToCache=function(b,c){PIXI.TextureCache[c]=b};PIXI.Texture.addTextureToCache=function(b){PIXI.TextureCache[b]=texture};PIXI=PIXI||{};PIXI.autoDetectRenderer=function(b,c){b||(b=800);c||(c=600);var f;try{f=!!window.WebGLRenderingContext&&!!document.createElement("canvas").getContext("experimental-webgl")}catch(e){f=!1}return f?new PIXI.WebGLRenderer(b,c):new PIXI.CanvasRenderer(b,c)};PIXI=PIXI||{};PIXI.SpriteSheetLoader=function(b){PIXI.EventTarget.call(this);this.url=b;this.baseUrl=b.replace(/[^\/]*$/,"");this.texture;this.frames={}};PIXI.SpriteSheetLoader.constructor=PIXI.SpriteSheetLoader;PIXI.SpriteSheetLoader.prototype.load=function(){this.ajaxRequest=new AjaxRequest;var b=this;this.ajaxRequest.onreadystatechange=function(){b.onLoaded()};this.ajaxRequest.open("GET",this.url,!0);this.ajaxRequest.send(null)};
PIXI.SpriteSheetLoader.prototype.onLoaded=function(){if(4==this.ajaxRequest.readyState&&(200==this.ajaxRequest.status||-1==window.location.href.indexOf("http"))){var b=eval("("+this.ajaxRequest.responseText+")");this.texture=PIXI.Texture.fromImage(this.baseUrl+b.meta.image).baseTexture;var b=b.frames,c;for(c in b){var f=b[c].frame;PIXI.TextureCache[c]=new PIXI.Texture(this.texture,{x:f.x,y:f.y,width:f.w,height:f.h})}if(this.texture.hasLoaded)this.dispatchEvent({type:"loaded",content:this});else{var e=
this;this.texture.addEventListener("loaded",function(){e.dispatchEvent({type:"loaded",content:e})})}}};PIXI=PIXI||{};PIXI.AssetLoader=function(b){PIXI.EventTarget.call(this);this.assetURLs=b;this.assets=[]};PIXI.AssetLoader.constructor=PIXI.AssetLoader;
PIXI.AssetLoader.prototype.load=function(){this.loadCount=this.assetURLs.length;for(var b=["jpeg","jpg","png","gif"],c=["json"],f=0;f<this.assetURLs.length;f++){for(var e=this.assetURLs[f],g=e.split(".").pop().toLowerCase(),h,k=0;k<b.length;k++)if(g==b[k]){h="img";break}if(!h)for(k=0;k<c.length;k++)if(g==c[k]){h="atlas";break}if("img"==h)if(e=PIXI.Texture.fromImage(e),e.hasLoaded)this.loadCount--;else{var l=this;e.baseTexture.addEventListener("loaded",function(){l.onAssetLoaded()});this.assets.push(e)}else if("atlas"==
h)e=new PIXI.SpriteSheetLoader(e),this.assets.push(e),l=this,e.addEventListener("loaded",function(){l.onAssetLoaded()}),e.load();else throw Error(e+" is an unsupported file type "+this);}};PIXI.AssetLoader.prototype.onAssetLoaded=function(){this.loadCount--;this.dispatchEvent({type:"progress",content:this});0==this.loadCount&&this.dispatchEvent({type:"loaded",content:this})};

View file

@ -1,84 +0,0 @@
window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(c){window.setTimeout(c,1E3/60)}}();var AjaxRequest=function(){var c=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var d=0;d<c.length;d++)try{return new ActiveXObject(c[d])}catch(f){}else return window.XMLHttpRequest?new XMLHttpRequest:!1};var PIXI=PIXI||{};PIXI.EventTarget=function(){var c={};this.addEventListener=function(d,f){void 0===c[d]&&(c[d]=[]);-1===c[d].indexOf(f)&&c[d].push(f)};this.dispatchEvent=function(d){for(var f in c[d.type])c[d.type][f](d)};this.removeEventListener=function(d,f){var g=c[d].indexOf(f);-1!==g&&c[d].splice(g,1)}};(function(c,d){"object"===typeof exports?module.exports=d(global):"function"===typeof define&&define.amd?define([],function(){return d(c)}):d(c)})(this,function(c){function d(a){return l=a}function f(){return l="undefined"!==typeof Float32Array?Float32Array:Array}var g={};if("undefined"!=typeof Float32Array){var m=new Float32Array(1),p=new Int32Array(m.buffer);g.invsqrt=function(a){m[0]=a;p[0]=1597463007-(p[0]>>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)}1<e[3]?e[3]=1:-1>e[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(0<c)d=Math.sqrt(c+1),b[3]=0.5*d,d=0.5/d,b[0]=(a[7]-a[5])*d,b[1]=(a[2]-a[6])*d,b[2]=(a[3]-a[1])*d;else{d=s.fromRotationMatrix.s_iNext=s.fromRotationMatrix.s_iNext||[1,2,0];c=0;a[4]>a[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];0<c?(b[3]=2*Math.acos(a[3]),c=g.invsqrt(c),b[0]=a[0]*c,b[1]=a[1]*c,b[2]=a[2]*c):(b[3]=0,b[0]=1,b[1]=0,b[2]=0);return b};s.str=function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"};var M={create:function(a){var b=new l(2);a?(b[0]=a[0],b[1]=a[1]):(b[0]=0,b[1]=0);return b},createFrom:function(a,b){var c=new l(2);c[0]=a;c[1]=b;return c},add:function(a,b,c){c||(c=b);c[0]=a[0]+b[0];c[1]=a[1]+b[1];return c},subtract:function(a,
b,c){c||(c=b);c[0]=a[0]-b[0];c[1]=a[1]-b[1];return c},multiply:function(a,b,c){c||(c=b);c[0]=a[0]*b[0];c[1]=a[1]*b[1];return c},divide:function(a,b,c){c||(c=b);c[0]=a[0]/b[0];c[1]=a[1]/b[1];return c},scale:function(a,b,c){c||(c=a);c[0]=a[0]*b;c[1]=a[1]*b;return c},dist:function(a,b){var c=b[0]-a[0],d=b[1]-a[1];return Math.sqrt(c*c+d*d)},set:function(a,b){b[0]=a[0];b[1]=a[1];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])},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<c?(c=Math.sqrt(c),b[0]=a[0]/c,b[1]=a[1]/c):b[0]=b[1]=0;return b},cross:function(a,b,c){a=a[0]*b[1]-a[1]*b[0];if(!c)return a;c[0]=c[1]=0;c[2]=a;return c},length:function(a){var b=a[0];a=a[1];return Math.sqrt(b*b+a*a)},squaredLength:function(a){var b=a[0];a=a[1];return b*b+a*a},dot:function(a,b){return a[0]*b[0]+a[1]*b[1]},direction:function(a,b,c){c||(c=a);var d=a[0]-b[0];a=a[1]-b[1];b=d*d+a*a;if(!b)return c[0]=
0,c[1]=0,c[2]=0,c;b=1/Math.sqrt(b);c[0]=d*b;c[1]=a*b;return c},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]);return d},str:function(a){return"["+a[0]+", "+a[1]+"]"}},L={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,c,d){var f=new l(4);f[0]=a;f[1]=b;f[2]=c;f[3]=d;return f},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=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<d.length;g++)f+=d[g];g=c.createShader(c.VERTEX_SHADER);c.shaderSource(g,f);c.compileShader(g);return!c.getShaderParameter(g,c.COMPILE_STATUS)?(alert(c.getShaderInfoLog(g)),null):g};PIXI.CompileFragmentShader=function(c,d){for(var f="",g=0;g<d.length;g++)f+=d[g];g=c.createShader(c.FRAGMENT_SHADER);c.shaderSource(g,f);c.compileShader(g);return!c.getShaderParameter(g,c.COMPILE_STATUS)?(alert(c.getShaderInfoLog(g)),null):g};PIXI=PIXI||{};PIXI._defaultFrame={x:0,y:0,width:1,height:1};
PIXI.WebGLRenderer=function(c,d){this.width=c?c:800;this.height=d?d:600;this.view=document.createElement("canvas");this.view.width=this.width;this.view.height=this.height;this.view.background="#FF0000";var f=this;this.view.addEventListener("webglcontextlost",function(c){f.handleContextLost(c)},!1);this.view.addEventListener("webglcontextrestored",function(c){f.handleContextRestored(c)},!1);this.batchs=[];try{this.gl=this.view.getContext("experimental-webgl",{alpha:!1})}catch(g){alert("Web GL only im afraid :/")}this.initShaders();
var m=this.gl;this.batch=new PIXI.WebGLBatch(m);m.disable(m.DEPTH_TEST);m.enable(m.BLEND);m.colorMask(!0,!0,!0,!1);this.projectionMatrix=mat4.create();this.resize(this.width,this.height);this.contextLost=!1};PIXI.WebGLRenderer.constructor=PIXI.WebGLRenderer;
PIXI.WebGLRenderer.prototype.initShaders=function(){var c=this.gl,d=PIXI.CompileFragmentShader(c,PIXI.shaderFragmentSrc),f=PIXI.CompileVertexShader(c,PIXI.shaderVertexSrc),g=this.shaderProgram=c.createProgram();c.attachShader(g,f);c.attachShader(g,d);c.linkProgram(g);c.getProgramParameter(g,c.LINK_STATUS)||alert("Could not initialise shaders");c.useProgram(g);g.vertexPositionAttribute=c.getAttribLocation(g,"aVertexPosition");c.enableVertexAttribArray(g.vertexPositionAttribute);g.textureCoordAttribute=
c.getAttribLocation(g,"aTextureCoord");c.enableVertexAttribArray(g.textureCoordAttribute);g.colorAttribute=c.getAttribLocation(g,"aColor");c.enableVertexAttribArray(g.colorAttribute);g.mvMatrixUniform=c.getUniformLocation(g,"uMVMatrix");g.samplerUniform=c.getUniformLocation(g,"uSampler");PIXI.shaderProgram=this.shaderProgram};
PIXI.WebGLRenderer.prototype.render=function(c){if(!this.contextLost){for(var d=0;d<c.__childrenRemoved.length;d++)this.removeDisplayObject(c.__childrenRemoved[d]);for(d=0;d<c.__childrenAdded.length;d++)this.addDisplayObject(c.__childrenAdded[d]);for(d=0;d<PIXI.texturesToUpdate.length;d++)this.updateTexture(PIXI.texturesToUpdate[d]);c.__childrenRemoved=[];c.__childrenAdded=[];PIXI.texturesToUpdate=[];c.updateTransform();var f=this.gl;f.clear(f.COLOR_BUFFER_BIT);f.clearColor(1,1,1,1);f.blendFunc(f.ONE,
f.ONE_MINUS_SRC_ALPHA);f.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform,!1,this.projectionMatrix);if(this.refreshBatchs){for(d=0;d<this.batchs.length;d++)this.batchs[d].dirty&&PIXI._returnBatch(this.batchs[d]);this.batchs=[];this.currentBatch=PIXI._getBatch(f);this.collectBatchs(c);this.currentBatch&&(this.currentBatch.cache(),this.batchs.push(this.currentBatch));this.refreshBatchs=!1}this.updateDisplayObjects(c);for(d=0;d<this.batchs.length;d++)this.batchs[d].render()}};
PIXI.WebGLRenderer.prototype.updateDisplayObjects=function(c){for(var d,f,g,m,p,l,j,x,n,z,A,H;c;){if(!c.visible&&(c=c.parent[c.childIndex+1],!c))continue;c.sprite&&(d=c.batch.verticies,g=c.width,m=c.height,p=c.anchor.x,l=c.anchor.y,j=g*(1-p),g*=-p,p=m*(1-l),l=m*-l,m=8*c.index,f=c.worldTransform,x=f[0],n=f[3],z=f[1],A=f[4],H=f[2],f=f[5],d[m+0]=x*g+z*l+H,d[m+1]=A*l+n*g+f,d[m+2]=x*j+z*l+H,d[m+3]=A*l+n*j+f,d[m+4]=x*j+z*p+H,d[m+5]=A*p+n*j+f,d[m+6]=x*g+z*p+H,d[m+7]=A*p+n*g+f,c.updateFrame&&(c.batch.dirtyUVS=
!0,j=c.frame,g=c.texture.width,p=c.texture.height,d=c.batch.uvs,d[m+0]=j.x/g,d[m+1]=j.y/p,d[m+2]=(j.x+j.width)/g,d[m+3]=j.y/p,d[m+4]=(j.x+j.width)/g,d[m+5]=(j.y+j.height)/p,d[m+6]=j.x/g,d[m+7]=(j.y+j.height)/p,c.updateFrame=!1),c.cacheAlpha!=c.alpha&&(c.cacheAlpha=c.alpha,j=4*c.index,d=c.batch.colors,d[j]=d[j+1]=d[j+2]=d[j+3]=c.alpha,c.batch.dirtyColors=!0),c.cacheVisible!=c.visible&&(c.cacheVisible=c.visible,this.refreshBatchs=c.batch.dirty=!0));c=c._next}};
PIXI.WebGLRenderer.prototype.collectBatchs=function(c){for(var d=this.currentBatch,f=this.gl,g=d.uvs,m=d.colors,p=d.indicies,l,j,x;c;){if(!c.visible&&(c=c.parent[c.childIndex+1],!c)){this.currentBatch=null;break}if(c.sprite){if(d.texture!=c.texture){d.cache();this.batchs.push(d);for(d=!1;!d;){d=!0;if(!c){this.currentBatch=null;return}c.batch&&!c.batch.dirty&&(this.batchs.push(c.batch),c=c.batch.last._next,d=!1)}d=this.currentBatch=PIXI._getBatch(f);g=d.uvs;m=d.colors;p=d.indicies;d.texture=c.texture}c.index=
d.size;l=8*d.size;j=6*d.size;x=4*d.size;index4=4*d.size;var n=c.frame,z=c.texture.width,A=c.texture.height;n||(n=PIXI._defaultFrame);g[l+0]=n.x/z;g[l+1]=n.y/A;g[l+2]=(n.x+n.width)/z;g[l+3]=n.y/A;g[l+4]=(n.x+n.width)/z;g[l+5]=(n.y+n.height)/A;g[l+6]=n.x/z;g[l+7]=(n.y+n.height)/A;m[index4]=m[index4+1]=m[index4+2]=m[index4+3]=c.alpha;p[j+0]=x+0;p[j+1]=x+1;p[j+2]=x+2;p[j+3]=x+0;p[j+4]=x+2;p[j+5]=x+3;d.last=c;d.size++}c.batch=d;d.last=c;c=c._next}};
PIXI.WebGLRenderer.prototype.updateTexture=function(c){var d=this.gl;c._glTexture||(c._glTexture=d.createTexture());c.hasLoaded&&(d.bindTexture(d.TEXTURE_2D,c._glTexture),d.pixelStorei(d.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),d.texImage2D(d.TEXTURE_2D,0,d.RGBA,d.RGBA,d.UNSIGNED_BYTE,c.image),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MAG_FILTER,d.LINEAR),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MIN_FILTER,d.LINEAR),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_WRAP_S,d.CLAMP_TO_EDGE),d.texParameteri(d.TEXTURE_2D,
d.TEXTURE_WRAP_T,d.CLAMP_TO_EDGE),d.generateMipmap(d.TEXTURE_2D),d.bindTexture(d.TEXTURE_2D,null));this.refreshBatchs=!0};
PIXI.WebGLRenderer.prototype.addDisplayObject=function(c){c.batch=null;c.cacheVisible=c.visible;var d;if(0==c.childIndex)d=c.parent;else for(d=c.parent.children[c.childIndex-1];0!=d.children.length;)d=d.children[d.children.length-1];var f=d._next;d._next=c;c._prev=d;f&&(c._next=f,f._prev=c);if(c.sprite){if((d=c._prev.batch)&&d.texture==c.texture)d.dirty=!0;if(c._next&&(c=c._next.batch)&&c.texture==c.texture)c.dirty=!0;this.refreshBatchs=!0}};
PIXI.WebGLRenderer.prototype.removeDisplayObject=function(c){var d=c.batch;d&&(d.dirty=!0);c._prev&&(c._prev._next=c._next);c._next&&(c._next._prev=c._prev);c.batch=null;this.refreshBatchs=!0};
PIXI.WebGLRenderer.prototype.resize=function(c,d){this.width=c;this.height=d;this.view.width=c;this.view.height=d;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])};PIXI.WebGLRenderer.prototype.handleContextLost=function(c){c.preventDefault();this.contextLost=!0};
PIXI.WebGLRenderer.prototype.handleContextRestored=function(){this.gl=this.view.getContext("experimental-webgl",{alpha:!0});this.initShaders();for(var c=0;c<PIXI.TextureCache.length;c++)this.updateTexture(PIXI.TextureCache[c]);for(c=0;c<this.batchs.length;c++)this.batchs[c].restoreLostContext(this.gl),this.batchs[c].dirty=!0;PIXI._restoreBatchs(this.gl);this.contextLost=!1};PIXI=PIXI||{};PIXI.CanvasRenderer=function(c,d){this.width=c?c:800;this.height=d?d:600;this.refresh=!0;this.view=document.createElement("canvas");this.view.width=this.width;this.view.height=this.height;this.view.background="#FF0000";this.context=this.view.getContext("2d")};PIXI.CanvasRenderer.constructor=PIXI.CanvasRenderer;
PIXI.CanvasRenderer.prototype.render=function(c){c.__childrenAdded=[];PIXI.texturesToUpdate=[];c.updateTransform();this.context.setTransform(1,0,0,1,0,0);this.context.clearRect(0,0,this.width,this.height);this.renderDisplayObject(c)};
PIXI.CanvasRenderer.prototype.renderDisplayObject=function(c){if(c.visible){if(c.sprite){var d=c.worldTransform,f=c.frame;f&&(this.context.globalAlpha=c.worldAlpha,this.context.setTransform(d[0],d[3],d[1],d[4],d[2],d[5]),this.context.drawImage(c.texture.image,f.x,f.y,f.width,f.height,c.anchor.x*-f.width,c.anchor.y*-f.height,f.width,f.height))}for(d=0;d<c.children.length;d++)this.renderDisplayObject(c.children[d])}};
PIXI.CanvasRenderer.prototype.resize=function(c,d){this.width=c;this.height=d;this.view.width=c;this.view.height=d};PIXI=PIXI||{};PIXI._defaultFrame={x:0,y:0,width:1,height:1};PIXI.DOMRenderer=function(c,d){this.width=c?c:800;this.height=d?d:600;this.view=document.createElement("div");this.view.style.width=this.width+"px";this.view.style.height=this.height+"px";this.view.style.background="#FF0000";this.view.style["-webkit-transform"]="translateZ(0)";this.resize(this.width,this.height)};PIXI.DOMRenderer.constructor=PIXI.DOMRenderer;
PIXI.DOMRenderer.prototype.render=function(c){for(var d=0;d<c.__childrenRemoved.length;d++)this.removeDisplayObject(c.__childrenRemoved[d]);for(d=0;d<c.__childrenAdded.length;d++)this.addDisplayObject(c.__childrenAdded[d]);for(d=0;d<PIXI.texturesToUpdate.length;d++)this.updateTexture(PIXI.texturesToUpdate[d]);c.__childrenRemoved=[];c.__childrenAdded=[];PIXI.texturesToUpdate=[];c.updateTransform();this.renderDisplayObject(c)};PIXI.DOMRenderer.prototype.updateTexture=function(){};
PIXI.DOMRenderer.prototype.renderDisplayObject=function(c){if(c.visible){if(c.sprite){var d=c.worldTransform;c.frame&&(c._div.style["-webkit-transform"]="matrix("+d[0]+", "+d[3]+","+d[1]+","+d[4]+","+d[2]+","+d[5]+")")}for(d=0;d<c.children.length;d++)this.renderDisplayObject(c.children[d])}};PIXI.DOMRenderer.prototype.addDisplayObject=function(c){if(c.sprite&&!c._div){var d=document.createElement("img");d.src=c.texture.imageUrl;d.style.cssText="position:absolute;";c._div=d;this.view.appendChild(d)}};
PIXI.DOMRenderer.prototype.removeDisplayObject=function(){};PIXI.DOMRenderer.prototype.resize=function(c,d){this.width=c;this.height=d;this.view.style.width=this.width+"px";this.view.style.height=this.height+"px"};PIXI=PIXI||{};PIXI.DisplayObject=function(){this.position={x:0,y:0};this.scale={x:1,y:1};this.rotation=0;this.dynamic=!0;this.alpha=1;this.color=[];this.worldAlpha=1;this.visible=!0;this.worldTransform=mat3.identity();this.localTransform=mat3.identity();this.parent;this.stage;this._sr=0;this._cr=1};PIXI.DisplayObject.constructor=Object.create(PIXI.DisplayObject.prototype);
PIXI.DisplayObject.prototype.updateTransform=function(){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;this.localTransform[2]=this.position.x;this.localTransform[5]=this.position.y;mat3.multiply(this.localTransform,this.parent.worldTransform,
this.worldTransform);this.worldAlpha=this.alpha*this.parent.worldAlpha};PIXI=PIXI||{};PIXI._batchs=[];PIXI._getBatch=function(c){return 0==PIXI._batchs.length?new PIXI.WebGLBatch(c):PIXI._batchs.pop()};PIXI._returnBatch=function(c){c.clean();PIXI._batchs.push(c)};PIXI._restoreBatchs=function(c){for(var d=0;d<PIXI._batchs.length;d++)PIXI._batchs[d].restoreLostContext(c)};
PIXI.WebGLBatch=function(c){this.gl=c;this.size=0;this.verticies=[];this.uvs=[];this.indicies=[];this.colors=[];this.texture;this.vertexBuffer=c.createBuffer();this.indexBuffer=c.createBuffer();this.uvBuffer=c.createBuffer();this.colorBuffer=c.createBuffer()};PIXI.WebGLBatch.constructor=PIXI.WebGLBatch;PIXI.WebGLBatch.prototype.clean=function(){this.verticies=[];this.uvs=[];this.indicies=[];this.colors=[];this.last=this.texture=null;this.size=0};
PIXI.WebGLBatch.prototype.restoreLostContext=function(c){this.gl=c;this.vertexBuffer=c.createBuffer();this.indexBuffer=c.createBuffer();this.uvBuffer=c.createBuffer();this.colorBuffer=c.createBuffer()};
PIXI.WebGLBatch.prototype.render=function(){if(0!=this.size){var c=this.gl,d=PIXI.shaderProgram;c.bindBuffer(c.ARRAY_BUFFER,this.vertexBuffer);c.bufferData(c.ARRAY_BUFFER,this.verticies,c.STATIC_DRAW);c.vertexAttribPointer(d.vertexPositionAttribute,2,c.FLOAT,!1,0,0);c.bindBuffer(c.ARRAY_BUFFER,this.uvBuffer);this.dirtyUVS&&(this.dirtyUVS=!1,c.bufferData(c.ARRAY_BUFFER,this.uvs,c.STATIC_DRAW));c.vertexAttribPointer(d.textureCoordAttribute,2,c.FLOAT,!1,0,0);c.activeTexture(c.TEXTURE0);c.bindTexture(c.TEXTURE_2D,
this.texture._glTexture);c.bindBuffer(c.ARRAY_BUFFER,this.colorBuffer);this.dirtyColors&&c.bufferData(c.ARRAY_BUFFER,this.colors,c.STATIC_DRAW);c.vertexAttribPointer(d.colorAttribute,1,c.FLOAT,!1,0,0);c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,this.indexBuffer);c.drawElements(c.TRIANGLES,6*this.size,c.UNSIGNED_SHORT,0)}};
PIXI.WebGLBatch.prototype.cache=function(){var c=this.gl;c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,this.indexBuffer);c.bufferData(c.ELEMENT_ARRAY_BUFFER,new Uint16Array(this.indicies),c.STATIC_DRAW);this.dirtyUVS=!0;this.uvs=new Float32Array(this.uvs);this.verticies=new Float32Array(8*this.size);this.colors=new Float32Array(this.colors)};PIXI=PIXI||{};PIXI.DisplayObjectContainer=function(){PIXI.DisplayObject.call(this);this.children=[]};PIXI.DisplayObjectContainer.constructor=PIXI.DisplayObjectContainer;PIXI.DisplayObjectContainer.protoype=Object.create(PIXI.DisplayObject.prototype);PIXI.DisplayObjectContainer.prototype.updateTransform=function(){PIXI.DisplayObject.prototype.updateTransform.call(this);for(var c=0,d=this.children.length;c<d;c++)this.children[c].updateTransform()};
PIXI.DisplayObjectContainer.prototype.addChild=function(c){void 0!=c.parent&&c.parent.removeChild(c);c.parent=this;c.childIndex=this.children.length;this.children.push(c);this.stage&&this.stage.__addChild(c)};PIXI.DisplayObjectContainer.prototype.removeChild=function(c){var d=this.children.indexOf(c);-1!==d&&(this.stage.__removeChild(c),c.parent=void 0,this.children.splice(d,1))};PIXI=PIXI||{};PIXI.Stage=function(){PIXI.DisplayObjectContainer.call(this);this.worldTransform=mat3.identity();this.__childrenAdded=[];this.__childrenRemoved=[];this.childIndex=0;this.stage=this};PIXI.Stage.constructor=PIXI.Stage;PIXI.Stage.prototype=Object.create(PIXI.DisplayObjectContainer.prototype);PIXI.Stage.prototype.updateTransform=function(){this.worldAlpha=1;for(var c=0,d=this.children.length;c<d;c++)this.children[c].updateTransform()};
PIXI.Stage.prototype.__addChild=function(c){this.__childrenAdded.push(c);c.stage=this;for(var d=0;d<c.children.length;d++)this.__addChild(c.children[d])};PIXI.Stage.prototype.__removeChild=function(c){this.__childrenRemoved.push(c);c.stage=void 0;for(var d=0,f=c.children.length;d<f;d++)this.__removeChild(c.children[d])};PIXI=PIXI||{};PIXI.Sprite=function(c,d){PIXI.DisplayObjectContainer.call(this);this.anchor={x:0,y:0};this.sprite=!0;this.texture=c;this.frame=d;this.height=this.width=1;c.hasLoaded&&(d||(d={x:0,y:0,width:c.width,height:c.height}),this.setFrame(d));var f=this;c.addEventListener("loaded",function(){f.frame||(f.frame={x:0,y:0,width:c.width,height:c.height});f.width=f.frame.width;f.height=f.frame.height;f.updateFrame=!0})};PIXI.Sprite.constructor=PIXI.Sprite;PIXI.Sprite.prototype=Object.create(PIXI.DisplayObjectContainer.prototype);
PIXI.Sprite.prototype.setFrame=function(c){this.frame=c;this.width=c.width;this.height=c.height;this.updateFrame=!0};PIXI.Sprite.spriteFromFrame=function(c){c=PIXI.FrameCache[c];return new PIXI.Sprite(PIXI.TextureCache[c.texture],{x:c.x,y:c.y,width:c.width,height:c.height})};PIXI.Sprite.spriteFromTexture=function(){return new PIXI.Sprite(PIXI.TextureCache[frameData.texture])};PIXI=PIXI||{};PIXI.MovieClip=function(c,d){PIXI.Sprite.call(this,c,d[0]);this.frames=d;this.framePosition=0;this.speed=1};PIXI.MovieClip.constructor=PIXI.MovieClip;PIXI.MovieClip.prototype=Object.create(PIXI.Sprite.prototype);PIXI.MovieClip.prototype.updateTransform=function(){PIXI.Sprite.prototype.updateTransform.call(this);this.framePosition+=this.speed;this.setFrame(this.frames[Math.round(this.framePosition)%this.frames.length])};PIXI=PIXI||{};PIXI.TextureCache={};PIXI.FrameCache={};PIXI.texturesToUpdate=[];PIXI.Texture=function(c){PIXI.EventTarget.call(this);this.imageUrl=c;this.frame={x:0,y:0,width:1,height:1};this.hasLoaded=!1;this.image=new Image;this.image.onload=$.proxy(this.onImageLoaded,this);this.image.src=c;this.height=this.width=100;PIXI.TextureCache[c]=this};
PIXI.Texture.prototype.onImageLoaded=function(){this.hasLoaded=!0;this.width=this.image.width;this.height=this.image.height;PIXI.texturesToUpdate.push(this);this.dispatchEvent({type:"loaded",content:this})};PIXI.Texture.getTexture=function(c){var d=PIXI.TextureCache[c];d||(d=new PIXI.Texture(c));return d};PIXI=PIXI||{};PIXI.autoDetectRenderer=function(c,d){var f;try{f=!!window.WebGLRenderingContext&&!!document.createElement("canvas").getContext("experimental-webgl")}catch(g){f=!1}console.log(f);return f?new PIXI.WebGLRenderer(c,d):new PIXI.CanvasRenderer(c,d)};PIXI=PIXI||{};PIXI.SpriteSheetLoader=function(c){PIXI.EventTarget.call(this);this.url=c;this.baseUrl=c.replace(/[^\/]*$/,"");this.texture;this.frames={}};PIXI.SpriteSheetLoader.constructor=PIXI.SpriteSheetLoader;PIXI.SpriteSheetLoader.prototype.load=function(){this.ajaxRequest=new AjaxRequest;var c=this;this.ajaxRequest.onreadystatechange=function(){c.onLoaded()};this.ajaxRequest.open("GET",this.url,!0);this.ajaxRequest.send(null)};
PIXI.SpriteSheetLoader.prototype.onLoaded=function(){if(4==this.ajaxRequest.readyState&&(200==this.ajaxRequest.status||-1==window.location.href.indexOf("http"))){var c=eval("("+this.ajaxRequest.responseText+")"),d=this.baseUrl+c.meta.image;this.texture=PIXI.TextureCache[d];this.texture||(this.texture=new PIXI.Texture(d));var c=c.frames,f;for(f in c){var g=c[f].frame;this.frames[f]={x:g.x,y:g.y,width:g.w,height:g.h,texture:d};PIXI.FrameCache[f]=this.frames[f]}this.dispatchEvent({type:"loaded",content:this})}};PIXI=PIXI||{};PIXI.AssetLoader=function(c){PIXI.EventTarget.call(this);this.assetURLs=c;this.assets=[]};PIXI.AssetLoader.constructor=PIXI.AssetLoader;
PIXI.AssetLoader.prototype.load=function(){this.loadCount=this.assetURLs.length;for(var c=["jpeg","jpg","png","gif"],d=["json"],f=0;f<this.assetURLs.length;f++){for(var g=this.assetURLs[f],m=g.split(".").pop().toLowerCase(),p,f=0;f<c.length;f++)if(m==c[f]){p="img";break}if(!p)for(f=0;f<d.length;f++)if(m==d[f]){p="atlas";break}if("img"==p)if(g=PIXI.Texture.getTexture(g),g.hasLoaded)this.loadCount--;else{var l=this;g.addEventListener("loaded",function(){l.onAssetLoaded()});this.assets.push(g)}else"atlas"==
p?(g=new PIXI.SpriteSheetLoader(g),this.assets.push(g),l=this,g.addEventListener("loaded",function(){l.onAssetLoaded()}),g.load()):this.loadCount--}};PIXI.AssetLoader.prototype.onAssetLoaded=function(){this.loadCount--;0==this.loadCount&&this.dispatchEvent({type:"loaded",content:this})};

BIN
logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

View file

@ -2,54 +2,60 @@
* @author Mat Groves http://matgroves.com/ * @author Mat Groves http://matgroves.com/
*/ */
var PIXI = PIXI || {};
/** /**
* @class The DisplayObject class is the base class for all objects that are rendered on the screen. * this is the base class for all objects that are rendered on the screen.
* @class DisplayObject
* @constructor * @constructor
* @return A new DisplayObject.
*/ */
PIXI.DisplayObject = function() PIXI.DisplayObject = function()
{ {
/** /**
* The coordinate of the object relative to the local coordinates of the parent. * The coordinate of the object relative to the local coordinates of the parent.
* @property position
* @type Point * @type Point
*/ */
this.position = new PIXI.Point(); this.position = new PIXI.Point();
/** /**
* The scale factor of the object. * The scale factor of the object.
* @property scale
* @type Point * @type Point
*/ */
this.scale = new PIXI.Point(1,1);//{x:1, y:1}; this.scale = new PIXI.Point(1,1);//{x:1, y:1};
/** /**
* The rotation of the object in radians. * The rotation of the object in radians.
* @property rotation
* @type Number * @type Number
*/ */
this.rotation = 0; this.rotation = 0;
/** /**
* The opacity of the object. * The opacity of the object.
* @property alpha
* @type Number * @type Number
*/ */
this.alpha = 1; this.alpha = 1;
/** /**
* The visibility of the object. * The visibility of the object.
* @type Number * @property visible
* @type Boolean
*/ */
this.visible = true; this.visible = true;
this.cacheVisible = false;
/** /**
* [read-only] The display object container that contains this display object. * [read-only] The display object container that contains this display object.
* @property parent
* @type DisplayObjectContainer * @type DisplayObjectContainer
*/ */
this.parent = null; this.parent = null;
/** /**
* [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage. * [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.
* @type #DisplayObjectContainer * @property stage
* @type Stage
*/ */
this.stage = null; this.stage = null;

View file

@ -2,13 +2,12 @@
* @author Mat Groves http://matgroves.com/ * @author Mat Groves http://matgroves.com/
*/ */
var PIXI = PIXI || {};
/** /**
* @class 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. * 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.
* @augments PIXI.DisplayObject * @class DisplayObjectContainer
* @extends DisplayObject
* @constructor * @constructor
* @return A new DisplayObjectContainer.
*/ */
PIXI.DisplayObjectContainer = function() PIXI.DisplayObjectContainer = function()
{ {
@ -16,7 +15,7 @@ PIXI.DisplayObjectContainer = function()
/** /**
* [read-only] The of children of this container. * [read-only] The of children of this container.
* @type Array * @property children {Array}
*/ */
this.children = []; this.children = [];
@ -29,7 +28,8 @@ PIXI.DisplayObjectContainer.prototype = Object.create( PIXI.DisplayObject.protot
/** /**
* Adds a child to the container. * Adds a child to the container.
* @param DisplayObject {@link PIXI.DisplayObject} * @method addChild
* @param DisplayObject {DisplayObject}
*/ */
PIXI.DisplayObjectContainer.prototype.addChild = function(child) PIXI.DisplayObjectContainer.prototype.addChild = function(child)
{ {
@ -50,8 +50,9 @@ PIXI.DisplayObjectContainer.prototype.addChild = function(child)
/** /**
* Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown
* @param DisplayObject {@link PIXI.DisplayObject} * @method addChildAt
* @param index * @param DisplayObject {DisplayObject}
* @param index {Number}
*/ */
PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index) PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
{ {
@ -59,7 +60,7 @@ PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
{ {
if(child.parent != undefined) if(child.parent != undefined)
{ {
child.parent.removeChild(child) child.parent.removeChild(child);
} }
if (index == this.children.length) if (index == this.children.length)
@ -89,13 +90,14 @@ PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
{ {
// error! // error!
throw new Error(child + " The index supplied is out of bounds " + this); throw new Error(child + " The index "+ index +" supplied is out of bounds " + this.children.length);
} }
} }
/** /**
* Removes a child from the container. * Removes a child from the container.
* @param DisplayObject {@link PIXI.DisplayObject} * @method removeChild
* @param DisplayObject {DisplayObject}
*/ */
PIXI.DisplayObjectContainer.prototype.removeChild = function(child) PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
{ {

View file

@ -1,13 +1,12 @@
/** /**
* @author Mat Groves http://matgroves.com/ * @author Mat Groves http://matgroves.com/
*/ */
var PIXI = PIXI || {};
/** /**
* @class A MovieClip is a simple way to display an animation depicted by a list of textures. * A MovieClip is a simple way to display an animation depicted by a list of textures.
* @augments PIXI.Sprite * @class MovieClip
* @param an array of textures that make up the animation * @constructor
* @return {PIXI.MovieClip} texture {@link PIXI.MovieClip} * @param textures {Array} an array of {Texture} objects that make up the animation
*/ */
PIXI.MovieClip = function(textures) PIXI.MovieClip = function(textures)
{ {
@ -15,24 +14,28 @@ PIXI.MovieClip = function(textures)
/** /**
* The array of textures that make up the animation * The array of textures that make up the animation
* @property textures
* @type Array * @type Array
*/ */
this.textures = textures; this.textures = textures;
/** /**
* [read only] The index MovieClips current frame (this may not have to be a whole number) * [read only] The index MovieClips current frame (this may not have to be a whole number)
* @property currentFrame
* @type Number * @type Number
*/ */
this.currentFrame = 0; this.currentFrame = 0;
/** /**
* The speed that the MovieClip will play at. Higher is faster, lower is slower * The speed that the MovieClip will play at. Higher is faster, lower is slower
* @property animationSpeed
* @type Number * @type Number
*/ */
this.animationSpeed = 1; this.animationSpeed = 1;
/** /**
* [read only] indicates if the MovieClip is currently playing * [read only] indicates if the MovieClip is currently playing
* @property playing
* @type Boolean * @type Boolean
*/ */
this.playing; this.playing;
@ -44,6 +47,7 @@ PIXI.MovieClip.prototype = Object.create( PIXI.Sprite.prototype );
/** /**
* Stops the MovieClip * Stops the MovieClip
* @method stop
*/ */
PIXI.MovieClip.prototype.stop = function() PIXI.MovieClip.prototype.stop = function()
{ {
@ -52,6 +56,7 @@ PIXI.MovieClip.prototype.stop = function()
/** /**
* Plays the MovieClip * Plays the MovieClip
* @method play
*/ */
PIXI.MovieClip.prototype.play = function() PIXI.MovieClip.prototype.play = function()
{ {
@ -60,7 +65,8 @@ PIXI.MovieClip.prototype.play = function()
/** /**
* Stops the MovieClip and goes to a specific frame * Stops the MovieClip and goes to a specific frame
* @param frame index to stop at * @method gotoAndStop
* @param frameNumber {Number} frame index to stop at
*/ */
PIXI.MovieClip.prototype.gotoAndStop = function(frameNumber) PIXI.MovieClip.prototype.gotoAndStop = function(frameNumber)
{ {
@ -72,7 +78,8 @@ PIXI.MovieClip.prototype.gotoAndStop = function(frameNumber)
/** /**
* Goes to a specific frame and begins playing the MovieClip * Goes to a specific frame and begins playing the MovieClip
* @param frame index to start at * @method gotoAndPlay
* @param frameNumber {Number} frame index to start at
*/ */
PIXI.MovieClip.prototype.gotoAndPlay = function(frameNumber) PIXI.MovieClip.prototype.gotoAndPlay = function(frameNumber)
{ {

8
src/pixi/Pixi.js Normal file
View file

@ -0,0 +1,8 @@
/**
* @author Mat Groves http://matgroves.com/
*/
/**
@module PIXI
*/
var PIXI = PIXI || {};

View file

@ -1,22 +1,33 @@
/** /**
* @author Mat Groves http://matgroves.com/ * @author Mat Groves http://matgroves.com/
*/ */
var PIXI = PIXI || {};
/** /**
* @class The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis. * 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 * @constructor
* @param x position of the point * @param x {Number} position of the point
* @param y position of the point * @param y {Number} position of the point
* @return A new Rectangle.
*/ */
PIXI.Point = function(x, y) PIXI.Point = function(x, y)
{ {
/**
* @property x
* @type Number
* @default 0
*/
this.x = x ? x : 0; this.x = x ? x : 0;
/**
* @property y
* @type Number
* @default 0
*/
this.y = y ? y : 0; this.y = y ? y : 0;
} }
/** /**
* @method clone
* @return a copy of the point * @return a copy of the point
*/ */
PIXI.Point.clone = function() PIXI.Point.clone = function()

View file

@ -1,27 +1,49 @@
/** /**
* @author Mat Groves http://matgroves.com/ * @author Mat Groves http://matgroves.com/
*/ */
var PIXI = PIXI || {};
/** /**
* @class 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. * 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 * @constructor
* @param x position of the rectangle * @param x {Number} position of the rectangle
* @param y position of the rectangle * @param y {Number} position of the rectangle
* @param width of the rectangle * @param width {Number} of the rectangle
* @param height of the rectangle * @param height {Number} of the rectangle
* @return A new Rectangle.
*/ */
PIXI.Rectangle = function(x, y, width, height) PIXI.Rectangle = function(x, y, width, height)
{ {
/**
* @property x
* @type Number
* @default 0
*/
this.x = x ? x : 0; this.x = x ? x : 0;
/**
* @property y
* @type Number
* @default 0
*/
this.y = y ? y : 0; this.y = y ? y : 0;
/**
* @property width
* @type Number
* @default 0
*/
this.width = width ? width : 0; this.width = width ? width : 0;
/**
* @property height
* @type Number
* @default 0
*/
this.height = height ? height : 0; this.height = height ? height : 0;
} }
/** /**
* @method clone
* @return a copy of the rectangle * @return a copy of the rectangle
*/ */
PIXI.Point.clone = function() PIXI.Point.clone = function()

View file

@ -1,53 +1,58 @@
/** /**
* @author Mat Groves http://matgroves.com/ * @author Mat Groves http://matgroves.com/
*/ */
var PIXI = PIXI || {};
PIXI.blendModes = {}; PIXI.blendModes = {};
PIXI.blendModes.NORMAL = 0; PIXI.blendModes.NORMAL = 0;
PIXI.blendModes.SCREEN = 1; PIXI.blendModes.SCREEN = 1;
/** /**
* @class A Sprite @class Sprite
* @augments PIXI.DisplayObjectContainer @extends DisplayObjectContainer
* @constructor @constructor
* @param {PIXI.textures.Texture} texture {@link PIXI.textures.Texture} @param texture {Texture}
* @return A new Sprite. @type String
*/ */
PIXI.Sprite = function(texture) PIXI.Sprite = function(texture)
{ {
PIXI.DisplayObjectContainer.call( this ); PIXI.DisplayObjectContainer.call( this );
/** /**
* The anchor sets the origin point of the texture. * The anchor sets the origin point of the texture.
* The default is 0,0 this means the textures origin is the top left * 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 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 * Setting the anchor to 1,1 would mean the textures origin points will be the bottom right
* @type #Point * @property anchor
*/ * @type Point
*/
this.anchor = new PIXI.Point(); this.anchor = new PIXI.Point();
/** /**
* The texture that the sprite is using * The texture that the sprite is using
* @type #Point * @property texture
* @type Texture
*/ */
this.texture = texture; this.texture = texture;
/** /**
* The blend mode of sprite. * The blend mode of sprite.
* currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN * currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN
* @property blendMode
* @type uint * @type uint
*/ */
this.blendMode = PIXI.blendModes.NORMAL; this.blendMode = PIXI.blendModes.NORMAL;
/** /**
* The width of the sprite (this is initially set by the texture) * The width of the sprite (this is initially set by the texture)
* @property width
* @type #Number * @type #Number
*/ */
this.width = 1; this.width = 1;
/** /**
* The height of the sprite (this is initially set by the texture) * The height of the sprite (this is initially set by the texture)
* @property height
* @type #Number * @type #Number
*/ */
this.height = 1; this.height = 1;
@ -72,9 +77,9 @@ PIXI.Sprite.constructor = PIXI.Sprite;
PIXI.Sprite.prototype = Object.create( PIXI.DisplayObjectContainer.prototype ); PIXI.Sprite.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
/** /**
* The PIXI texture that is displayed by the sprite @method setTexture
* @param {PIXI.Texture} texture {@link PIXI.Texture} @param texture {Texture} The PIXI texture that is displayed by the sprite
*/ */
PIXI.Sprite.prototype.setTexture = function(texture) PIXI.Sprite.prototype.setTexture = function(texture)
{ {
// stop current texture; // stop current texture;
@ -107,8 +112,10 @@ PIXI.Sprite.prototype.onTextureUpdate = function(event)
* *
* Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId * 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 * The frame ids are created when a Texture packer file has been loaded
* @param The frame Id of the texture in the cache * @method fromFrame
* @return {PIXI.Sprite} texture {@link PIXI.Sprite} * @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) PIXI.Sprite.fromFrame = function(frameId)
{ {
@ -121,8 +128,10 @@ PIXI.Sprite.fromFrame = function(frameId)
* *
* Helper function that creates a sprite that will contain a texture based on an image url * 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 * If the image is not in the texture cache it will be loaded
* @method fromImage
* @static
* @param The image url of the texture * @param The image url of the texture
* @return {PIXI.Sprite} texture {@link PIXI.Sprite} * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id
*/ */
PIXI.Sprite.fromImage = function(imageId) PIXI.Sprite.fromImage = function(imageId)
{ {

View file

@ -2,14 +2,12 @@
* @author Mat Groves http://matgroves.com/ * @author Mat Groves http://matgroves.com/
*/ */
var PIXI = PIXI || {};
/** /**
* @class A Stage represents the root of the display tree. Everything connected to the stage is rendered A Stage represents the root of the display tree. Everything connected to the stage is rendered
* @augments PIXI.DisplayObjectContainer @class Stage
* @constructor @extends DisplayObjectContainer
* @return A new Stage. @constructor
*/ */
PIXI.Stage = function() PIXI.Stage = function()
{ {
PIXI.DisplayObjectContainer.call( this ); PIXI.DisplayObjectContainer.call( this );
@ -25,6 +23,9 @@ PIXI.Stage.constructor = PIXI.Stage;
PIXI.Stage.prototype = Object.create( PIXI.DisplayObjectContainer.prototype ); PIXI.Stage.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
/**
@method updateTransform
*/
PIXI.Stage.prototype.updateTransform = function() PIXI.Stage.prototype.updateTransform = function()
{ {
this.worldAlpha = 1; this.worldAlpha = 1;
@ -40,9 +41,12 @@ PIXI.Stage.prototype.setFilter = function(filters)
this.filters = filters; this.filters = filters;
}*/ }*/
/**
@method __addChild
*/
PIXI.Stage.prototype.__addChild = function(child) PIXI.Stage.prototype.__addChild = function(child)
{ {
this.__childrenAdded.push(child); //this.__childrenAdded.push(child);
child.stage = this; child.stage = this;
@ -56,6 +60,9 @@ PIXI.Stage.prototype.__addChild = function(child)
} }
/**
@method __removeChild
*/
PIXI.Stage.prototype.__removeChild = function(child) PIXI.Stage.prototype.__removeChild = function(child)
{ {
this.__childrenRemoved.push(child); this.__childrenRemoved.push(child);

View file

@ -1,7 +1,6 @@
/** /**
* @author Mat Groves http://matgroves.com/ * @author Mat Groves http://matgroves.com/
*/ */
var PIXI = PIXI || {};
PIXI.Rope = function(texture, points) PIXI.Rope = function(texture, points)
@ -30,7 +29,7 @@ PIXI.Rope = function(texture, points)
// constructor // constructor
PIXI.Rope.constructor = GAME.Rope; PIXI.Rope.constructor = PIXI.Rope;
PIXI.Rope.prototype = Object.create( PIXI.Strip.prototype ); PIXI.Rope.prototype = Object.create( PIXI.Strip.prototype );
PIXI.Rope.prototype.refresh = function() PIXI.Rope.prototype.refresh = function()

View file

@ -1,8 +1,6 @@
/** /**
* @author Mat Groves http://matgroves.com/ * @author Mat Groves http://matgroves.com/
*/ */
var PIXI = PIXI || {};
PIXI.Strip = function(texture, width, height) PIXI.Strip = function(texture, width, height)
{ {

View file

@ -1,18 +1,15 @@
/** /**
* @author Mat Groves http://matgroves.com/ * @author Mat Groves http://matgroves.com/
*/ */
var PIXI = PIXI || {};
/** /**
* @class 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() * 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()
* @augments PIXI.EventTarget
* When all items have been loaded this class will dispatch a 'loaded' event * 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 * As each individual item is loaded this class will dispatch a 'progress' event
* @class AssetLoader
* @constructor * @constructor
* * @extends EventTarget
* @param 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 * @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
* @return A new AssetLoader
*/ */
PIXI.AssetLoader = function(assetURLs) PIXI.AssetLoader = function(assetURLs)
{ {
@ -21,6 +18,7 @@ PIXI.AssetLoader = function(assetURLs)
/** /**
* The array of asset URLs that are going to be loaded * The array of asset URLs that are going to be loaded
* @property assetURLs
* @type Array * @type Array
*/ */
this.assetURLs = assetURLs; this.assetURLs = assetURLs;

View file

@ -1,20 +1,19 @@
/** /**
* @author Mat Groves http://matgroves.com/ * @author Mat Groves http://matgroves.com/
*/ */
var PIXI = PIXI || {};
/** /**
* @class The sprite sheet loader is used to load in JSON sprite sheet data * 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 * 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. * 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. * 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() * 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. * 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 * When loaded this class will dispatch a 'loaded' event
* @augments PIXI.EventTarget * @class SpriteSheetLoader
* @extends EventTarget
* @constructor * @constructor
* @param the url of the sprite sheet JSON file * @param url {String} the url of the sprite sheet JSON file
* @return A new SpriteSheetLoader
*/ */
PIXI.SpriteSheetLoader = function(url) PIXI.SpriteSheetLoader = function(url)
@ -68,8 +67,16 @@ PIXI.SpriteSheetLoader.prototype.onLoaded = function()
for (var i in frameData) for (var i in frameData)
{ {
var rect = frameData[i].frame; 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] = ; // this.frames[i] = ;
PIXI.TextureCache[i] = new PIXI.Texture(this.texture, {x:rect.x, y:rect.y, width:rect.w, height:rect.h})
} }
if(this.texture.hasLoaded) if(this.texture.hasLoaded)

View file

@ -1,25 +1,28 @@
/** /**
* @author Mat Groves http://matgroves.com/ * @author Mat Groves http://matgroves.com/
*/ */
var PIXI = PIXI || {};
/** /**
* @class 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. * 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 :) * Dont forget to add the view to your DOM or you will not see anything :)
* @param the width of the canvas view * @class CanvasRenderer
* @param the height of the canvas view * @param width {Number} the width of the canvas view
* @return CanvasRenderer * @param height {Number} the height of the canvas view
*/ */
PIXI.CanvasRenderer = function(width, height) PIXI.CanvasRenderer = function(width, height)
{ {
/** /**
* The width of the canvas view * The width of the canvas view
* @property width
* @type Number * @type Number
* @default 800
*/ */
this.width = width ? width : 800; this.width = width ? width : 800;
/** /**
* The height of the canvas view * The height of the canvas view
* @property height
* @type Number * @type Number
* @default 600
*/ */
this.height = height ? height : 600; this.height = height ? height : 600;
@ -27,7 +30,8 @@ PIXI.CanvasRenderer = function(width, height)
/** /**
* The canvas element that the everything is drawn to * The canvas element that the everything is drawn to
* @type Number * @property view
* @type Canvas
*/ */
this.view = document.createElement( 'canvas' ); this.view = document.createElement( 'canvas' );
@ -35,6 +39,12 @@ PIXI.CanvasRenderer = function(width, height)
this.view.height = this.height; this.view.height = this.height;
this.view.background = "#FF0000"; this.view.background = "#FF0000";
this.count = 0; this.count = 0;
/**
* The canvas context that the everything is drawn to
* @property context
* @type Canvas 2d Context
*/
this.context = this.view.getContext("2d"); this.context = this.view.getContext("2d");
} }
@ -43,7 +53,8 @@ PIXI.CanvasRenderer.constructor = PIXI.CanvasRenderer;
/** /**
* Renders the stage to its canvas view * Renders the stage to its canvas view
* @param the PIXI.Stage element to be rendered * @method render
* @param stage {Stage} the Stage element to be rendered
*/ */
PIXI.CanvasRenderer.prototype.render = function(stage) PIXI.CanvasRenderer.prototype.render = function(stage)
{ {
@ -113,10 +124,10 @@ PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
frame.y, frame.y,
frame.width, frame.width,
frame.height, frame.height,
(transform[2]+displayObject.anchor.x * -frame.width + 0.5) | 0, (transform[2]+ ((displayObject.anchor.x - displayObject.texture.trim.x) * -frame.width) * transform[0]),
(transform[5]+displayObject.anchor.y * -frame.height + 0.5) | 0, (transform[5]+ ((displayObject.anchor.y - displayObject.texture.trim.y) * -frame.height)* transform[4]),
(frame.width * transform[0]), (displayObject.width * transform[0]),
(frame.height * transform[4])); (displayObject.height * transform[4]));
} }
else else
@ -128,17 +139,17 @@ PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
frame.y, frame.y,
frame.width, frame.width,
frame.height, frame.height,
displayObject.anchor.x * -frame.width, (displayObject.anchor.x - displayObject.texture.trim.x) * -frame.width,
displayObject.anchor.y * -frame.height, (displayObject.anchor.y - displayObject.texture.trim.y) * -frame.height,
frame.width, displayObject.width,
frame.height); displayObject.height);
} }
} }
} }
else if(displayObject instanceof PIXI.Strip) else if(displayObject instanceof PIXI.Strip)
{ {
context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5]) context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5])
this.renderStrip(displayObject) this.renderStrip(displayObject);
} }
// render! // render!

View file

@ -2,8 +2,6 @@
* @author Mat Groves http://matgroves.com/ * @author Mat Groves http://matgroves.com/
*/ */
var PIXI = PIXI || {};
PIXI._batchs = []; PIXI._batchs = [];
/** /**
@ -42,9 +40,9 @@ PIXI._restoreBatchs = function(gl)
} }
/** /**
* @class A WebGLBatch Enables a group of sprites to be drawn using the same settings. * 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. * 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.
* @augments PIXI.Sprite * @class WebGLBatch
* @param an instance of the webGL context * @param an instance of the webGL context
* @return {PIXI.renderers.WebGLBatch} WebGLBatch {@link PIXI.renderers.WebGLBatch} * @return {PIXI.renderers.WebGLBatch} WebGLBatch {@link PIXI.renderers.WebGLBatch}
*/ */
@ -99,7 +97,8 @@ PIXI.WebGLBatch.prototype.restoreLostContext = function(gl)
/** /**
* inits the batch's texture and blend mode based if the supplied sprite * inits the batch's texture and blend mode based if the supplied sprite
* @param 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 * @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) PIXI.WebGLBatch.prototype.init = function(sprite)
{ {
@ -117,8 +116,9 @@ PIXI.WebGLBatch.prototype.init = function(sprite)
/** /**
* inserts a sprite before the specified sprite * inserts a sprite before the specified sprite
* @param the sprite to be added * @method insertBefore
* @param the first sprite will be inserted before this sprite * @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) PIXI.WebGLBatch.prototype.insertBefore = function(sprite, nextSprite)
{ {
@ -144,8 +144,9 @@ PIXI.WebGLBatch.prototype.insertBefore = function(sprite, nextSprite)
/** /**
* inserts a sprite after the specified sprite * inserts a sprite after the specified sprite
* @param the sprite to be added * @method insertAfter
* @param the first sprite will be inserted after this sprite * @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) PIXI.WebGLBatch.prototype.insertAfter = function(sprite, previousSprite)
{ {
@ -173,7 +174,8 @@ PIXI.WebGLBatch.prototype.insertAfter = function(sprite, previousSprite)
/** /**
* removes a sprite from the batch * removes a sprite from the batch
* @param the sprite to be removed * @method remove
* @param sprite {Sprite} the sprite to be removed
*/ */
PIXI.WebGLBatch.prototype.remove = function(sprite) PIXI.WebGLBatch.prototype.remove = function(sprite)
{ {
@ -181,6 +183,7 @@ PIXI.WebGLBatch.prototype.remove = function(sprite)
if(this.size == 0) if(this.size == 0)
{ {
sprite.batch = null;
sprite.__prev = null; sprite.__prev = null;
sprite.__next = null; sprite.__next = null;
return; return;
@ -193,7 +196,7 @@ PIXI.WebGLBatch.prototype.remove = function(sprite)
else else
{ {
this.head = sprite.__next; this.head = sprite.__next;
//this.head.__prev = null; this.head.__prev = null;
} }
if(sprite.__next) if(sprite.__next)
@ -203,7 +206,7 @@ PIXI.WebGLBatch.prototype.remove = function(sprite)
else else
{ {
this.tail = sprite.__prev; this.tail = sprite.__prev;
//this.tail.__next = null this.tail.__next = null
} }
sprite.batch = null; sprite.batch = null;
@ -214,8 +217,9 @@ PIXI.WebGLBatch.prototype.remove = function(sprite)
/** /**
* Splits the batch into two with the specified sprite being the start of the new batch. * Splits the batch into two with the specified sprite being the start of the new batch.
* @param the sprite that indicates where the batch should be split * @method split
* @return the new batch * @param sprite {Sprite} the sprite that indicates where the batch should be split
* @return {WebGLBatch} the new batch
*/ */
PIXI.WebGLBatch.prototype.split = function(sprite) PIXI.WebGLBatch.prototype.split = function(sprite)
{ {
@ -262,7 +266,8 @@ PIXI.WebGLBatch.prototype.split = function(sprite)
/** /**
* Merges two batchs together * Merges two batchs together
* @param the batch that will be merged * @method merge
* @param batch {WebGLBatch} the batch that will be merged
*/ */
PIXI.WebGLBatch.prototype.merge = function(batch) PIXI.WebGLBatch.prototype.merge = function(batch)
{ {
@ -286,6 +291,7 @@ PIXI.WebGLBatch.prototype.merge = function(batch)
/** /**
* 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 * 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() PIXI.WebGLBatch.prototype.growBatch = function()
{ {
@ -338,6 +344,7 @@ PIXI.WebGLBatch.prototype.growBatch = function()
/** /**
* Refresh's all the data in the batch and sync's it with the webGL buffers * Refresh's all the data in the batch and sync's it with the webGL buffers
* @method refresh
*/ */
PIXI.WebGLBatch.prototype.refresh = function() PIXI.WebGLBatch.prototype.refresh = function()
{ {
@ -392,6 +399,7 @@ PIXI.WebGLBatch.prototype.refresh = function()
/** /**
* Updates all the relevant geometry and uploads the data to the GPU * Updates all the relevant geometry and uploads the data to the GPU
* @method update
*/ */
PIXI.WebGLBatch.prototype.update = function() PIXI.WebGLBatch.prototype.update = function()
{ {
@ -409,9 +417,8 @@ PIXI.WebGLBatch.prototype.update = function()
width = displayObject.width; width = displayObject.width;
height = displayObject.height; height = displayObject.height;
aX = displayObject.anchor.x; aX = displayObject.anchor.x - displayObject.texture.trim.x
aY = displayObject.anchor.y; aY = displayObject.anchor.y - displayObject.texture.trim.y
w0 = width * (1-aX); w0 = width * (1-aX);
w1 = width * -aX; w1 = width * -aX;
@ -467,12 +474,12 @@ PIXI.WebGLBatch.prototype.update = function()
} }
// TODO this probably could do with some optimisation.... // TODO this probably could do with some optimisation....
if(displayObject.cacheAlpha != displayObject.alpha) if(displayObject.cacheAlpha != displayObject.worldAlpha)
{ {
displayObject.cacheAlpha = displayObject.alpha; displayObject.cacheAlpha = displayObject.worldAlpha;
var colorIndex = indexRun * 4; var colorIndex = indexRun * 4;
this.colors[index2] = this.colors[colorIndex + 1] = this.colors[colorIndex + 2] = this.colors[colorIndex + 3] = displayObject.worldAlpha; this.colors[colorIndex] = this.colors[colorIndex + 1] = this.colors[colorIndex + 2] = this.colors[colorIndex + 3] = displayObject.worldAlpha;
this.dirtyColors = true; this.dirtyColors = true;
} }
@ -483,6 +490,7 @@ PIXI.WebGLBatch.prototype.update = function()
/** /**
* Draws the batch to the frame buffer * Draws the batch to the frame buffer
* @method render
*/ */
PIXI.WebGLBatch.prototype.render = function() PIXI.WebGLBatch.prototype.render = function()
{ {

View file

@ -1,16 +1,17 @@
/** /**
* @author Mat Groves http://matgroves.com/ * @author Mat Groves http://matgroves.com/
*/ */
var PIXI = PIXI || {};§
PIXI._defaultFrame = new PIXI.Rectangle(0,0,1,1); PIXI._defaultFrame = new PIXI.Rectangle(0,0,1,1);
/** /**
* @class 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 * 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 :) * Dont forget to add the view to your DOM or you will not see anything :)
* @param the width of the canvas view * @class WebGLRenderer
* @param the height of the canvas view * @param width {Number} the width of the canvas view
* @return WebGLRenderer * @default 0
* @param height {Number} the height of the canvas view
* @default 0
*/ */
PIXI.WebGLRenderer = function(width, height) PIXI.WebGLRenderer = function(width, height)
{ {
@ -101,21 +102,24 @@ PIXI.WebGLRenderer.prototype.initShaders = function()
/** /**
* @private * @private
*/ */
PIXI.WebGLRenderer.prototype.checkVisibility = function(displayObject) PIXI.WebGLRenderer.prototype.checkVisibility = function(displayObject, globalVisible)
{ {
var children = displayObject.children; var children = displayObject.children;
for (var i=0; i < children.length; i++) for (var i=0; i < children.length; i++)
{ {
var child = children[i]; var child = children[i];
// TODO optimize... shouldt need to loop through everything all the time // TODO optimize... shouldt need to loop through everything all the time
var actualVisibility = child.visible && globalVisible;
// everything should have a batch! // everything should have a batch!
// time to see whats new! // time to see whats new!
if(child.textureChange) if(child.textureChange)
{ {
child.textureChange = false; child.textureChange = false;
if(child.visible) if(actualVisibility)
{ {
this.removeDisplayObject(child) this.removeDisplayObject(child)
this.addDisplayObject(child) this.addDisplayObject(child)
@ -123,61 +127,36 @@ PIXI.WebGLRenderer.prototype.checkVisibility = function(displayObject)
// update texture!! // update texture!!
} }
if(child.cacheVisible != child.visible)
if(child.cacheVisible != actualVisibility)
{ {
child.cacheVisible = child.visible; child.cacheVisible = actualVisibility;
if(child.visible)
if(child.cacheVisible)
{ {
this.addDisplayObject(child); this.addDisplayObject(child);
} }
else else
{ {
this.removeDisplayObject(child); this.removeDisplayObject(child);
} }
}
this.setGLVisible(child, child.visible);
continue;
}
if(child.children.length > 0) if(child.children.length > 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 * 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) PIXI.WebGLRenderer.prototype.render = function(stage)
{ {
@ -185,9 +164,18 @@ PIXI.WebGLRenderer.prototype.render = function(stage)
// update children if need be // update children if need be
// best to remove first! // 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 // 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 // update any textures
for (var i=0; i < PIXI.texturesToUpdate.length; i++) this.updateTexture(PIXI.texturesToUpdate[i]); for (var i=0; i < PIXI.texturesToUpdate.length; i++) this.updateTexture(PIXI.texturesToUpdate[i]);
@ -197,7 +185,7 @@ PIXI.WebGLRenderer.prototype.render = function(stage)
PIXI.texturesToUpdate = []; PIXI.texturesToUpdate = [];
// recursivly loop through all items! // recursivly loop through all items!
this.checkVisibility(stage); this.checkVisibility(stage, true);
// update the scen graph // update the scen graph
stage.updateTransform(); stage.updateTransform();
@ -206,7 +194,7 @@ PIXI.WebGLRenderer.prototype.render = function(stage)
gl.clear(gl.COLOR_BUFFER_BIT) 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! // set the correct blend mode!
gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA); gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
@ -265,12 +253,16 @@ PIXI.WebGLRenderer.prototype.updateTexture = function(texture)
*/ */
PIXI.WebGLRenderer.prototype.addDisplayObject = function(displayObject) 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.batch = null;
//displayObject.cacheVisible = true; //displayObject.cacheVisible = true;
@ -458,10 +450,12 @@ PIXI.WebGLRenderer.prototype.addDisplayObject = function(displayObject)
PIXI.WebGLRenderer.prototype.removeDisplayObject = function(displayObject) PIXI.WebGLRenderer.prototype.removeDisplayObject = function(displayObject)
{ {
//if(displayObject.stage)return; //if(displayObject.stage)return;
displayObject.cacheVisible = displayObject.visible; displayObject.cacheVisible = false;//displayObject.visible;
if(!displayObject.renderable)return; if(!displayObject.renderable)return;
displayObject.__inWebGL = false;
/* /*
* removing is a lot quicker.. * removing is a lot quicker..
* *
@ -472,9 +466,11 @@ PIXI.WebGLRenderer.prototype.removeDisplayObject = function(displayObject)
{ {
// should always have a batch! // should always have a batch!
var batch = displayObject.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); batch.remove(displayObject);
if(batch.size==0) if(batch.size==0)
{ {
batchToRemove = batch batchToRemove = batch
@ -528,8 +524,9 @@ PIXI.WebGLRenderer.prototype.removeDisplayObject = function(displayObject)
/** /**
* resizes the webGL view to the specified width and height * resizes the webGL view to the specified width and height
* @param the new width of the webGL view * @method resize
* @param the new height of the webGL view * @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) PIXI.WebGLRenderer.prototype.resize = function(width, height)
{ {

View file

@ -2,7 +2,6 @@
/** /**
* @author Mat Groves http://matgroves.com/ * @author Mat Groves http://matgroves.com/
*/ */
var PIXI = PIXI || {};
PIXI.shaderFragmentSrc = [ "precision mediump float;", PIXI.shaderFragmentSrc = [ "precision mediump float;",
"varying vec2 vTextureCoord;", "varying vec2 vTextureCoord;",

View file

@ -1,17 +1,16 @@
/** /**
* @author Mat Groves http://matgroves.com/ * @author Mat Groves http://matgroves.com/
*/ */
var PIXI = PIXI || {};
PIXI.BaseTextureCache = {}; PIXI.BaseTextureCache = {};
PIXI.texturesToUpdate = []; PIXI.texturesToUpdate = [];
/** /**
* @class A texture stores the information that represents an image. All textures have a base texture * A texture stores the information that represents an image. All textures have a base texture
* @augments PIXI.EventTarget * @class BaseTexture
* @extends EventTarget
* @constructor * @constructor
* @param image url * @param imageUrl {String} image url
* @return A new BaseTexture
*/ */
PIXI.BaseTexture = function(imageUrl) PIXI.BaseTexture = function(imageUrl)
{ {
@ -19,13 +18,15 @@ PIXI.BaseTexture = function(imageUrl)
/** /**
* The url of the texture * The url of the texture
* @type #BaseTexture * @property imageUrl
* @type String
*/ */
this.imageUrl = imageUrl; this.imageUrl = imageUrl;
/** /**
* The html image that is loaded to create the texture * The html image that is loaded to create the texture
* @type #BaseTexture * @property image
* @type Image
*/ */
this.image = new Image(); this.image = new Image();
@ -41,17 +42,19 @@ PIXI.BaseTexture = function(imageUrl)
scope.dispatchEvent( { type: 'loaded', content: scope } ); scope.dispatchEvent( { type: 'loaded', content: scope } );
} }
$.proxy(this.onImageLoaded, this); $.proxy(this.onImageLoaded, this);
this.image.src = imageUrl; this.image.src = imageUrl;
/** /**
* [read only] The width of the base texture set when the image has loaded * [read only] The width of the base texture set when the image has loaded
* @type #BaseTexture * @property width
* @type Number
*/ */
this.width = 100; this.width = 100;
/** /**
* [read only] The height of the base texture set when the image has loaded * [read only] The height of the base texture set when the image has loaded
* @type #BaseTexture * @property height
* @type Number
*/ */
this.height = 100; this.height = 100;

View file

@ -1,18 +1,17 @@
/** /**
* @author Mat Groves http://matgroves.com/ * @author Mat Groves http://matgroves.com/
*/ */
var PIXI = PIXI || {};
PIXI.TextureCache = {}; PIXI.TextureCache = {};
PIXI.FrameCache = {}; 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 * 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 * @class Texture
* @extends EventTarget
* @constructor * @constructor
* @param {PIXI.textures.BaseTexture} base texture {@link PIXI.textures.BaseTexture} * @param baseTexture {BaseTexture}
* @param {PIXI.Rectangle} frame {@link PIXI.Rectangle} * @param frmae {Rectangle}
* @return A new Texture.
*/ */
PIXI.Texture = function(baseTexture, frame) PIXI.Texture = function(baseTexture, frame)
{ {
@ -24,9 +23,12 @@ PIXI.Texture = function(baseTexture, frame)
frame = new PIXI.Rectangle(0,0,1,1); frame = new PIXI.Rectangle(0,0,1,1);
} }
this.trim = new PIXI.Point();
/** /**
* The base texture of this texture * The base texture of this texture
* @type #BaseTexture * @property baseTexture
* @type BaseTexture
*/ */
this.baseTexture = baseTexture; this.baseTexture = baseTexture;
@ -34,6 +36,7 @@ PIXI.Texture = function(baseTexture, frame)
/** /**
* The frame specifies the region of the base texture that this texture uses * The frame specifies the region of the base texture that this texture uses
* @property frame
* @type #Rectangle * @type #Rectangle
*/ */
this.frame = frame; this.frame = frame;
@ -71,8 +74,8 @@ PIXI.Texture.prototype.onBaseTextureLoaded = function(event)
/** /**
* Specifies the rectangle region of the baseTexture * Specifies the rectangle region of the baseTexture
* @param {PIXI.Rectangle} frame {@link PIXI.Rectangle} * @method setFrame
* @return A new Texture. * @param frame {Rectangle}
*/ */
PIXI.Texture.prototype.setFrame = function(frame) PIXI.Texture.prototype.setFrame = function(frame)
{ {
@ -86,8 +89,10 @@ PIXI.Texture.prototype.setFrame = function(frame)
* *
* Helper function that returns a texture based on an image url * 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 * If the image is not in the texture cache it will be created and loaded
* @param The image url of the texture * @static
* @return {PIXI.textures.Texture} texture {@link PIXI.textures.Texture} * @method fromImage
* @param imageUrl {String} The image url of the texture
* @return Texture
*/ */
PIXI.Texture.fromImage = function(imageUrl) PIXI.Texture.fromImage = function(imageUrl)
{ {
@ -108,21 +113,23 @@ PIXI.Texture.fromImage = function(imageUrl)
* *
* Helper function that returns a texture based on a frame id * 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 * If the frame id is not in the texture cache an error will be thrown
* @param The frame id of the texture * @method fromFrameId
* @return {PIXI.textures.Texture} texture {@link PIXI.textures.Texture} * @param frameId {String} The frame id of the texture
* @return Texture
*/ */
PIXI.Texture.fromFrameId = function(frameId) PIXI.Texture.fromFrameId = function(frameId)
{ {
var texture = PIXI.TextureCache[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; return texture;
} }
/** /**
* *
* Adds a texture to the textureCache. * Adds a texture to the textureCache.
* @param {PIXI.textures.Texture} texture {@link PIXI.textures.Texture} * @method addTextureToCache
* @param the id that the texture will be stored against. * @param texture {Texture}
* @param id {String} the id that the texture will be stored against.
*/ */
PIXI.Texture.addTextureToCache = function(texture, id) PIXI.Texture.addTextureToCache = function(texture, id)
{ {
@ -132,9 +139,10 @@ PIXI.Texture.addTextureToCache = function(texture, id)
/** /**
* *
* Remove a texture from the textureCache. * 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; PIXI.TextureCache[id] = texture;
} }

View file

@ -1,14 +1,14 @@
/** /**
* @author Mat Groves http://matgroves.com/ * @author Mat Groves http://matgroves.com/
*/ */
var PIXI = PIXI || {};
/** /**
* This helper function will automatically detect which renderer you should be using. * 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 * 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 * @method autoDetectRenderer
* @param the height of the renderers view * @static
* @return A new Renderer * @param width {Number} the width of the renderers view
* @param height {Number} the height of the renderers view
*/ */
PIXI.autoDetectRenderer = function(width, height) PIXI.autoDetectRenderer = function(width, height)
{ {

View file

@ -2,7 +2,6 @@
* https://github.com/mrdoob/eventtarget.js/ * https://github.com/mrdoob/eventtarget.js/
* THankS mr DOob! * THankS mr DOob!
*/ */
var PIXI = PIXI || {};
PIXI.EventTarget = function () { PIXI.EventTarget = function () {

9
src/yuidoc.json Normal file
View file

@ -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"
}
}