From 9a806b5720eb594934f53a4791ca0b4242245a59 Mon Sep 17 00:00:00 2001 From: Mat Groves Date: Mon, 17 Jun 2013 14:14:34 +0100 Subject: [PATCH 01/68] Initial Commit Mitre line algorth working in webGL --- bin/pixi.dev.js | 133 +- bin/pixi.js | 6 +- examples/example 1 - Basics/pixi.js | 133 +- examples/example 10 - Text/pixi.js | 133 +- examples/example 11 - RenderTexture/pixi.js | 133 +- examples/example 13 - Graphics/index.html | 86 + examples/example 13 - Graphics/pixi.js | 5832 +++++++++++++++++ examples/example 13 - Graphics/spinObj_01.png | Bin 0 -> 35843 bytes examples/example 13 - Graphics/spinObj_02.png | Bin 0 -> 37746 bytes examples/example 13 - Graphics/spinObj_03.png | Bin 0 -> 37240 bytes examples/example 13 - Graphics/spinObj_04.png | Bin 0 -> 35136 bytes examples/example 13 - Graphics/spinObj_05.png | Bin 0 -> 36128 bytes examples/example 13 - Graphics/spinObj_06.png | Bin 0 -> 36751 bytes examples/example 13 - Graphics/spinObj_07.png | Bin 0 -> 35407 bytes examples/example 13 - Graphics/spinObj_08.png | Bin 0 -> 33533 bytes examples/example 2 - SpriteSheet/pixi.js | 133 +- examples/example 3 - MovieClip/pixi.js | 133 +- examples/example 4 - Balls/pixi.js | 133 +- examples/example 5 - Morph/pixi.js | 133 +- examples/example 6 - Interactivity/pixi.js | 133 +- .../pixi.js | 133 +- examples/example 8 - Dragging/pixi.js | 133 +- examples/example 9 - Tiling Texture/pixi.js | 133 +- src/pixi/InteractionManager.js | 2 +- src/pixi/primitives/Graphics.js | 472 ++ src/pixi/primitives/Line.js | 37 + src/pixi/renderers/CanvasRenderer.js | 4 + src/pixi/renderers/WebGLRenderGroup.js | 121 +- src/pixi/renderers/WebGLRenderer.js | 8 +- 29 files changed, 8043 insertions(+), 121 deletions(-) create mode 100644 examples/example 13 - Graphics/index.html create mode 100644 examples/example 13 - Graphics/pixi.js create mode 100644 examples/example 13 - Graphics/spinObj_01.png create mode 100644 examples/example 13 - Graphics/spinObj_02.png create mode 100644 examples/example 13 - Graphics/spinObj_03.png create mode 100644 examples/example 13 - Graphics/spinObj_04.png create mode 100644 examples/example 13 - Graphics/spinObj_05.png create mode 100644 examples/example 13 - Graphics/spinObj_06.png create mode 100644 examples/example 13 - Graphics/spinObj_07.png create mode 100644 examples/example 13 - Graphics/spinObj_08.png create mode 100644 src/pixi/primitives/Graphics.js create mode 100644 src/pixi/primitives/Line.js diff --git a/bin/pixi.dev.js b/bin/pixi.dev.js index 2028846..31f792b 100644 --- a/bin/pixi.dev.js +++ b/bin/pixi.dev.js @@ -4,7 +4,7 @@ * Copyright (c) 2012, Mat Groves * http://goodboydigital.com/ * - * Compiled: 2013-06-07 + * Compiled: 2013-06-14 * * Pixi.JS is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license.php @@ -1465,7 +1465,7 @@ PIXI.InteractionManager.prototype.update = function() var len = this.interactiveItems.length; - for (var i=0; i < this.interactiveItems.length; i++) { + for (var i=0; i < len; i++) { this.interactiveItems[i].interactiveChildren = false; } @@ -2643,7 +2643,9 @@ PIXI.WebGLRenderer.prototype.render = function(stage) gl.clearColor(stage.backgroundColorSplit[0],stage.backgroundColorSplit[1],stage.backgroundColorSplit[2], !this.transparent); gl.clear(gl.COLOR_BUFFER_BIT); - + // HACK TO TEST + PIXI.projectionMatrix = this.projectionMatrix; + this.stageRenderGroup.backgroundColor = stage.backgroundColorSplit; this.stageRenderGroup.render(this.projectionMatrix); @@ -3422,7 +3424,6 @@ PIXI.WebGLRenderGroup.prototype.setRenderable = function(displayObject) PIXI.WebGLRenderGroup.prototype.render = function(projectionMatrix) { - PIXI.WebGLRenderer.updateTextures(); var gl = this.gl; @@ -3452,6 +3453,10 @@ PIXI.WebGLRenderGroup.prototype.render = function(projectionMatrix) { if(renderable.visible)this.renderStrip(renderable, projectionMatrix); } + else if(renderable instanceof PIXI.Graphics) + { + if(renderable.visible) renderable.renderWebGL(this, projectionMatrix); + } } } @@ -3652,8 +3657,9 @@ PIXI.WebGLRenderGroup.prototype.checkVisibility = function(displayObject, global child.textureChange = false; if(child.worldVisible) { - this.removeDisplayObject(child) - this.addDisplayObject(child) + this.removeDisplayObject(child); + this.addDisplayObject(child); + //this.updateTexture(child); } // update texture!! } @@ -3665,6 +3671,106 @@ PIXI.WebGLRenderGroup.prototype.checkVisibility = function(displayObject, global }; } +PIXI.WebGLRenderGroup.prototype.updateTexture = function(displayObject) +{ + // we know this exists.. + // is it in a batch.. + // check batch length + if(displayObject.batch.length == 1) + { + // just one! this guy! so simply swap the texture + displayObject.batch.texture = displayObject.texture.baseTexture; + return; + } + + // early out! + if(displayObject.batch.texture == displayObject.texture.baseTexture)return; + + + if(displayObject.batch.head == displayObject) + { + //console.log("HEAD") + var currentBatch = displayObject.batch; + + var index = this.batchs.indexOf( currentBatch ); + var previousBatch = this.batchs[index-1]; + currentBatch.remove(displayObject); + + if(previousBatch) + { + if(previousBatch.texture == displayObject.texture.baseTexture && previousBatch.blendMode == displayObject.blendMode) + { + previousBatch.insertAfter(displayObject, previousBatch.tail); + } + else + { + // add it before.. + var batch = PIXI.WebGLRenderer.getBatch(); + batch.init(displayObject); + this.batchs.splice(index-1, 0, batch); + } + + } + else + { + // we are 0! + var batch = PIXI.WebGLRenderer.getBatch(); + batch.init(displayObject); + this.batchs.splice(0, 0, batch); + } + + } + else if(displayObject.batch.tail == displayObject) + { + var currentBatch = displayObject.batch; + + var index = this.batchs.indexOf( currentBatch ); + var nextBatch = this.batchs[index+1]; + currentBatch.remove(displayObject); + + if(nextBatch) + { + if(nextBatch.texture == displayObject.texture.baseTexture && nextBatch.blendMode == displayObject.blendMode) + { + nextBatch.insertBefore(displayObject, nextBatch.head); + return; + } + else + { + // add it before.. + var batch = PIXI.WebGLRenderer.getBatch(); + batch.init(displayObject); + this.batchs.splice(index+1, 0, batch); + } + + } + else + { + // we are 0! + var batch = PIXI.WebGLRenderer.getBatch(); + batch.init(displayObject); + this.batchs.push(batch); + } + } + else + { + // console.log("MIDDLE") + var currentBatch = displayObject.batch; + + // split the batch into 2 + // AH! dont split on the current display object as the texture is wrong! + var splitBatch = currentBatch.split(displayObject); + + // now remove the display object + splitBatch.remove(displayObject); + + var batch = PIXI.WebGLRenderer.getBatch(); + var index = this.batchs.indexOf( currentBatch ); + batch.init(displayObject); + this.batchs.splice(index+1, 0, batch, splitBatch); + } +} + PIXI.WebGLRenderGroup.prototype.addDisplayObject = function(displayObject) { // add a child to the render group.. @@ -3683,19 +3789,16 @@ PIXI.WebGLRenderGroup.prototype.addDisplayObject = function(displayObject) var previousSprite = this.getPreviousRenderable(displayObject); var nextSprite = this.getNextRenderable(displayObject); - /* * so now we have the next renderable and the previous renderable * */ - if(displayObject instanceof PIXI.Sprite) { var previousBatch var nextBatch - //console.log( previousSprite) if(previousSprite instanceof PIXI.Sprite) { previousBatch = previousSprite.batch; @@ -3792,6 +3895,14 @@ PIXI.WebGLRenderGroup.prototype.addDisplayObject = function(displayObject) this.initStrip(displayObject); this.batchs.push(displayObject); } + else if(displayObject instanceof PIXI.Graphics) + { + //displayObject.initWebGL(this); + + // add to a batch!! + //this.initStrip(displayObject); + this.batchs.push(displayObject); + } // if its somthing else... then custom codes! this.batchUpdate = true; @@ -4383,6 +4494,10 @@ PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject) { displayObject.renderCanvas(this); } + else if(displayObject instanceof PIXI.Graphics) + { + displayObject.render(this); + } // render! for (var i=0; i < displayObject.children.length; i++) diff --git a/bin/pixi.js b/bin/pixi.js index 63e46d9..0c19198 100644 --- a/bin/pixi.js +++ b/bin/pixi.js @@ -4,10 +4,10 @@ * Copyright (c) 2012, Mat Groves * http://goodboydigital.com/ * - * Compiled: 2013-06-07 + * Compiled: 2013-06-14 * * Pixi.JS is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license.php */ -(function(){function t(t){return[(255&t>>16)/255,(255&t>>8)/255,(255&t)/255]}function e(){return r.Matrix="undefined"!=typeof Float32Array?Float32Array:Array,r.Matrix}var i=this,r=r||{};r.Point=function(t,e){this.x=t||0,this.y=e||0},r.Point.prototype.clone=function(){return new r.Point(this.x,this.y)},r.Point.constructor=r.Point,r.Rectangle=function(t,e,i,r){this.x=t||0,this.y=e||0,this.width=i||0,this.height=r||0},r.Rectangle.prototype.clone=function(){return new r.Rectangle(this.x,this.y,this.width,this.height)},r.Rectangle.constructor=r.Rectangle,r.DisplayObject=function(){this.position=new r.Point,this.scale=new r.Point(1,1),this.pivot=new r.Point(0,0),this.rotation=0,this.alpha=1,this.visible=!0,this.worldVisible=!1,this.parent=null,this.stage=null,this.hitArea=null,this.worldAlpha=1,this.color=[],this.worldTransform=r.mat3.create(),this.localTransform=r.mat3.create(),this.dynamic=!0,this._sr=0,this._cr=1,this.childIndex=0,this.renderable=!1,this.interactive=!1,this.buttonMode=!1},r.DisplayObject.constructor=r.DisplayObject,r.DisplayObject.prototype.setInteractive=function(t){this.interactive=t,this.stage&&(this.stage.dirty=!0)},r.DisplayObject.prototype.updateTransform=function(){this.rotation!=this.rotationCache&&(this.rotationCache=this.rotation,this._sr=Math.sin(this.rotation),this._cr=Math.cos(this.rotation));var t=this.localTransform,e=this.parent.worldTransform,i=this.worldTransform;t[0]=this._cr*this.scale.x,t[1]=-this._sr*this.scale.y,t[3]=this._sr*this.scale.x,t[4]=this._cr*this.scale.y;var r=this.pivot.x,s=this.pivot.y;t[2]=this.position.x-t[0]*r-s*t[1],t[5]=this.position.y-t[4]*s-r*t[3];var n=t[0],o=t[1],a=t[2],h=t[3],u=t[4],d=t[5],c=e[0],l=e[1],p=e[2],f=e[3],x=e[4],v=e[5];i[0]=c*n+l*h,i[1]=c*o+l*u,i[2]=c*a+l*d+p,i[3]=f*n+x*h,i[4]=f*o+x*u,i[5]=f*a+x*d+v,this.worldAlpha=this.alpha*this.parent.worldAlpha},r.DisplayObjectContainer=function(){r.DisplayObject.call(this),this.children=[],this.renderable=!1},r.DisplayObjectContainer.constructor=r.DisplayObjectContainer,r.DisplayObjectContainer.prototype=Object.create(r.DisplayObject.prototype),r.DisplayObjectContainer.prototype.addChild=function(t){void 0!=t.parent&&t.parent.removeChild(t),t.parent=this,t.childIndex=this.children.length,this.children.push(t),this.stage&&this.stage.__addChild(t),this.__renderGroup&&(t.__renderGroup&&t.__renderGroup.removeDisplayObjectAndChildren(t),this.__renderGroup.addDisplayObjectAndChildren(t))},r.DisplayObjectContainer.prototype.addChildAt=function(t,e){if(!(e>=0&&this.children.length>=e))throw Error(t+" The index "+e+" supplied is out of bounds "+this.children.length);void 0!=t.parent&&t.parent.removeChild(t),e==this.children.length?this.children.push(t):this.children.splice(e,0,t),t.parent=this,t.childIndex=e;for(var i=this.children.length,r=e;i>r;r++)this.children[r].childIndex=r;this.stage&&this.stage.__addChild(t),this.__renderGroup&&(t.__renderGroup&&t.__renderGroup.removeDisplayObjectAndChildren(t),this.__renderGroup.addDisplayObjectAndChildren(t))},r.DisplayObjectContainer.prototype.swapChildren=function(t,e){var i=this.children.indexOf(t),r=this.children.indexOf(e);if(-1===i||-1===r)throw Error(t+" Both the supplied DisplayObjects must be a child of the caller "+this);this.stage&&(this.stage.__removeChild(t),this.stage.__removeChild(e),this.stage.__addChild(t),this.stage.__addChild(e)),t.childIndex=r,e.childIndex=i,this.children[i]=e,this.children[r]=t},r.DisplayObjectContainer.prototype.getChildAt=function(t){if(t>=0&&this.children.length>t)return this.children[t];throw Error(child+" Both the supplied DisplayObjects must be a child of the caller "+this)},r.DisplayObjectContainer.prototype.removeChild=function(t){var e=this.children.indexOf(t);if(-1===e)throw Error(t+" The supplied DisplayObject must be a child of the caller "+this);this.stage&&this.stage.__removeChild(t),t.__renderGroup&&t.__renderGroup.removeDisplayObjectAndChildren(t),t.parent=void 0,this.children.splice(e,1);for(var i=e,r=this.children.length;r>i;i++)this.children[i].childIndex-=1},r.DisplayObjectContainer.prototype.updateTransform=function(){if(this.visible){r.DisplayObject.prototype.updateTransform.call(this);for(var t=0,e=this.children.length;e>t;t++)this.children[t].updateTransform()}},r.blendModes={},r.blendModes.NORMAL=0,r.blendModes.SCREEN=1,r.Sprite=function(t){r.DisplayObjectContainer.call(this),this.anchor=new r.Point,this.texture=t,this.blendMode=r.blendModes.NORMAL,this._width=0,this._height=0,t.baseTexture.hasLoaded?this.updateFrame=!0:(this.onTextureUpdateBind=this.onTextureUpdate.bind(this),this.texture.addEventListener("update",this.onTextureUpdateBind)),this.renderable=!0},r.Sprite.constructor=r.Sprite,r.Sprite.prototype=Object.create(r.DisplayObjectContainer.prototype),Object.defineProperty(r.Sprite.prototype,"width",{get:function(){return this.scale.x*this.texture.frame.width},set:function(t){this.scale.x=t/this.texture.frame.width,this._width=t}}),Object.defineProperty(r.Sprite.prototype,"height",{get:function(){return this.scale.y*this.texture.frame.height},set:function(t){this.scale.y=t/this.texture.frame.height,this._height=t}}),r.Sprite.prototype.setTexture=function(t){this.texture.baseTexture!=t.baseTexture&&(this.textureChange=!0),this.texture=t,this.updateFrame=!0},r.Sprite.prototype.onTextureUpdate=function(){this._width&&(this.scale.x=this._width/this.texture.frame.width),this._height&&(this.scale.y=this._height/this.texture.frame.height),this.updateFrame=!0},r.Sprite.fromFrame=function(t){var e=r.TextureCache[t];if(!e)throw Error("The frameId '"+t+"' does not exist in the texture cache"+this);return new r.Sprite(e)},r.Sprite.fromImage=function(t){var e=r.Texture.fromImage(t);return new r.Sprite(e)},r.MovieClip=function(t){r.Sprite.call(this,t[0]),this.textures=t,this.currentFrame=0,this.animationSpeed=1,this.loop=!0,this.onComplete=null,this.playing},r.MovieClip.constructor=r.MovieClip,r.MovieClip.prototype=Object.create(r.Sprite.prototype),r.MovieClip.prototype.stop=function(){this.playing=!1},r.MovieClip.prototype.play=function(){this.playing=!0},r.MovieClip.prototype.gotoAndStop=function(t){this.playing=!1,this.currentFrame=t;var e=0|this.currentFrame+.5;this.setTexture(this.textures[e%this.textures.length])},r.MovieClip.prototype.gotoAndPlay=function(t){this.currentFrame=t,this.playing=!0},r.MovieClip.prototype.updateTransform=function(){if(r.Sprite.prototype.updateTransform.call(this),this.playing){this.currentFrame+=this.animationSpeed;var t=0|this.currentFrame+.5;this.loop||this.textures.length>t?this.setTexture(this.textures[t%this.textures.length]):t>=this.textures.length&&(this.gotoAndStop(this.textures.length-1),this.onComplete&&this.onComplete())}},r.Text=function(t,e){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"),r.Sprite.call(this,r.Texture.fromCanvas(this.canvas)),this.setText(t),this.setStyle(e),this.updateText(),this.dirty=!1},r.Text.constructor=r.Text,r.Text.prototype=Object.create(r.Sprite.prototype),r.Text.prototype.setStyle=function(t){t=t||{},t.font=t.font||"bold 20pt Arial",t.fill=t.fill||"black",t.align=t.align||"left",t.strokeThickness=t.strokeThickness||0,t.wordWrap=t.wordWrap||!1,t.wordWrapWidth=t.wordWrapWidth||100,this.style=t,this.dirty=!0},r.Sprite.prototype.setText=function(t){this.text=""+t||" ",this.dirty=!0},r.Text.prototype.updateText=function(){this.context.font=this.style.font;var t=this.text;this.style.wordWrap&&(t=this.wordWrap(this.text));for(var e=t.split(/(?:\r\n|\r|\n)/),i=[],s=0,n=0;e.length>n;n++){var o=this.context.measureText(e[n]).width;i[n]=o,s=Math.max(s,o)}this.canvas.width=s+this.style.strokeThickness;var a=this.determineFontHeight("font: "+this.style.font+";")+this.style.strokeThickness;for(this.canvas.height=a*e.length,this.context.fillStyle=this.style.fill,this.context.font=this.style.font,this.context.strokeStyle=this.style.stroke,this.context.lineWidth=this.style.strokeThickness,this.context.textBaseline="top",n=0;e.length>n;n++){var h=new r.Point(this.style.strokeThickness/2,this.style.strokeThickness/2+n*a);"right"==this.style.align?h.x+=s-i[n]:"center"==this.style.align&&(h.x+=(s-i[n])/2),this.style.stroke&&this.style.strokeThickness&&this.context.strokeText(e[n],h.x,h.y),this.style.fill&&this.context.fillText(e[n],h.x,h.y)}this.updateTexture()},r.Text.prototype.updateTexture=function(){this.texture.baseTexture.width=this.canvas.width,this.texture.baseTexture.height=this.canvas.height,this.texture.frame.width=this.canvas.width,this.texture.frame.height=this.canvas.height,this._width=this.canvas.width,this._height=this.canvas.height,r.texturesToUpdate.push(this.texture.baseTexture)},r.Text.prototype.updateTransform=function(){this.dirty&&(this.updateText(),this.dirty=!1),r.Sprite.prototype.updateTransform.call(this)},r.Text.prototype.determineFontHeight=function(t){var e=r.Text.heightCache[t];if(!e){var i=document.getElementsByTagName("body")[0],s=document.createElement("div"),n=document.createTextNode("M");s.appendChild(n),s.setAttribute("style",t),i.appendChild(s),e=s.offsetHeight,r.Text.heightCache[t]=e,i.removeChild(s)}return e},r.Text.prototype.wordWrap=function(t){for(var e=function(t,e,i,r,s){var n=Math.floor((r-i)/2)+i;return n==i?1:s>=t.measureText(e.substring(0,n)).width?t.measureText(e.substring(0,n+1)).width>s?n:arguments.callee(t,e,n,r,s):arguments.callee(t,e,i,n,s)},i=function(t,i,r){if(r>=t.measureText(i).width||1>i.length)return i;var s=e(t,i,0,i.length,r);return i.substring(0,s)+"\n"+arguments.callee(t,i.substring(s),r)},r="",s=t.split("\n"),n=0;s.length>n;n++)r+=i(this.context,s[n],this.style.wordWrapWidth)+"\n";return r},r.Text.prototype.destroy=function(t){t&&this.texture.destroy()},r.Text.heightCache={},r.BitmapText=function(t,e){r.DisplayObjectContainer.call(this),this.setText(t),this.setStyle(e),this.updateText(),this.dirty=!1},r.BitmapText.constructor=r.BitmapText,r.BitmapText.prototype=Object.create(r.DisplayObjectContainer.prototype),r.BitmapText.prototype.setText=function(t){this.text=t||" ",this.dirty=!0},r.BitmapText.prototype.setStyle=function(t){t=t||{},t.align=t.align||"left",this.style=t;var e=t.font.split(" ");this.fontName=e[e.length-1],this.fontSize=e.length>=2?parseInt(e[e.length-2],10):r.BitmapText.fonts[this.fontName].size,this.dirty=!0},r.BitmapText.prototype.updateText=function(){for(var t=r.BitmapText.fonts[this.fontName],e=new r.Point,i=null,s=[],n=0,o=[],a=0,h=this.fontSize/t.size,u=0;this.text.length>u;u++){var d=this.text.charCodeAt(u);if(/(?:\r\n|\r|\n)/.test(this.text.charAt(u)))o.push(e.x),n=Math.max(n,e.x),a++,e.x=0,e.y+=t.lineHeight,i=null;else{var c=t.chars[d];c&&(i&&c[i]&&(e.x+=c.kerning[i]),s.push({texture:c.texture,line:a,charCode:d,position:new r.Point(e.x+c.xOffset,e.y+c.yOffset)}),e.x+=c.xAdvance,i=d)}}o.push(e.x),n=Math.max(n,e.x);var l=[];for(u=0;a>=u;u++){var p=0;"right"==this.style.align?p=n-o[u]:"center"==this.style.align&&(p=(n-o[u])/2),l.push(p)}for(u=0;s.length>u;u++){var f=new r.Sprite(s[u].texture);f.position.x=(s[u].position.x+l[s[u].line])*h,f.position.y=s[u].position.y*h,f.scale.x=f.scale.y=h,this.addChild(f)}this.width=e.x*h,this.height=(e.y+t.lineHeight)*h},r.BitmapText.prototype.updateTransform=function(){if(this.dirty){for(;this.children.length>0;)this.removeChild(this.getChildAt(0));this.updateText(),this.dirty=!1}r.DisplayObjectContainer.prototype.updateTransform.call(this)},r.BitmapText.fonts={},r.InteractionManager=function(t){this.stage=t,this.tempPoint=new r.Point,this.mouseoverEnabled=!0,this.mouse=new r.InteractionData,this.touchs={},this.pool=[],this.interactiveItems=[],this.last=0},r.InteractionManager.constructor=r.InteractionManager,r.InteractionManager.prototype.collectInteractiveSprite=function(t,e){for(var i=t.children,r=i.length,s=r-1;s>=0;s--){var n=i[s];n.interactive?(e.interactiveChildren=!0,this.interactiveItems.push(n),n.children.length>0&&this.collectInteractiveSprite(n,n)):(n.__iParent=null,n.children.length>0&&this.collectInteractiveSprite(n,e))}},r.InteractionManager.prototype.setTarget=function(t){window.navigator.msPointerEnabled&&(t.view.style["-ms-content-zooming"]="none",t.view.style["-ms-touch-action"]="none"),this.target=t,t.view.addEventListener("mousemove",this.onMouseMove.bind(this),!0),t.view.addEventListener("mousedown",this.onMouseDown.bind(this),!0),document.body.addEventListener("mouseup",this.onMouseUp.bind(this),!0),t.view.addEventListener("mouseout",this.onMouseUp.bind(this),!0),t.view.addEventListener("touchstart",this.onTouchStart.bind(this),!0),t.view.addEventListener("touchend",this.onTouchEnd.bind(this),!0),t.view.addEventListener("touchmove",this.onTouchMove.bind(this),!0)},r.InteractionManager.prototype.update=function(){if(this.target){var t=Date.now(),e=t-this.last;if(e=30*e/1e3,!(1>e)){if(this.last=t,this.dirty){this.dirty=!1,this.interactiveItems.length;for(var i=0;this.interactiveItems.length>i;i++)this.interactiveItems[i].interactiveChildren=!1;this.interactiveItems=[],this.stage.interactive&&this.interactiveItems.push(this.stage),this.collectInteractiveSprite(this.stage,this.stage)}var r=this.interactiveItems.length;this.target.view.style.cursor="default";for(var i=0;r>i;i++){var s=this.interactiveItems[i];s.visible&&(s.mouseover||s.mouseout||s.buttonMode)&&(s.__hit=this.hitTest(s,this.mouse),s.__hit?(s.buttonMode&&(this.target.view.style.cursor="pointer"),s.__isOver||(s.mouseover&&s.mouseover(this.mouse),s.__isOver=!0)):s.__isOver&&(s.mouseout&&s.mouseout(this.mouse),s.__isOver=!1))}}}},r.InteractionManager.prototype.onMouseMove=function(t){t.preventDefault();var e=this.target.view.getBoundingClientRect();this.mouse.global.x=(t.clientX-e.left)*(this.target.width/e.width),this.mouse.global.y=(t.clientY-e.top)*(this.target.height/e.height);var i=this.interactiveItems.length;this.mouse.global;for(var r=0;i>r;r++){var s=this.interactiveItems[r];s.mousemove&&s.mousemove(this.mouse)}},r.InteractionManager.prototype.onMouseDown=function(t){t.preventDefault();var e=this.interactiveItems.length;this.mouse.global,this.stage;for(var i=0;e>i;i++){var r=this.interactiveItems[i];if((r.mousedown||r.click)&&(r.__mouseIsDown=!0,r.__hit=this.hitTest(r,this.mouse),r.__hit&&(r.mousedown&&r.mousedown(this.mouse),r.__isDown=!0,!r.interactiveChildren)))break}},r.InteractionManager.prototype.onMouseUp=function(t){t.preventDefault(),this.mouse.global;for(var e=this.interactiveItems.length,i=!1,r=0;e>r;r++){var s=this.interactiveItems[r];(s.mouseup||s.mouseupoutside||s.click)&&(s.__hit=this.hitTest(s,this.mouse),s.__hit&&!i?(s.mouseup&&s.mouseup(this.mouse),s.__isDown&&s.click&&s.click(this.mouse),s.interactiveChildren||(i=!0)):s.__isDown&&s.mouseupoutside&&s.mouseupoutside(this.mouse),s.__isDown=!1)}},r.InteractionManager.prototype.hitTest=function(t,e){var i=e.global;if(!t.visible)return!1;if(t instanceof r.Sprite){var s=t.worldTransform,n=s[0],o=s[1],a=s[2],h=s[3],u=s[4],d=s[5],c=1/(n*u+o*-h),l=u*c*i.x+-o*c*i.y+(d*o-a*u)*c,p=n*c*i.y+-h*c*i.x+(-d*n+a*h)*c,f=t.texture.frame.width,x=t.texture.frame.height,v=-f*t.anchor.x;if(l>v&&v+f>l){var g=-x*t.anchor.y;if(p>g&&g+x>p)return e.target=t,!0}}else if(t.hitArea){var s=t.worldTransform,b=t.hitArea,n=s[0],o=s[1],a=s[2],h=s[3],u=s[4],d=s[5],c=1/(n*u+o*-h),l=u*c*i.x+-o*c*i.y+(d*o-a*u)*c,p=n*c*i.y+-h*c*i.x+(-d*n+a*h)*c,v=b.x;if(l>v&&v+b.width>l){var g=b.y;if(p>g&&g+b.height>p)return!0}}for(var T=t.children.length,m=0;T>m;m++){var y=t.children[m],_=this.hitTest(y,e);if(_)return!0}return!1},r.InteractionManager.prototype.onTouchMove=function(t){t.preventDefault();for(var e=this.target.view.getBoundingClientRect(),i=t.changedTouches,r=0;i.length>r;r++){var s=i[r],n=this.touchs[s.identifier];n.global.x=(s.clientX-e.left)*(this.target.width/e.width),n.global.y=(s.clientY-e.top)*(this.target.height/e.height)}for(var o=this.interactiveItems.length,r=0;o>r;r++){var a=this.interactiveItems[r];a.touchmove&&a.touchmove(n)}},r.InteractionManager.prototype.onTouchStart=function(t){t.preventDefault();for(var e=this.target.view.getBoundingClientRect(),i=t.changedTouches,s=0;i.length>s;s++){var n=i[s],o=this.pool.pop();o||(o=new r.InteractionData),this.touchs[n.identifier]=o,o.global.x=(n.clientX-e.left)*(this.target.width/e.width),o.global.y=(n.clientY-e.top)*(this.target.height/e.height);for(var a=this.interactiveItems.length,h=0;a>h;h++){var u=this.interactiveItems[h];if((u.touchstart||u.tap)&&(u.__hit=this.hitTest(u,o),u.__hit&&(u.touchstart&&u.touchstart(o),u.__isDown=!0,u.__touchData=o,!u.interactiveChildren)))break}}},r.InteractionManager.prototype.onTouchEnd=function(t){t.preventDefault();for(var e=this.target.view.getBoundingClientRect(),i=t.changedTouches,r=0;i.length>r;r++){var s=i[r],n=this.touchs[s.identifier],o=!1;n.global.x=(s.clientX-e.left)*(this.target.width/e.width),n.global.y=(s.clientY-e.top)*(this.target.height/e.height);for(var a=this.interactiveItems.length,h=0;a>h;h++){var u=this.interactiveItems[h],d=u.__touchData;u.__hit=this.hitTest(u,n),d==n&&((u.touchend||u.tap)&&(u.__hit&&!o?(u.touchend&&u.touchend(n),u.__isDown&&u.tap&&u.tap(n),u.interactiveChildren||(o=!0)):u.__isDown&&u.touchendoutside&&u.touchendoutside(n),u.__isDown=!1),u.__touchData=null)}this.pool.push(n),this.touchs[s.identifier]=null}},r.InteractionData=function(){this.global=new r.Point,this.local=new r.Point,this.target},r.InteractionData.prototype.getLocalPosition=function(t){var e=t.worldTransform,i=this.global,s=e[0],n=e[1],o=e[2],a=e[3],h=e[4],u=e[5],d=1/(s*h+n*-a);return new r.Point(h*d*i.x+-n*d*i.y+(u*n-o*h)*d,s*d*i.y+-a*d*i.x+(-u*s+o*a)*d)},r.InteractionData.constructor=r.InteractionData,r.Stage=function(t,e){r.DisplayObjectContainer.call(this),this.worldTransform=r.mat3.create(),this.__childrenAdded=[],this.__childrenRemoved=[],this.childIndex=0,this.stage=this,this.stage.hitArea=new r.Rectangle(0,0,1e5,1e5),this.interactive=!!e,this.interactionManager=new r.InteractionManager(this),this.setBackgroundColor(t),this.worldVisible=!0},r.Stage.constructor=r.Stage,r.Stage.prototype=Object.create(r.DisplayObjectContainer.prototype),r.Stage.prototype.updateTransform=function(){this.worldAlpha=1;for(var t=0,e=this.children.length;e>t;t++)this.children[t].updateTransform();this.dirty&&(this.dirty=!1,this.interactionManager.dirty=!0),this.interactive&&this.interactionManager.update()},r.Stage.prototype.setBackgroundColor=function(e){this.backgroundColor=e||0,this.backgroundColorSplit=t(this.backgroundColor),this.backgroundColorString="#"+this.backgroundColor.toString(16)},r.Stage.prototype.getMousePosition=function(){return this.interactionManager.mouse.global},r.Stage.prototype.__addChild=function(t){if(t.interactive&&(this.dirty=!0),t.stage=this,t.children)for(var e=0;t.children.length>e;e++)this.__addChild(t.children[e])},r.Stage.prototype.__removeChild=function(t){if(t.interactive&&(this.dirty=!0),t.stage=void 0,t.children)for(var e=0,i=t.children.length;i>e;e++)this.__removeChild(t.children[e])},window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){window.setTimeout(t,1e3/60)}}(),"function"!=typeof Function.prototype.bind&&(Function.prototype.bind=function(){var t=Array.prototype.slice;return function(e){function i(){var n=s.concat(t.call(arguments));r.apply(this instanceof i?this:e,n)}var r=this,s=t.call(arguments,1);if("function"!=typeof r)throw new TypeError;return i.prototype=function n(t){return t&&(n.prototype=t),this instanceof n?void 0:new n}(r.prototype),i}}());var s=function(){var t=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(!window.ActiveXObject)return window.XMLHttpRequest?new XMLHttpRequest:!1;for(var e=0;t.length>e;e++)try{return new ActiveXObject(t[e])}catch(i){}};r.EventTarget=function(){var t={};this.addEventListener=this.on=function(e,i){void 0===t[e]&&(t[e]=[]),-1===t[e].indexOf(i)&&t[e].push(i)},this.dispatchEvent=this.emit=function(e){for(var i in t[e.type])t[e.type][i](e)},this.removeEventListener=this.off=function(e,i){var r=t[e].indexOf(i);-1!==r&&t[e].splice(r,1)}},e(),r.mat3={},r.mat3.create=function(){var t=new r.Matrix(9);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},r.mat4={},r.mat4.create=function(){var t=new r.Matrix(16);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},r.mat3.multiply=function(t,e,i){i||(i=t);var r=t[0],s=t[1],n=t[2],o=t[3],a=t[4],h=t[5],u=t[6],d=t[7],c=t[8],l=e[0],p=e[1],f=e[2],x=e[3],v=e[4],g=e[5],b=e[6],T=e[7],m=e[8];return i[0]=l*r+p*o+f*u,i[1]=l*s+p*a+f*d,i[2]=l*n+p*h+f*c,i[3]=x*r+v*o+g*u,i[4]=x*s+v*a+g*d,i[5]=x*n+v*h+g*c,i[6]=b*r+T*o+m*u,i[7]=b*s+T*a+m*d,i[8]=b*n+T*h+m*c,i},r.mat3.toMat4=function(t,e){return e||(e=r.mat4.create()),e[15]=1,e[14]=0,e[13]=0,e[12]=0,e[11]=0,e[10]=t[8],e[9]=t[7],e[8]=t[6],e[7]=0,e[6]=t[5],e[5]=t[4],e[4]=t[3],e[3]=0,e[2]=t[2],e[1]=t[1],e[0]=t[0],e},r.mat4.create=function(){var t=new r.Matrix(16);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},r.mat4.transpose=function(t,e){if(!e||t===e){var i=t[1],r=t[2],s=t[3],n=t[6],o=t[7],a=t[11];return t[1]=t[4],t[2]=t[8],t[3]=t[12],t[4]=i,t[6]=t[9],t[7]=t[13],t[8]=r,t[9]=n,t[11]=t[14],t[12]=s,t[13]=o,t[14]=a,t}return e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15],e},r.mat4.multiply=function(t,e,i){i||(i=t);var r=t[0],s=t[1],n=t[2],o=t[3],a=t[4],h=t[5],u=t[6],d=t[7],c=t[8],l=t[9],p=t[10],f=t[11],x=t[12],v=t[13],g=t[14],b=t[15],T=e[0],m=e[1],y=e[2],_=e[3];return i[0]=T*r+m*a+y*c+_*x,i[1]=T*s+m*h+y*l+_*v,i[2]=T*n+m*u+y*p+_*g,i[3]=T*o+m*d+y*f+_*b,T=e[4],m=e[5],y=e[6],_=e[7],i[4]=T*r+m*a+y*c+_*x,i[5]=T*s+m*h+y*l+_*v,i[6]=T*n+m*u+y*p+_*g,i[7]=T*o+m*d+y*f+_*b,T=e[8],m=e[9],y=e[10],_=e[11],i[8]=T*r+m*a+y*c+_*x,i[9]=T*s+m*h+y*l+_*v,i[10]=T*n+m*u+y*p+_*g,i[11]=T*o+m*d+y*f+_*b,T=e[12],m=e[13],y=e[14],_=e[15],i[12]=T*r+m*a+y*c+_*x,i[13]=T*s+m*h+y*l+_*v,i[14]=T*n+m*u+y*p+_*g,i[15]=T*o+m*d+y*f+_*b,i},r.autoDetectRenderer=function(t,e,i,s){t||(t=800),e||(e=600);var n=function(){try{return!!window.WebGLRenderingContext&&!!document.createElement("canvas").getContext("experimental-webgl")}catch(t){return!1}}();return n?new r.WebGLRenderer(t,e,i,s):new r.CanvasRenderer(t,e,i,s)},r.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;","}"],r.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;","}"],r.CompileVertexShader=function(t,e){return r._CompileShader(t,e,t.VERTEX_SHADER)},r.CompileFragmentShader=function(t,e){return r._CompileShader(t,e,t.FRAGMENT_SHADER)},r._CompileShader=function(t,e,i){var r=e.join("\n"),s=t.createShader(i);return t.shaderSource(s,r),t.compileShader(s),t.getShaderParameter(s,t.COMPILE_STATUS)?s:(alert(t.getShaderInfoLog(s)),null)},r._defaultFrame=new r.Rectangle(0,0,1,1),r.gl,r.WebGLRenderer=function(t,e,i,s){this.transparent=!!s,this.width=t||800,this.height=e||600,this.view=i||document.createElement("canvas"),this.view.width=this.width,this.view.height=this.height;var n=this;this.view.addEventListener("webglcontextlost",function(t){n.handleContextLost(t)},!1),this.view.addEventListener("webglcontextrestored",function(t){n.handleContextRestored(t)},!1),this.batchs=[];try{r.gl=this.gl=this.view.getContext("experimental-webgl",{alpha:this.transparent,antialias:!1,premultipliedAlpha:!1})}catch(o){throw Error(" This browser does not support webGL. Try using the canvas renderer"+this)}this.initShaders();var a=this.gl;r.WebGLRenderer.gl=a,this.batch=new r.WebGLBatch(a),a.disable(a.DEPTH_TEST),a.disable(a.CULL_FACE),a.enable(a.BLEND),a.colorMask(!0,!0,!0,this.transparent),this.projectionMatrix=r.mat4.create(),this.resize(this.width,this.height),this.contextLost=!1,this.stageRenderGroup=new r.WebGLRenderGroup(this.gl)},r.WebGLRenderer.constructor=r.WebGLRenderer,r.WebGLRenderer.getBatch=function(){return 0==r._batchs.length?new r.WebGLBatch(r.WebGLRenderer.gl):r._batchs.pop()},r.WebGLRenderer.returnBatch=function(t){t.clean(),r._batchs.push(t)},r.WebGLRenderer.prototype.initShaders=function(){var t=this.gl,e=r.CompileFragmentShader(t,r.shaderFragmentSrc),i=r.CompileVertexShader(t,r.shaderVertexSrc);r.shaderProgram=t.createProgram();var s=r.shaderProgram;t.attachShader(s,i),t.attachShader(s,e),t.linkProgram(s),t.getProgramParameter(s,t.LINK_STATUS)||alert("Could not initialise shaders"),t.useProgram(s),s.vertexPositionAttribute=t.getAttribLocation(s,"aVertexPosition"),t.enableVertexAttribArray(s.vertexPositionAttribute),s.textureCoordAttribute=t.getAttribLocation(s,"aTextureCoord"),t.enableVertexAttribArray(s.textureCoordAttribute),s.colorAttribute=t.getAttribLocation(s,"aColor"),t.enableVertexAttribArray(s.colorAttribute),s.mvMatrixUniform=t.getUniformLocation(s,"uMVMatrix"),s.samplerUniform=t.getUniformLocation(s,"uSampler")},r.WebGLRenderer.prototype.render=function(t){if(!this.contextLost){this.__stage!==t&&(this.__stage=t,this.stageRenderGroup.setRenderable(t)),r.WebGLRenderer.updateTextures(),t.updateTransform();var e=this.gl;if(e.colorMask(!0,!0,!0,this.transparent),e.viewport(0,0,this.width,this.height),e.bindFramebuffer(e.FRAMEBUFFER,null),e.clearColor(t.backgroundColorSplit[0],t.backgroundColorSplit[1],t.backgroundColorSplit[2],!this.transparent),e.clear(e.COLOR_BUFFER_BIT),this.stageRenderGroup.backgroundColor=t.backgroundColorSplit,this.stageRenderGroup.render(this.projectionMatrix),t.interactive&&(t._interactiveEventsAdded||(t._interactiveEventsAdded=!0,t.interactionManager.setTarget(this))),r.Texture.frameUpdates.length>0){for(var i=0;r.Texture.frameUpdates.length>i;i++)r.Texture.frameUpdates[i].updateFrame=!1;r.Texture.frameUpdates=[]}}},r.WebGLRenderer.updateTextures=function(){for(var t=0;r.texturesToUpdate.length>t;t++)this.updateTexture(r.texturesToUpdate[t]);for(var t=0;r.texturesToDestroy.length>t;t++)this.destroyTexture(r.texturesToDestroy[t]);r.texturesToUpdate=[],r.texturesToDestroy=[]},r.WebGLRenderer.updateTexture=function(t){var e=r.gl;t._glTexture||(t._glTexture=e.createTexture()),t.hasLoaded&&(e.bindTexture(e.TEXTURE_2D,t._glTexture),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,t.source),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),t._powerOf2?(e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.REPEAT)):(e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE)),e.bindTexture(e.TEXTURE_2D,null))},r.WebGLRenderer.prototype.destroyTexture=function(t){var e=this.gl;t._glTexture&&(t._glTexture=e.createTexture(),e.deleteTexture(e.TEXTURE_2D,t._glTexture))},r.WebGLRenderer.prototype.resize=function(t,e){this.width=t,this.height=e,this.view.width=t,this.view.height=e,this.gl.viewport(0,0,this.width,this.height);var i=this.projectionMatrix;i[0]=2/this.width,i[5]=-2/this.height,i[12]=-1,i[13]=1},r.WebGLRenderer.prototype.handleContextLost=function(t){t.preventDefault(),this.contextLost=!0},r.WebGLRenderer.prototype.handleContextRestored=function(){this.gl=this.view.getContext("experimental-webgl",{alpha:!0}),this.initShaders();for(var t=0;r.TextureCache.length>t;t++)this.updateTexture(r.TextureCache[t]);for(var t=0;this.batchs.length>t;t++)this.batchs[t].restoreLostContext(this.gl),this.batchs[t].dirty=!0;r._restoreBatchs(this.gl),this.contextLost=!1},r._batchs=[],r._getBatch=function(t){return 0==r._batchs.length?new r.WebGLBatch(t):r._batchs.pop()},r._returnBatch=function(t){t.clean(),r._batchs.push(t)},r._restoreBatchs=function(t){for(var e=0;r._batchs.length>e;e++)r._batchs[e].restoreLostContext(t)},r.WebGLBatch=function(t){this.gl=t,this.size=0,this.vertexBuffer=t.createBuffer(),this.indexBuffer=t.createBuffer(),this.uvBuffer=t.createBuffer(),this.colorBuffer=t.createBuffer(),this.blendMode=r.blendModes.NORMAL,this.dynamicSize=1},r.WebGLBatch.constructor=r.WebGLBatch,r.WebGLBatch.prototype.clean=function(){this.verticies=[],this.uvs=[],this.indices=[],this.colors=[],this.dynamicSize=1,this.texture=null,this.last=null,this.size=0,this.head,this.tail},r.WebGLBatch.prototype.restoreLostContext=function(t){this.gl=t,this.vertexBuffer=t.createBuffer(),this.indexBuffer=t.createBuffer(),this.uvBuffer=t.createBuffer(),this.colorBuffer=t.createBuffer()},r.WebGLBatch.prototype.init=function(t){t.batch=this,this.dirty=!0,this.blendMode=t.blendMode,this.texture=t.texture.baseTexture,this.head=t,this.tail=t,this.size=1,this.growBatch()},r.WebGLBatch.prototype.insertBefore=function(t,e){this.size++,t.batch=this,this.dirty=!0;var i=e.__prev;e.__prev=t,t.__next=e,i?(t.__prev=i,i.__next=t):this.head=t},r.WebGLBatch.prototype.insertAfter=function(t,e){this.size++,t.batch=this,this.dirty=!0;var i=e.__next;e.__next=t,t.__prev=e,i?(t.__next=i,i.__prev=t):this.tail=t},r.WebGLBatch.prototype.remove=function(t){return this.size--,0==this.size?(t.batch=null,t.__prev=null,t.__next=null,void 0):(t.__prev?t.__prev.__next=t.__next:(this.head=t.__next,this.head.__prev=null),t.__next?t.__next.__prev=t.__prev:(this.tail=t.__prev,this.tail.__next=null),t.batch=null,t.__next=null,t.__prev=null,this.dirty=!0,void 0)},r.WebGLBatch.prototype.split=function(t){this.dirty=!0;var e=new r.WebGLBatch(this.gl);e.init(t),e.texture=this.texture,e.tail=this.tail,this.tail=t.__prev,this.tail.__next=null,t.__prev=null;for(var i=0;t;)i++,t.batch=e,t=t.__next;return e.size=i,this.size-=i,e},r.WebGLBatch.prototype.merge=function(t){this.dirty=!0,this.tail.__next=t.head,t.head.__prev=this.tail,this.size+=t.size,this.tail=t.tail;for(var e=t.head;e;)e.batch=this,e=e.__next},r.WebGLBatch.prototype.growBatch=function(){var t=this.gl;this.dynamicSize=1==this.size?1:1.5*this.size,this.verticies=new Float32Array(8*this.dynamicSize),t.bindBuffer(t.ARRAY_BUFFER,this.vertexBuffer),t.bufferData(t.ARRAY_BUFFER,this.verticies,t.DYNAMIC_DRAW),this.uvs=new Float32Array(8*this.dynamicSize),t.bindBuffer(t.ARRAY_BUFFER,this.uvBuffer),t.bufferData(t.ARRAY_BUFFER,this.uvs,t.DYNAMIC_DRAW),this.dirtyUVS=!0,this.colors=new Float32Array(4*this.dynamicSize),t.bindBuffer(t.ARRAY_BUFFER,this.colorBuffer),t.bufferData(t.ARRAY_BUFFER,this.colors,t.DYNAMIC_DRAW),this.dirtyColors=!0,this.indices=new Uint16Array(6*this.dynamicSize);for(var e=this.indices.length/6,i=0;e>i;i++){var r=6*i,s=4*i;this.indices[r+0]=s+0,this.indices[r+1]=s+1,this.indices[r+2]=s+2,this.indices[r+3]=s+0,this.indices[r+4]=s+2,this.indices[r+5]=s+3}t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indexBuffer),t.bufferData(t.ELEMENT_ARRAY_BUFFER,this.indices,t.STATIC_DRAW)},r.WebGLBatch.prototype.refresh=function(){this.gl,this.dynamicSizes;s++)i=this.batchs[s],i instanceof r.WebGLBatch?this.batchs[s].render():i instanceof r.TilingSprite?i.visible&&this.renderTilingSprite(i,t):i instanceof r.Strip&&i.visible&&this.renderStrip(i,t)},r.WebGLRenderGroup.prototype.renderSpecific=function(t,e){r.WebGLRenderer.updateTextures();var i=this.gl;this.checkVisibility(t,t.visible),i.uniformMatrix4fv(r.shaderProgram.mvMatrixUniform,!1,e);var s,n,o,a,h=t.renderable?t:this.getNextRenderable(t),u=h.batch;if(h instanceof r.Sprite){u=h.batch;var d=u.head;if(d==h)s=0;else for(s=1;d.__next!=h;)s++,d=d.__next}else u=h;for(var c,l=t,p=t;p.children.length>0;)p=p.children[p.children.length-1],p.renderable&&(l=p);if(l instanceof r.Sprite){c=l.batch;var d=c.head;if(d==l)o=0;else for(o=1;d.__next!=l;)o++,d=d.__next}else c=l;if(u==c)return u instanceof r.WebGLBatch?u.render(s,o+1):u instanceof r.TilingSprite?u.visible&&this.renderTilingSprite(u,e):u instanceof r.Strip?u.visible&&this.renderStrip(u,e):u instanceof r.CustomRenderable&&u.visible&&u.renderWebGL(this,e),void 0;n=this.batchs.indexOf(u),a=this.batchs.indexOf(c),u instanceof r.WebGLBatch?u.render(s):u instanceof r.TilingSprite?u.visible&&this.renderTilingSprite(u,e):u instanceof r.Strip?u.visible&&this.renderStrip(u,e):u instanceof r.CustomRenderable&&u.visible&&u.renderWebGL(this,e);for(var f=n+1;a>f;f++)renderable=this.batchs[f],renderable instanceof r.WebGLBatch?this.batchs[f].render():renderable instanceof r.TilingSprite?renderable.visible&&this.renderTilingSprite(renderable,e):renderable instanceof r.Strip?renderable.visible&&this.renderStrip(renderable,e):renderable instanceof r.CustomRenderable&&renderable.visible&&renderable.renderWebGL(this,e);c instanceof r.WebGLBatch?c.render(0,o+1):c instanceof r.TilingSprite?c.visible&&this.renderTilingSprite(c):c instanceof r.Strip?c.visible&&this.renderStrip(c):c instanceof r.CustomRenderable&&c.visible&&c.renderWebGL(this,e)},r.WebGLRenderGroup.prototype.checkVisibility=function(t,e){for(var i=t.children,r=0;i.length>r;r++){var s=i[r];s.worldVisible=s.visible&&e,s.textureChange&&(s.textureChange=!1,s.worldVisible&&(this.removeDisplayObject(s),this.addDisplayObject(s))),s.children.length>0&&this.checkVisibility(s,s.worldVisible)}},r.WebGLRenderGroup.prototype.addDisplayObject=function(t){if(t.__renderGroup&&t.__renderGroup.removeDisplayObjectAndChildren(t),t.__renderGroup=this,t.renderable){var e=this.getPreviousRenderable(t),i=this.getNextRenderable(t);if(t instanceof r.Sprite){var s,n;if(e instanceof r.Sprite){if(s=e.batch,s&&s.texture==t.texture.baseTexture&&s.blendMode==t.blendMode)return s.insertAfter(t,e),void 0}else s=e;if(i)if(i instanceof r.Sprite){if(n=i.batch){if(n.texture==t.texture.baseTexture&&n.blendMode==t.blendMode)return n.insertBefore(t,i),void 0;if(n==s){var o=s.split(i),a=r.WebGLRenderer.getBatch(),h=this.batchs.indexOf(s);return a.init(t),this.batchs.splice(h+1,0,a,o),void 0}}}else n=i;var a=r.WebGLRenderer.getBatch();if(a.init(t),s){var h=this.batchs.indexOf(s);this.batchs.splice(h+1,0,a)}else this.batchs.push(a)}else t instanceof r.TilingSprite?(this.initTilingSprite(t),this.batchs.push(t)):t instanceof r.Strip&&(this.initStrip(t),this.batchs.push(t));this.batchUpdate=!0}},r.WebGLRenderGroup.prototype.addDisplayObjectAndChildren=function(t){this.addDisplayObject(t);for(var e=t.children,i=0;e.length>i;i++)this.addDisplayObjectAndChildren(e[i])},r.WebGLRenderGroup.prototype.removeDisplayObject=function(t){if(t.__renderGroup=null,t.renderable){var e;if(t instanceof r.Sprite){var i=t.batch;if(!i)return;i.remove(t),0==i.size&&(e=i)}else e=t;if(e){var s=this.batchs.indexOf(e);if(-1==s)return;if(0==s||s==this.batchs.length-1)return this.batchs.splice(s,1),e instanceof r.WebGLBatch&&r.WebGLRenderer.returnBatch(e),void 0;if(this.batchs[s-1]instanceof r.WebGLBatch&&this.batchs[s+1]instanceof r.WebGLBatch&&this.batchs[s-1].texture==this.batchs[s+1].texture&&this.batchs[s-1].blendMode==this.batchs[s+1].blendMode)return this.batchs[s-1].merge(this.batchs[s+1]),e instanceof r.WebGLBatch&&r.WebGLRenderer.returnBatch(e),r.WebGLRenderer.returnBatch(this.batchs[s+1]),this.batchs.splice(s,2),void 0;this.batchs.splice(s,1),e instanceof r.WebGLBatch&&r.WebGLRenderer.returnBatch(e)}}},r.WebGLRenderGroup.prototype.removeDisplayObjectAndChildren=function(t){if(t.__renderGroup==this){this.removeDisplayObject(t);for(var e=t.children,i=0;e.length>i;i++)this.removeDisplayObjectAndChildren(e[i])}},r.WebGLRenderGroup.prototype.getNextRenderable=function(t){var e=t;do{if(0==e.children.length){if(!e.parent)return null;for(;e.childIndex==e.parent.children.length-1;)if(e=e.parent,e==this.root||!e.parent){e=null;break}e&&(e=e.parent.children[e.childIndex+1])}else e=e.children[0];if(!e)break}while(!e.renderable||!e.__renderGroup);return e},r.WebGLRenderGroup.prototype.getPreviousRenderable=function(t){var e=t;do{if(0==e.childIndex){if(e=e.parent,!e)return null}else for(e=e.parent.children[e.childIndex-1];0!=e.children.length;)e=e.children[e.children.length-1];if(e==this.root)break}while(!e.renderable||!e.__renderGroup);return e},r.WebGLRenderGroup.prototype.initTilingSprite=function(t){var e=this.gl;t.verticies=new Float32Array([0,0,t.width,0,t.width,t.height,0,t.height]),t.uvs=new Float32Array([0,0,1,0,1,1,0,1]),t.colors=new Float32Array([1,1,1,1]),t.indices=new Uint16Array([0,1,3,2]),t._vertexBuffer=e.createBuffer(),t._indexBuffer=e.createBuffer(),t._uvBuffer=e.createBuffer(),t._colorBuffer=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,t._vertexBuffer),e.bufferData(e.ARRAY_BUFFER,t.verticies,e.STATIC_DRAW),e.bindBuffer(e.ARRAY_BUFFER,t._uvBuffer),e.bufferData(e.ARRAY_BUFFER,t.uvs,e.DYNAMIC_DRAW),e.bindBuffer(e.ARRAY_BUFFER,t._colorBuffer),e.bufferData(e.ARRAY_BUFFER,t.colors,e.STATIC_DRAW),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t._indexBuffer),e.bufferData(e.ELEMENT_ARRAY_BUFFER,t.indices,e.STATIC_DRAW),t.texture.baseTexture._glTexture?(e.bindTexture(e.TEXTURE_2D,t.texture.baseTexture._glTexture),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.REPEAT),t.texture.baseTexture._powerOf2=!0):t.texture.baseTexture._powerOf2=!0},r.WebGLRenderGroup.prototype.renderStrip=function(t,e){var i=this.gl,s=r.shaderProgram,n=r.mat3.toMat4(t.worldTransform);r.mat4.transpose(n),r.mat4.multiply(e,n,n),i.uniformMatrix4fv(s.mvMatrixUniform,!1,n),t.blendMode==r.blendModes.NORMAL?i.blendFunc(i.ONE,i.ONE_MINUS_SRC_ALPHA):i.blendFunc(i.ONE,i.ONE_MINUS_SRC_COLOR),t.dirty?(t.dirty=!1,i.bindBuffer(i.ARRAY_BUFFER,t._vertexBuffer),i.bufferData(i.ARRAY_BUFFER,t.verticies,i.STATIC_DRAW),i.vertexAttribPointer(s.vertexPositionAttribute,2,i.FLOAT,!1,0,0),i.bindBuffer(i.ARRAY_BUFFER,t._uvBuffer),i.bufferData(i.ARRAY_BUFFER,t.uvs,i.STATIC_DRAW),i.vertexAttribPointer(s.textureCoordAttribute,2,i.FLOAT,!1,0,0),i.activeTexture(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,t.texture.baseTexture._glTexture),i.bindBuffer(i.ARRAY_BUFFER,t._colorBuffer),i.bufferData(i.ARRAY_BUFFER,t.colors,i.STATIC_DRAW),i.vertexAttribPointer(s.colorAttribute,1,i.FLOAT,!1,0,0),i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,t._indexBuffer),i.bufferData(i.ELEMENT_ARRAY_BUFFER,t.indices,i.STATIC_DRAW)):(i.bindBuffer(i.ARRAY_BUFFER,t._vertexBuffer),i.bufferSubData(i.ARRAY_BUFFER,0,t.verticies),i.vertexAttribPointer(s.vertexPositionAttribute,2,i.FLOAT,!1,0,0),i.bindBuffer(i.ARRAY_BUFFER,t._uvBuffer),i.vertexAttribPointer(s.textureCoordAttribute,2,i.FLOAT,!1,0,0),i.activeTexture(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,t.texture.baseTexture._glTexture),i.bindBuffer(i.ARRAY_BUFFER,t._colorBuffer),i.vertexAttribPointer(s.colorAttribute,1,i.FLOAT,!1,0,0),i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,t._indexBuffer)),i.drawElements(i.TRIANGLE_STRIP,t.indices.length,i.UNSIGNED_SHORT,0),i.uniformMatrix4fv(s.mvMatrixUniform,!1,e)},r.WebGLRenderGroup.prototype.renderTilingSprite=function(t,e){var i=this.gl;r.shaderProgram;var s=t.tilePosition,n=t.tileScale,o=s.x/t.texture.baseTexture.width,a=s.y/t.texture.baseTexture.height,h=t.width/t.texture.baseTexture.width/n.x,u=t.height/t.texture.baseTexture.height/n.y;t.uvs[0]=0-o,t.uvs[1]=0-a,t.uvs[2]=1*h-o,t.uvs[3]=0-a,t.uvs[4]=1*h-o,t.uvs[5]=1*u-a,t.uvs[6]=0-o,t.uvs[7]=1*u-a,i.bindBuffer(i.ARRAY_BUFFER,t._uvBuffer),i.bufferSubData(i.ARRAY_BUFFER,0,t.uvs),this.renderStrip(t,e)},r.WebGLRenderer.prototype.initStrip=function(t){var e=this.gl;this.shaderProgram,t._vertexBuffer=e.createBuffer(),t._indexBuffer=e.createBuffer(),t._uvBuffer=e.createBuffer(),t._colorBuffer=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,t._vertexBuffer),e.bufferData(e.ARRAY_BUFFER,t.verticies,e.DYNAMIC_DRAW),e.bindBuffer(e.ARRAY_BUFFER,t._uvBuffer),e.bufferData(e.ARRAY_BUFFER,t.uvs,e.STATIC_DRAW),e.bindBuffer(e.ARRAY_BUFFER,t._colorBuffer),e.bufferData(e.ARRAY_BUFFER,t.colors,e.STATIC_DRAW),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t._indexBuffer),e.bufferData(e.ELEMENT_ARRAY_BUFFER,t.indices,e.STATIC_DRAW)},r.CanvasRenderer=function(t,e,i,r){this.transparent=r,this.width=t||800,this.height=e||600,this.refresh=!0,this.view=i||document.createElement("canvas"),this.view.width=this.width,this.view.height=this.height,this.count=0,this.context=this.view.getContext("2d")},r.CanvasRenderer.constructor=r.CanvasRenderer,r.CanvasRenderer.prototype.render=function(t){r.texturesToUpdate=[],r.texturesToDestroy=[],t.updateTransform(),this.view.style.backgroundColor==t.backgroundColorString||this.transparent||(this.view.style.backgroundColor=t.backgroundColorString),this.context.setTransform(1,0,0,1,0,0),this.context.clearRect(0,0,this.width,this.height),this.renderDisplayObject(t),t.interactive&&(t._interactiveEventsAdded||(t._interactiveEventsAdded=!0,t.interactionManager.setTarget(this))),r.Texture.frameUpdates.length>0&&(r.Texture.frameUpdates=[])},r.CanvasRenderer.prototype.resize=function(t,e){this.width=t,this.height=e,this.view.width=t,this.view.height=e},r.CanvasRenderer.prototype.renderDisplayObject=function(t){var e=t.worldTransform,i=this.context;if(t.visible){if(t instanceof r.Sprite){var s=t.texture.frame;s&&(i.globalAlpha=t.worldAlpha,i.setTransform(e[0],e[3],e[1],e[4],e[2],e[5]),i.drawImage(t.texture.baseTexture.source,s.x,s.y,s.width,s.height,t.anchor.x*-s.width,t.anchor.y*-s.height,s.width,s.height))}else t instanceof r.Strip?(i.setTransform(e[0],e[3],e[1],e[4],e[2],e[5]),this.renderStrip(t)):t instanceof r.TilingSprite?(i.setTransform(e[0],e[3],e[1],e[4],e[2],e[5]),this.renderTilingSprite(t)):t instanceof r.CustomRenderable&&t.renderCanvas(this);for(var n=0;t.children.length>n;n++)this.renderDisplayObject(t.children[n]);this.context.setTransform(1,0,0,1,0,0)}},r.CanvasRenderer.prototype.renderStripFlat=function(t){var e=this.context,i=t.verticies;t.uvs;var r=i.length/2;this.count++,e.beginPath();for(var s=1;r-2>s;s++){var n=2*s,o=i[n],a=i[n+2],h=i[n+4],u=i[n+1],d=i[n+3],c=i[n+5];e.moveTo(o,u),e.lineTo(a,d),e.lineTo(h,c)}e.fillStyle="#FF0000",e.fill(),e.closePath()},r.CanvasRenderer.prototype.renderTilingSprite=function(t){var e=this.context;t.__tilePattern||(t.__tilePattern=e.createPattern(t.texture.baseTexture.source,"repeat")),e.beginPath();var i=t.tilePosition,r=t.tileScale;e.scale(r.x,r.y),e.translate(i.x,i.y),e.fillStyle=t.__tilePattern,e.fillRect(-i.x,-i.y,t.width/r.x,t.height/r.y),e.scale(1/r.x,1/r.y),e.translate(-i.x,-i.y),e.closePath()},r.CanvasRenderer.prototype.renderStrip=function(t){var e=this.context,i=t.verticies,r=t.uvs,s=i.length/2;this.count++;for(var n=1;s-2>n;n++){var o=2*n,a=i[o],h=i[o+2],u=i[o+4],d=i[o+1],c=i[o+3],l=i[o+5],p=r[o]*t.texture.width,f=r[o+2]*t.texture.width,x=r[o+4]*t.texture.width,v=r[o+1]*t.texture.height,g=r[o+3]*t.texture.height,b=r[o+5]*t.texture.height;e.save(),e.beginPath(),e.moveTo(a,d),e.lineTo(h,c),e.lineTo(u,l),e.closePath(),e.clip();var T=p*g+v*x+f*b-g*x-v*f-p*b,m=a*g+v*u+h*b-g*u-v*h-a*b,y=p*h+a*x+f*u-h*x-a*f-p*u,_=p*g*u+v*h*x+a*f*b-a*g*x-v*f*u-p*h*b,R=d*g+v*l+c*b-g*l-v*c-d*b,w=p*c+d*x+f*l-c*x-d*f-p*l,A=p*g*l+v*c*x+d*f*b-d*g*x-v*f*l-p*c*b;e.transform(m/T,R/T,y/T,w/T,_/T,A/T),e.drawImage(t.texture.baseTexture.source,0,0),e.restore()}},r.Strip=function(t,e,i){r.DisplayObjectContainer.call(this),this.texture=t,this.blendMode=r.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(s){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=e,this.height=i,t.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},r.Strip.constructor=r.Strip,r.Strip.prototype=Object.create(r.DisplayObjectContainer.prototype),r.Strip.prototype.setTexture=function(t){this.texture=t,this.width=t.frame.width,this.height=t.frame.height,this.updateFrame=!0},r.Strip.prototype.onTextureUpdate=function(){this.updateFrame=!0},r.Rope=function(t,e){r.Strip.call(this,t),this.points=e;try{this.verticies=new Float32Array(4*e.length),this.uvs=new Float32Array(4*e.length),this.colors=new Float32Array(2*e.length),this.indices=new Uint16Array(2*e.length)}catch(i){this.verticies=verticies,this.uvs=uvs,this.colors=colors,this.indices=indices}this.refresh()},r.Rope.constructor=r.Rope,r.Rope.prototype=Object.create(r.Strip.prototype),r.Rope.prototype.refresh=function(){var t=this.points;if(!(1>t.length)){var e=this.uvs,i=this.indices,r=this.colors,s=t[0],n=t[0];this.count-=.2,e[0]=0,e[1]=1,e[2]=0,e[3]=1,r[0]=1,r[1]=1,i[0]=0,i[1]=1;for(var o=t.length,a=1;o>a;a++){var n=t[a],h=4*a,u=a/(o-1);a%2?(e[h]=u,e[h+1]=0,e[h+2]=u,e[h+3]=1):(e[h]=u,e[h+1]=0,e[h+2]=u,e[h+3]=1),h=2*a,r[h]=1,r[h+1]=1,h=2*a,i[h]=h,i[h+1]=h+1,s=n}}},r.Rope.prototype.updateTransform=function(){var t=this.points;if(!(1>t.length)){var e,i=this.verticies,s=t[0],n={x:0,y:0},o=t[0];this.count-=.2,i[0]=o.x+n.x,i[1]=o.y+n.y,i[2]=o.x-n.x,i[3]=o.y-n.y;for(var a=t.length,h=1;a>h;h++){var o=t[h],u=4*h;e=t.length-1>h?t[h+1]:o,n.y=-(e.x-s.x),n.x=e.y-s.y;var d=10*(1-h/(a-1));d>1&&(d=1);var c=Math.sqrt(n.x*n.x+n.y*n.y),l=this.texture.height/2;n.x/=c,n.y/=c,n.x*=l,n.y*=l,i[u]=o.x+n.x,i[u+1]=o.y+n.y,i[u+2]=o.x-n.x,i[u+3]=o.y-n.y,s=o}r.DisplayObjectContainer.prototype.updateTransform.call(this)}},r.Rope.prototype.setTexture=function(t){this.texture=t,this.updateFrame=!0},r.TilingSprite=function(t,e,i){r.DisplayObjectContainer.call(this),this.texture=t,this.width=e,this.height=i,this.renderable=!0,this.tileScale=new r.Point(1,1),this.tilePosition=new r.Point(0,0),this.blendMode=r.blendModes.NORMAL},r.TilingSprite.constructor=r.TilingSprite,r.TilingSprite.prototype=Object.create(r.DisplayObjectContainer.prototype),r.TilingSprite.prototype.setTexture=function(t){this.texture=t,this.updateFrame=!0},r.TilingSprite.prototype.onTextureUpdate=function(){this.updateFrame=!0},r.CustomRenderable=function(){r.DisplayObject.call(this)},r.CustomRenderable.constructor=r.CustomRenderable,r.CustomRenderable.prototype=Object.create(r.DisplayObject.prototype),r.CustomRenderable.prototype.renderCanvas=function(){},r.CustomRenderable.prototype.initWebGL=function(){},r.CustomRenderable.prototype.renderWebGL=function(){},r.BaseTextureCache={},r.texturesToUpdate=[],r.texturesToDestroy=[],r.BaseTexture=function(t){if(r.EventTarget.call(this),this.width=100,this.height=100,this.source=t,t){if(this.source instanceof Image)if(this.source.complete)this.hasLoaded=!0,this.width=this.source.width,this.height=this.source.height,r.texturesToUpdate.push(this);else{var e=this;this.source.onload=function(){e.hasLoaded=!0,e.width=e.source.width,e.height=e.source.height,r.texturesToUpdate.push(e),e.dispatchEvent({type:"loaded",content:e})}}else this.hasLoaded=!0,this.width=this.source.width,this.height=this.source.height,r.texturesToUpdate.push(this);this._powerOf2=!1}},r.BaseTexture.constructor=r.BaseTexture,r.BaseTexture.prototype.destroy=function(){this.source instanceof Image&&(this.source.src=null),this.source=null,r.texturesToDestroy.push(this)},r.BaseTexture.fromImage=function(t,e){var i=r.BaseTextureCache[t];if(!i){var s=new Image;e&&(s.crossOrigin=""),s.src=t,i=new r.BaseTexture(s),r.BaseTextureCache[t]=i}return i},r.TextureCache={},r.FrameCache={},r.Texture=function(t,e){if(r.EventTarget.call(this),e||(this.noFrame=!0,e=new r.Rectangle(0,0,1,1)),this.trim=new r.Point,t instanceof r.Texture&&(t=t.baseTexture),this.baseTexture=t,this.frame=e,this.scope=this,t.hasLoaded)this.noFrame&&(e=new r.Rectangle(0,0,t.width,t.height)),this.setFrame(e);else{var i=this;t.addEventListener("loaded",function(){i.onBaseTextureLoaded()})}},r.Texture.constructor=r.Texture,r.Texture.prototype.onBaseTextureLoaded=function(){var t=this.baseTexture;t.removeEventListener("loaded",this.onLoaded),this.noFrame&&(this.frame=new r.Rectangle(0,0,t.width,t.height)),this.noFrame=!1,this.width=this.frame.width,this.height=this.frame.height,this.scope.dispatchEvent({type:"update",content:this})},r.Texture.prototype.destroy=function(t){t&&this.baseTexture.destroy()},r.Texture.prototype.setFrame=function(t){if(this.frame=t,this.width=t.width,this.height=t.height,t.x+t.width>this.baseTexture.width||t.y+t.height>this.baseTexture.height)throw Error("Texture Error: frame does not fit inside the base Texture dimensions "+this);this.updateFrame=!0,r.Texture.frameUpdates.push(this)},r.Texture.fromImage=function(t,e){var i=r.TextureCache[t];return i||(i=new r.Texture(r.BaseTexture.fromImage(t,e)),r.TextureCache[t]=i),i},r.Texture.fromFrame=function(t){var e=r.TextureCache[t];if(!e)throw Error("The frameId '"+t+"' does not exist in the texture cache "+this);return e},r.Texture.fromCanvas=function(t){var e=new r.BaseTexture(t);return new r.Texture(e)},r.Texture.addTextureToCache=function(t,e){r.TextureCache[e]=t},r.Texture.removeTextureFromCache=function(t){var e=r.TextureCache[t];return r.TextureCache[t]=null,e},r.Texture.frameUpdates=[],r.RenderTexture=function(t,e){r.EventTarget.call(this),this.width=t||100,this.height=e||100,this.indetityMatrix=r.mat3.create(),this.frame=new r.Rectangle(0,0,this.width,this.height),r.gl?this.initWebGL():this.initCanvas()},r.RenderTexture.constructor=r.RenderTexture,r.RenderTexture.prototype=Object.create(r.Texture.prototype),r.RenderTexture.prototype.initWebGL=function(){var t=r.gl;this.glFramebuffer=t.createFramebuffer(),t.bindFramebuffer(t.FRAMEBUFFER,this.glFramebuffer),this.glFramebuffer.width=this.width,this.glFramebuffer.height=this.height,this.baseTexture=new r.BaseTexture,this.baseTexture.width=this.width,this.baseTexture.height=this.height,this.baseTexture._glTexture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.baseTexture._glTexture),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,this.width,this.height,0,t.RGBA,t.UNSIGNED_BYTE,null),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),this.baseTexture.isRender=!0,t.bindFramebuffer(t.FRAMEBUFFER,this.glFramebuffer),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,this.baseTexture._glTexture,0),this.projectionMatrix=r.mat4.create(),this.projectionMatrix[5]=2/this.height,this.projectionMatrix[13]=-1,this.projectionMatrix[0]=2/this.width,this.projectionMatrix[12]=-1,this.render=this.renderWebGL},r.RenderTexture.prototype.initCanvas=function(){this.renderer=new r.CanvasRenderer(this.width,this.height,null,0),this.baseTexture=new r.BaseTexture(this.renderer.view),this.frame=new r.Rectangle(0,0,this.width,this.height),this.render=this.renderCanvas},r.RenderTexture.prototype.renderWebGL=function(t,e){var i=r.gl;i.colorMask(!0,!0,!0,!0),i.viewport(0,0,this.width,this.height),i.bindFramebuffer(i.FRAMEBUFFER,this.glFramebuffer),e&&(i.clearColor(0,0,0,0),i.clear(i.COLOR_BUFFER_BIT));var s=t.children;t.worldTransform=r.mat3.create();for(var n=0,o=s.length;o>n;n++)s[n].updateTransform();var a=t.__renderGroup;a?t==a.root?a.render(this.projectionMatrix):a.renderSpecific(t,this.projectionMatrix):(this.renderGroup||(this.renderGroup=new r.WebGLRenderGroup(i)),this.renderGroup.setRenderable(t),this.renderGroup.render(this.projectionMatrix))},r.RenderTexture.prototype.renderCanvas=function(t,e){var i=t.children;t.worldTransform=r.mat3.create();for(var s=0,n=i.length;n>s;s++)i[s].updateTransform();e&&this.renderer.context.clearRect(0,0,this.width,this.height),this.renderer.renderDisplayObject(t),r.texturesToUpdate.push(this.baseTexture)},r.AssetLoader=function(t){r.EventTarget.call(this),this.assetURLs=t,this.crossorigin=!1,this.loadersByType={jpg:r.ImageLoader,jpeg:r.ImageLoader,png:r.ImageLoader,gif:r.ImageLoader,json:r.SpriteSheetLoader,xml:r.BitmapFontLoader,fnt:r.BitmapFontLoader}},r.AssetLoader.constructor=r.AssetLoader,r.AssetLoader.prototype.load=function(){var t=this;this.loadCount=this.assetURLs.length;for(var e=0;this.assetURLs.length>e;e++){var i=this.assetURLs[e],r=i.split(".").pop().toLowerCase(),s=this.loadersByType[r];if(!s)throw Error(r+" is an unsupported file type");var n=new s(i,this.crossorigin);n.addEventListener("loaded",function(){t.onAssetLoaded()}),n.load()}},r.AssetLoader.prototype.onAssetLoaded=function(){this.loadCount--,this.dispatchEvent({type:"onProgress",content:this}),this.onProgress&&this.onProgress(),0==this.loadCount&&(this.dispatchEvent({type:"onComplete",content:this}),this.onComplete&&this.onComplete())},r.JsonLoader=function(t,e){r.EventTarget.call(this),this.url=t,this.baseUrl=t.replace(/[^\/]*$/,""),this.crossorigin=e},r.JsonLoader.constructor=r.JsonLoader,r.JsonLoader.prototype.load=function(){this.ajaxRequest=new s;var t=this;this.ajaxRequest.onreadystatechange=function(){t.onJSONLoaded()},this.ajaxRequest.open("GET",this.url,!0),this.ajaxRequest.overrideMimeType&&this.ajaxRequest.overrideMimeType("application/json"),this.ajaxRequest.send(null)},r.JsonLoader.prototype.onJSONLoaded=function(){4==this.ajaxRequest.readyState&&(200==this.ajaxRequest.status||-1==window.location.href.indexOf("http")?(this.json=JSON.parse(this.ajaxRequest.responseText),this.onLoaded()):this.onError())},r.JsonLoader.prototype.onLoaded=function(){this.dispatchEvent({type:"loaded",content:this})},r.JsonLoader.prototype.onError=function(){this.dispatchEvent({type:"error",content:this})},r.SpriteSheetLoader=function(t,e){r.EventTarget.call(this),this.url=t,this.baseUrl=t.replace(/[^\/]*$/,""),this.texture=null,this.frames={},this.crossorigin=e},r.SpriteSheetLoader.constructor=r.SpriteSheetLoader,r.SpriteSheetLoader.prototype.load=function(){var t=this,e=new r.JsonLoader(this.url,this.crossorigin);e.addEventListener("loaded",function(e){t.json=e.content.json,t.onJSONLoaded()}),e.load()},r.SpriteSheetLoader.prototype.onJSONLoaded=function(){var t=this,e=this.baseUrl+this.json.meta.image,i=new r.ImageLoader(e,this.crossorigin),s=this.json.frames;this.texture=i.texture.baseTexture,i.addEventListener("loaded",function(){t.onLoaded()});for(var n in s){var o=s[n].frame;o&&(r.TextureCache[n]=new r.Texture(this.texture,{x:o.x,y:o.y,width:o.w,height:o.h}),s[n].trimmed&&(r.TextureCache[n].realSize=s[n].spriteSourceSize,r.TextureCache[n].trim.x=0))}i.load()},r.SpriteSheetLoader.prototype.onLoaded=function(){this.dispatchEvent({type:"loaded",content:this})},r.ImageLoader=function(t,e){r.EventTarget.call(this),this.texture=r.Texture.fromImage(t,e)},r.ImageLoader.constructor=r.ImageLoader,r.ImageLoader.prototype.load=function(){if(this.texture.baseTexture.hasLoaded)this.onLoaded();else{var t=this;this.texture.baseTexture.addEventListener("loaded",function(){t.onLoaded()})}},r.ImageLoader.prototype.onLoaded=function(){this.dispatchEvent({type:"loaded",content:this})},r.BitmapFontLoader=function(t,e){r.EventTarget.call(this),this.url=t,this.baseUrl=t.replace(/[^\/]*$/,""),this.texture=null,this.crossorigin=e},r.BitmapFontLoader.constructor=r.BitmapFontLoader,r.BitmapFontLoader.prototype.load=function(){this.ajaxRequest=new XMLHttpRequest;var t=this;this.ajaxRequest.onreadystatechange=function(){t.onXMLLoaded()},this.ajaxRequest.open("GET",this.url,!0),this.ajaxRequest.overrideMimeType&&this.ajaxRequest.overrideMimeType("application/xml"),this.ajaxRequest.send(null)},r.BitmapFontLoader.prototype.onXMLLoaded=function(){if(4==this.ajaxRequest.readyState&&(200==this.ajaxRequest.status||-1==window.location.href.indexOf("http"))){var t=this.baseUrl+this.ajaxRequest.responseXML.getElementsByTagName("page")[0].attributes.getNamedItem("file").nodeValue,e=new r.ImageLoader(t,this.crossorigin);this.texture=e.texture.baseTexture;var i={},s=this.ajaxRequest.responseXML.getElementsByTagName("info")[0],n=this.ajaxRequest.responseXML.getElementsByTagName("common")[0];i.font=s.attributes.getNamedItem("face").nodeValue,i.size=parseInt(s.attributes.getNamedItem("size").nodeValue,10),i.lineHeight=parseInt(n.attributes.getNamedItem("lineHeight").nodeValue,10),i.chars={};for(var o=this.ajaxRequest.responseXML.getElementsByTagName("char"),a=0;o.length>a;a++){var h=parseInt(o[a].attributes.getNamedItem("id").nodeValue,10),u={x:parseInt(o[a].attributes.getNamedItem("x").nodeValue,10),y:parseInt(o[a].attributes.getNamedItem("y").nodeValue,10),width:parseInt(o[a].attributes.getNamedItem("width").nodeValue,10),height:parseInt(o[a].attributes.getNamedItem("height").nodeValue,10)};r.TextureCache[h]=new r.Texture(this.texture,u),i.chars[h]={xOffset:parseInt(o[a].attributes.getNamedItem("xoffset").nodeValue,10),yOffset:parseInt(o[a].attributes.getNamedItem("yoffset").nodeValue,10),xAdvance:parseInt(o[a].attributes.getNamedItem("xadvance").nodeValue,10),kerning:{},texture:new r.Texture(this.texture,u)}}var d=this.ajaxRequest.responseXML.getElementsByTagName("kerning");for(a=0;d.length>a;a++){var c=parseInt(d[a].attributes.getNamedItem("first").nodeValue,10),l=parseInt(d[a].attributes.getNamedItem("second").nodeValue,10),p=parseInt(d[a].attributes.getNamedItem("amount").nodeValue,10);i.chars[l].kerning[c]=p}r.BitmapText.fonts[i.font]=i;var f=this;e.addEventListener("loaded",function(){f.onLoaded()}),e.load()}},r.BitmapFontLoader.prototype.onLoaded=function(){this.dispatchEvent({type:"loaded",content:this})},"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=r),exports.PIXI=r):i.PIXI=r}).call(this); \ No newline at end of file +(function(){function t(t){return[(255&t>>16)/255,(255&t>>8)/255,(255&t)/255]}function e(){return r.Matrix="undefined"!=typeof Float32Array?Float32Array:Array,r.Matrix}var i=this,r=r||{};r.Point=function(t,e){this.x=t||0,this.y=e||0},r.Point.prototype.clone=function(){return new r.Point(this.x,this.y)},r.Point.constructor=r.Point,r.Rectangle=function(t,e,i,r){this.x=t||0,this.y=e||0,this.width=i||0,this.height=r||0},r.Rectangle.prototype.clone=function(){return new r.Rectangle(this.x,this.y,this.width,this.height)},r.Rectangle.constructor=r.Rectangle,r.DisplayObject=function(){this.position=new r.Point,this.scale=new r.Point(1,1),this.pivot=new r.Point(0,0),this.rotation=0,this.alpha=1,this.visible=!0,this.worldVisible=!1,this.parent=null,this.stage=null,this.hitArea=null,this.worldAlpha=1,this.color=[],this.worldTransform=r.mat3.create(),this.localTransform=r.mat3.create(),this.dynamic=!0,this._sr=0,this._cr=1,this.childIndex=0,this.renderable=!1,this.interactive=!1,this.buttonMode=!1},r.DisplayObject.constructor=r.DisplayObject,r.DisplayObject.prototype.setInteractive=function(t){this.interactive=t,this.stage&&(this.stage.dirty=!0)},r.DisplayObject.prototype.updateTransform=function(){this.rotation!=this.rotationCache&&(this.rotationCache=this.rotation,this._sr=Math.sin(this.rotation),this._cr=Math.cos(this.rotation));var t=this.localTransform,e=this.parent.worldTransform,i=this.worldTransform;t[0]=this._cr*this.scale.x,t[1]=-this._sr*this.scale.y,t[3]=this._sr*this.scale.x,t[4]=this._cr*this.scale.y;var r=this.pivot.x,s=this.pivot.y;t[2]=this.position.x-t[0]*r-s*t[1],t[5]=this.position.y-t[4]*s-r*t[3];var n=t[0],a=t[1],o=t[2],h=t[3],u=t[4],d=t[5],c=e[0],l=e[1],p=e[2],f=e[3],x=e[4],v=e[5];i[0]=c*n+l*h,i[1]=c*a+l*u,i[2]=c*o+l*d+p,i[3]=f*n+x*h,i[4]=f*a+x*u,i[5]=f*o+x*d+v,this.worldAlpha=this.alpha*this.parent.worldAlpha},r.DisplayObjectContainer=function(){r.DisplayObject.call(this),this.children=[],this.renderable=!1},r.DisplayObjectContainer.constructor=r.DisplayObjectContainer,r.DisplayObjectContainer.prototype=Object.create(r.DisplayObject.prototype),r.DisplayObjectContainer.prototype.addChild=function(t){void 0!=t.parent&&t.parent.removeChild(t),t.parent=this,t.childIndex=this.children.length,this.children.push(t),this.stage&&this.stage.__addChild(t),this.__renderGroup&&(t.__renderGroup&&t.__renderGroup.removeDisplayObjectAndChildren(t),this.__renderGroup.addDisplayObjectAndChildren(t))},r.DisplayObjectContainer.prototype.addChildAt=function(t,e){if(!(e>=0&&this.children.length>=e))throw Error(t+" The index "+e+" supplied is out of bounds "+this.children.length);void 0!=t.parent&&t.parent.removeChild(t),e==this.children.length?this.children.push(t):this.children.splice(e,0,t),t.parent=this,t.childIndex=e;for(var i=this.children.length,r=e;i>r;r++)this.children[r].childIndex=r;this.stage&&this.stage.__addChild(t),this.__renderGroup&&(t.__renderGroup&&t.__renderGroup.removeDisplayObjectAndChildren(t),this.__renderGroup.addDisplayObjectAndChildren(t))},r.DisplayObjectContainer.prototype.swapChildren=function(t,e){var i=this.children.indexOf(t),r=this.children.indexOf(e);if(-1===i||-1===r)throw Error(t+" Both the supplied DisplayObjects must be a child of the caller "+this);this.stage&&(this.stage.__removeChild(t),this.stage.__removeChild(e),this.stage.__addChild(t),this.stage.__addChild(e)),t.childIndex=r,e.childIndex=i,this.children[i]=e,this.children[r]=t},r.DisplayObjectContainer.prototype.getChildAt=function(t){if(t>=0&&this.children.length>t)return this.children[t];throw Error(child+" Both the supplied DisplayObjects must be a child of the caller "+this)},r.DisplayObjectContainer.prototype.removeChild=function(t){var e=this.children.indexOf(t);if(-1===e)throw Error(t+" The supplied DisplayObject must be a child of the caller "+this);this.stage&&this.stage.__removeChild(t),t.__renderGroup&&t.__renderGroup.removeDisplayObjectAndChildren(t),t.parent=void 0,this.children.splice(e,1);for(var i=e,r=this.children.length;r>i;i++)this.children[i].childIndex-=1},r.DisplayObjectContainer.prototype.updateTransform=function(){if(this.visible){r.DisplayObject.prototype.updateTransform.call(this);for(var t=0,e=this.children.length;e>t;t++)this.children[t].updateTransform()}},r.blendModes={},r.blendModes.NORMAL=0,r.blendModes.SCREEN=1,r.Sprite=function(t){r.DisplayObjectContainer.call(this),this.anchor=new r.Point,this.texture=t,this.blendMode=r.blendModes.NORMAL,this._width=0,this._height=0,t.baseTexture.hasLoaded?this.updateFrame=!0:(this.onTextureUpdateBind=this.onTextureUpdate.bind(this),this.texture.addEventListener("update",this.onTextureUpdateBind)),this.renderable=!0},r.Sprite.constructor=r.Sprite,r.Sprite.prototype=Object.create(r.DisplayObjectContainer.prototype),Object.defineProperty(r.Sprite.prototype,"width",{get:function(){return this.scale.x*this.texture.frame.width},set:function(t){this.scale.x=t/this.texture.frame.width,this._width=t}}),Object.defineProperty(r.Sprite.prototype,"height",{get:function(){return this.scale.y*this.texture.frame.height},set:function(t){this.scale.y=t/this.texture.frame.height,this._height=t}}),r.Sprite.prototype.setTexture=function(t){this.texture.baseTexture!=t.baseTexture&&(this.textureChange=!0),this.texture=t,this.updateFrame=!0},r.Sprite.prototype.onTextureUpdate=function(){this._width&&(this.scale.x=this._width/this.texture.frame.width),this._height&&(this.scale.y=this._height/this.texture.frame.height),this.updateFrame=!0},r.Sprite.fromFrame=function(t){var e=r.TextureCache[t];if(!e)throw Error("The frameId '"+t+"' does not exist in the texture cache"+this);return new r.Sprite(e)},r.Sprite.fromImage=function(t){var e=r.Texture.fromImage(t);return new r.Sprite(e)},r.MovieClip=function(t){r.Sprite.call(this,t[0]),this.textures=t,this.currentFrame=0,this.animationSpeed=1,this.loop=!0,this.onComplete=null,this.playing},r.MovieClip.constructor=r.MovieClip,r.MovieClip.prototype=Object.create(r.Sprite.prototype),r.MovieClip.prototype.stop=function(){this.playing=!1},r.MovieClip.prototype.play=function(){this.playing=!0},r.MovieClip.prototype.gotoAndStop=function(t){this.playing=!1,this.currentFrame=t;var e=0|this.currentFrame+.5;this.setTexture(this.textures[e%this.textures.length])},r.MovieClip.prototype.gotoAndPlay=function(t){this.currentFrame=t,this.playing=!0},r.MovieClip.prototype.updateTransform=function(){if(r.Sprite.prototype.updateTransform.call(this),this.playing){this.currentFrame+=this.animationSpeed;var t=0|this.currentFrame+.5;this.loop||this.textures.length>t?this.setTexture(this.textures[t%this.textures.length]):t>=this.textures.length&&(this.gotoAndStop(this.textures.length-1),this.onComplete&&this.onComplete())}},r.Text=function(t,e){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"),r.Sprite.call(this,r.Texture.fromCanvas(this.canvas)),this.setText(t),this.setStyle(e),this.updateText(),this.dirty=!1},r.Text.constructor=r.Text,r.Text.prototype=Object.create(r.Sprite.prototype),r.Text.prototype.setStyle=function(t){t=t||{},t.font=t.font||"bold 20pt Arial",t.fill=t.fill||"black",t.align=t.align||"left",t.strokeThickness=t.strokeThickness||0,t.wordWrap=t.wordWrap||!1,t.wordWrapWidth=t.wordWrapWidth||100,this.style=t,this.dirty=!0},r.Sprite.prototype.setText=function(t){this.text=""+t||" ",this.dirty=!0},r.Text.prototype.updateText=function(){this.context.font=this.style.font;var t=this.text;this.style.wordWrap&&(t=this.wordWrap(this.text));for(var e=t.split(/(?:\r\n|\r|\n)/),i=[],s=0,n=0;e.length>n;n++){var a=this.context.measureText(e[n]).width;i[n]=a,s=Math.max(s,a)}this.canvas.width=s+this.style.strokeThickness;var o=this.determineFontHeight("font: "+this.style.font+";")+this.style.strokeThickness;for(this.canvas.height=o*e.length,this.context.fillStyle=this.style.fill,this.context.font=this.style.font,this.context.strokeStyle=this.style.stroke,this.context.lineWidth=this.style.strokeThickness,this.context.textBaseline="top",n=0;e.length>n;n++){var h=new r.Point(this.style.strokeThickness/2,this.style.strokeThickness/2+n*o);"right"==this.style.align?h.x+=s-i[n]:"center"==this.style.align&&(h.x+=(s-i[n])/2),this.style.stroke&&this.style.strokeThickness&&this.context.strokeText(e[n],h.x,h.y),this.style.fill&&this.context.fillText(e[n],h.x,h.y)}this.updateTexture()},r.Text.prototype.updateTexture=function(){this.texture.baseTexture.width=this.canvas.width,this.texture.baseTexture.height=this.canvas.height,this.texture.frame.width=this.canvas.width,this.texture.frame.height=this.canvas.height,this._width=this.canvas.width,this._height=this.canvas.height,r.texturesToUpdate.push(this.texture.baseTexture)},r.Text.prototype.updateTransform=function(){this.dirty&&(this.updateText(),this.dirty=!1),r.Sprite.prototype.updateTransform.call(this)},r.Text.prototype.determineFontHeight=function(t){var e=r.Text.heightCache[t];if(!e){var i=document.getElementsByTagName("body")[0],s=document.createElement("div"),n=document.createTextNode("M");s.appendChild(n),s.setAttribute("style",t),i.appendChild(s),e=s.offsetHeight,r.Text.heightCache[t]=e,i.removeChild(s)}return e},r.Text.prototype.wordWrap=function(t){for(var e=function(t,e,i,r,s){var n=Math.floor((r-i)/2)+i;return n==i?1:s>=t.measureText(e.substring(0,n)).width?t.measureText(e.substring(0,n+1)).width>s?n:arguments.callee(t,e,n,r,s):arguments.callee(t,e,i,n,s)},i=function(t,i,r){if(r>=t.measureText(i).width||1>i.length)return i;var s=e(t,i,0,i.length,r);return i.substring(0,s)+"\n"+arguments.callee(t,i.substring(s),r)},r="",s=t.split("\n"),n=0;s.length>n;n++)r+=i(this.context,s[n],this.style.wordWrapWidth)+"\n";return r},r.Text.prototype.destroy=function(t){t&&this.texture.destroy()},r.Text.heightCache={},r.BitmapText=function(t,e){r.DisplayObjectContainer.call(this),this.setText(t),this.setStyle(e),this.updateText(),this.dirty=!1},r.BitmapText.constructor=r.BitmapText,r.BitmapText.prototype=Object.create(r.DisplayObjectContainer.prototype),r.BitmapText.prototype.setText=function(t){this.text=t||" ",this.dirty=!0},r.BitmapText.prototype.setStyle=function(t){t=t||{},t.align=t.align||"left",this.style=t;var e=t.font.split(" ");this.fontName=e[e.length-1],this.fontSize=e.length>=2?parseInt(e[e.length-2],10):r.BitmapText.fonts[this.fontName].size,this.dirty=!0},r.BitmapText.prototype.updateText=function(){for(var t=r.BitmapText.fonts[this.fontName],e=new r.Point,i=null,s=[],n=0,a=[],o=0,h=this.fontSize/t.size,u=0;this.text.length>u;u++){var d=this.text.charCodeAt(u);if(/(?:\r\n|\r|\n)/.test(this.text.charAt(u)))a.push(e.x),n=Math.max(n,e.x),o++,e.x=0,e.y+=t.lineHeight,i=null;else{var c=t.chars[d];c&&(i&&c[i]&&(e.x+=c.kerning[i]),s.push({texture:c.texture,line:o,charCode:d,position:new r.Point(e.x+c.xOffset,e.y+c.yOffset)}),e.x+=c.xAdvance,i=d)}}a.push(e.x),n=Math.max(n,e.x);var l=[];for(u=0;o>=u;u++){var p=0;"right"==this.style.align?p=n-a[u]:"center"==this.style.align&&(p=(n-a[u])/2),l.push(p)}for(u=0;s.length>u;u++){var f=new r.Sprite(s[u].texture);f.position.x=(s[u].position.x+l[s[u].line])*h,f.position.y=s[u].position.y*h,f.scale.x=f.scale.y=h,this.addChild(f)}this.width=e.x*h,this.height=(e.y+t.lineHeight)*h},r.BitmapText.prototype.updateTransform=function(){if(this.dirty){for(;this.children.length>0;)this.removeChild(this.getChildAt(0));this.updateText(),this.dirty=!1}r.DisplayObjectContainer.prototype.updateTransform.call(this)},r.BitmapText.fonts={},r.InteractionManager=function(t){this.stage=t,this.tempPoint=new r.Point,this.mouseoverEnabled=!0,this.mouse=new r.InteractionData,this.touchs={},this.pool=[],this.interactiveItems=[],this.last=0},r.InteractionManager.constructor=r.InteractionManager,r.InteractionManager.prototype.collectInteractiveSprite=function(t,e){for(var i=t.children,r=i.length,s=r-1;s>=0;s--){var n=i[s];n.interactive?(e.interactiveChildren=!0,this.interactiveItems.push(n),n.children.length>0&&this.collectInteractiveSprite(n,n)):(n.__iParent=null,n.children.length>0&&this.collectInteractiveSprite(n,e))}},r.InteractionManager.prototype.setTarget=function(t){window.navigator.msPointerEnabled&&(t.view.style["-ms-content-zooming"]="none",t.view.style["-ms-touch-action"]="none"),this.target=t,t.view.addEventListener("mousemove",this.onMouseMove.bind(this),!0),t.view.addEventListener("mousedown",this.onMouseDown.bind(this),!0),document.body.addEventListener("mouseup",this.onMouseUp.bind(this),!0),t.view.addEventListener("mouseout",this.onMouseUp.bind(this),!0),t.view.addEventListener("touchstart",this.onTouchStart.bind(this),!0),t.view.addEventListener("touchend",this.onTouchEnd.bind(this),!0),t.view.addEventListener("touchmove",this.onTouchMove.bind(this),!0)},r.InteractionManager.prototype.update=function(){if(this.target){var t=Date.now(),e=t-this.last;if(e=30*e/1e3,!(1>e)){if(this.last=t,this.dirty){this.dirty=!1;for(var i=this.interactiveItems.length,r=0;i>r;r++)this.interactiveItems[r].interactiveChildren=!1;this.interactiveItems=[],this.stage.interactive&&this.interactiveItems.push(this.stage),this.collectInteractiveSprite(this.stage,this.stage)}var s=this.interactiveItems.length;this.target.view.style.cursor="default";for(var r=0;s>r;r++){var n=this.interactiveItems[r];n.visible&&(n.mouseover||n.mouseout||n.buttonMode)&&(n.__hit=this.hitTest(n,this.mouse),n.__hit?(n.buttonMode&&(this.target.view.style.cursor="pointer"),n.__isOver||(n.mouseover&&n.mouseover(this.mouse),n.__isOver=!0)):n.__isOver&&(n.mouseout&&n.mouseout(this.mouse),n.__isOver=!1))}}}},r.InteractionManager.prototype.onMouseMove=function(t){t.preventDefault();var e=this.target.view.getBoundingClientRect();this.mouse.global.x=(t.clientX-e.left)*(this.target.width/e.width),this.mouse.global.y=(t.clientY-e.top)*(this.target.height/e.height);var i=this.interactiveItems.length;this.mouse.global;for(var r=0;i>r;r++){var s=this.interactiveItems[r];s.mousemove&&s.mousemove(this.mouse)}},r.InteractionManager.prototype.onMouseDown=function(t){t.preventDefault();var e=this.interactiveItems.length;this.mouse.global,this.stage;for(var i=0;e>i;i++){var r=this.interactiveItems[i];if((r.mousedown||r.click)&&(r.__mouseIsDown=!0,r.__hit=this.hitTest(r,this.mouse),r.__hit&&(r.mousedown&&r.mousedown(this.mouse),r.__isDown=!0,!r.interactiveChildren)))break}},r.InteractionManager.prototype.onMouseUp=function(t){t.preventDefault(),this.mouse.global;for(var e=this.interactiveItems.length,i=!1,r=0;e>r;r++){var s=this.interactiveItems[r];(s.mouseup||s.mouseupoutside||s.click)&&(s.__hit=this.hitTest(s,this.mouse),s.__hit&&!i?(s.mouseup&&s.mouseup(this.mouse),s.__isDown&&s.click&&s.click(this.mouse),s.interactiveChildren||(i=!0)):s.__isDown&&s.mouseupoutside&&s.mouseupoutside(this.mouse),s.__isDown=!1)}},r.InteractionManager.prototype.hitTest=function(t,e){var i=e.global;if(!t.visible)return!1;if(t instanceof r.Sprite){var s=t.worldTransform,n=s[0],a=s[1],o=s[2],h=s[3],u=s[4],d=s[5],c=1/(n*u+a*-h),l=u*c*i.x+-a*c*i.y+(d*a-o*u)*c,p=n*c*i.y+-h*c*i.x+(-d*n+o*h)*c,f=t.texture.frame.width,x=t.texture.frame.height,v=-f*t.anchor.x;if(l>v&&v+f>l){var g=-x*t.anchor.y;if(p>g&&g+x>p)return e.target=t,!0}}else if(t.hitArea){var s=t.worldTransform,b=t.hitArea,n=s[0],a=s[1],o=s[2],h=s[3],u=s[4],d=s[5],c=1/(n*u+a*-h),l=u*c*i.x+-a*c*i.y+(d*a-o*u)*c,p=n*c*i.y+-h*c*i.x+(-d*n+o*h)*c,v=b.x;if(l>v&&v+b.width>l){var g=b.y;if(p>g&&g+b.height>p)return!0}}for(var T=t.children.length,m=0;T>m;m++){var y=t.children[m],_=this.hitTest(y,e);if(_)return!0}return!1},r.InteractionManager.prototype.onTouchMove=function(t){t.preventDefault();for(var e=this.target.view.getBoundingClientRect(),i=t.changedTouches,r=0;i.length>r;r++){var s=i[r],n=this.touchs[s.identifier];n.global.x=(s.clientX-e.left)*(this.target.width/e.width),n.global.y=(s.clientY-e.top)*(this.target.height/e.height)}for(var a=this.interactiveItems.length,r=0;a>r;r++){var o=this.interactiveItems[r];o.touchmove&&o.touchmove(n)}},r.InteractionManager.prototype.onTouchStart=function(t){t.preventDefault();for(var e=this.target.view.getBoundingClientRect(),i=t.changedTouches,s=0;i.length>s;s++){var n=i[s],a=this.pool.pop();a||(a=new r.InteractionData),this.touchs[n.identifier]=a,a.global.x=(n.clientX-e.left)*(this.target.width/e.width),a.global.y=(n.clientY-e.top)*(this.target.height/e.height);for(var o=this.interactiveItems.length,h=0;o>h;h++){var u=this.interactiveItems[h];if((u.touchstart||u.tap)&&(u.__hit=this.hitTest(u,a),u.__hit&&(u.touchstart&&u.touchstart(a),u.__isDown=!0,u.__touchData=a,!u.interactiveChildren)))break}}},r.InteractionManager.prototype.onTouchEnd=function(t){t.preventDefault();for(var e=this.target.view.getBoundingClientRect(),i=t.changedTouches,r=0;i.length>r;r++){var s=i[r],n=this.touchs[s.identifier],a=!1;n.global.x=(s.clientX-e.left)*(this.target.width/e.width),n.global.y=(s.clientY-e.top)*(this.target.height/e.height);for(var o=this.interactiveItems.length,h=0;o>h;h++){var u=this.interactiveItems[h],d=u.__touchData;u.__hit=this.hitTest(u,n),d==n&&((u.touchend||u.tap)&&(u.__hit&&!a?(u.touchend&&u.touchend(n),u.__isDown&&u.tap&&u.tap(n),u.interactiveChildren||(a=!0)):u.__isDown&&u.touchendoutside&&u.touchendoutside(n),u.__isDown=!1),u.__touchData=null)}this.pool.push(n),this.touchs[s.identifier]=null}},r.InteractionData=function(){this.global=new r.Point,this.local=new r.Point,this.target},r.InteractionData.prototype.getLocalPosition=function(t){var e=t.worldTransform,i=this.global,s=e[0],n=e[1],a=e[2],o=e[3],h=e[4],u=e[5],d=1/(s*h+n*-o);return new r.Point(h*d*i.x+-n*d*i.y+(u*n-a*h)*d,s*d*i.y+-o*d*i.x+(-u*s+a*o)*d)},r.InteractionData.constructor=r.InteractionData,r.Stage=function(t,e){r.DisplayObjectContainer.call(this),this.worldTransform=r.mat3.create(),this.__childrenAdded=[],this.__childrenRemoved=[],this.childIndex=0,this.stage=this,this.stage.hitArea=new r.Rectangle(0,0,1e5,1e5),this.interactive=!!e,this.interactionManager=new r.InteractionManager(this),this.setBackgroundColor(t),this.worldVisible=!0},r.Stage.constructor=r.Stage,r.Stage.prototype=Object.create(r.DisplayObjectContainer.prototype),r.Stage.prototype.updateTransform=function(){this.worldAlpha=1;for(var t=0,e=this.children.length;e>t;t++)this.children[t].updateTransform();this.dirty&&(this.dirty=!1,this.interactionManager.dirty=!0),this.interactive&&this.interactionManager.update()},r.Stage.prototype.setBackgroundColor=function(e){this.backgroundColor=e||0,this.backgroundColorSplit=t(this.backgroundColor),this.backgroundColorString="#"+this.backgroundColor.toString(16)},r.Stage.prototype.getMousePosition=function(){return this.interactionManager.mouse.global},r.Stage.prototype.__addChild=function(t){if(t.interactive&&(this.dirty=!0),t.stage=this,t.children)for(var e=0;t.children.length>e;e++)this.__addChild(t.children[e])},r.Stage.prototype.__removeChild=function(t){if(t.interactive&&(this.dirty=!0),t.stage=void 0,t.children)for(var e=0,i=t.children.length;i>e;e++)this.__removeChild(t.children[e])},window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){window.setTimeout(t,1e3/60)}}(),"function"!=typeof Function.prototype.bind&&(Function.prototype.bind=function(){var t=Array.prototype.slice;return function(e){function i(){var n=s.concat(t.call(arguments));r.apply(this instanceof i?this:e,n)}var r=this,s=t.call(arguments,1);if("function"!=typeof r)throw new TypeError;return i.prototype=function n(t){return t&&(n.prototype=t),this instanceof n?void 0:new n}(r.prototype),i}}());var s=function(){var t=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(!window.ActiveXObject)return window.XMLHttpRequest?new XMLHttpRequest:!1;for(var e=0;t.length>e;e++)try{return new ActiveXObject(t[e])}catch(i){}};r.EventTarget=function(){var t={};this.addEventListener=this.on=function(e,i){void 0===t[e]&&(t[e]=[]),-1===t[e].indexOf(i)&&t[e].push(i)},this.dispatchEvent=this.emit=function(e){for(var i in t[e.type])t[e.type][i](e)},this.removeEventListener=this.off=function(e,i){var r=t[e].indexOf(i);-1!==r&&t[e].splice(r,1)}},e(),r.mat3={},r.mat3.create=function(){var t=new r.Matrix(9);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},r.mat4={},r.mat4.create=function(){var t=new r.Matrix(16);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},r.mat3.multiply=function(t,e,i){i||(i=t);var r=t[0],s=t[1],n=t[2],a=t[3],o=t[4],h=t[5],u=t[6],d=t[7],c=t[8],l=e[0],p=e[1],f=e[2],x=e[3],v=e[4],g=e[5],b=e[6],T=e[7],m=e[8];return i[0]=l*r+p*a+f*u,i[1]=l*s+p*o+f*d,i[2]=l*n+p*h+f*c,i[3]=x*r+v*a+g*u,i[4]=x*s+v*o+g*d,i[5]=x*n+v*h+g*c,i[6]=b*r+T*a+m*u,i[7]=b*s+T*o+m*d,i[8]=b*n+T*h+m*c,i},r.mat3.toMat4=function(t,e){return e||(e=r.mat4.create()),e[15]=1,e[14]=0,e[13]=0,e[12]=0,e[11]=0,e[10]=t[8],e[9]=t[7],e[8]=t[6],e[7]=0,e[6]=t[5],e[5]=t[4],e[4]=t[3],e[3]=0,e[2]=t[2],e[1]=t[1],e[0]=t[0],e},r.mat4.create=function(){var t=new r.Matrix(16);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},r.mat4.transpose=function(t,e){if(!e||t===e){var i=t[1],r=t[2],s=t[3],n=t[6],a=t[7],o=t[11];return t[1]=t[4],t[2]=t[8],t[3]=t[12],t[4]=i,t[6]=t[9],t[7]=t[13],t[8]=r,t[9]=n,t[11]=t[14],t[12]=s,t[13]=a,t[14]=o,t}return e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15],e},r.mat4.multiply=function(t,e,i){i||(i=t);var r=t[0],s=t[1],n=t[2],a=t[3],o=t[4],h=t[5],u=t[6],d=t[7],c=t[8],l=t[9],p=t[10],f=t[11],x=t[12],v=t[13],g=t[14],b=t[15],T=e[0],m=e[1],y=e[2],_=e[3];return i[0]=T*r+m*o+y*c+_*x,i[1]=T*s+m*h+y*l+_*v,i[2]=T*n+m*u+y*p+_*g,i[3]=T*a+m*d+y*f+_*b,T=e[4],m=e[5],y=e[6],_=e[7],i[4]=T*r+m*o+y*c+_*x,i[5]=T*s+m*h+y*l+_*v,i[6]=T*n+m*u+y*p+_*g,i[7]=T*a+m*d+y*f+_*b,T=e[8],m=e[9],y=e[10],_=e[11],i[8]=T*r+m*o+y*c+_*x,i[9]=T*s+m*h+y*l+_*v,i[10]=T*n+m*u+y*p+_*g,i[11]=T*a+m*d+y*f+_*b,T=e[12],m=e[13],y=e[14],_=e[15],i[12]=T*r+m*o+y*c+_*x,i[13]=T*s+m*h+y*l+_*v,i[14]=T*n+m*u+y*p+_*g,i[15]=T*a+m*d+y*f+_*b,i},r.autoDetectRenderer=function(t,e,i,s){t||(t=800),e||(e=600);var n=function(){try{return!!window.WebGLRenderingContext&&!!document.createElement("canvas").getContext("experimental-webgl")}catch(t){return!1}}();return n?new r.WebGLRenderer(t,e,i,s):new r.CanvasRenderer(t,e,i,s)},r.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;","}"],r.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;","}"],r.CompileVertexShader=function(t,e){return r._CompileShader(t,e,t.VERTEX_SHADER)},r.CompileFragmentShader=function(t,e){return r._CompileShader(t,e,t.FRAGMENT_SHADER)},r._CompileShader=function(t,e,i){var r=e.join("\n"),s=t.createShader(i);return t.shaderSource(s,r),t.compileShader(s),t.getShaderParameter(s,t.COMPILE_STATUS)?s:(alert(t.getShaderInfoLog(s)),null)},r._defaultFrame=new r.Rectangle(0,0,1,1),r.gl,r.WebGLRenderer=function(t,e,i,s){this.transparent=!!s,this.width=t||800,this.height=e||600,this.view=i||document.createElement("canvas"),this.view.width=this.width,this.view.height=this.height;var n=this;this.view.addEventListener("webglcontextlost",function(t){n.handleContextLost(t)},!1),this.view.addEventListener("webglcontextrestored",function(t){n.handleContextRestored(t)},!1),this.batchs=[];try{r.gl=this.gl=this.view.getContext("experimental-webgl",{alpha:this.transparent,antialias:!1,premultipliedAlpha:!1})}catch(a){throw Error(" This browser does not support webGL. Try using the canvas renderer"+this)}this.initShaders();var o=this.gl;r.WebGLRenderer.gl=o,this.batch=new r.WebGLBatch(o),o.disable(o.DEPTH_TEST),o.disable(o.CULL_FACE),o.enable(o.BLEND),o.colorMask(!0,!0,!0,this.transparent),this.projectionMatrix=r.mat4.create(),this.resize(this.width,this.height),this.contextLost=!1,this.stageRenderGroup=new r.WebGLRenderGroup(this.gl)},r.WebGLRenderer.constructor=r.WebGLRenderer,r.WebGLRenderer.getBatch=function(){return 0==r._batchs.length?new r.WebGLBatch(r.WebGLRenderer.gl):r._batchs.pop()},r.WebGLRenderer.returnBatch=function(t){t.clean(),r._batchs.push(t)},r.WebGLRenderer.prototype.initShaders=function(){var t=this.gl,e=r.CompileFragmentShader(t,r.shaderFragmentSrc),i=r.CompileVertexShader(t,r.shaderVertexSrc);r.shaderProgram=t.createProgram();var s=r.shaderProgram;t.attachShader(s,i),t.attachShader(s,e),t.linkProgram(s),t.getProgramParameter(s,t.LINK_STATUS)||alert("Could not initialise shaders"),t.useProgram(s),s.vertexPositionAttribute=t.getAttribLocation(s,"aVertexPosition"),t.enableVertexAttribArray(s.vertexPositionAttribute),s.textureCoordAttribute=t.getAttribLocation(s,"aTextureCoord"),t.enableVertexAttribArray(s.textureCoordAttribute),s.colorAttribute=t.getAttribLocation(s,"aColor"),t.enableVertexAttribArray(s.colorAttribute),s.mvMatrixUniform=t.getUniformLocation(s,"uMVMatrix"),s.samplerUniform=t.getUniformLocation(s,"uSampler")},r.WebGLRenderer.prototype.render=function(t){if(!this.contextLost){this.__stage!==t&&(this.__stage=t,this.stageRenderGroup.setRenderable(t)),r.WebGLRenderer.updateTextures(),t.updateTransform();var e=this.gl;if(e.colorMask(!0,!0,!0,this.transparent),e.viewport(0,0,this.width,this.height),e.bindFramebuffer(e.FRAMEBUFFER,null),e.clearColor(t.backgroundColorSplit[0],t.backgroundColorSplit[1],t.backgroundColorSplit[2],!this.transparent),e.clear(e.COLOR_BUFFER_BIT),r.projectionMatrix=this.projectionMatrix,this.stageRenderGroup.backgroundColor=t.backgroundColorSplit,this.stageRenderGroup.render(this.projectionMatrix),t.interactive&&(t._interactiveEventsAdded||(t._interactiveEventsAdded=!0,t.interactionManager.setTarget(this))),r.Texture.frameUpdates.length>0){for(var i=0;r.Texture.frameUpdates.length>i;i++)r.Texture.frameUpdates[i].updateFrame=!1;r.Texture.frameUpdates=[]}}},r.WebGLRenderer.updateTextures=function(){for(var t=0;r.texturesToUpdate.length>t;t++)this.updateTexture(r.texturesToUpdate[t]);for(var t=0;r.texturesToDestroy.length>t;t++)this.destroyTexture(r.texturesToDestroy[t]);r.texturesToUpdate=[],r.texturesToDestroy=[]},r.WebGLRenderer.updateTexture=function(t){var e=r.gl;t._glTexture||(t._glTexture=e.createTexture()),t.hasLoaded&&(e.bindTexture(e.TEXTURE_2D,t._glTexture),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,t.source),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),t._powerOf2?(e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.REPEAT)):(e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE)),e.bindTexture(e.TEXTURE_2D,null))},r.WebGLRenderer.prototype.destroyTexture=function(t){var e=this.gl;t._glTexture&&(t._glTexture=e.createTexture(),e.deleteTexture(e.TEXTURE_2D,t._glTexture))},r.WebGLRenderer.prototype.resize=function(t,e){this.width=t,this.height=e,this.view.width=t,this.view.height=e,this.gl.viewport(0,0,this.width,this.height);var i=this.projectionMatrix;i[0]=2/this.width,i[5]=-2/this.height,i[12]=-1,i[13]=1},r.WebGLRenderer.prototype.handleContextLost=function(t){t.preventDefault(),this.contextLost=!0},r.WebGLRenderer.prototype.handleContextRestored=function(){this.gl=this.view.getContext("experimental-webgl",{alpha:!0}),this.initShaders();for(var t=0;r.TextureCache.length>t;t++)this.updateTexture(r.TextureCache[t]);for(var t=0;this.batchs.length>t;t++)this.batchs[t].restoreLostContext(this.gl),this.batchs[t].dirty=!0;r._restoreBatchs(this.gl),this.contextLost=!1},r._batchs=[],r._getBatch=function(t){return 0==r._batchs.length?new r.WebGLBatch(t):r._batchs.pop()},r._returnBatch=function(t){t.clean(),r._batchs.push(t)},r._restoreBatchs=function(t){for(var e=0;r._batchs.length>e;e++)r._batchs[e].restoreLostContext(t)},r.WebGLBatch=function(t){this.gl=t,this.size=0,this.vertexBuffer=t.createBuffer(),this.indexBuffer=t.createBuffer(),this.uvBuffer=t.createBuffer(),this.colorBuffer=t.createBuffer(),this.blendMode=r.blendModes.NORMAL,this.dynamicSize=1},r.WebGLBatch.constructor=r.WebGLBatch,r.WebGLBatch.prototype.clean=function(){this.verticies=[],this.uvs=[],this.indices=[],this.colors=[],this.dynamicSize=1,this.texture=null,this.last=null,this.size=0,this.head,this.tail},r.WebGLBatch.prototype.restoreLostContext=function(t){this.gl=t,this.vertexBuffer=t.createBuffer(),this.indexBuffer=t.createBuffer(),this.uvBuffer=t.createBuffer(),this.colorBuffer=t.createBuffer()},r.WebGLBatch.prototype.init=function(t){t.batch=this,this.dirty=!0,this.blendMode=t.blendMode,this.texture=t.texture.baseTexture,this.head=t,this.tail=t,this.size=1,this.growBatch()},r.WebGLBatch.prototype.insertBefore=function(t,e){this.size++,t.batch=this,this.dirty=!0;var i=e.__prev;e.__prev=t,t.__next=e,i?(t.__prev=i,i.__next=t):this.head=t},r.WebGLBatch.prototype.insertAfter=function(t,e){this.size++,t.batch=this,this.dirty=!0;var i=e.__next;e.__next=t,t.__prev=e,i?(t.__next=i,i.__prev=t):this.tail=t},r.WebGLBatch.prototype.remove=function(t){return this.size--,0==this.size?(t.batch=null,t.__prev=null,t.__next=null,void 0):(t.__prev?t.__prev.__next=t.__next:(this.head=t.__next,this.head.__prev=null),t.__next?t.__next.__prev=t.__prev:(this.tail=t.__prev,this.tail.__next=null),t.batch=null,t.__next=null,t.__prev=null,this.dirty=!0,void 0)},r.WebGLBatch.prototype.split=function(t){this.dirty=!0;var e=new r.WebGLBatch(this.gl);e.init(t),e.texture=this.texture,e.tail=this.tail,this.tail=t.__prev,this.tail.__next=null,t.__prev=null;for(var i=0;t;)i++,t.batch=e,t=t.__next;return e.size=i,this.size-=i,e},r.WebGLBatch.prototype.merge=function(t){this.dirty=!0,this.tail.__next=t.head,t.head.__prev=this.tail,this.size+=t.size,this.tail=t.tail;for(var e=t.head;e;)e.batch=this,e=e.__next},r.WebGLBatch.prototype.growBatch=function(){var t=this.gl;this.dynamicSize=1==this.size?1:1.5*this.size,this.verticies=new Float32Array(8*this.dynamicSize),t.bindBuffer(t.ARRAY_BUFFER,this.vertexBuffer),t.bufferData(t.ARRAY_BUFFER,this.verticies,t.DYNAMIC_DRAW),this.uvs=new Float32Array(8*this.dynamicSize),t.bindBuffer(t.ARRAY_BUFFER,this.uvBuffer),t.bufferData(t.ARRAY_BUFFER,this.uvs,t.DYNAMIC_DRAW),this.dirtyUVS=!0,this.colors=new Float32Array(4*this.dynamicSize),t.bindBuffer(t.ARRAY_BUFFER,this.colorBuffer),t.bufferData(t.ARRAY_BUFFER,this.colors,t.DYNAMIC_DRAW),this.dirtyColors=!0,this.indices=new Uint16Array(6*this.dynamicSize);for(var e=this.indices.length/6,i=0;e>i;i++){var r=6*i,s=4*i;this.indices[r+0]=s+0,this.indices[r+1]=s+1,this.indices[r+2]=s+2,this.indices[r+3]=s+0,this.indices[r+4]=s+2,this.indices[r+5]=s+3}t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indexBuffer),t.bufferData(t.ELEMENT_ARRAY_BUFFER,this.indices,t.STATIC_DRAW)},r.WebGLBatch.prototype.refresh=function(){this.gl,this.dynamicSizes;s++)i=this.batchs[s],i instanceof r.WebGLBatch?this.batchs[s].render():i instanceof r.TilingSprite?i.visible&&this.renderTilingSprite(i,t):i instanceof r.Strip?i.visible&&this.renderStrip(i,t):i instanceof r.Graphics&&i.visible&&i.renderWebGL(this,t)},r.WebGLRenderGroup.prototype.renderSpecific=function(t,e){r.WebGLRenderer.updateTextures();var i=this.gl;this.checkVisibility(t,t.visible),i.uniformMatrix4fv(r.shaderProgram.mvMatrixUniform,!1,e);var s,n,a,o,h=t.renderable?t:this.getNextRenderable(t),u=h.batch;if(h instanceof r.Sprite){u=h.batch;var d=u.head;if(d==h)s=0;else for(s=1;d.__next!=h;)s++,d=d.__next}else u=h;for(var c,l=t,p=t;p.children.length>0;)p=p.children[p.children.length-1],p.renderable&&(l=p);if(l instanceof r.Sprite){c=l.batch;var d=c.head;if(d==l)a=0;else for(a=1;d.__next!=l;)a++,d=d.__next}else c=l;if(u==c)return u instanceof r.WebGLBatch?u.render(s,a+1):u instanceof r.TilingSprite?u.visible&&this.renderTilingSprite(u,e):u instanceof r.Strip?u.visible&&this.renderStrip(u,e):u instanceof r.CustomRenderable&&u.visible&&u.renderWebGL(this,e),void 0;n=this.batchs.indexOf(u),o=this.batchs.indexOf(c),u instanceof r.WebGLBatch?u.render(s):u instanceof r.TilingSprite?u.visible&&this.renderTilingSprite(u,e):u instanceof r.Strip?u.visible&&this.renderStrip(u,e):u instanceof r.CustomRenderable&&u.visible&&u.renderWebGL(this,e);for(var f=n+1;o>f;f++)renderable=this.batchs[f],renderable instanceof r.WebGLBatch?this.batchs[f].render():renderable instanceof r.TilingSprite?renderable.visible&&this.renderTilingSprite(renderable,e):renderable instanceof r.Strip?renderable.visible&&this.renderStrip(renderable,e):renderable instanceof r.CustomRenderable&&renderable.visible&&renderable.renderWebGL(this,e);c instanceof r.WebGLBatch?c.render(0,a+1):c instanceof r.TilingSprite?c.visible&&this.renderTilingSprite(c):c instanceof r.Strip?c.visible&&this.renderStrip(c):c instanceof r.CustomRenderable&&c.visible&&c.renderWebGL(this,e)},r.WebGLRenderGroup.prototype.checkVisibility=function(t,e){for(var i=t.children,r=0;i.length>r;r++){var s=i[r];s.worldVisible=s.visible&&e,s.textureChange&&(s.textureChange=!1,s.worldVisible&&(this.removeDisplayObject(s),this.addDisplayObject(s))),s.children.length>0&&this.checkVisibility(s,s.worldVisible)}},r.WebGLRenderGroup.prototype.updateTexture=function(t){if(1==t.batch.length)return t.batch.texture=t.texture.baseTexture,void 0;if(t.batch.texture!=t.texture.baseTexture)if(t.batch.head==t){var e=t.batch,i=this.batchs.indexOf(e),s=this.batchs[i-1];if(e.remove(t),s)if(s.texture==t.texture.baseTexture&&s.blendMode==t.blendMode)s.insertAfter(t,s.tail);else{var n=r.WebGLRenderer.getBatch();n.init(t),this.batchs.splice(i-1,0,n)}else{var n=r.WebGLRenderer.getBatch();n.init(t),this.batchs.splice(0,0,n)}}else if(t.batch.tail==t){var e=t.batch,i=this.batchs.indexOf(e),a=this.batchs[i+1];if(e.remove(t),a){if(a.texture==t.texture.baseTexture&&a.blendMode==t.blendMode)return a.insertBefore(t,a.head),void 0;var n=r.WebGLRenderer.getBatch();n.init(t),this.batchs.splice(i+1,0,n)}else{var n=r.WebGLRenderer.getBatch();n.init(t),this.batchs.push(n)}}else{var e=t.batch,o=e.split(t);o.remove(t);var n=r.WebGLRenderer.getBatch(),i=this.batchs.indexOf(e);n.init(t),this.batchs.splice(i+1,0,n,o)}},r.WebGLRenderGroup.prototype.addDisplayObject=function(t){if(t.__renderGroup&&t.__renderGroup.removeDisplayObjectAndChildren(t),t.__renderGroup=this,t.renderable){var e=this.getPreviousRenderable(t),i=this.getNextRenderable(t);if(t instanceof r.Sprite){var s,n;if(e instanceof r.Sprite){if(s=e.batch,s&&s.texture==t.texture.baseTexture&&s.blendMode==t.blendMode)return s.insertAfter(t,e),void 0}else s=e;if(i)if(i instanceof r.Sprite){if(n=i.batch){if(n.texture==t.texture.baseTexture&&n.blendMode==t.blendMode)return n.insertBefore(t,i),void 0;if(n==s){var a=s.split(i),o=r.WebGLRenderer.getBatch(),h=this.batchs.indexOf(s);return o.init(t),this.batchs.splice(h+1,0,o,a),void 0}}}else n=i;var o=r.WebGLRenderer.getBatch();if(o.init(t),s){var h=this.batchs.indexOf(s);this.batchs.splice(h+1,0,o)}else this.batchs.push(o)}else t instanceof r.TilingSprite?(this.initTilingSprite(t),this.batchs.push(t)):t instanceof r.Strip?(this.initStrip(t),this.batchs.push(t)):t instanceof r.Graphics&&this.batchs.push(t);this.batchUpdate=!0}},r.WebGLRenderGroup.prototype.addDisplayObjectAndChildren=function(t){this.addDisplayObject(t);for(var e=t.children,i=0;e.length>i;i++)this.addDisplayObjectAndChildren(e[i])},r.WebGLRenderGroup.prototype.removeDisplayObject=function(t){if(t.__renderGroup=null,t.renderable){var e;if(t instanceof r.Sprite){var i=t.batch;if(!i)return;i.remove(t),0==i.size&&(e=i)}else e=t;if(e){var s=this.batchs.indexOf(e);if(-1==s)return;if(0==s||s==this.batchs.length-1)return this.batchs.splice(s,1),e instanceof r.WebGLBatch&&r.WebGLRenderer.returnBatch(e),void 0;if(this.batchs[s-1]instanceof r.WebGLBatch&&this.batchs[s+1]instanceof r.WebGLBatch&&this.batchs[s-1].texture==this.batchs[s+1].texture&&this.batchs[s-1].blendMode==this.batchs[s+1].blendMode)return this.batchs[s-1].merge(this.batchs[s+1]),e instanceof r.WebGLBatch&&r.WebGLRenderer.returnBatch(e),r.WebGLRenderer.returnBatch(this.batchs[s+1]),this.batchs.splice(s,2),void 0;this.batchs.splice(s,1),e instanceof r.WebGLBatch&&r.WebGLRenderer.returnBatch(e)}}},r.WebGLRenderGroup.prototype.removeDisplayObjectAndChildren=function(t){if(t.__renderGroup==this){this.removeDisplayObject(t);for(var e=t.children,i=0;e.length>i;i++)this.removeDisplayObjectAndChildren(e[i])}},r.WebGLRenderGroup.prototype.getNextRenderable=function(t){var e=t;do{if(0==e.children.length){if(!e.parent)return null;for(;e.childIndex==e.parent.children.length-1;)if(e=e.parent,e==this.root||!e.parent){e=null;break}e&&(e=e.parent.children[e.childIndex+1])}else e=e.children[0];if(!e)break}while(!e.renderable||!e.__renderGroup);return e},r.WebGLRenderGroup.prototype.getPreviousRenderable=function(t){var e=t;do{if(0==e.childIndex){if(e=e.parent,!e)return null}else for(e=e.parent.children[e.childIndex-1];0!=e.children.length;)e=e.children[e.children.length-1];if(e==this.root)break}while(!e.renderable||!e.__renderGroup);return e},r.WebGLRenderGroup.prototype.initTilingSprite=function(t){var e=this.gl;t.verticies=new Float32Array([0,0,t.width,0,t.width,t.height,0,t.height]),t.uvs=new Float32Array([0,0,1,0,1,1,0,1]),t.colors=new Float32Array([1,1,1,1]),t.indices=new Uint16Array([0,1,3,2]),t._vertexBuffer=e.createBuffer(),t._indexBuffer=e.createBuffer(),t._uvBuffer=e.createBuffer(),t._colorBuffer=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,t._vertexBuffer),e.bufferData(e.ARRAY_BUFFER,t.verticies,e.STATIC_DRAW),e.bindBuffer(e.ARRAY_BUFFER,t._uvBuffer),e.bufferData(e.ARRAY_BUFFER,t.uvs,e.DYNAMIC_DRAW),e.bindBuffer(e.ARRAY_BUFFER,t._colorBuffer),e.bufferData(e.ARRAY_BUFFER,t.colors,e.STATIC_DRAW),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t._indexBuffer),e.bufferData(e.ELEMENT_ARRAY_BUFFER,t.indices,e.STATIC_DRAW),t.texture.baseTexture._glTexture?(e.bindTexture(e.TEXTURE_2D,t.texture.baseTexture._glTexture),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.REPEAT),t.texture.baseTexture._powerOf2=!0):t.texture.baseTexture._powerOf2=!0},r.WebGLRenderGroup.prototype.renderStrip=function(t,e){var i=this.gl,s=r.shaderProgram,n=r.mat3.toMat4(t.worldTransform);r.mat4.transpose(n),r.mat4.multiply(e,n,n),i.uniformMatrix4fv(s.mvMatrixUniform,!1,n),t.blendMode==r.blendModes.NORMAL?i.blendFunc(i.ONE,i.ONE_MINUS_SRC_ALPHA):i.blendFunc(i.ONE,i.ONE_MINUS_SRC_COLOR),t.dirty?(t.dirty=!1,i.bindBuffer(i.ARRAY_BUFFER,t._vertexBuffer),i.bufferData(i.ARRAY_BUFFER,t.verticies,i.STATIC_DRAW),i.vertexAttribPointer(s.vertexPositionAttribute,2,i.FLOAT,!1,0,0),i.bindBuffer(i.ARRAY_BUFFER,t._uvBuffer),i.bufferData(i.ARRAY_BUFFER,t.uvs,i.STATIC_DRAW),i.vertexAttribPointer(s.textureCoordAttribute,2,i.FLOAT,!1,0,0),i.activeTexture(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,t.texture.baseTexture._glTexture),i.bindBuffer(i.ARRAY_BUFFER,t._colorBuffer),i.bufferData(i.ARRAY_BUFFER,t.colors,i.STATIC_DRAW),i.vertexAttribPointer(s.colorAttribute,1,i.FLOAT,!1,0,0),i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,t._indexBuffer),i.bufferData(i.ELEMENT_ARRAY_BUFFER,t.indices,i.STATIC_DRAW)):(i.bindBuffer(i.ARRAY_BUFFER,t._vertexBuffer),i.bufferSubData(i.ARRAY_BUFFER,0,t.verticies),i.vertexAttribPointer(s.vertexPositionAttribute,2,i.FLOAT,!1,0,0),i.bindBuffer(i.ARRAY_BUFFER,t._uvBuffer),i.vertexAttribPointer(s.textureCoordAttribute,2,i.FLOAT,!1,0,0),i.activeTexture(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,t.texture.baseTexture._glTexture),i.bindBuffer(i.ARRAY_BUFFER,t._colorBuffer),i.vertexAttribPointer(s.colorAttribute,1,i.FLOAT,!1,0,0),i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,t._indexBuffer)),i.drawElements(i.TRIANGLE_STRIP,t.indices.length,i.UNSIGNED_SHORT,0),i.uniformMatrix4fv(s.mvMatrixUniform,!1,e)},r.WebGLRenderGroup.prototype.renderTilingSprite=function(t,e){var i=this.gl;r.shaderProgram;var s=t.tilePosition,n=t.tileScale,a=s.x/t.texture.baseTexture.width,o=s.y/t.texture.baseTexture.height,h=t.width/t.texture.baseTexture.width/n.x,u=t.height/t.texture.baseTexture.height/n.y;t.uvs[0]=0-a,t.uvs[1]=0-o,t.uvs[2]=1*h-a,t.uvs[3]=0-o,t.uvs[4]=1*h-a,t.uvs[5]=1*u-o,t.uvs[6]=0-a,t.uvs[7]=1*u-o,i.bindBuffer(i.ARRAY_BUFFER,t._uvBuffer),i.bufferSubData(i.ARRAY_BUFFER,0,t.uvs),this.renderStrip(t,e)},r.WebGLRenderer.prototype.initStrip=function(t){var e=this.gl;this.shaderProgram,t._vertexBuffer=e.createBuffer(),t._indexBuffer=e.createBuffer(),t._uvBuffer=e.createBuffer(),t._colorBuffer=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,t._vertexBuffer),e.bufferData(e.ARRAY_BUFFER,t.verticies,e.DYNAMIC_DRAW),e.bindBuffer(e.ARRAY_BUFFER,t._uvBuffer),e.bufferData(e.ARRAY_BUFFER,t.uvs,e.STATIC_DRAW),e.bindBuffer(e.ARRAY_BUFFER,t._colorBuffer),e.bufferData(e.ARRAY_BUFFER,t.colors,e.STATIC_DRAW),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t._indexBuffer),e.bufferData(e.ELEMENT_ARRAY_BUFFER,t.indices,e.STATIC_DRAW)},r.CanvasRenderer=function(t,e,i,r){this.transparent=r,this.width=t||800,this.height=e||600,this.refresh=!0,this.view=i||document.createElement("canvas"),this.view.width=this.width,this.view.height=this.height,this.count=0,this.context=this.view.getContext("2d")},r.CanvasRenderer.constructor=r.CanvasRenderer,r.CanvasRenderer.prototype.render=function(t){r.texturesToUpdate=[],r.texturesToDestroy=[],t.updateTransform(),this.view.style.backgroundColor==t.backgroundColorString||this.transparent||(this.view.style.backgroundColor=t.backgroundColorString),this.context.setTransform(1,0,0,1,0,0),this.context.clearRect(0,0,this.width,this.height),this.renderDisplayObject(t),t.interactive&&(t._interactiveEventsAdded||(t._interactiveEventsAdded=!0,t.interactionManager.setTarget(this))),r.Texture.frameUpdates.length>0&&(r.Texture.frameUpdates=[])},r.CanvasRenderer.prototype.resize=function(t,e){this.width=t,this.height=e,this.view.width=t,this.view.height=e},r.CanvasRenderer.prototype.renderDisplayObject=function(t){var e=t.worldTransform,i=this.context;if(t.visible){if(t instanceof r.Sprite){var s=t.texture.frame;s&&(i.globalAlpha=t.worldAlpha,i.setTransform(e[0],e[3],e[1],e[4],e[2],e[5]),i.drawImage(t.texture.baseTexture.source,s.x,s.y,s.width,s.height,t.anchor.x*-s.width,t.anchor.y*-s.height,s.width,s.height))}else t instanceof r.Strip?(i.setTransform(e[0],e[3],e[1],e[4],e[2],e[5]),this.renderStrip(t)):t instanceof r.TilingSprite?(i.setTransform(e[0],e[3],e[1],e[4],e[2],e[5]),this.renderTilingSprite(t)):t instanceof r.CustomRenderable?t.renderCanvas(this):t instanceof r.Graphics&&t.render(this);for(var n=0;t.children.length>n;n++)this.renderDisplayObject(t.children[n]);this.context.setTransform(1,0,0,1,0,0)}},r.CanvasRenderer.prototype.renderStripFlat=function(t){var e=this.context,i=t.verticies;t.uvs;var r=i.length/2;this.count++,e.beginPath();for(var s=1;r-2>s;s++){var n=2*s,a=i[n],o=i[n+2],h=i[n+4],u=i[n+1],d=i[n+3],c=i[n+5];e.moveTo(a,u),e.lineTo(o,d),e.lineTo(h,c)}e.fillStyle="#FF0000",e.fill(),e.closePath()},r.CanvasRenderer.prototype.renderTilingSprite=function(t){var e=this.context;t.__tilePattern||(t.__tilePattern=e.createPattern(t.texture.baseTexture.source,"repeat")),e.beginPath();var i=t.tilePosition,r=t.tileScale;e.scale(r.x,r.y),e.translate(i.x,i.y),e.fillStyle=t.__tilePattern,e.fillRect(-i.x,-i.y,t.width/r.x,t.height/r.y),e.scale(1/r.x,1/r.y),e.translate(-i.x,-i.y),e.closePath()},r.CanvasRenderer.prototype.renderStrip=function(t){var e=this.context,i=t.verticies,r=t.uvs,s=i.length/2;this.count++;for(var n=1;s-2>n;n++){var a=2*n,o=i[a],h=i[a+2],u=i[a+4],d=i[a+1],c=i[a+3],l=i[a+5],p=r[a]*t.texture.width,f=r[a+2]*t.texture.width,x=r[a+4]*t.texture.width,v=r[a+1]*t.texture.height,g=r[a+3]*t.texture.height,b=r[a+5]*t.texture.height;e.save(),e.beginPath(),e.moveTo(o,d),e.lineTo(h,c),e.lineTo(u,l),e.closePath(),e.clip();var T=p*g+v*x+f*b-g*x-v*f-p*b,m=o*g+v*u+h*b-g*u-v*h-o*b,y=p*h+o*x+f*u-h*x-o*f-p*u,_=p*g*u+v*h*x+o*f*b-o*g*x-v*f*u-p*h*b,R=d*g+v*l+c*b-g*l-v*c-d*b,w=p*c+d*x+f*l-c*x-d*f-p*l,A=p*g*l+v*c*x+d*f*b-d*g*x-v*f*l-p*c*b;e.transform(m/T,R/T,y/T,w/T,_/T,A/T),e.drawImage(t.texture.baseTexture.source,0,0),e.restore()}},r.Strip=function(t,e,i){r.DisplayObjectContainer.call(this),this.texture=t,this.blendMode=r.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(s){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=e,this.height=i,t.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},r.Strip.constructor=r.Strip,r.Strip.prototype=Object.create(r.DisplayObjectContainer.prototype),r.Strip.prototype.setTexture=function(t){this.texture=t,this.width=t.frame.width,this.height=t.frame.height,this.updateFrame=!0},r.Strip.prototype.onTextureUpdate=function(){this.updateFrame=!0},r.Rope=function(t,e){r.Strip.call(this,t),this.points=e;try{this.verticies=new Float32Array(4*e.length),this.uvs=new Float32Array(4*e.length),this.colors=new Float32Array(2*e.length),this.indices=new Uint16Array(2*e.length)}catch(i){this.verticies=verticies,this.uvs=uvs,this.colors=colors,this.indices=indices}this.refresh()},r.Rope.constructor=r.Rope,r.Rope.prototype=Object.create(r.Strip.prototype),r.Rope.prototype.refresh=function(){var t=this.points;if(!(1>t.length)){var e=this.uvs,i=this.indices,r=this.colors,s=t[0],n=t[0];this.count-=.2,e[0]=0,e[1]=1,e[2]=0,e[3]=1,r[0]=1,r[1]=1,i[0]=0,i[1]=1;for(var a=t.length,o=1;a>o;o++){var n=t[o],h=4*o,u=o/(a-1);o%2?(e[h]=u,e[h+1]=0,e[h+2]=u,e[h+3]=1):(e[h]=u,e[h+1]=0,e[h+2]=u,e[h+3]=1),h=2*o,r[h]=1,r[h+1]=1,h=2*o,i[h]=h,i[h+1]=h+1,s=n}}},r.Rope.prototype.updateTransform=function(){var t=this.points;if(!(1>t.length)){var e,i=this.verticies,s=t[0],n={x:0,y:0},a=t[0];this.count-=.2,i[0]=a.x+n.x,i[1]=a.y+n.y,i[2]=a.x-n.x,i[3]=a.y-n.y;for(var o=t.length,h=1;o>h;h++){var a=t[h],u=4*h;e=t.length-1>h?t[h+1]:a,n.y=-(e.x-s.x),n.x=e.y-s.y;var d=10*(1-h/(o-1));d>1&&(d=1);var c=Math.sqrt(n.x*n.x+n.y*n.y),l=this.texture.height/2;n.x/=c,n.y/=c,n.x*=l,n.y*=l,i[u]=a.x+n.x,i[u+1]=a.y+n.y,i[u+2]=a.x-n.x,i[u+3]=a.y-n.y,s=a}r.DisplayObjectContainer.prototype.updateTransform.call(this)}},r.Rope.prototype.setTexture=function(t){this.texture=t,this.updateFrame=!0},r.TilingSprite=function(t,e,i){r.DisplayObjectContainer.call(this),this.texture=t,this.width=e,this.height=i,this.renderable=!0,this.tileScale=new r.Point(1,1),this.tilePosition=new r.Point(0,0),this.blendMode=r.blendModes.NORMAL},r.TilingSprite.constructor=r.TilingSprite,r.TilingSprite.prototype=Object.create(r.DisplayObjectContainer.prototype),r.TilingSprite.prototype.setTexture=function(t){this.texture=t,this.updateFrame=!0},r.TilingSprite.prototype.onTextureUpdate=function(){this.updateFrame=!0},r.CustomRenderable=function(){r.DisplayObject.call(this)},r.CustomRenderable.constructor=r.CustomRenderable,r.CustomRenderable.prototype=Object.create(r.DisplayObject.prototype),r.CustomRenderable.prototype.renderCanvas=function(){},r.CustomRenderable.prototype.initWebGL=function(){},r.CustomRenderable.prototype.renderWebGL=function(){},r.BaseTextureCache={},r.texturesToUpdate=[],r.texturesToDestroy=[],r.BaseTexture=function(t){if(r.EventTarget.call(this),this.width=100,this.height=100,this.source=t,t){if(this.source instanceof Image)if(this.source.complete)this.hasLoaded=!0,this.width=this.source.width,this.height=this.source.height,r.texturesToUpdate.push(this);else{var e=this;this.source.onload=function(){e.hasLoaded=!0,e.width=e.source.width,e.height=e.source.height,r.texturesToUpdate.push(e),e.dispatchEvent({type:"loaded",content:e})}}else this.hasLoaded=!0,this.width=this.source.width,this.height=this.source.height,r.texturesToUpdate.push(this);this._powerOf2=!1}},r.BaseTexture.constructor=r.BaseTexture,r.BaseTexture.prototype.destroy=function(){this.source instanceof Image&&(this.source.src=null),this.source=null,r.texturesToDestroy.push(this)},r.BaseTexture.fromImage=function(t,e){var i=r.BaseTextureCache[t];if(!i){var s=new Image;e&&(s.crossOrigin=""),s.src=t,i=new r.BaseTexture(s),r.BaseTextureCache[t]=i}return i},r.TextureCache={},r.FrameCache={},r.Texture=function(t,e){if(r.EventTarget.call(this),e||(this.noFrame=!0,e=new r.Rectangle(0,0,1,1)),this.trim=new r.Point,t instanceof r.Texture&&(t=t.baseTexture),this.baseTexture=t,this.frame=e,this.scope=this,t.hasLoaded)this.noFrame&&(e=new r.Rectangle(0,0,t.width,t.height)),this.setFrame(e);else{var i=this;t.addEventListener("loaded",function(){i.onBaseTextureLoaded()})}},r.Texture.constructor=r.Texture,r.Texture.prototype.onBaseTextureLoaded=function(){var t=this.baseTexture;t.removeEventListener("loaded",this.onLoaded),this.noFrame&&(this.frame=new r.Rectangle(0,0,t.width,t.height)),this.noFrame=!1,this.width=this.frame.width,this.height=this.frame.height,this.scope.dispatchEvent({type:"update",content:this})},r.Texture.prototype.destroy=function(t){t&&this.baseTexture.destroy()},r.Texture.prototype.setFrame=function(t){if(this.frame=t,this.width=t.width,this.height=t.height,t.x+t.width>this.baseTexture.width||t.y+t.height>this.baseTexture.height)throw Error("Texture Error: frame does not fit inside the base Texture dimensions "+this);this.updateFrame=!0,r.Texture.frameUpdates.push(this)},r.Texture.fromImage=function(t,e){var i=r.TextureCache[t];return i||(i=new r.Texture(r.BaseTexture.fromImage(t,e)),r.TextureCache[t]=i),i},r.Texture.fromFrame=function(t){var e=r.TextureCache[t];if(!e)throw Error("The frameId '"+t+"' does not exist in the texture cache "+this);return e},r.Texture.fromCanvas=function(t){var e=new r.BaseTexture(t);return new r.Texture(e)},r.Texture.addTextureToCache=function(t,e){r.TextureCache[e]=t},r.Texture.removeTextureFromCache=function(t){var e=r.TextureCache[t];return r.TextureCache[t]=null,e},r.Texture.frameUpdates=[],r.RenderTexture=function(t,e){r.EventTarget.call(this),this.width=t||100,this.height=e||100,this.indetityMatrix=r.mat3.create(),this.frame=new r.Rectangle(0,0,this.width,this.height),r.gl?this.initWebGL():this.initCanvas()},r.RenderTexture.constructor=r.RenderTexture,r.RenderTexture.prototype=Object.create(r.Texture.prototype),r.RenderTexture.prototype.initWebGL=function(){var t=r.gl;this.glFramebuffer=t.createFramebuffer(),t.bindFramebuffer(t.FRAMEBUFFER,this.glFramebuffer),this.glFramebuffer.width=this.width,this.glFramebuffer.height=this.height,this.baseTexture=new r.BaseTexture,this.baseTexture.width=this.width,this.baseTexture.height=this.height,this.baseTexture._glTexture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.baseTexture._glTexture),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,this.width,this.height,0,t.RGBA,t.UNSIGNED_BYTE,null),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),this.baseTexture.isRender=!0,t.bindFramebuffer(t.FRAMEBUFFER,this.glFramebuffer),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,this.baseTexture._glTexture,0),this.projectionMatrix=r.mat4.create(),this.projectionMatrix[5]=2/this.height,this.projectionMatrix[13]=-1,this.projectionMatrix[0]=2/this.width,this.projectionMatrix[12]=-1,this.render=this.renderWebGL},r.RenderTexture.prototype.initCanvas=function(){this.renderer=new r.CanvasRenderer(this.width,this.height,null,0),this.baseTexture=new r.BaseTexture(this.renderer.view),this.frame=new r.Rectangle(0,0,this.width,this.height),this.render=this.renderCanvas},r.RenderTexture.prototype.renderWebGL=function(t,e){var i=r.gl;i.colorMask(!0,!0,!0,!0),i.viewport(0,0,this.width,this.height),i.bindFramebuffer(i.FRAMEBUFFER,this.glFramebuffer),e&&(i.clearColor(0,0,0,0),i.clear(i.COLOR_BUFFER_BIT));var s=t.children;t.worldTransform=r.mat3.create();for(var n=0,a=s.length;a>n;n++)s[n].updateTransform();var o=t.__renderGroup;o?t==o.root?o.render(this.projectionMatrix):o.renderSpecific(t,this.projectionMatrix):(this.renderGroup||(this.renderGroup=new r.WebGLRenderGroup(i)),this.renderGroup.setRenderable(t),this.renderGroup.render(this.projectionMatrix))},r.RenderTexture.prototype.renderCanvas=function(t,e){var i=t.children;t.worldTransform=r.mat3.create();for(var s=0,n=i.length;n>s;s++)i[s].updateTransform();e&&this.renderer.context.clearRect(0,0,this.width,this.height),this.renderer.renderDisplayObject(t),r.texturesToUpdate.push(this.baseTexture)},r.AssetLoader=function(t){r.EventTarget.call(this),this.assetURLs=t,this.crossorigin=!1,this.loadersByType={jpg:r.ImageLoader,jpeg:r.ImageLoader,png:r.ImageLoader,gif:r.ImageLoader,json:r.SpriteSheetLoader,xml:r.BitmapFontLoader,fnt:r.BitmapFontLoader}},r.AssetLoader.constructor=r.AssetLoader,r.AssetLoader.prototype.load=function(){var t=this;this.loadCount=this.assetURLs.length;for(var e=0;this.assetURLs.length>e;e++){var i=this.assetURLs[e],r=i.split(".").pop().toLowerCase(),s=this.loadersByType[r];if(!s)throw Error(r+" is an unsupported file type");var n=new s(i,this.crossorigin);n.addEventListener("loaded",function(){t.onAssetLoaded()}),n.load()}},r.AssetLoader.prototype.onAssetLoaded=function(){this.loadCount--,this.dispatchEvent({type:"onProgress",content:this}),this.onProgress&&this.onProgress(),0==this.loadCount&&(this.dispatchEvent({type:"onComplete",content:this}),this.onComplete&&this.onComplete())},r.JsonLoader=function(t,e){r.EventTarget.call(this),this.url=t,this.baseUrl=t.replace(/[^\/]*$/,""),this.crossorigin=e},r.JsonLoader.constructor=r.JsonLoader,r.JsonLoader.prototype.load=function(){this.ajaxRequest=new s;var t=this;this.ajaxRequest.onreadystatechange=function(){t.onJSONLoaded()},this.ajaxRequest.open("GET",this.url,!0),this.ajaxRequest.overrideMimeType&&this.ajaxRequest.overrideMimeType("application/json"),this.ajaxRequest.send(null)},r.JsonLoader.prototype.onJSONLoaded=function(){4==this.ajaxRequest.readyState&&(200==this.ajaxRequest.status||-1==window.location.href.indexOf("http")?(this.json=JSON.parse(this.ajaxRequest.responseText),this.onLoaded()):this.onError())},r.JsonLoader.prototype.onLoaded=function(){this.dispatchEvent({type:"loaded",content:this})},r.JsonLoader.prototype.onError=function(){this.dispatchEvent({type:"error",content:this})},r.SpriteSheetLoader=function(t,e){r.EventTarget.call(this),this.url=t,this.baseUrl=t.replace(/[^\/]*$/,""),this.texture=null,this.frames={},this.crossorigin=e},r.SpriteSheetLoader.constructor=r.SpriteSheetLoader,r.SpriteSheetLoader.prototype.load=function(){var t=this,e=new r.JsonLoader(this.url,this.crossorigin);e.addEventListener("loaded",function(e){t.json=e.content.json,t.onJSONLoaded()}),e.load()},r.SpriteSheetLoader.prototype.onJSONLoaded=function(){var t=this,e=this.baseUrl+this.json.meta.image,i=new r.ImageLoader(e,this.crossorigin),s=this.json.frames;this.texture=i.texture.baseTexture,i.addEventListener("loaded",function(){t.onLoaded()});for(var n in s){var a=s[n].frame;a&&(r.TextureCache[n]=new r.Texture(this.texture,{x:a.x,y:a.y,width:a.w,height:a.h}),s[n].trimmed&&(r.TextureCache[n].realSize=s[n].spriteSourceSize,r.TextureCache[n].trim.x=0))}i.load()},r.SpriteSheetLoader.prototype.onLoaded=function(){this.dispatchEvent({type:"loaded",content:this})},r.ImageLoader=function(t,e){r.EventTarget.call(this),this.texture=r.Texture.fromImage(t,e)},r.ImageLoader.constructor=r.ImageLoader,r.ImageLoader.prototype.load=function(){if(this.texture.baseTexture.hasLoaded)this.onLoaded();else{var t=this;this.texture.baseTexture.addEventListener("loaded",function(){t.onLoaded()})}},r.ImageLoader.prototype.onLoaded=function(){this.dispatchEvent({type:"loaded",content:this})},r.BitmapFontLoader=function(t,e){r.EventTarget.call(this),this.url=t,this.baseUrl=t.replace(/[^\/]*$/,""),this.texture=null,this.crossorigin=e},r.BitmapFontLoader.constructor=r.BitmapFontLoader,r.BitmapFontLoader.prototype.load=function(){this.ajaxRequest=new XMLHttpRequest;var t=this;this.ajaxRequest.onreadystatechange=function(){t.onXMLLoaded()},this.ajaxRequest.open("GET",this.url,!0),this.ajaxRequest.overrideMimeType&&this.ajaxRequest.overrideMimeType("application/xml"),this.ajaxRequest.send(null)},r.BitmapFontLoader.prototype.onXMLLoaded=function(){if(4==this.ajaxRequest.readyState&&(200==this.ajaxRequest.status||-1==window.location.href.indexOf("http"))){var t=this.baseUrl+this.ajaxRequest.responseXML.getElementsByTagName("page")[0].attributes.getNamedItem("file").nodeValue,e=new r.ImageLoader(t,this.crossorigin);this.texture=e.texture.baseTexture;var i={},s=this.ajaxRequest.responseXML.getElementsByTagName("info")[0],n=this.ajaxRequest.responseXML.getElementsByTagName("common")[0];i.font=s.attributes.getNamedItem("face").nodeValue,i.size=parseInt(s.attributes.getNamedItem("size").nodeValue,10),i.lineHeight=parseInt(n.attributes.getNamedItem("lineHeight").nodeValue,10),i.chars={};for(var a=this.ajaxRequest.responseXML.getElementsByTagName("char"),o=0;a.length>o;o++){var h=parseInt(a[o].attributes.getNamedItem("id").nodeValue,10),u={x:parseInt(a[o].attributes.getNamedItem("x").nodeValue,10),y:parseInt(a[o].attributes.getNamedItem("y").nodeValue,10),width:parseInt(a[o].attributes.getNamedItem("width").nodeValue,10),height:parseInt(a[o].attributes.getNamedItem("height").nodeValue,10)};r.TextureCache[h]=new r.Texture(this.texture,u),i.chars[h]={xOffset:parseInt(a[o].attributes.getNamedItem("xoffset").nodeValue,10),yOffset:parseInt(a[o].attributes.getNamedItem("yoffset").nodeValue,10),xAdvance:parseInt(a[o].attributes.getNamedItem("xadvance").nodeValue,10),kerning:{},texture:new r.Texture(this.texture,u)}}var d=this.ajaxRequest.responseXML.getElementsByTagName("kerning");for(o=0;d.length>o;o++){var c=parseInt(d[o].attributes.getNamedItem("first").nodeValue,10),l=parseInt(d[o].attributes.getNamedItem("second").nodeValue,10),p=parseInt(d[o].attributes.getNamedItem("amount").nodeValue,10);i.chars[l].kerning[c]=p}r.BitmapText.fonts[i.font]=i;var f=this;e.addEventListener("loaded",function(){f.onLoaded()}),e.load()}},r.BitmapFontLoader.prototype.onLoaded=function(){this.dispatchEvent({type:"loaded",content:this})},"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=r),exports.PIXI=r):i.PIXI=r}).call(this); \ No newline at end of file diff --git a/examples/example 1 - Basics/pixi.js b/examples/example 1 - Basics/pixi.js index 2028846..31f792b 100644 --- a/examples/example 1 - Basics/pixi.js +++ b/examples/example 1 - Basics/pixi.js @@ -4,7 +4,7 @@ * Copyright (c) 2012, Mat Groves * http://goodboydigital.com/ * - * Compiled: 2013-06-07 + * Compiled: 2013-06-14 * * Pixi.JS is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license.php @@ -1465,7 +1465,7 @@ PIXI.InteractionManager.prototype.update = function() var len = this.interactiveItems.length; - for (var i=0; i < this.interactiveItems.length; i++) { + for (var i=0; i < len; i++) { this.interactiveItems[i].interactiveChildren = false; } @@ -2643,7 +2643,9 @@ PIXI.WebGLRenderer.prototype.render = function(stage) gl.clearColor(stage.backgroundColorSplit[0],stage.backgroundColorSplit[1],stage.backgroundColorSplit[2], !this.transparent); gl.clear(gl.COLOR_BUFFER_BIT); - + // HACK TO TEST + PIXI.projectionMatrix = this.projectionMatrix; + this.stageRenderGroup.backgroundColor = stage.backgroundColorSplit; this.stageRenderGroup.render(this.projectionMatrix); @@ -3422,7 +3424,6 @@ PIXI.WebGLRenderGroup.prototype.setRenderable = function(displayObject) PIXI.WebGLRenderGroup.prototype.render = function(projectionMatrix) { - PIXI.WebGLRenderer.updateTextures(); var gl = this.gl; @@ -3452,6 +3453,10 @@ PIXI.WebGLRenderGroup.prototype.render = function(projectionMatrix) { if(renderable.visible)this.renderStrip(renderable, projectionMatrix); } + else if(renderable instanceof PIXI.Graphics) + { + if(renderable.visible) renderable.renderWebGL(this, projectionMatrix); + } } } @@ -3652,8 +3657,9 @@ PIXI.WebGLRenderGroup.prototype.checkVisibility = function(displayObject, global child.textureChange = false; if(child.worldVisible) { - this.removeDisplayObject(child) - this.addDisplayObject(child) + this.removeDisplayObject(child); + this.addDisplayObject(child); + //this.updateTexture(child); } // update texture!! } @@ -3665,6 +3671,106 @@ PIXI.WebGLRenderGroup.prototype.checkVisibility = function(displayObject, global }; } +PIXI.WebGLRenderGroup.prototype.updateTexture = function(displayObject) +{ + // we know this exists.. + // is it in a batch.. + // check batch length + if(displayObject.batch.length == 1) + { + // just one! this guy! so simply swap the texture + displayObject.batch.texture = displayObject.texture.baseTexture; + return; + } + + // early out! + if(displayObject.batch.texture == displayObject.texture.baseTexture)return; + + + if(displayObject.batch.head == displayObject) + { + //console.log("HEAD") + var currentBatch = displayObject.batch; + + var index = this.batchs.indexOf( currentBatch ); + var previousBatch = this.batchs[index-1]; + currentBatch.remove(displayObject); + + if(previousBatch) + { + if(previousBatch.texture == displayObject.texture.baseTexture && previousBatch.blendMode == displayObject.blendMode) + { + previousBatch.insertAfter(displayObject, previousBatch.tail); + } + else + { + // add it before.. + var batch = PIXI.WebGLRenderer.getBatch(); + batch.init(displayObject); + this.batchs.splice(index-1, 0, batch); + } + + } + else + { + // we are 0! + var batch = PIXI.WebGLRenderer.getBatch(); + batch.init(displayObject); + this.batchs.splice(0, 0, batch); + } + + } + else if(displayObject.batch.tail == displayObject) + { + var currentBatch = displayObject.batch; + + var index = this.batchs.indexOf( currentBatch ); + var nextBatch = this.batchs[index+1]; + currentBatch.remove(displayObject); + + if(nextBatch) + { + if(nextBatch.texture == displayObject.texture.baseTexture && nextBatch.blendMode == displayObject.blendMode) + { + nextBatch.insertBefore(displayObject, nextBatch.head); + return; + } + else + { + // add it before.. + var batch = PIXI.WebGLRenderer.getBatch(); + batch.init(displayObject); + this.batchs.splice(index+1, 0, batch); + } + + } + else + { + // we are 0! + var batch = PIXI.WebGLRenderer.getBatch(); + batch.init(displayObject); + this.batchs.push(batch); + } + } + else + { + // console.log("MIDDLE") + var currentBatch = displayObject.batch; + + // split the batch into 2 + // AH! dont split on the current display object as the texture is wrong! + var splitBatch = currentBatch.split(displayObject); + + // now remove the display object + splitBatch.remove(displayObject); + + var batch = PIXI.WebGLRenderer.getBatch(); + var index = this.batchs.indexOf( currentBatch ); + batch.init(displayObject); + this.batchs.splice(index+1, 0, batch, splitBatch); + } +} + PIXI.WebGLRenderGroup.prototype.addDisplayObject = function(displayObject) { // add a child to the render group.. @@ -3683,19 +3789,16 @@ PIXI.WebGLRenderGroup.prototype.addDisplayObject = function(displayObject) var previousSprite = this.getPreviousRenderable(displayObject); var nextSprite = this.getNextRenderable(displayObject); - /* * so now we have the next renderable and the previous renderable * */ - if(displayObject instanceof PIXI.Sprite) { var previousBatch var nextBatch - //console.log( previousSprite) if(previousSprite instanceof PIXI.Sprite) { previousBatch = previousSprite.batch; @@ -3792,6 +3895,14 @@ PIXI.WebGLRenderGroup.prototype.addDisplayObject = function(displayObject) this.initStrip(displayObject); this.batchs.push(displayObject); } + else if(displayObject instanceof PIXI.Graphics) + { + //displayObject.initWebGL(this); + + // add to a batch!! + //this.initStrip(displayObject); + this.batchs.push(displayObject); + } // if its somthing else... then custom codes! this.batchUpdate = true; @@ -4383,6 +4494,10 @@ PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject) { displayObject.renderCanvas(this); } + else if(displayObject instanceof PIXI.Graphics) + { + displayObject.render(this); + } // render! for (var i=0; i < displayObject.children.length; i++) diff --git a/examples/example 10 - Text/pixi.js b/examples/example 10 - Text/pixi.js index 2028846..31f792b 100644 --- a/examples/example 10 - Text/pixi.js +++ b/examples/example 10 - Text/pixi.js @@ -4,7 +4,7 @@ * Copyright (c) 2012, Mat Groves * http://goodboydigital.com/ * - * Compiled: 2013-06-07 + * Compiled: 2013-06-14 * * Pixi.JS is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license.php @@ -1465,7 +1465,7 @@ PIXI.InteractionManager.prototype.update = function() var len = this.interactiveItems.length; - for (var i=0; i < this.interactiveItems.length; i++) { + for (var i=0; i < len; i++) { this.interactiveItems[i].interactiveChildren = false; } @@ -2643,7 +2643,9 @@ PIXI.WebGLRenderer.prototype.render = function(stage) gl.clearColor(stage.backgroundColorSplit[0],stage.backgroundColorSplit[1],stage.backgroundColorSplit[2], !this.transparent); gl.clear(gl.COLOR_BUFFER_BIT); - + // HACK TO TEST + PIXI.projectionMatrix = this.projectionMatrix; + this.stageRenderGroup.backgroundColor = stage.backgroundColorSplit; this.stageRenderGroup.render(this.projectionMatrix); @@ -3422,7 +3424,6 @@ PIXI.WebGLRenderGroup.prototype.setRenderable = function(displayObject) PIXI.WebGLRenderGroup.prototype.render = function(projectionMatrix) { - PIXI.WebGLRenderer.updateTextures(); var gl = this.gl; @@ -3452,6 +3453,10 @@ PIXI.WebGLRenderGroup.prototype.render = function(projectionMatrix) { if(renderable.visible)this.renderStrip(renderable, projectionMatrix); } + else if(renderable instanceof PIXI.Graphics) + { + if(renderable.visible) renderable.renderWebGL(this, projectionMatrix); + } } } @@ -3652,8 +3657,9 @@ PIXI.WebGLRenderGroup.prototype.checkVisibility = function(displayObject, global child.textureChange = false; if(child.worldVisible) { - this.removeDisplayObject(child) - this.addDisplayObject(child) + this.removeDisplayObject(child); + this.addDisplayObject(child); + //this.updateTexture(child); } // update texture!! } @@ -3665,6 +3671,106 @@ PIXI.WebGLRenderGroup.prototype.checkVisibility = function(displayObject, global }; } +PIXI.WebGLRenderGroup.prototype.updateTexture = function(displayObject) +{ + // we know this exists.. + // is it in a batch.. + // check batch length + if(displayObject.batch.length == 1) + { + // just one! this guy! so simply swap the texture + displayObject.batch.texture = displayObject.texture.baseTexture; + return; + } + + // early out! + if(displayObject.batch.texture == displayObject.texture.baseTexture)return; + + + if(displayObject.batch.head == displayObject) + { + //console.log("HEAD") + var currentBatch = displayObject.batch; + + var index = this.batchs.indexOf( currentBatch ); + var previousBatch = this.batchs[index-1]; + currentBatch.remove(displayObject); + + if(previousBatch) + { + if(previousBatch.texture == displayObject.texture.baseTexture && previousBatch.blendMode == displayObject.blendMode) + { + previousBatch.insertAfter(displayObject, previousBatch.tail); + } + else + { + // add it before.. + var batch = PIXI.WebGLRenderer.getBatch(); + batch.init(displayObject); + this.batchs.splice(index-1, 0, batch); + } + + } + else + { + // we are 0! + var batch = PIXI.WebGLRenderer.getBatch(); + batch.init(displayObject); + this.batchs.splice(0, 0, batch); + } + + } + else if(displayObject.batch.tail == displayObject) + { + var currentBatch = displayObject.batch; + + var index = this.batchs.indexOf( currentBatch ); + var nextBatch = this.batchs[index+1]; + currentBatch.remove(displayObject); + + if(nextBatch) + { + if(nextBatch.texture == displayObject.texture.baseTexture && nextBatch.blendMode == displayObject.blendMode) + { + nextBatch.insertBefore(displayObject, nextBatch.head); + return; + } + else + { + // add it before.. + var batch = PIXI.WebGLRenderer.getBatch(); + batch.init(displayObject); + this.batchs.splice(index+1, 0, batch); + } + + } + else + { + // we are 0! + var batch = PIXI.WebGLRenderer.getBatch(); + batch.init(displayObject); + this.batchs.push(batch); + } + } + else + { + // console.log("MIDDLE") + var currentBatch = displayObject.batch; + + // split the batch into 2 + // AH! dont split on the current display object as the texture is wrong! + var splitBatch = currentBatch.split(displayObject); + + // now remove the display object + splitBatch.remove(displayObject); + + var batch = PIXI.WebGLRenderer.getBatch(); + var index = this.batchs.indexOf( currentBatch ); + batch.init(displayObject); + this.batchs.splice(index+1, 0, batch, splitBatch); + } +} + PIXI.WebGLRenderGroup.prototype.addDisplayObject = function(displayObject) { // add a child to the render group.. @@ -3683,19 +3789,16 @@ PIXI.WebGLRenderGroup.prototype.addDisplayObject = function(displayObject) var previousSprite = this.getPreviousRenderable(displayObject); var nextSprite = this.getNextRenderable(displayObject); - /* * so now we have the next renderable and the previous renderable * */ - if(displayObject instanceof PIXI.Sprite) { var previousBatch var nextBatch - //console.log( previousSprite) if(previousSprite instanceof PIXI.Sprite) { previousBatch = previousSprite.batch; @@ -3792,6 +3895,14 @@ PIXI.WebGLRenderGroup.prototype.addDisplayObject = function(displayObject) this.initStrip(displayObject); this.batchs.push(displayObject); } + else if(displayObject instanceof PIXI.Graphics) + { + //displayObject.initWebGL(this); + + // add to a batch!! + //this.initStrip(displayObject); + this.batchs.push(displayObject); + } // if its somthing else... then custom codes! this.batchUpdate = true; @@ -4383,6 +4494,10 @@ PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject) { displayObject.renderCanvas(this); } + else if(displayObject instanceof PIXI.Graphics) + { + displayObject.render(this); + } // render! for (var i=0; i < displayObject.children.length; i++) diff --git a/examples/example 11 - RenderTexture/pixi.js b/examples/example 11 - RenderTexture/pixi.js index 2028846..31f792b 100644 --- a/examples/example 11 - RenderTexture/pixi.js +++ b/examples/example 11 - RenderTexture/pixi.js @@ -4,7 +4,7 @@ * Copyright (c) 2012, Mat Groves * http://goodboydigital.com/ * - * Compiled: 2013-06-07 + * Compiled: 2013-06-14 * * Pixi.JS is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license.php @@ -1465,7 +1465,7 @@ PIXI.InteractionManager.prototype.update = function() var len = this.interactiveItems.length; - for (var i=0; i < this.interactiveItems.length; i++) { + for (var i=0; i < len; i++) { this.interactiveItems[i].interactiveChildren = false; } @@ -2643,7 +2643,9 @@ PIXI.WebGLRenderer.prototype.render = function(stage) gl.clearColor(stage.backgroundColorSplit[0],stage.backgroundColorSplit[1],stage.backgroundColorSplit[2], !this.transparent); gl.clear(gl.COLOR_BUFFER_BIT); - + // HACK TO TEST + PIXI.projectionMatrix = this.projectionMatrix; + this.stageRenderGroup.backgroundColor = stage.backgroundColorSplit; this.stageRenderGroup.render(this.projectionMatrix); @@ -3422,7 +3424,6 @@ PIXI.WebGLRenderGroup.prototype.setRenderable = function(displayObject) PIXI.WebGLRenderGroup.prototype.render = function(projectionMatrix) { - PIXI.WebGLRenderer.updateTextures(); var gl = this.gl; @@ -3452,6 +3453,10 @@ PIXI.WebGLRenderGroup.prototype.render = function(projectionMatrix) { if(renderable.visible)this.renderStrip(renderable, projectionMatrix); } + else if(renderable instanceof PIXI.Graphics) + { + if(renderable.visible) renderable.renderWebGL(this, projectionMatrix); + } } } @@ -3652,8 +3657,9 @@ PIXI.WebGLRenderGroup.prototype.checkVisibility = function(displayObject, global child.textureChange = false; if(child.worldVisible) { - this.removeDisplayObject(child) - this.addDisplayObject(child) + this.removeDisplayObject(child); + this.addDisplayObject(child); + //this.updateTexture(child); } // update texture!! } @@ -3665,6 +3671,106 @@ PIXI.WebGLRenderGroup.prototype.checkVisibility = function(displayObject, global }; } +PIXI.WebGLRenderGroup.prototype.updateTexture = function(displayObject) +{ + // we know this exists.. + // is it in a batch.. + // check batch length + if(displayObject.batch.length == 1) + { + // just one! this guy! so simply swap the texture + displayObject.batch.texture = displayObject.texture.baseTexture; + return; + } + + // early out! + if(displayObject.batch.texture == displayObject.texture.baseTexture)return; + + + if(displayObject.batch.head == displayObject) + { + //console.log("HEAD") + var currentBatch = displayObject.batch; + + var index = this.batchs.indexOf( currentBatch ); + var previousBatch = this.batchs[index-1]; + currentBatch.remove(displayObject); + + if(previousBatch) + { + if(previousBatch.texture == displayObject.texture.baseTexture && previousBatch.blendMode == displayObject.blendMode) + { + previousBatch.insertAfter(displayObject, previousBatch.tail); + } + else + { + // add it before.. + var batch = PIXI.WebGLRenderer.getBatch(); + batch.init(displayObject); + this.batchs.splice(index-1, 0, batch); + } + + } + else + { + // we are 0! + var batch = PIXI.WebGLRenderer.getBatch(); + batch.init(displayObject); + this.batchs.splice(0, 0, batch); + } + + } + else if(displayObject.batch.tail == displayObject) + { + var currentBatch = displayObject.batch; + + var index = this.batchs.indexOf( currentBatch ); + var nextBatch = this.batchs[index+1]; + currentBatch.remove(displayObject); + + if(nextBatch) + { + if(nextBatch.texture == displayObject.texture.baseTexture && nextBatch.blendMode == displayObject.blendMode) + { + nextBatch.insertBefore(displayObject, nextBatch.head); + return; + } + else + { + // add it before.. + var batch = PIXI.WebGLRenderer.getBatch(); + batch.init(displayObject); + this.batchs.splice(index+1, 0, batch); + } + + } + else + { + // we are 0! + var batch = PIXI.WebGLRenderer.getBatch(); + batch.init(displayObject); + this.batchs.push(batch); + } + } + else + { + // console.log("MIDDLE") + var currentBatch = displayObject.batch; + + // split the batch into 2 + // AH! dont split on the current display object as the texture is wrong! + var splitBatch = currentBatch.split(displayObject); + + // now remove the display object + splitBatch.remove(displayObject); + + var batch = PIXI.WebGLRenderer.getBatch(); + var index = this.batchs.indexOf( currentBatch ); + batch.init(displayObject); + this.batchs.splice(index+1, 0, batch, splitBatch); + } +} + PIXI.WebGLRenderGroup.prototype.addDisplayObject = function(displayObject) { // add a child to the render group.. @@ -3683,19 +3789,16 @@ PIXI.WebGLRenderGroup.prototype.addDisplayObject = function(displayObject) var previousSprite = this.getPreviousRenderable(displayObject); var nextSprite = this.getNextRenderable(displayObject); - /* * so now we have the next renderable and the previous renderable * */ - if(displayObject instanceof PIXI.Sprite) { var previousBatch var nextBatch - //console.log( previousSprite) if(previousSprite instanceof PIXI.Sprite) { previousBatch = previousSprite.batch; @@ -3792,6 +3895,14 @@ PIXI.WebGLRenderGroup.prototype.addDisplayObject = function(displayObject) this.initStrip(displayObject); this.batchs.push(displayObject); } + else if(displayObject instanceof PIXI.Graphics) + { + //displayObject.initWebGL(this); + + // add to a batch!! + //this.initStrip(displayObject); + this.batchs.push(displayObject); + } // if its somthing else... then custom codes! this.batchUpdate = true; @@ -4383,6 +4494,10 @@ PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject) { displayObject.renderCanvas(this); } + else if(displayObject instanceof PIXI.Graphics) + { + displayObject.render(this); + } // render! for (var i=0; i < displayObject.children.length; i++) diff --git a/examples/example 13 - Graphics/index.html b/examples/example 13 - Graphics/index.html new file mode 100644 index 0000000..f3fe742 --- /dev/null +++ b/examples/example 13 - Graphics/index.html @@ -0,0 +1,86 @@ + + + + pixi.js example 13 - Graphics + + + + + + + + + + + + + + diff --git a/examples/example 13 - Graphics/pixi.js b/examples/example 13 - Graphics/pixi.js new file mode 100644 index 0000000..2028846 --- /dev/null +++ b/examples/example 13 - Graphics/pixi.js @@ -0,0 +1,5832 @@ +/** + * @license + * Pixi.JS - v1.0.0 + * Copyright (c) 2012, Mat Groves + * http://goodboydigital.com/ + * + * Compiled: 2013-06-07 + * + * Pixi.JS is licensed under the MIT License. + * http://www.opensource.org/licenses/mit-license.php + */ +/** + * @author Mat Groves http://matgroves.com/ @Doormat23 + */ + +(function(){ + + var root = this; + +/** + * @author Mat Groves http://matgroves.com/ @Doormat23 + */ + +/** +@module PIXI + */ +var PIXI = PIXI || {}; + +/** + * @author Mat Groves http://matgroves.com/ @Doormat23 + */ + +/** + * The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis. + * @class Point + * @constructor + * @param x {Number} position of the point + * @param y {Number} position of the point + */ +PIXI.Point = function(x, y) +{ + /** + * @property x + * @type Number + * @default 0 + */ + this.x = x || 0; + + /** + * @property y + * @type Number + * @default 0 + */ + this.y = y || 0; +} + +/** + * @method clone + * @return a copy of the point + */ +PIXI.Point.prototype.clone = function() +{ + return new PIXI.Point(this.x, this.y); +} + +// constructor +PIXI.Point.constructor = PIXI.Point; + + +/** + * @author Mat Groves http://matgroves.com/ + */ + +/** + * the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height. + * @class Rectangle + * @constructor + * @param x {Number} position of the rectangle + * @param y {Number} position of the rectangle + * @param width {Number} of the rectangle + * @param height {Number} of the rectangle + */ +PIXI.Rectangle = function(x, y, width, height) +{ + /** + * @property x + * @type Number + * @default 0 + */ + this.x = x || 0; + + /** + * @property y + * @type Number + * @default 0 + */ + this.y = y || 0; + + /** + * @property width + * @type Number + * @default 0 + */ + this.width = width || 0; + + /** + * @property height + * @type Number + * @default 0 + */ + this.height = height || 0; +} + +/** + * @method clone + * @return a copy of the rectangle + */ +PIXI.Rectangle.prototype.clone = function() +{ + return new PIXI.Rectangle(this.x, this.y, this.width, this.height); +} + +// constructor +PIXI.Rectangle.constructor = PIXI.Rectangle; + + +/** + * @author Mat Groves http://matgroves.com/ @Doormat23 + */ + +/** + * this is the base class for all objects that are rendered on the screen. + * @class DisplayObject + * @constructor + */ +PIXI.DisplayObject = function() +{ + /** + * The coordinate of the object relative to the local coordinates of the parent. + * @property position + * @type Point + */ + this.position = new PIXI.Point(); + + /** + * The scale factor of the object. + * @property scale + * @type Point + */ + this.scale = new PIXI.Point(1,1);//{x:1, y:1}; + + /** + * The pivot point of the displayObject that it rotates around + * @property pivot + * @type Point + */ + this.pivot = new PIXI.Point(0,0); + + /** + * The rotation of the object in radians. + * @property rotation + * @type Number + */ + this.rotation = 0; + + /** + * The opacity of the object. + * @property alpha + * @type Number + */ + this.alpha = 1; + + /** + * The visibility of the object. + * @property visible + * @type Boolean + */ + this.visible = true; + this.worldVisible = false; + + /** + * [read-only] The display object container that contains this display object. + * @property parent + * @type DisplayObjectContainer + */ + this.parent = null; + + /** + * [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage. + * @property stage + * @type Stage + */ + this.stage = null; + + /** + * This is the defined area that will pick up mouse / touch events. It is null by default. + * Setting it is a neat way of optimising the hitTest function that the interactionManager will use (as it will not need to hit test all the children) + * @property hitArea + * @type Rectangle + */ + this.hitArea = null; + + this.worldAlpha = 1; + this.color = []; + + this.worldTransform = PIXI.mat3.create()//mat3.identity(); + this.localTransform = PIXI.mat3.create()//mat3.identity(); + + this.dynamic = true; + // chach that puppy! + this._sr = 0; + this._cr = 1; + + this.childIndex = 0; + + this.renderable = false; + + // [readonly] best not to toggle directly! use setInteractive() + this.interactive = false; + + /** + * This is used to indicate if the displayObject should display a mouse hand cursor on rollover + * @property buttonMode + * @type Boolean + */ + this.buttonMode = false; + + /* + * MOUSE Callbacks + */ + + /** + * A callback that is used when the users clicks on the displayObject with their mouse + * @method click + * @param interactionData {InteractionData} + */ + + /** + * A callback that is used when the user clicks the mouse down over the sprite + * @method mousedown + * @param interactionData {InteractionData} + */ + + /** + * A callback that is used when the user releases the mouse that was over the displayObject + * for this callback to be fired the mouse must have been pressed down over the displayObject + * @method mouseup + * @param interactionData {InteractionData} + */ + + /** + * A callback that is used when the user releases the mouse that was over the displayObject but is no longer over the displayObject + * for this callback to be fired, The touch must have started over the displayObject + * @method mouseupoutside + * @param interactionData {InteractionData} + */ + + /** + * A callback that is used when the users mouse rolls over the displayObject + * @method mouseover + * @param interactionData {InteractionData} + */ + + /** + * A callback that is used when the users mouse leaves the displayObject + * @method mouseout + * @param interactionData {InteractionData} + */ + + + /* + * TOUCH Callbacks + */ + + /** + * A callback that is used when the users taps on the sprite with their finger + * basically a touch version of click + * @method tap + * @param interactionData {InteractionData} + */ + + /** + * A callback that is used when the user touch's over the displayObject + * @method touchstart + * @param interactionData {InteractionData} + */ + + /** + * A callback that is used when the user releases a touch over the displayObject + * @method touchend + * @param interactionData {InteractionData} + */ + + /** + * A callback that is used when the user releases the touch that was over the displayObject + * for this callback to be fired, The touch must have started over the sprite + * @method touchendoutside + * @param interactionData {InteractionData} + */ +} + +// constructor +PIXI.DisplayObject.constructor = PIXI.DisplayObject; + +//TODO make visible a getter setter +/* +Object.defineProperty(PIXI.DisplayObject.prototype, 'visible', { + get: function() { + return this._visible; + }, + set: function(value) { + this._visible = value; + } +});*/ + +/** + * Indicates if the sprite will have touch and mouse interactivity. It is false by default + * @method setInteractive + * @param interactive {Boolean} + */ +PIXI.DisplayObject.prototype.setInteractive = function(interactive) +{ + this.interactive = interactive; + // TODO more to be done here.. + // need to sort out a re-crawl! + if(this.stage)this.stage.dirty = true; +} + + +/** + * @private + */ +PIXI.DisplayObject.prototype.updateTransform = function() +{ + // TODO OPTIMIZE THIS!! with dirty + if(this.rotation != this.rotationCache) + { + this.rotationCache = this.rotation; + this._sr = Math.sin(this.rotation); + this._cr = Math.cos(this.rotation); + } + + var localTransform = this.localTransform; + var parentTransform = this.parent.worldTransform; + var worldTransform = this.worldTransform; + //console.log(localTransform) + localTransform[0] = this._cr * this.scale.x; + localTransform[1] = -this._sr * this.scale.y + localTransform[3] = this._sr * this.scale.x; + localTransform[4] = this._cr * this.scale.y; + + ///AAARR GETTER SETTTER! + //localTransform[2] = this.position.x; + //localTransform[5] = this.position.y; + + var px = this.pivot.x; + var py = this.pivot.y; + + ///AAARR GETTER SETTTER! + localTransform[2] = this.position.x - localTransform[0] * px - py * localTransform[1]; + localTransform[5] = this.position.y - localTransform[4] * py - px * localTransform[3]; + + // Cache the matrix values (makes for huge speed increases!) + var a00 = localTransform[0], a01 = localTransform[1], a02 = localTransform[2], + a10 = localTransform[3], a11 = localTransform[4], a12 = localTransform[5], + + b00 = parentTransform[0], b01 = parentTransform[1], b02 = parentTransform[2], + b10 = parentTransform[3], b11 = parentTransform[4], b12 = parentTransform[5]; + + worldTransform[0] = b00 * a00 + b01 * a10; + worldTransform[1] = b00 * a01 + b01 * a11; + worldTransform[2] = b00 * a02 + b01 * a12 + b02; + + worldTransform[3] = b10 * a00 + b11 * a10; + worldTransform[4] = b10 * a01 + b11 * a11; + worldTransform[5] = b10 * a02 + b11 * a12 + b12; + + // because we are using affine transformation, we can optimise the matrix concatenation process.. wooo! + // mat3.multiply(this.localTransform, this.parent.worldTransform, this.worldTransform); + this.worldAlpha = this.alpha * this.parent.worldAlpha; + + +} + +/** + * @author Mat Groves http://matgroves.com/ @Doormat23 + */ + + +/** + * A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects. + * @class DisplayObjectContainer + * @extends DisplayObject + * @constructor + */ +PIXI.DisplayObjectContainer = function() +{ + PIXI.DisplayObject.call( this ); + + /** + * [read-only] The of children of this container. + * @property children {Array} + */ + this.children = []; + //s + this.renderable = false; +} + +// constructor +PIXI.DisplayObjectContainer.constructor = PIXI.DisplayObjectContainer; +PIXI.DisplayObjectContainer.prototype = Object.create( PIXI.DisplayObject.prototype ); + +//TODO make visible a getter setter +/* +Object.defineProperty(PIXI.DisplayObjectContainer.prototype, 'visible', { + get: function() { + return this._visible; + }, + set: function(value) { + this._visible = value; + + } +});*/ + +/** + * Adds a child to the container. + * @method addChild + * @param DisplayObject {DisplayObject} + */ +PIXI.DisplayObjectContainer.prototype.addChild = function(child) +{ + if(child.parent != undefined) + { + child.parent.removeChild(child); + } + + child.parent = this; + child.childIndex = this.children.length; + + this.children.push(child); + + if(this.stage) + { + this.stage.__addChild(child); + } + + // need to remove any render groups.. + if(this.__renderGroup) + { + // being used by a renderTexture.. if it exists then it must be from a render texture; + if(child.__renderGroup)child.__renderGroup.removeDisplayObjectAndChildren(child); + // add them to the new render group.. + this.__renderGroup.addDisplayObjectAndChildren(child); + } +} + +/** + * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown + * @method addChildAt + * @param DisplayObject {DisplayObject} + * @param index {Number} + */ +PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index) +{ + if(index >= 0 && index <= this.children.length) + { + if(child.parent != undefined) + { + child.parent.removeChild(child); + } + + if (index == this.children.length) + { + this.children.push(child); + } + else + { + this.children.splice(index, 0, child); + } + + child.parent = this; + child.childIndex = index; + + var length = this.children.length; + for (var i=index; i < length; i++) + { + this.children[i].childIndex = i; + } + + if(this.stage) + { + this.stage.__addChild(child); + } + + // need to remove any render groups.. + if(this.__renderGroup) + { + // being used by a renderTexture.. if it exists then it must be from a render texture; + if(child.__renderGroup)child.__renderGroup.removeDisplayObjectAndChildren(child); + // add them to the new render group.. + this.__renderGroup.addDisplayObjectAndChildren(child); + } + } + else + { + // error! + + throw new Error(child + " The index "+ index +" supplied is out of bounds " + this.children.length); + } +} + +/** + * Swaps the depth of 2 displayObjects + * @method swapChildren + * @param DisplayObject {DisplayObject} + * @param DisplayObject2 {DisplayObject} + */ +PIXI.DisplayObjectContainer.prototype.swapChildren = function(child, child2) +{ + // TODO I already know this?? + var index = this.children.indexOf( child ); + var index2 = this.children.indexOf( child2 ); + + if ( index !== -1 && index2 !== -1 ) + { + // cool + if(this.stage) + { + // this is to satisfy the webGL batching.. + // TODO sure there is a nicer way to achieve this! + this.stage.__removeChild(child); + this.stage.__removeChild(child2); + + this.stage.__addChild(child); + this.stage.__addChild(child2); + } + + // swap the indexes.. + child.childIndex = index2; + child2.childIndex = index; + // swap the positions.. + this.children[index] = child2; + this.children[index2] = child; + + } + else + { + throw new Error(child + " Both the supplied DisplayObjects must be a child of the caller " + this); + } +} + +/** + * Returns the Child at the specified index + * @method getChildAt + * @param index {Number} + */ +PIXI.DisplayObjectContainer.prototype.getChildAt = function(index) +{ + if(index >= 0 && index < this.children.length) + { + return this.children[index]; + } + else + { + throw new Error(child + " Both the supplied DisplayObjects must be a child of the caller " + this); + + } +} + +/** + * Removes a child from the container. + * @method removeChild + * @param DisplayObject {DisplayObject} + */ +PIXI.DisplayObjectContainer.prototype.removeChild = function(child) +{ + var index = this.children.indexOf( child ); + + if ( index !== -1 ) + { + if(this.stage) + { + this.stage.__removeChild(child); + } + + // webGL trim + if(child.__renderGroup) + { + child.__renderGroup.removeDisplayObjectAndChildren(child); + } + + // console.log(">" + child.__renderGroup) + child.parent = undefined; + + this.children.splice( index, 1 ); + + // update in dexs! + for(var i=index,j=this.children.length; i= this.textures.length) + { + this.gotoAndStop(this.textures.length - 1); + if(this.onComplete) + { + this.onComplete(); + } + } +} +/** + * @author Mat Groves http://matgroves.com/ @Doormat23 + */ + +/** + * A Text Object will create a line(s) of text to split a line you can use "\n" + * @class Text + * @extends Sprite + * @constructor + * @param {String} text The copy that you would like the text to display + * @param {Object} [style] The style parameters + * @param {String} [style.font] default "bold 20pt Arial" The style and size of the font + * @param {Object} [style.fill="black"] A canvas fillstyle that will be used on the text eg "red", "#00FF00" + * @param {String} [style.align="left"] An alignment of the multiline text ("left", "center" or "right") + * @param {String} [style.stroke] A canvas fillstyle that will be used on the text stroke eg "blue", "#FCFF00" + * @param {Number} [style.strokeThickness=0] A number that represents the thickness of the stroke. Default is 0 (no stroke) + * @param {Boolean} [style.wordWrap=false] Indicates if word wrap should be used + * @param {Number} [style.wordWrapWidth=100] The width at which text will wrap + */ +PIXI.Text = function(text, style) +{ + this.canvas = document.createElement("canvas"); + this.context = this.canvas.getContext("2d"); + PIXI.Sprite.call(this, PIXI.Texture.fromCanvas(this.canvas)); + + this.setText(text); + this.setStyle(style); + + this.updateText(); + this.dirty = false; +}; + +// constructor +PIXI.Text.constructor = PIXI.Text; +PIXI.Text.prototype = Object.create(PIXI.Sprite.prototype); + +/** + * Set the style of the text + * @method setStyle + * @param {Object} [style] The style parameters + * @param {String} [style.font="bold 20pt Arial"] The style and size of the font + * @param {Object} [style.fill="black"] A canvas fillstyle that will be used on the text eg "red", "#00FF00" + * @param {String} [style.align="left"] An alignment of the multiline text ("left", "center" or "right") + * @param {String} [style.stroke] A canvas fillstyle that will be used on the text stroke eg "blue", "#FCFF00" + * @param {Number} [style.strokeThickness=0] A number that represents the thickness of the stroke. Default is 0 (no stroke) + * @param {Boolean} [style.wordWrap=false] Indicates if word wrap should be used + * @param {Number} [style.wordWrapWidth=100] The width at which text will wrap + */ +PIXI.Text.prototype.setStyle = function(style) +{ + style = style || {}; + style.font = style.font || "bold 20pt Arial"; + style.fill = style.fill || "black"; + style.align = style.align || "left"; + style.strokeThickness = style.strokeThickness || 0; + style.wordWrap = style.wordWrap || false; + style.wordWrapWidth = style.wordWrapWidth || 100; + this.style = style; + this.dirty = true; +}; + +/** + * Set the copy for the text object. To split a line you can use "\n" + * @methos setText + * @param {String} text The copy that you would like the text to display + */ +PIXI.Sprite.prototype.setText = function(text) +{ + this.text = text.toString() || " "; + this.dirty = true; +}; + +/** + * Renders text + * @private + */ +PIXI.Text.prototype.updateText = function() +{ + this.context.font = this.style.font; + + var outputText = this.text; + + // word wrap + // preserve original text + if(this.style.wordWrap)outputText = this.wordWrap(this.text); + + //split text into lines + var lines = outputText.split(/(?:\r\n|\r|\n)/); + + //calculate text width + var lineWidths = []; + var maxLineWidth = 0; + for (var i = 0; i < lines.length; i++) + { + var lineWidth = this.context.measureText(lines[i]).width; + lineWidths[i] = lineWidth; + maxLineWidth = Math.max(maxLineWidth, lineWidth); + } + this.canvas.width = maxLineWidth + this.style.strokeThickness; + + //calculate text height + var lineHeight = this.determineFontHeight("font: " + this.style.font + ";") + this.style.strokeThickness; + this.canvas.height = lineHeight * lines.length; + + //set canvas text styles + this.context.fillStyle = this.style.fill; + this.context.font = this.style.font; + + this.context.strokeStyle = this.style.stroke; + this.context.lineWidth = this.style.strokeThickness; + + this.context.textBaseline = "top"; + + //draw lines line by line + for (i = 0; i < lines.length; i++) + { + var linePosition = new PIXI.Point(this.style.strokeThickness / 2, this.style.strokeThickness / 2 + i * lineHeight); + + if(this.style.align == "right") + { + linePosition.x += maxLineWidth - lineWidths[i]; + } + else if(this.style.align == "center") + { + linePosition.x += (maxLineWidth - lineWidths[i]) / 2; + } + + if(this.style.stroke && this.style.strokeThickness) + { + this.context.strokeText(lines[i], linePosition.x, linePosition.y); + } + + if(this.style.fill) + { + this.context.fillText(lines[i], linePosition.x, linePosition.y); + } + } + + this.updateTexture(); +}; + +/** + * Updates texture size based on canvas size + * @private + */ +PIXI.Text.prototype.updateTexture = function() +{ + + this.texture.baseTexture.width = this.canvas.width; + this.texture.baseTexture.height = this.canvas.height; + this.texture.frame.width = this.canvas.width; + this.texture.frame.height = this.canvas.height; + + this._width = this.canvas.width; + this._height = this.canvas.height; + + PIXI.texturesToUpdate.push(this.texture.baseTexture); +}; + +/** + * @private + */ +PIXI.Text.prototype.updateTransform = function() +{ + if(this.dirty) + { + this.updateText(); + this.dirty = false; + } + + PIXI.Sprite.prototype.updateTransform.call(this); +}; + +/* + * http://stackoverflow.com/users/34441/ellisbben + * great solution to the problem! + */ +PIXI.Text.prototype.determineFontHeight = function(fontStyle) +{ + // build a little reference dictionary so if the font style has been used return a + // cached version... + var result = PIXI.Text.heightCache[fontStyle]; + + if(!result) + { + var body = document.getElementsByTagName("body")[0]; + var dummy = document.createElement("div"); + var dummyText = document.createTextNode("M"); + dummy.appendChild(dummyText); + dummy.setAttribute("style", fontStyle); + body.appendChild(dummy); + + result = dummy.offsetHeight; + PIXI.Text.heightCache[fontStyle] = result; + + body.removeChild(dummy); + } + + return result; +}; + +/** + * A Text Object will apply wordwrap + * @private + */ +PIXI.Text.prototype.wordWrap = function(text) +{ + // search good wrap position + var searchWrapPos = function(ctx, text, start, end, wrapWidth) + { + var p = Math.floor((end-start) / 2) + start; + if(p == start) { + return 1; + } + + if(ctx.measureText(text.substring(0,p)).width <= wrapWidth) + { + if(ctx.measureText(text.substring(0,p+1)).width > wrapWidth) + { + return p; + } + else + { + return arguments.callee(ctx, text, p, end, wrapWidth); + } + } + else + { + return arguments.callee(ctx, text, start, p, wrapWidth); + } + }; + + var lineWrap = function(ctx, text, wrapWidth) + { + if(ctx.measureText(text).width <= wrapWidth || text.length < 1) + { + return text; + } + var pos = searchWrapPos(ctx, text, 0, text.length, wrapWidth); + return text.substring(0, pos) + "\n" + arguments.callee(ctx, text.substring(pos), wrapWidth); + }; + + var result = ""; + var lines = text.split("\n"); + for (var i = 0; i < lines.length; i++) + { + result += lineWrap(this.context, lines[i], this.style.wordWrapWidth) + "\n"; + } + + return result; +}; + +PIXI.Text.prototype.destroy = function(destroyTexture) +{ + if(destroyTexture) + { + this.texture.destroy(); + } + +}; + +PIXI.Text.heightCache = {}; + +/** + * @author Mat Groves http://matgroves.com/ @Doormat23 + */ + +/** + * A Text Object will create a line(s) of text using bitmap font. To split a line you can use "\n", "\r" or "\r\n" + * You can generate the fnt files using + * http://www.angelcode.com/products/bmfont/ for windows or + * http://www.bmglyph.com/ for mac. + * @class BitmapText + * @extends DisplayObjectContainer + * @constructor + * @param {String} text The copy that you would like the text to display + * @param {Object} style The style parameters + * @param {String} style.font The size (optional) and bitmap font id (required) eq "Arial" or "20px Arial" (must have loaded previously) + * @param {String} [style.align="left"] An alignment of the multiline text ("left", "center" or "right") + */ +PIXI.BitmapText = function(text, style) +{ + PIXI.DisplayObjectContainer.call(this); + + this.setText(text); + this.setStyle(style); + this.updateText(); + this.dirty = false + +}; + +// constructor +PIXI.BitmapText.constructor = PIXI.BitmapText; +PIXI.BitmapText.prototype = Object.create(PIXI.DisplayObjectContainer.prototype); + +/** + * Set the copy for the text object + * @method setText + * @param {String} text The copy that you would like the text to display + */ +PIXI.BitmapText.prototype.setText = function(text) +{ + this.text = text || " "; + this.dirty = true; +}; + +/** + * Set the style of the text + * @method setStyle + * @param {Object} style The style parameters + * @param {String} style.font The size (optional) and bitmap font id (required) eq "Arial" or "20px Arial" (must have loaded previously) + * @param {String} [style.align="left"] An alignment of the multiline text ("left", "center" or "right") + */ +PIXI.BitmapText.prototype.setStyle = function(style) +{ + style = style || {}; + style.align = style.align || "left"; + this.style = style; + + var font = style.font.split(" "); + this.fontName = font[font.length - 1]; + this.fontSize = font.length >= 2 ? parseInt(font[font.length - 2], 10) : PIXI.BitmapText.fonts[this.fontName].size; + + this.dirty = true; +}; + +/** + * Renders text + * @private + */ +PIXI.BitmapText.prototype.updateText = function() +{ + var data = PIXI.BitmapText.fonts[this.fontName]; + var pos = new PIXI.Point(); + var prevCharCode = null; + var chars = []; + var maxLineWidth = 0; + var lineWidths = []; + var line = 0; + var scale = this.fontSize / data.size; + for(var i = 0; i < this.text.length; i++) + { + var charCode = this.text.charCodeAt(i); + if(/(?:\r\n|\r|\n)/.test(this.text.charAt(i))) + { + lineWidths.push(pos.x); + maxLineWidth = Math.max(maxLineWidth, pos.x); + line++; + + pos.x = 0; + pos.y += data.lineHeight; + prevCharCode = null; + continue; + } + + var charData = data.chars[charCode]; + if(!charData) continue; + + if(prevCharCode && charData[prevCharCode]) + { + pos.x += charData.kerning[prevCharCode]; + } + chars.push({texture:charData.texture, line: line, charCode: charCode, position: new PIXI.Point(pos.x + charData.xOffset, pos.y + charData.yOffset)}); + pos.x += charData.xAdvance; + + prevCharCode = charCode; + } + + lineWidths.push(pos.x); + maxLineWidth = Math.max(maxLineWidth, pos.x); + + var lineAlignOffsets = []; + for(i = 0; i <= line; i++) + { + var alignOffset = 0; + if(this.style.align == "right") + { + alignOffset = maxLineWidth - lineWidths[i]; + } + else if(this.style.align == "center") + { + alignOffset = (maxLineWidth - lineWidths[i]) / 2; + } + lineAlignOffsets.push(alignOffset); + } + + for(i = 0; i < chars.length; i++) + { + var char = new PIXI.Sprite(chars[i].texture)//PIXI.Sprite.fromFrame(chars[i].charCode); + char.position.x = (chars[i].position.x + lineAlignOffsets[chars[i].line]) * scale; + char.position.y = chars[i].position.y * scale; + char.scale.x = char.scale.y = scale; + this.addChild(char); + } + + this.width = pos.x * scale; + this.height = (pos.y + data.lineHeight) * scale; +}; + +/** + * @private + */ +PIXI.BitmapText.prototype.updateTransform = function() +{ + if(this.dirty) + { + while(this.children.length > 0) + { + this.removeChild(this.getChildAt(0)); + } + this.updateText(); + + this.dirty = false; + } + + PIXI.DisplayObjectContainer.prototype.updateTransform.call(this); +}; + +PIXI.BitmapText.fonts = {}; +/** + * @author Mat Groves http://matgroves.com/ @Doormat23 + */ + + + +/** +The interaction manager deals with mouse and touch events. Any DisplayObject can be interactive +This manager also supports multitouch. +@class InteractionManager +@constructor +@param stage {Stage} +@type Stage +*/ +PIXI.InteractionManager = function(stage) +{ + /** + * a refference to the stage + * @property stage + * @type Stage + */ + this.stage = stage; + + // helpers + this.tempPoint = new PIXI.Point(); + //this.tempMatrix = mat3.create(); + + this.mouseoverEnabled = true; + + /** + * the mouse data + * @property mouse + * @type InteractionData + */ + this.mouse = new PIXI.InteractionData(); + + /** + * an object that stores current touches (InteractionData) by id reference + * @property touchs + * @type Object + */ + this.touchs = {}; + + //tiny little interactiveData pool! + this.pool = []; + + this.interactiveItems = []; + + this.last = 0; +} + +// constructor +PIXI.InteractionManager.constructor = PIXI.InteractionManager; + +PIXI.InteractionManager.prototype.collectInteractiveSprite = function(displayObject, iParent) +{ + var children = displayObject.children; + var length = children.length; + + //this.interactiveItems = []; + /// make an interaction tree... {item.__interactiveParent} + for (var i = length-1; i >= 0; i--) + { + var child = children[i]; + + // push all interactive bits + if(child.interactive) + { + iParent.interactiveChildren = true; + //child.__iParent = iParent; + this.interactiveItems.push(child); + + if(child.children.length > 0) + { + this.collectInteractiveSprite(child, child); + } + } + else + { + child.__iParent = null; + + if(child.children.length > 0) + { + this.collectInteractiveSprite(child, iParent); + } + } + } +} + +PIXI.InteractionManager.prototype.setTarget = function(target) +{ + if (window.navigator.msPointerEnabled) + { + // time to remove some of that zoom in ja.. + target.view.style["-ms-content-zooming"] = "none"; + target.view.style["-ms-touch-action"] = "none" + + // DO some window specific touch! + } + + this.target = target; + target.view.addEventListener('mousemove', this.onMouseMove.bind(this), true); + target.view.addEventListener('mousedown', this.onMouseDown.bind(this), true); + document.body.addEventListener('mouseup', this.onMouseUp.bind(this), true); + target.view.addEventListener('mouseout', this.onMouseUp.bind(this), true); + + // aint no multi touch just yet! + target.view.addEventListener("touchstart", this.onTouchStart.bind(this), true); + target.view.addEventListener("touchend", this.onTouchEnd.bind(this), true); + target.view.addEventListener("touchmove", this.onTouchMove.bind(this), true); +} + +PIXI.InteractionManager.prototype.update = function() +{ + if(!this.target)return; + + // frequency of 30fps?? + var now = Date.now(); + var diff = now - this.last; + diff = (diff * 30) / 1000; + if(diff < 1)return; + this.last = now; + // + + // ok.. so mouse events?? + // yes for now :) + // OPTIMSE - how often to check?? + if(this.dirty) + { + this.dirty = false; + + var len = this.interactiveItems.length; + + for (var i=0; i < this.interactiveItems.length; i++) { + this.interactiveItems[i].interactiveChildren = false; + } + + this.interactiveItems = []; + + if(this.stage.interactive)this.interactiveItems.push(this.stage); + // go through and collect all the objects that are interactive.. + this.collectInteractiveSprite(this.stage, this.stage); + } + + // loop through interactive objects! + var length = this.interactiveItems.length; + + this.target.view.style.cursor = "default"; + + for (var i = 0; i < length; i++) + { + var item = this.interactiveItems[i]; + if(!item.visible)continue; + + // OPTIMISATION - only calculate every time if the mousemove function exists.. + // OK so.. does the object have any other interactive functions? + // hit-test the clip! + + + if(item.mouseover || item.mouseout || item.buttonMode) + { + // ok so there are some functions so lets hit test it.. + item.__hit = this.hitTest(item, this.mouse); + // ok so deal with interactions.. + // loks like there was a hit! + if(item.__hit) + { + if(item.buttonMode)this.target.view.style.cursor = "pointer"; + + if(!item.__isOver) + { + + if(item.mouseover)item.mouseover(this.mouse); + item.__isOver = true; + } + } + else + { + if(item.__isOver) + { + // roll out! + if(item.mouseout)item.mouseout(this.mouse); + item.__isOver = false; + } + } + } + + // ---> + } +} + +PIXI.InteractionManager.prototype.onMouseMove = function(event) +{ + event.preventDefault(); + + // TODO optimize by not check EVERY TIME! maybe half as often? // + var rect = this.target.view.getBoundingClientRect(); + + this.mouse.global.x = (event.clientX - rect.left) * (this.target.width / rect.width); + this.mouse.global.y = (event.clientY - rect.top) * ( this.target.height / rect.height); + + var length = this.interactiveItems.length; + var global = this.mouse.global; + + + for (var i = 0; i < length; i++) + { + var item = this.interactiveItems[i]; + + if(item.mousemove) + { + //call the function! + item.mousemove(this.mouse); + } + } +} + +PIXI.InteractionManager.prototype.onMouseDown = function(event) +{ + event.preventDefault(); + + // loop through inteaction tree... + // hit test each item! -> + // get interactive items under point?? + //stage.__i + var length = this.interactiveItems.length; + var global = this.mouse.global; + + var index = 0; + var parent = this.stage; + + // while + // hit test + for (var i = 0; i < length; i++) + { + var item = this.interactiveItems[i]; + + if(item.mousedown || item.click) + { + item.__mouseIsDown = true; + item.__hit = this.hitTest(item, this.mouse); + + if(item.__hit) + { + //call the function! + if(item.mousedown)item.mousedown(this.mouse); + item.__isDown = true; + + // just the one! + if(!item.interactiveChildren)break; + } + } + } +} + +PIXI.InteractionManager.prototype.onMouseUp = function(event) +{ + event.preventDefault(); + var global = this.mouse.global; + + + var length = this.interactiveItems.length; + var up = false; + + for (var i = 0; i < length; i++) + { + var item = this.interactiveItems[i]; + + if(item.mouseup || item.mouseupoutside || item.click) + { + item.__hit = this.hitTest(item, this.mouse); + + if(item.__hit && !up) + { + //call the function! + if(item.mouseup) + { + item.mouseup(this.mouse); + } + if(item.__isDown) + { + if(item.click)item.click(this.mouse); + } + + if(!item.interactiveChildren)up = true; + } + else + { + if(item.__isDown) + { + if(item.mouseupoutside)item.mouseupoutside(this.mouse); + } + } + + item.__isDown = false; + } + } +} + +PIXI.InteractionManager.prototype.hitTest = function(item, interactionData) +{ + var global = interactionData.global; + + if(!item.visible)return false; + + if(item instanceof PIXI.Sprite) + { + var worldTransform = item.worldTransform; + + var a00 = worldTransform[0], a01 = worldTransform[1], a02 = worldTransform[2], + a10 = worldTransform[3], a11 = worldTransform[4], a12 = worldTransform[5], + id = 1 / (a00 * a11 + a01 * -a10); + + var x = a11 * id * global.x + -a01 * id * global.y + (a12 * a01 - a02 * a11) * id; + var y = a00 * id * global.y + -a10 * id * global.x + (-a12 * a00 + a02 * a10) * id; + + var width = item.texture.frame.width; + var height = item.texture.frame.height; + + var x1 = -width * item.anchor.x; + + if(x > x1 && x < x1 + width) + { + var y1 = -height * item.anchor.y; + + if(y > y1 && y < y1 + height) + { + // set the target property if a hit is true! + interactionData.target = item + return true; + } + } + } + else if(item.hitArea) + { + var worldTransform = item.worldTransform; + var hitArea = item.hitArea; + + var a00 = worldTransform[0], a01 = worldTransform[1], a02 = worldTransform[2], + a10 = worldTransform[3], a11 = worldTransform[4], a12 = worldTransform[5], + id = 1 / (a00 * a11 + a01 * -a10); + + var x = a11 * id * global.x + -a01 * id * global.y + (a12 * a01 - a02 * a11) * id; + var y = a00 * id * global.y + -a10 * id * global.x + (-a12 * a00 + a02 * a10) * id; + + var x1 = hitArea.x; + if(x > x1 && x < x1 + hitArea.width) + { + var y1 = hitArea.y; + + if(y > y1 && y < y1 + hitArea.height) + { + return true; + } + } + } + + var length = item.children.length; + + for (var i = 0; i < length; i++) + { + var tempItem = item.children[i]; + var hit = this.hitTest(tempItem, interactionData); + if(hit)return true; + } + + return false; +} + + + +PIXI.InteractionManager.prototype.onTouchMove = function(event) +{ + event.preventDefault(); + + var rect = this.target.view.getBoundingClientRect(); + var changedTouches = event.changedTouches; + + for (var i=0; i < changedTouches.length; i++) + { + var touchEvent = changedTouches[i]; + var touchData = this.touchs[touchEvent.identifier]; + + // update the touch position + touchData.global.x = (touchEvent.clientX - rect.left) * (this.target.width / rect.width); + touchData.global.y = (touchEvent.clientY - rect.top) * (this.target.height / rect.height); + } + + var length = this.interactiveItems.length; + for (var i = 0; i < length; i++) + { + var item = this.interactiveItems[i]; + if(item.touchmove)item.touchmove(touchData); + } +} + +PIXI.InteractionManager.prototype.onTouchStart = function(event) +{ + event.preventDefault(); + var rect = this.target.view.getBoundingClientRect(); + + var changedTouches = event.changedTouches; + for (var i=0; i < changedTouches.length; i++) + { + var touchEvent = changedTouches[i]; + + var touchData = this.pool.pop(); + if(!touchData)touchData = new PIXI.InteractionData(); + + this.touchs[touchEvent.identifier] = touchData; + touchData.global.x = (touchEvent.clientX - rect.left) * (this.target.width / rect.width); + touchData.global.y = (touchEvent.clientY - rect.top) * (this.target.height / rect.height); + + var length = this.interactiveItems.length; + + for (var j = 0; j < length; j++) + { + var item = this.interactiveItems[j]; + + if(item.touchstart || item.tap) + { + item.__hit = this.hitTest(item, touchData); + + if(item.__hit) + { + //call the function! + if(item.touchstart)item.touchstart(touchData); + item.__isDown = true; + item.__touchData = touchData; + + if(!item.interactiveChildren)break; + } + } + } + } + +} + +PIXI.InteractionManager.prototype.onTouchEnd = function(event) +{ + event.preventDefault(); + + + var rect = this.target.view.getBoundingClientRect(); + var changedTouches = event.changedTouches; + + for (var i=0; i < changedTouches.length; i++) + { + + var touchEvent = changedTouches[i]; + var touchData = this.touchs[touchEvent.identifier]; + var up = false; + touchData.global.x = (touchEvent.clientX - rect.left) * (this.target.width / rect.width); + touchData.global.y = (touchEvent.clientY - rect.top) * (this.target.height / rect.height); + + var length = this.interactiveItems.length; + for (var j = 0; j < length; j++) + { + var item = this.interactiveItems[j]; + var itemTouchData = item.__touchData; // <-- Here! + item.__hit = this.hitTest(item, touchData); + + if(itemTouchData == touchData) + { + // so this one WAS down... + + // hitTest?? + + if(item.touchend || item.tap) + { + if(item.__hit && !up) + { + if(item.touchend)item.touchend(touchData); + if(item.__isDown) + { + if(item.tap)item.tap(touchData); + } + + if(!item.interactiveChildren)up = true; + } + else + { + if(item.__isDown) + { + if(item.touchendoutside)item.touchendoutside(touchData); + } + } + + item.__isDown = false; + } + + item.__touchData = null; + + } + else + { + + } + } + // remove the touch.. + this.pool.push(touchData); + this.touchs[touchEvent.identifier] = null; + } +} + +/** +@class InteractionData +@constructor +*/ +PIXI.InteractionData = function() +{ + /** + * This point stores the global coords of where the touch/mouse event happened + * @property global + * @type Point + */ + this.global = new PIXI.Point(); + + // this is here for legacy... but will remove + this.local = new PIXI.Point(); + + /** + * The target Sprite that was interacted with + * @property target + * @type Sprite + */ + this.target; +} + +/** + * This will return the local coords of the specified displayObject for this InteractionData + * @method getLocalPosition + * @param displayObject {DisplayObject} The DisplayObject that you would like the local coords off + * @return {Point} A point containing the coords of the InteractionData position relative to the DisplayObject + */ +PIXI.InteractionData.prototype.getLocalPosition = function(displayObject) +{ + var worldTransform = displayObject.worldTransform; + var global = this.global; + + // do a cheeky transform to get the mouse coords; + var a00 = worldTransform[0], a01 = worldTransform[1], a02 = worldTransform[2], + a10 = worldTransform[3], a11 = worldTransform[4], a12 = worldTransform[5], + id = 1 / (a00 * a11 + a01 * -a10); + // set the mouse coords... + return new PIXI.Point(a11 * id * global.x + -a01 * id * global.y + (a12 * a01 - a02 * a11) * id, + a00 * id * global.y + -a10 * id * global.x + (-a12 * a00 + a02 * a10) * id) +} + +// constructor +PIXI.InteractionData.constructor = PIXI.InteractionData; + + + +/** + * @author Mat Groves http://matgroves.com/ @Doormat23 + */ + +/** +A Stage represents the root of the display tree. Everything connected to the stage is rendered +@class Stage +@extends DisplayObjectContainer +@constructor +@param backgroundColor {Number} the background color of the stage +@param interactive {Boolean} enable / disable interaction (default is false) +*/ +PIXI.Stage = function(backgroundColor, interactive) +{ + + PIXI.DisplayObjectContainer.call( this ); + this.worldTransform = PIXI.mat3.create() + this.__childrenAdded = []; + this.__childrenRemoved = []; + this.childIndex = 0; + this.stage= this; + + this.stage.hitArea = new PIXI.Rectangle(0,0,100000, 100000); + + // interaction! + this.interactive = !!interactive; + this.interactionManager = new PIXI.InteractionManager(this); + + this.setBackgroundColor(backgroundColor); + this.worldVisible = true; +} + +// constructor +PIXI.Stage.constructor = PIXI.Stage; + +PIXI.Stage.prototype = Object.create( PIXI.DisplayObjectContainer.prototype ); + +/** +@method updateTransform +@internal +*/ +PIXI.Stage.prototype.updateTransform = function() +{ + this.worldAlpha = 1; + + for(var i=0,j=this.children.length; i> 16 & 0xFF) / 255, ( hex >> 8 & 0xFF) / 255, (hex & 0xFF)/ 255]; +} + +/** + * Provides bind in a cross browser way. + */ +if (typeof Function.prototype.bind != 'function') { + Function.prototype.bind = (function () { + var slice = Array.prototype.slice; + return function (thisArg) { + var target = this, boundArgs = slice.call(arguments, 1); + + if (typeof target != 'function') throw new TypeError(); + + function bound() { + var args = boundArgs.concat(slice.call(arguments)); + target.apply(this instanceof bound ? this : thisArg, args); + } + + bound.prototype = (function F(proto) { + proto && (F.prototype = proto); + if (!(this instanceof F)) return new F; + })(target.prototype); + + return bound; + }; + })(); +} + +var AjaxRequest = function() +{ + var activexmodes = ["Msxml2.XMLHTTP", "Microsoft.XMLHTTP"] //activeX versions to check for in IE + + if (window.ActiveXObject) + { //Test for support for ActiveXObject in IE first (as XMLHttpRequest in IE7 is broken) + for (var i=0; i 0) + { + for (var i=0; i < PIXI.Texture.frameUpdates.length; i++) + { + PIXI.Texture.frameUpdates[i].updateFrame = false; + }; + + PIXI.Texture.frameUpdates = []; + } +} + +/** + * @private + */ + +PIXI.WebGLRenderer.updateTextures = function() +{ + for (var i=0; i < PIXI.texturesToUpdate.length; i++) this.updateTexture(PIXI.texturesToUpdate[i]); + for (var i=0; i < PIXI.texturesToDestroy.length; i++) this.destroyTexture(PIXI.texturesToDestroy[i]); + PIXI.texturesToUpdate = []; + PIXI.texturesToDestroy = []; +} + +PIXI.WebGLRenderer.updateTexture = function(texture) +{ + var gl = PIXI.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.source); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR); + + // reguler... + + if(!texture._powerOf2) + { + 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); + } + else + { + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.REPEAT); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.REPEAT); + } + + gl.bindTexture(gl.TEXTURE_2D, null); + } + +} + +PIXI.WebGLRenderer.prototype.destroyTexture = function(texture) +{ + var gl = this.gl; + + if(texture._glTexture) + { + texture._glTexture = gl.createTexture(); + gl.deleteTexture(gl.TEXTURE_2D, texture._glTexture); + } +} + +/** + * resizes the webGL view to the specified width and height + * @method resize + * @param width {Number} the new width of the webGL view + * @param height {Number} the new height of the webGL view + */ +PIXI.WebGLRenderer.prototype.resize = function(width, height) +{ + this.width = width; + this.height = height; + + this.view.width = width; + this.view.height = height; + + this.gl.viewport(0, 0, this.width, this.height); + + var projectionMatrix = this.projectionMatrix; + + projectionMatrix[0] = 2/this.width; + projectionMatrix[5] = -2/this.height; + projectionMatrix[12] = -1; + projectionMatrix[13] = 1; +} + +/** + * @private + */ +PIXI.WebGLRenderer.prototype.handleContextLost = function(event) +{ + event.preventDefault(); + this.contextLost = true; +} + +/** + * @private + */ +PIXI.WebGLRenderer.prototype.handleContextRestored = function(event) +{ + this.gl = this.view.getContext("experimental-webgl", { + alpha: true + }); + + this.initShaders(); + + for (var i=0; i < PIXI.TextureCache.length; i++) + { + this.updateTexture(PIXI.TextureCache[i]); + }; + + for (var i=0; i < this.batchs.length; i++) + { + this.batchs[i].restoreLostContext(this.gl)// + this.batchs[i].dirty = true; + }; + + PIXI._restoreBatchs(this.gl); + + this.contextLost = false; +} + + +/** + * @author Mat Groves http://matgroves.com/ @Doormat23 + */ + +PIXI._batchs = []; + +/** + * @private + */ +PIXI._getBatch = function(gl) +{ + if(PIXI._batchs.length == 0) + { + return new PIXI.WebGLBatch(gl); + } + else + { + return PIXI._batchs.pop(); + } +} + +/** + * @private + */ +PIXI._returnBatch = function(batch) +{ + batch.clean(); + PIXI._batchs.push(batch); +} + +/** + * @private + */ +PIXI._restoreBatchs = function(gl) +{ + for (var i=0; i < PIXI._batchs.length; i++) + { + PIXI._batchs[i].restoreLostContext(gl); + }; +} + +/** + * A WebGLBatch Enables a group of sprites to be drawn using the same settings. + * if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run. + * @class WebGLBatch + * @param an instance of the webGL context + * @return {PIXI.renderers.WebGLBatch} WebGLBatch {@link PIXI.renderers.WebGLBatch} + */ +PIXI.WebGLBatch = function(gl) +{ + this.gl = gl; + + this.size = 0; + + this.vertexBuffer = gl.createBuffer(); + this.indexBuffer = gl.createBuffer(); + this.uvBuffer = gl.createBuffer(); + this.colorBuffer = gl.createBuffer(); + this.blendMode = PIXI.blendModes.NORMAL; + this.dynamicSize = 1; +} + + +// constructor +PIXI.WebGLBatch.constructor = PIXI.WebGLBatch; + +/** + * Cleans the batch so that is can be returned to an object pool and reused + */ +PIXI.WebGLBatch.prototype.clean = function() +{ + this.verticies = []; + this.uvs = []; + this.indices = []; + this.colors = []; + //this.sprites = []; + this.dynamicSize = 1; + this.texture = null; + this.last = null; + this.size = 0; + + this.head; + this.tail; +} + +/* + * recreates the buffers in the event of a context loss + */ +PIXI.WebGLBatch.prototype.restoreLostContext = function(gl) +{ + this.gl = gl; + this.vertexBuffer = gl.createBuffer(); + this.indexBuffer = gl.createBuffer(); + this.uvBuffer = gl.createBuffer(); + this.colorBuffer = gl.createBuffer(); +} + +/** + * inits the batch's texture and blend mode based if the supplied sprite + * @method init + * @param sprite {Sprite} the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch + */ +PIXI.WebGLBatch.prototype.init = function(sprite) +{ + sprite.batch = this; + this.dirty = true; + this.blendMode = sprite.blendMode; + this.texture = sprite.texture.baseTexture; +// this.sprites.push(sprite); + this.head = sprite; + this.tail = sprite; + this.size = 1; + + this.growBatch(); +} + +/** + * inserts a sprite before the specified sprite + * @method insertBefore + * @param sprite {Sprite} the sprite to be added + * @param nextSprite {nextSprite} the first sprite will be inserted before this sprite + */ +PIXI.WebGLBatch.prototype.insertBefore = function(sprite, nextSprite) +{ + this.size++; + + sprite.batch = this; + this.dirty = true; + var tempPrev = nextSprite.__prev; + nextSprite.__prev = sprite; + sprite.__next = nextSprite; + + if(tempPrev) + { + sprite.__prev = tempPrev; + tempPrev.__next = sprite; + } + else + { + this.head = sprite; + //this.head.__prev = null + } +} + +/** + * inserts a sprite after the specified sprite + * @method insertAfter + * @param sprite {Sprite} the sprite to be added + * @param previousSprite {Sprite} the first sprite will be inserted after this sprite + */ +PIXI.WebGLBatch.prototype.insertAfter = function(sprite, previousSprite) +{ + this.size++; + + + sprite.batch = this; + this.dirty = true; + + var tempNext = previousSprite.__next; + previousSprite.__next = sprite; + sprite.__prev = previousSprite; + + if(tempNext) + { + sprite.__next = tempNext; + tempNext.__prev = sprite; + } + else + { + this.tail = sprite + } + +} + +/** + * removes a sprite from the batch + * @method remove + * @param sprite {Sprite} the sprite to be removed + */ +PIXI.WebGLBatch.prototype.remove = function(sprite) +{ + this.size--; + + if(this.size == 0) + { + sprite.batch = null; + sprite.__prev = null; + sprite.__next = null; + return; + } + + if(sprite.__prev) + { + sprite.__prev.__next = sprite.__next; + } + else + { + this.head = sprite.__next; + this.head.__prev = null; + } + + if(sprite.__next) + { + sprite.__next.__prev = sprite.__prev; + } + else + { + this.tail = sprite.__prev; + this.tail.__next = null + } + + sprite.batch = null; + sprite.__next = null; + sprite.__prev = null; + this.dirty = true; +} + +/** + * Splits the batch into two with the specified sprite being the start of the new batch. + * @method split + * @param sprite {Sprite} the sprite that indicates where the batch should be split + * @return {WebGLBatch} the new batch + */ +PIXI.WebGLBatch.prototype.split = function(sprite) +{ + + //console.log("Splitting batch :" + this.size) +// console.log(sprite) +// console.log("-------") + this.dirty = true; + + //var val = (this.tail == this.head) + //console.log(val + " SAME?"); + var batch = new PIXI.WebGLBatch(this.gl)//PIXI._getBatch(this.gl); + batch.init(sprite); + batch.texture = this.texture; + batch.tail = this.tail; + //console.log("id is " +batcheee.id) + + this.tail = sprite.__prev; + this.tail.__next = null; + + sprite.__prev = null; + // return a splite batch! + //sprite.__prev.__next = null; + //sprite.__prev = null; + + + // TODO this size is wrong! + // need to recalculate :/ problem with a linked list! + // unless it gets calculated in the "clean"? + + // need to loop through items as there is no way to know the length on a linked list :/ + var tempSize = 0; + while(sprite) + { + tempSize++; + sprite.batch = batch; + sprite = sprite.__next; + } + + batch.size = tempSize; + this.size -= tempSize; + + return batch; +} + +/** + * Merges two batchs together + * @method merge + * @param batch {WebGLBatch} the batch that will be merged + */ +PIXI.WebGLBatch.prototype.merge = function(batch) +{ + this.dirty = true; + + this.tail.__next = batch.head; + batch.head.__prev = this.tail; + + this.size += batch.size; + + this.tail = batch.tail; + + var sprite = batch.head; + while(sprite) + { + sprite.batch = this; + sprite = sprite.__next; + } + +} + +/** + * Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added + * @methos growBatch + */ +PIXI.WebGLBatch.prototype.growBatch = function() +{ + var gl = this.gl; + if( this.size == 1) + { + this.dynamicSize = 1; + } + else + { + this.dynamicSize = this.size * 1.5 + } + // grow verts + this.verticies = new Float32Array(this.dynamicSize * 8); + + gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer); + gl.bufferData(gl.ARRAY_BUFFER,this.verticies , gl.DYNAMIC_DRAW); + + this.uvs = new Float32Array( this.dynamicSize * 8 ) + gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer); + gl.bufferData(gl.ARRAY_BUFFER, this.uvs , gl.DYNAMIC_DRAW); + + this.dirtyUVS = true; + + this.colors = new Float32Array( this.dynamicSize * 4 ) + gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer); + gl.bufferData(gl.ARRAY_BUFFER, this.colors , gl.DYNAMIC_DRAW); + + this.dirtyColors = true; + + this.indices = new Uint16Array(this.dynamicSize * 6); + var length = this.indices.length/6; + + for (var i=0; i < length; i++) + { + var index2 = i * 6; + var index3 = i * 4; + this.indices[index2 + 0] = index3 + 0; + this.indices[index2 + 1] = index3 + 1; + this.indices[index2 + 2] = index3 + 2; + this.indices[index2 + 3] = index3 + 0; + this.indices[index2 + 4] = index3 + 2; + this.indices[index2 + 5] = index3 + 3; + }; + + gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer); + gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW); + +} + +/** + * Refresh's all the data in the batch and sync's it with the webGL buffers + * @method refresh + */ +PIXI.WebGLBatch.prototype.refresh = function() +{ + var gl = this.gl; + + if (this.dynamicSize < this.size) + { + this.growBatch(); + } + + var indexRun = 0; + var worldTransform, width, height, aX, aY, w0, w1, h0, h1, index + var a, b, c, d, tx, ty + + var displayObject = this.head + + while(displayObject) + { + index = indexRun * 8; + + var texture = displayObject.texture; + + var frame = texture.frame; + var tw = texture.baseTexture.width; + var th = texture.baseTexture.height; + + this.uvs[index + 0] = frame.x / tw; + this.uvs[index +1] = frame.y / th; + + this.uvs[index +2] = (frame.x + frame.width) / tw; + this.uvs[index +3] = frame.y / th; + + this.uvs[index +4] = (frame.x + frame.width) / tw; + this.uvs[index +5] = (frame.y + frame.height) / th; + + this.uvs[index +6] = frame.x / tw; + this.uvs[index +7] = (frame.y + frame.height) / th; + + displayObject.updateFrame = false; + + colorIndex = indexRun * 4; + this.colors[colorIndex] = this.colors[colorIndex + 1] = this.colors[colorIndex + 2] = this.colors[colorIndex + 3] = displayObject.worldAlpha; + + displayObject = displayObject.__next; + + indexRun ++; + } + + this.dirtyUVS = true; + this.dirtyColors = true; +} + +/** + * Updates all the relevant geometry and uploads the data to the GPU + * @method update + */ +PIXI.WebGLBatch.prototype.update = function() +{ + var gl = this.gl; + var worldTransform, width, height, aX, aY, w0, w1, h0, h1, index, index2, index3 + + var a, b, c, d, tx, ty; + + var indexRun = 0; + + var displayObject = this.head; + + while(displayObject) + { + if(displayObject.worldVisible) + { + width = displayObject.texture.frame.width; + height = displayObject.texture.frame.height; + + // TODO trim?? + 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 || displayObject.texture.updateFrame) + { + this.dirtyUVS = true; + + var texture = displayObject.texture; + + var frame = texture.frame; + var tw = texture.baseTexture.width; + var th = texture.baseTexture.height; + + this.uvs[index + 0] = frame.x / tw; + this.uvs[index +1] = frame.y / th; + + this.uvs[index +2] = (frame.x + frame.width) / tw; + this.uvs[index +3] = frame.y / th; + + this.uvs[index +4] = (frame.x + frame.width) / tw; + this.uvs[index +5] = (frame.y + frame.height) / th; + + this.uvs[index +6] = frame.x / tw; + this.uvs[index +7] = (frame.y + frame.height) / th; + + displayObject.updateFrame = false; + } + + // TODO this probably could do with some optimisation.... + if(displayObject.cacheAlpha != displayObject.worldAlpha) + { + displayObject.cacheAlpha = displayObject.worldAlpha; + + var colorIndex = indexRun * 4; + this.colors[colorIndex] = this.colors[colorIndex + 1] = this.colors[colorIndex + 2] = this.colors[colorIndex + 3] = displayObject.worldAlpha; + this.dirtyColors = true; + } + } + else + { + index = indexRun * 8; + + this.verticies[index + 0 ] = 0; + this.verticies[index + 1 ] = 0; + + this.verticies[index + 2 ] = 0; + this.verticies[index + 3 ] = 0; + + this.verticies[index + 4 ] = 0; + this.verticies[index + 5 ] = 0; + + this.verticies[index + 6] = 0; + this.verticies[index + 7] = 0; + } + + indexRun++; + displayObject = displayObject.__next; + } +} + +/** + * Draws the batch to the frame buffer + * @method render + */ +PIXI.WebGLBatch.prototype.render = function(start, end) +{ +// console.log(start + " :: " + end + " : " + this.size); + start = start || 0; + //end = end || this.size; + if(end == undefined)end = this.size; + + if(this.dirty) + { + this.refresh(); + this.dirty = false; + } + + if (this.size == 0)return; + + this.update(); + var gl = this.gl; + + //TODO optimize this! + gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA); + + var shaderProgram = PIXI.shaderProgram; + gl.useProgram(shaderProgram); + + // update the verts.. + gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer); + // ok.. + gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.verticies) + gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0); + + // update the uvs + gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer); + + if(this.dirtyUVS) + { + this.dirtyUVS = false; + gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.uvs); + } + + gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0); + + gl.activeTexture(gl.TEXTURE0); + gl.bindTexture(gl.TEXTURE_2D, this.texture._glTexture); + + // update color! + gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer); + + if(this.dirtyColors) + { + this.dirtyColors = false; + gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.colors); + } + + gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0); + + // dont need to upload! + gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer); + + + //var startIndex = 0//1; + var len = end - start; + // console.log(this.size) + // DRAW THAT this! + gl.drawElements(gl.TRIANGLES, len * 6, gl.UNSIGNED_SHORT, start * 2 * 6 ); +} + + +/** + * @author Mat Groves http://matgroves.com/ @Doormat23 + */ + + + + +/** + * A WebGLBatch Enables a group of sprites to be drawn using the same settings. + * if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run. + * @class WebGLBatch + * @param an instance of the webGL context + * @return {PIXI.renderers.WebGLBatch} WebGLBatch {@link PIXI.renderers.WebGLBatch} + */ +PIXI.WebGLRenderGroup = function(gl) +{ + this.gl = gl; + this.root; + + this.backgroundColor; + this.batchs = []; + this.toRemove = []; +} + + +// constructor +PIXI.WebGLRenderGroup.constructor = PIXI.WebGLRenderGroup; + +PIXI.WebGLRenderGroup.prototype.setRenderable = function(displayObject) +{ + // has this changed?? + if(this.root)this.removeDisplayObjectAndChildren(this.root); + + displayObject.worldVisible = displayObject.visible; + + // soooooo // + // to check if any batchs exist already?? + + // TODO what if its already has an object? should remove it + this.root = displayObject; + //displayObject.__renderGroup = this; + this.addDisplayObjectAndChildren(displayObject); + //displayObject +} + +PIXI.WebGLRenderGroup.prototype.render = function(projectionMatrix) +{ + + PIXI.WebGLRenderer.updateTextures(); + + var gl = this.gl; + + // set the flipped matrix.. + gl.uniformMatrix4fv(PIXI.shaderProgram.mvMatrixUniform, false, projectionMatrix); + + // TODO remove this by replacing visible with getter setters.. + this.checkVisibility(this.root, this.root.visible); + + // will render all the elements in the group + var renderable; + + + for (var i=0; i < this.batchs.length; i++) + { + renderable = this.batchs[i]; + if(renderable instanceof PIXI.WebGLBatch) + { + this.batchs[i].render(); + } + else if(renderable instanceof PIXI.TilingSprite) + { + if(renderable.visible)this.renderTilingSprite(renderable, projectionMatrix); + } + else if(renderable instanceof PIXI.Strip) + { + if(renderable.visible)this.renderStrip(renderable, projectionMatrix); + } + } + +} + +PIXI.WebGLRenderGroup.prototype.renderSpecific = function(displayObject, projectionMatrix) +{ + PIXI.WebGLRenderer.updateTextures(); + + var gl = this.gl; + this.checkVisibility(displayObject, displayObject.visible); + gl.uniformMatrix4fv(PIXI.shaderProgram.mvMatrixUniform, false, projectionMatrix); + + + //console.log("SPECIFIC"); + // to do! + // render part of the scene... + + var startIndex; + var startBatchIndex; + + var endIndex; + var endBatchIndex; + + // get NEXT Renderable! + var nextRenderable = displayObject.renderable ? displayObject : this.getNextRenderable(displayObject); + var startBatch = nextRenderable.batch; + + if(nextRenderable instanceof PIXI.Sprite) + { + startBatch = nextRenderable.batch; + + var head = startBatch.head; + var next = head; + + // ok now we have the batch.. need to find the start index! + if(head == nextRenderable) + { + startIndex = 0; + } + else + { + startIndex = 1; + + while(head.__next != nextRenderable) + { + startIndex++; + head = head.__next; + } + } + } + else + { + startBatch = nextRenderable; + } + + // Get the LAST renderable object + var lastRenderable = displayObject; + var endBatch; + var lastItem = displayObject; + while(lastItem.children.length > 0) + { + lastItem = lastItem.children[lastItem.children.length-1]; + if(lastItem.renderable)lastRenderable = lastItem; + } + + if(lastRenderable instanceof PIXI.Sprite) + { + endBatch = lastRenderable.batch; + + var head = endBatch.head; + + if(head == lastRenderable) + { + endIndex = 0; + } + else + { + endIndex = 1; + + while(head.__next != lastRenderable) + { + endIndex++; + head = head.__next; + } + } + } + else + { + endBatch = lastRenderable; + } + + // TODO - need to fold this up a bit! + + + if(startBatch == endBatch) + { + if(startBatch instanceof PIXI.WebGLBatch) + { + startBatch.render(startIndex, endIndex+1); + } + else if(startBatch instanceof PIXI.TilingSprite) + { + if(startBatch.visible)this.renderTilingSprite(startBatch, projectionMatrix); + } + else if(startBatch instanceof PIXI.Strip) + { + if(startBatch.visible)this.renderStrip(startBatch, projectionMatrix); + } + else if(startBatch instanceof PIXI.CustomRenderable) + { + if(startBatch.visible) startBatch.renderWebGL(this, projectionMatrix); + } + + return; + } + + // now we have first and last! + startBatchIndex = this.batchs.indexOf(startBatch); + endBatchIndex = this.batchs.indexOf(endBatch); + + // DO the first batch + if(startBatch instanceof PIXI.WebGLBatch) + { + startBatch.render(startIndex); + } + else if(startBatch instanceof PIXI.TilingSprite) + { + if(startBatch.visible)this.renderTilingSprite(startBatch, projectionMatrix); + } + else if(startBatch instanceof PIXI.Strip) + { + if(startBatch.visible)this.renderStrip(startBatch, projectionMatrix); + } + else if(startBatch instanceof PIXI.CustomRenderable) + { + if(startBatch.visible) startBatch.renderWebGL(this, projectionMatrix); + } + + // DO the middle batchs.. + for (var i=startBatchIndex+1; i < endBatchIndex; i++) + { + renderable = this.batchs[i]; + + if(renderable instanceof PIXI.WebGLBatch) + { + this.batchs[i].render(); + } + else if(renderable instanceof PIXI.TilingSprite) + { + if(renderable.visible)this.renderTilingSprite(renderable, projectionMatrix); + } + else if(renderable instanceof PIXI.Strip) + { + if(renderable.visible)this.renderStrip(renderable, projectionMatrix); + } + else if(renderable instanceof PIXI.CustomRenderable) + { + if(renderable.visible) renderable.renderWebGL(this, projectionMatrix); + } + + } + + // DO the last batch.. + if(endBatch instanceof PIXI.WebGLBatch) + { + endBatch.render(0, endIndex+1); + } + else if(endBatch instanceof PIXI.TilingSprite) + { + if(endBatch.visible)this.renderTilingSprite(endBatch); + } + else if(endBatch instanceof PIXI.Strip) + { + if(endBatch.visible)this.renderStrip(endBatch); + } + else if(endBatch instanceof PIXI.CustomRenderable) + { + if(endBatch.visible) endBatch.renderWebGL(this, projectionMatrix); + } +} + +PIXI.WebGLRenderGroup.prototype.checkVisibility = function(displayObject, globalVisible) +{ + // give the dp a refference to its renderGroup... + var children = displayObject.children; + //displayObject.worldVisible = globalVisible; + for (var i=0; i < children.length; i++) + { + var child = children[i]; + + // TODO optimize... shouldt need to loop through everything all the time + child.worldVisible = child.visible && globalVisible; + + // everything should have a batch! + // time to see whats new! + if(child.textureChange) + { + child.textureChange = false; + if(child.worldVisible) + { + this.removeDisplayObject(child) + this.addDisplayObject(child) + } + // update texture!! + } + + if(child.children.length > 0) + { + this.checkVisibility(child, child.worldVisible); + } + }; +} + +PIXI.WebGLRenderGroup.prototype.addDisplayObject = function(displayObject) +{ + // add a child to the render group.. + if(displayObject.__renderGroup)displayObject.__renderGroup.removeDisplayObjectAndChildren(displayObject); + + // DONT htink this is needed? + // displayObject.batch = null; + + displayObject.__renderGroup = this; + + //displayObject.cacheVisible = true; + if(!displayObject.renderable)return; + + // while looping below THE OBJECT MAY NOT HAVE BEEN ADDED + //displayObject.__inWebGL = true; + + var previousSprite = this.getPreviousRenderable(displayObject); + var nextSprite = this.getNextRenderable(displayObject); + + + /* + * so now we have the next renderable and the previous renderable + * + */ + + if(displayObject instanceof PIXI.Sprite) + { + var previousBatch + var nextBatch + + //console.log( previousSprite) + if(previousSprite instanceof PIXI.Sprite) + { + previousBatch = previousSprite.batch; + if(previousBatch) + { + if(previousBatch.texture == displayObject.texture.baseTexture && previousBatch.blendMode == displayObject.blendMode) + { + previousBatch.insertAfter(displayObject, previousSprite); + return; + } + } + } + else + { + // TODO reword! + previousBatch = previousSprite; + } + + if(nextSprite) + { + if(nextSprite instanceof PIXI.Sprite) + { + nextBatch = nextSprite.batch; + + //batch may not exist if item was added to the display list but not to the webGL + if(nextBatch) + { + if(nextBatch.texture == displayObject.texture.baseTexture && nextBatch.blendMode == displayObject.blendMode) + { + nextBatch.insertBefore(displayObject, nextSprite); + return; + } + else + { + if(nextBatch == previousBatch) + { + // THERE IS A SPLIT IN THIS BATCH! // + var splitBatch = previousBatch.split(nextSprite); + // COOL! + // add it back into the array + /* + * OOPS! + * seems the new sprite is in the middle of a batch + * lets split it.. + */ + var batch = PIXI.WebGLRenderer.getBatch(); + + var index = this.batchs.indexOf( previousBatch ); + batch.init(displayObject); + this.batchs.splice(index+1, 0, batch, splitBatch); + + return; + } + } + } + } + else + { + // TODO re-word! + nextBatch = nextSprite; + } + } + + /* + * looks like it does not belong to any batch! + * but is also not intersecting one.. + * time to create anew one! + */ + + var batch = PIXI.WebGLRenderer.getBatch(); + batch.init(displayObject); + + if(previousBatch) // if this is invalid it means + { + var index = this.batchs.indexOf( previousBatch ); + this.batchs.splice(index+1, 0, batch); + } + else + { + this.batchs.push(batch); + } + + } + else if(displayObject instanceof PIXI.TilingSprite) + { + // add to a batch!! + this.initTilingSprite(displayObject); + this.batchs.push(displayObject); + + } + else if(displayObject instanceof PIXI.Strip) + { + // add to a batch!! + this.initStrip(displayObject); + this.batchs.push(displayObject); + } + + // if its somthing else... then custom codes! + this.batchUpdate = true; +} + +PIXI.WebGLRenderGroup.prototype.addDisplayObjectAndChildren = function(displayObject) +{ + // TODO - this can be faster - but not as important right now + + this.addDisplayObject(displayObject); + var children = displayObject.children; + + for (var i=0; i < children.length; i++) + { + this.addDisplayObjectAndChildren(children[i]); + }; +} + +PIXI.WebGLRenderGroup.prototype.removeDisplayObject = function(displayObject) +{ + // loop through children.. + // display object // + + // add a child from the render group.. + // remove it and all its children! + //displayObject.cacheVisible = false;//displayObject.visible; + displayObject.__renderGroup = null; + + if(!displayObject.renderable)return; + + /* + * removing is a lot quicker.. + * + */ + var batchToRemove; + + if(displayObject instanceof PIXI.Sprite) + { + // should always have a batch! + var batch = displayObject.batch; + if(!batch)return; // this means the display list has been altered befre rendering + + batch.remove(displayObject); + + if(batch.size==0) + { + batchToRemove = batch; + } + } + else + { + batchToRemove = displayObject; + } + + /* + * Looks like there is somthing that needs removing! + */ + if(batchToRemove) + { + var index = this.batchs.indexOf( batchToRemove ); + if(index == -1)return;// this means it was added then removed before rendered + + // ok so.. check to see if you adjacent batchs should be joined. + // TODO may optimise? + if(index == 0 || index == this.batchs.length-1) + { + // wha - eva! just get of the empty batch! + this.batchs.splice(index, 1); + if(batchToRemove instanceof PIXI.WebGLBatch)PIXI.WebGLRenderer.returnBatch(batchToRemove); + + return; + } + + if(this.batchs[index-1] instanceof PIXI.WebGLBatch && this.batchs[index+1] instanceof PIXI.WebGLBatch) + { + if(this.batchs[index-1].texture == this.batchs[index+1].texture && this.batchs[index-1].blendMode == this.batchs[index+1].blendMode) + { + //console.log("MERGE") + this.batchs[index-1].merge(this.batchs[index+1]); + + if(batchToRemove instanceof PIXI.WebGLBatch)PIXI.WebGLRenderer.returnBatch(batchToRemove); + PIXI.WebGLRenderer.returnBatch(this.batchs[index+1]); + this.batchs.splice(index, 2); + return; + } + } + + + this.batchs.splice(index, 1); + if(batchToRemove instanceof PIXI.WebGLBatch)PIXI.WebGLRenderer.returnBatch(batchToRemove); + } +} + +PIXI.WebGLRenderGroup.prototype.removeDisplayObjectAndChildren = function(displayObject) +{ + // TODO - this can be faster - but not as important right now + if(displayObject.__renderGroup != this)return; + + this.removeDisplayObject(displayObject); + var children = displayObject.children; + + for (var i=0; i < children.length; i++) + { + this.removeDisplayObjectAndChildren(children[i]); + }; +} + +/** + * @private + */ + +PIXI.WebGLRenderGroup.prototype.getNextRenderable = function(displayObject) +{ + /* + * LOOK FOR THE NEXT SPRITE + * This part looks for the closest next sprite that can go into a batch + * it keeps looking until it finds a sprite or gets to the end of the display + * scene graph + * + * These look a lot scarier than the actually are... + */ + + var nextSprite = displayObject; + do + { + // moving forward! + // if it has no children.. + if(nextSprite.children.length == 0) + { + //maynot have a parent + if(!nextSprite.parent)return null; + + // go along to the parent.. + while(nextSprite.childIndex == nextSprite.parent.children.length-1) + { + nextSprite = nextSprite.parent; + //console.log(">" + nextSprite); +// console.log(">-" + this.root); + if(nextSprite == this.root || !nextSprite.parent)//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.__renderGroup) + + return nextSprite; +} + +PIXI.WebGLRenderGroup.prototype.getPreviousRenderable = function(displayObject) +{ + /* + * LOOK FOR THE PREVIOUS SPRITE + * This part looks for the closest previous sprite that can go into a batch + * It keeps going back until it finds a sprite or the stage + */ + var previousSprite = displayObject; + do + { + if(previousSprite.childIndex == 0) + { + previousSprite = previousSprite.parent; + if(!previousSprite)return null; + } + else + { + + previousSprite = previousSprite.parent.children[previousSprite.childIndex-1]; + // what if the bloop has children??? + while(previousSprite.children.length != 0) + { + // keep diggin till we get to the last child + previousSprite = previousSprite.children[previousSprite.children.length-1]; + } + } + + if(previousSprite == this.root)break; + } + while(!previousSprite.renderable || !previousSprite.__renderGroup); + + return previousSprite; +} + +/** + * @private + */ +PIXI.WebGLRenderGroup.prototype.initTilingSprite = function(sprite) +{ + var gl = this.gl; + + // make the texture tilable.. + + sprite.verticies = new Float32Array([0, 0, + sprite.width, 0, + sprite.width, sprite.height, + 0, sprite.height]); + + sprite.uvs = new Float32Array([0, 0, + 1, 0, + 1, 1, + 0, 1]); + + sprite.colors = new Float32Array([1,1,1,1]); + + sprite.indices = new Uint16Array([0, 1, 3,2])//, 2]); + + + sprite._vertexBuffer = gl.createBuffer(); + sprite._indexBuffer = gl.createBuffer(); + sprite._uvBuffer = gl.createBuffer(); + sprite._colorBuffer = gl.createBuffer(); + + gl.bindBuffer(gl.ARRAY_BUFFER, sprite._vertexBuffer); + gl.bufferData(gl.ARRAY_BUFFER, sprite.verticies, gl.STATIC_DRAW); + + gl.bindBuffer(gl.ARRAY_BUFFER, sprite._uvBuffer); + gl.bufferData(gl.ARRAY_BUFFER, sprite.uvs, gl.DYNAMIC_DRAW); + + gl.bindBuffer(gl.ARRAY_BUFFER, sprite._colorBuffer); + gl.bufferData(gl.ARRAY_BUFFER, sprite.colors, gl.STATIC_DRAW); + + gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, sprite._indexBuffer); + gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, sprite.indices, gl.STATIC_DRAW); + +// return ( (x > 0) && ((x & (x - 1)) == 0) ); + + if(sprite.texture.baseTexture._glTexture) + { + gl.bindTexture(gl.TEXTURE_2D, sprite.texture.baseTexture._glTexture); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.REPEAT); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.REPEAT); + sprite.texture.baseTexture._powerOf2 = true; + } + else + { + sprite.texture.baseTexture._powerOf2 = true; + } +} + +/** + * @private + */ +PIXI.WebGLRenderGroup.prototype.renderStrip = function(strip, projectionMatrix) +{ + var gl = this.gl; + var shaderProgram = PIXI.shaderProgram; +// mat + var mat4Real = PIXI.mat3.toMat4(strip.worldTransform); + PIXI.mat4.transpose(mat4Real); + PIXI.mat4.multiply(projectionMatrix, mat4Real, mat4Real ) + + gl.uniformMatrix4fv(shaderProgram.mvMatrixUniform, false, mat4Real); + + if(strip.blendMode == PIXI.blendModes.NORMAL) + { + gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA); + } + else + { + gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_COLOR); + } + + if(!strip.dirty) + { + + gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer); + gl.bufferSubData(gl.ARRAY_BUFFER, 0, strip.verticies) + gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0); + + // update the uvs + gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer); + gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0); + + gl.activeTexture(gl.TEXTURE0); + gl.bindTexture(gl.TEXTURE_2D, strip.texture.baseTexture._glTexture); + + gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer); + gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0); + + // dont need to upload! + gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer); + + + } + else + { + strip.dirty = false; + gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer); + gl.bufferData(gl.ARRAY_BUFFER, strip.verticies, gl.STATIC_DRAW) + gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0); + + // update the uvs + gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer); + gl.bufferData(gl.ARRAY_BUFFER, strip.uvs, gl.STATIC_DRAW) + gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0); + + gl.activeTexture(gl.TEXTURE0); + gl.bindTexture(gl.TEXTURE_2D, strip.texture.baseTexture._glTexture); + + gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer); + gl.bufferData(gl.ARRAY_BUFFER, strip.colors, gl.STATIC_DRAW) + gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0); + + // dont need to upload! + gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer); + gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, strip.indices, gl.STATIC_DRAW); + + } + //console.log(gl.TRIANGLE_STRIP) + gl.drawElements(gl.TRIANGLE_STRIP, strip.indices.length, gl.UNSIGNED_SHORT, 0); + + gl.uniformMatrix4fv(shaderProgram.mvMatrixUniform, false, projectionMatrix); + +} + + +/** + * @private + */ +PIXI.WebGLRenderGroup.prototype.renderTilingSprite = function(sprite, projectionMatrix) +{ + var gl = this.gl; + var shaderProgram = PIXI.shaderProgram; + + var tilePosition = sprite.tilePosition; + var tileScale = sprite.tileScale; + + var offsetX = tilePosition.x/sprite.texture.baseTexture.width; + var offsetY = tilePosition.y/sprite.texture.baseTexture.height; + + var scaleX = (sprite.width / sprite.texture.baseTexture.width) / tileScale.x; + var scaleY = (sprite.height / sprite.texture.baseTexture.height) / tileScale.y; + + sprite.uvs[0] = 0 - offsetX; + sprite.uvs[1] = 0 - offsetY; + + sprite.uvs[2] = (1 * scaleX) -offsetX; + sprite.uvs[3] = 0 - offsetY; + + sprite.uvs[4] = (1 *scaleX) - offsetX; + sprite.uvs[5] = (1 *scaleY) - offsetY; + + sprite.uvs[6] = 0 - offsetX; + sprite.uvs[7] = (1 *scaleY) - offsetY; + + gl.bindBuffer(gl.ARRAY_BUFFER, sprite._uvBuffer); + gl.bufferSubData(gl.ARRAY_BUFFER, 0, sprite.uvs) + + this.renderStrip(sprite, projectionMatrix); +} + + + +/** + * @private + */ +PIXI.WebGLRenderer.prototype.initStrip = function(strip) +{ + // build the strip! + var gl = this.gl; + var shaderProgram = this.shaderProgram; + + strip._vertexBuffer = gl.createBuffer(); + strip._indexBuffer = gl.createBuffer(); + strip._uvBuffer = gl.createBuffer(); + strip._colorBuffer = gl.createBuffer(); + + gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer); + gl.bufferData(gl.ARRAY_BUFFER, strip.verticies, gl.DYNAMIC_DRAW); + + gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer); + gl.bufferData(gl.ARRAY_BUFFER, strip.uvs, gl.STATIC_DRAW); + + gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer); + gl.bufferData(gl.ARRAY_BUFFER, strip.colors, gl.STATIC_DRAW); + + + gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer); + gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, strip.indices, gl.STATIC_DRAW); +} + + +/** + * @author Mat Groves http://matgroves.com/ @Doormat23 + */ + + +/** + * the CanvasRenderer 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 + * @constructor + * @param width {Number} the width of the canvas view + * @default 0 + * @param height {Number} the height of the canvas view + * @default 0 + * @param view {Canvas} the canvas to use as a view, optional + * @param transparent {Boolean} the transparency of the render view, default false + * @default false + * + */ +PIXI.CanvasRenderer = function(width, height, view, transparent) +{ + this.transparent = transparent; + + /** + * The width of the canvas view + * @property width + * @type Number + * @default 800 + */ + this.width = width || 800; + /** + * The height of the canvas view + * @property height + * @type Number + * @default 600 + */ + this.height = height || 600; + + this.refresh = true; + + /** + * The canvas element that the everything is drawn to + * @property view + * @type Canvas + */ + this.view = view || document.createElement( 'canvas' ); + + // hack to enable some hardware acceleration! + //this.view.style["transform"] = "translatez(0)"; + + this.view.width = this.width; + this.view.height = this.height; + this.count = 0; + + /** + * The canvas context that the everything is drawn to + * @property context + * @type Canvas 2d Context + */ + this.context = this.view.getContext("2d"); +} + +// constructor +PIXI.CanvasRenderer.constructor = PIXI.CanvasRenderer; + +/** + * Renders the stage to its canvas view + * @method render + * @param stage {Stage} the Stage element to be rendered + */ +PIXI.CanvasRenderer.prototype.render = function(stage) +{ + // update children if need be + + //stage.__childrenAdded = []; + //stage.__childrenRemoved = []; + + // update textures if need be + PIXI.texturesToUpdate = []; + PIXI.texturesToDestroy = []; + + stage.updateTransform(); + + // update the background color + if(this.view.style.backgroundColor!=stage.backgroundColorString && !this.transparent)this.view.style.backgroundColor = stage.backgroundColorString; + + this.context.setTransform(1,0,0,1,0,0); + this.context.clearRect(0, 0, this.width, this.height) + this.renderDisplayObject(stage); + //as + + // run interaction! + if(stage.interactive) + { + //need to add some events! + if(!stage._interactiveEventsAdded) + { + stage._interactiveEventsAdded = true; + stage.interactionManager.setTarget(this); + } + } + + // remove frame updates.. + if(PIXI.Texture.frameUpdates.length > 0) + { + PIXI.Texture.frameUpdates = []; + } +} + +/** + * resizes the canvas view to the specified width and height + * @param the new width of the canvas view + * @param the new height of the canvas view + */ +PIXI.CanvasRenderer.prototype.resize = function(width, height) +{ + this.width = width; + this.height = height; + + this.view.width = width; + this.view.height = height; +} + +/** + * @private + */ + +PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject) +{ + var transform = displayObject.worldTransform; + var context = this.context; + //context.globalCompositeOperation = "source-over" + var blit = false; + + if(!displayObject.visible)return; + + if(displayObject instanceof PIXI.Sprite) + { + var frame = displayObject.texture.frame; + + if(frame) + { + context.globalAlpha = displayObject.worldAlpha; + + // BLITZ!!! + /* + * if the rotation is 0 then we can blitz it + * meaning we dont need to do a transform and also we + * can round to the nearest round number for a little extra speed! + */ + /*if(displayObject.rotation == 0) + { + if(!blit)this.context.setTransform(1,0,0,1,0,0); + blit = true; + context.drawImage(displayObject.texture.baseTexture.image, + frame.x, + frame.y, + frame.width, + frame.height, + (transform[2]+ ((displayObject.anchor.x - displayObject.texture.trim.x) * -frame.width) * transform[0]), + (transform[5]+ ((displayObject.anchor.y - displayObject.texture.trim.y) * -frame.height)* transform[4]), + (displayObject.width * transform[0]), + (displayObject.height * transform[4])); + + } + else + {*/ + // blit = false; + context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5]); + + context.drawImage(displayObject.texture.baseTexture.source, + frame.x, + frame.y, + frame.width, + frame.height, + (displayObject.anchor.x) * -frame.width, + (displayObject.anchor.y) * -frame.height, + // (displayObject.anchor.x - displayObject.texture.trim.x) * -frame.width, + // (displayObject.anchor.y - displayObject.texture.trim.y) * -frame.height, + + frame.width, + frame.height); + //} + } + } + else if(displayObject instanceof PIXI.Strip) + { + context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5]) + this.renderStrip(displayObject); + } + else if(displayObject instanceof PIXI.TilingSprite) + { + context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5]) + this.renderTilingSprite(displayObject); + } + else if(displayObject instanceof PIXI.CustomRenderable) + { + displayObject.renderCanvas(this); + } + + // render! + for (var i=0; i < displayObject.children.length; i++) + { + this.renderDisplayObject(displayObject.children[i]); + } + + this.context.setTransform(1,0,0,1,0,0); +} + +/** + * @private + */ +PIXI.CanvasRenderer.prototype.renderStripFlat = function(strip) +{ + var context = this.context; + var verticies = strip.verticies; + var uvs = strip.uvs; + + var length = verticies.length/2; + this.count++; + + context.beginPath(); + for (var i=1; i < length-2; i++) + { + + // draw some triangles! + var index = i*2; + + var x0 = verticies[index], x1 = verticies[index+2], x2 = verticies[index+4]; + var y0 = verticies[index+1], y1 = verticies[index+3], y2 = verticies[index+5]; + + context.moveTo(x0, y0); + context.lineTo(x1, y1); + context.lineTo(x2, y2); + + }; + +// context.globalCompositeOperation = 'lighter'; + context.fillStyle = "#FF0000"; + context.fill(); + context.closePath(); + //context.globalCompositeOperation = 'source-over'; +} + +/** + * @private + */ +PIXI.CanvasRenderer.prototype.renderTilingSprite = function(sprite) +{ + var context = this.context; + + if(!sprite.__tilePattern) sprite.__tilePattern = context.createPattern(sprite.texture.baseTexture.source, "repeat"); + + context.beginPath(); + + var tilePosition = sprite.tilePosition; + var tileScale = sprite.tileScale; + + // offset + context.scale(tileScale.x,tileScale.y); + context.translate(tilePosition.x, tilePosition.y); + + context.fillStyle = sprite.__tilePattern; + context.fillRect(-tilePosition.x,-tilePosition.y,sprite.width / tileScale.x, sprite.height / tileScale.y); + + context.scale(1/tileScale.x, 1/tileScale.y); + context.translate(-tilePosition.x, -tilePosition.y); + + context.closePath(); +} + + + +/** + * @private + */ +PIXI.CanvasRenderer.prototype.renderStrip = function(strip) +{ + var context = this.context; + //context.globalCompositeOperation = 'lighter'; + // draw triangles!! + var verticies = strip.verticies; + var uvs = strip.uvs; + + var length = verticies.length/2; + this.count++; + for (var i=1; i < length-2; i++) + { + + // draw some triangles! + var index = i*2; + + var x0 = verticies[index], x1 = verticies[index+2], x2 = verticies[index+4]; + var y0 = verticies[index+1], y1 = verticies[index+3], y2 = verticies[index+5]; + + var u0 = uvs[index] * strip.texture.width, u1 = uvs[index+2] * strip.texture.width, u2 = uvs[index+4]* strip.texture.width; + var v0 = uvs[index+1]* strip.texture.height, v1 = uvs[index+3] * strip.texture.height, v2 = uvs[index+5]* strip.texture.height; + + + context.save(); + context.beginPath(); + context.moveTo(x0, y0); + context.lineTo(x1, y1); + context.lineTo(x2, y2); + context.closePath(); + + // context.fillStyle = "white"//rgb(1, 1, 1,1)); + // context.fill(); + context.clip(); + + + // Compute matrix transform + var delta = u0*v1 + v0*u2 + u1*v2 - v1*u2 - v0*u1 - u0*v2; + var delta_a = x0*v1 + v0*x2 + x1*v2 - v1*x2 - v0*x1 - x0*v2; + var delta_b = u0*x1 + x0*u2 + u1*x2 - x1*u2 - x0*u1 - u0*x2; + var delta_c = u0*v1*x2 + v0*x1*u2 + x0*u1*v2 - x0*v1*u2 - v0*u1*x2 - u0*x1*v2; + var delta_d = y0*v1 + v0*y2 + y1*v2 - v1*y2 - v0*y1 - y0*v2; + var delta_e = u0*y1 + y0*u2 + u1*y2 - y1*u2 - y0*u1 - u0*y2; + var delta_f = u0*v1*y2 + v0*y1*u2 + y0*u1*v2 - y0*v1*u2 - v0*u1*y2 - u0*y1*v2; + + + + + context.transform(delta_a/delta, delta_d/delta, + delta_b/delta, delta_e/delta, + delta_c/delta, delta_f/delta); + + context.drawImage(strip.texture.baseTexture.source, 0, 0); + context.restore(); + }; + +// context.globalCompositeOperation = 'source-over'; +} + + + + + + + + + +/** + * @author Mat Groves http://matgroves.com/ + */ + +PIXI.Strip = function(texture, width, height) +{ + PIXI.DisplayObjectContainer.call( this ); + this.texture = texture; + this.blendMode = PIXI.blendModes.NORMAL; + + try + { + this.uvs = new Float32Array([0, 1, + 1, 1, + 1, 0, 0,1]); + + this.verticies = new Float32Array([0, 0, + 0,0, + 0,0, 0, + 0, 0]); + + this.colors = new Float32Array([1, 1, 1, 1]); + + this.indices = new Uint16Array([0, 1, 2, 3]); + } + catch(error) + { + this.uvs = [0, 1, + 1, 1, + 1, 0, 0,1]; + + this.verticies = [0, 0, + 0,0, + 0,0, 0, + 0, 0]; + + this.colors = [1, 1, 1, 1]; + + this.indices = [0, 1, 2, 3]; + } + + + /* + this.uvs = new Float32Array() + this.verticies = new Float32Array() + this.colors = new Float32Array() + this.indices = new Uint16Array() +*/ + this.width = width; + this.height = height; + + // load the texture! + if(texture.baseTexture.hasLoaded) + { + this.width = this.texture.frame.width; + this.height = this.texture.frame.height; + this.updateFrame = true; + } + else + { + this.onTextureUpdateBind = this.onTextureUpdate.bind(this); + this.texture.addEventListener( 'update', this.onTextureUpdateBind ); + } + + this.renderable = true; +} + +// constructor +PIXI.Strip.constructor = PIXI.Strip; +PIXI.Strip.prototype = Object.create( PIXI.DisplayObjectContainer.prototype ); + +PIXI.Strip.prototype.setTexture = function(texture) +{ + //TODO SET THE TEXTURES + //TODO VISIBILITY + + // stop current texture + this.texture = texture; + this.width = texture.frame.width; + this.height = texture.frame.height; + this.updateFrame = true; +} + +PIXI.Strip.prototype.onTextureUpdate = function(event) +{ + this.updateFrame = true; +} +// some helper functions.. + + +/** + * @author Mat Groves http://matgroves.com/ + */ + + +PIXI.Rope = function(texture, points) +{ + PIXI.Strip.call( this, texture ); + this.points = points; + + try + { + this.verticies = new Float32Array( points.length * 4); + this.uvs = new Float32Array( points.length * 4); + this.colors = new Float32Array( points.length * 2); + this.indices = new Uint16Array( points.length * 2); + } + catch(error) + { + this.verticies = verticies + + this.uvs = uvs + this.colors = colors + this.indices = indices + } + + this.refresh(); +} + + +// constructor +PIXI.Rope.constructor = PIXI.Rope; +PIXI.Rope.prototype = Object.create( PIXI.Strip.prototype ); + +PIXI.Rope.prototype.refresh = function() +{ + var points = this.points; + if(points.length < 1)return; + + var uvs = this.uvs + var indices = this.indices; + var colors = this.colors; + + var lastPoint = points[0]; + var nextPoint; + var perp = {x:0, y:0}; + var point = points[0]; + + this.count-=0.2; + + + uvs[0] = 0 + uvs[1] = 1 + uvs[2] = 0 + uvs[3] = 1 + + colors[0] = 1; + colors[1] = 1; + + indices[0] = 0; + indices[1] = 1; + + var total = points.length; + + for (var i = 1; i < total; i++) + { + + var point = points[i]; + var index = i * 4; + // time to do some smart drawing! + var amount = i/(total-1) + + if(i%2) + { + uvs[index] = amount; + uvs[index+1] = 0; + + uvs[index+2] = amount + uvs[index+3] = 1 + + } + else + { + uvs[index] = amount + uvs[index+1] = 0 + + uvs[index+2] = amount + uvs[index+3] = 1 + } + + index = i * 2; + colors[index] = 1; + colors[index+1] = 1; + + index = i * 2; + indices[index] = index; + indices[index + 1] = index + 1; + + lastPoint = point; + } +} + +PIXI.Rope.prototype.updateTransform = function() +{ + + var points = this.points; + if(points.length < 1)return; + + var verticies = this.verticies + + var lastPoint = points[0]; + var nextPoint; + var perp = {x:0, y:0}; + var point = points[0]; + + this.count-=0.2; + + verticies[0] = point.x + perp.x + verticies[1] = point.y + perp.y //+ 200 + verticies[2] = point.x - perp.x + verticies[3] = point.y - perp.y//+200 + // time to do some smart drawing! + + var total = points.length; + + for (var i = 1; i < total; i++) + { + + var point = points[i]; + var index = i * 4; + + if(i < points.length-1) + { + nextPoint = points[i+1]; + } + else + { + nextPoint = point + } + + perp.y = -(nextPoint.x - lastPoint.x); + perp.x = nextPoint.y - lastPoint.y; + + var ratio = (1 - (i / (total-1))) * 10; + if(ratio > 1)ratio = 1; + + var perpLength = Math.sqrt(perp.x * perp.x + perp.y * perp.y); + var num = this.texture.height/2//(20 + Math.abs(Math.sin((i + this.count) * 0.3) * 50) )* ratio; + perp.x /= perpLength; + perp.y /= perpLength; + + perp.x *= num; + perp.y *= num; + + verticies[index] = point.x + perp.x + verticies[index+1] = point.y + perp.y + verticies[index+2] = point.x - perp.x + verticies[index+3] = point.y - perp.y + + lastPoint = point; + } + + PIXI.DisplayObjectContainer.prototype.updateTransform.call( this ); +} + +PIXI.Rope.prototype.setTexture = function(texture) +{ + // stop current texture + this.texture = texture; + this.updateFrame = true; +} + + + + + +/** + * @author Mat Groves http://matgroves.com/ + */ + +/** + * A tiling sprite is a fast way of rendering a tiling image + * @class TilingSprite + * @extends DisplayObjectContainer + * @constructor + * @param texture {Texture} the texture of the tiling sprite + * @param width {Number} the width of the tiling sprite + * @param height {Number} the height of the tiling sprite + */ +PIXI.TilingSprite = function(texture, width, height) +{ + PIXI.DisplayObjectContainer.call( this ); + + this.texture = texture; + this.width = width; + this.height = height; + this.renderable = true; + + /** + * The scaling of the image that is being tiled + * @property tileScale + * @type Point + */ + this.tileScale = new PIXI.Point(1,1); + /** + * The offset position of the image that is being tiled + * @property tilePosition + * @type Point + */ + this.tilePosition = new PIXI.Point(0,0); + + this.blendMode = PIXI.blendModes.NORMAL +} + +// constructor +PIXI.TilingSprite.constructor = PIXI.TilingSprite; +PIXI.TilingSprite.prototype = Object.create( PIXI.DisplayObjectContainer.prototype ); + +PIXI.TilingSprite.prototype.setTexture = function(texture) +{ + //TODO SET THE TEXTURES + //TODO VISIBILITY + + // stop current texture + this.texture = texture; + this.updateFrame = true; +} + +PIXI.TilingSprite.prototype.onTextureUpdate = function(event) +{ + this.updateFrame = true; +} + + +/** + * @author Mat Groves http://matgroves.com/ @Doormat23 + */ + + +/** + * Need to finalize this a bit more but works! Its in but will be working on this feature properly next..:) + * @class CustomRenderable + * @extends DisplayObject + * @constructor + */ +PIXI.CustomRenderable = function() +{ + PIXI.DisplayObject.call( this ); + +} + +// constructor +PIXI.CustomRenderable.constructor = PIXI.CustomRenderable; +PIXI.CustomRenderable.prototype = Object.create( PIXI.DisplayObject.prototype ); + +PIXI.CustomRenderable.prototype.renderCanvas = function(renderer) +{ + // override! +} + + +PIXI.CustomRenderable.prototype.initWebGL = function(renderer) +{ + // override! +} + + +PIXI.CustomRenderable.prototype.renderWebGL = function(renderGroup, projectionMatrix) +{ + // not sure if both needed? but ya have for now! + // override! +} + + +/** + * @author Mat Groves http://matgroves.com/ @Doormat23 + */ + +PIXI.BaseTextureCache = {}; +PIXI.texturesToUpdate = []; +PIXI.texturesToDestroy = []; + +/** + * A texture stores the information that represents an image. All textures have a base texture + * @class BaseTexture + * @extends EventTarget + * @constructor + * @param source {String} the source object (image or canvas) + */ +PIXI.BaseTexture = function(source) +{ + PIXI.EventTarget.call( this ); + + /* + * The url of the texture + * @property imageUrl + * @type String + */ + //this.imageUrl = source.src; + + /** + * [read only] The width of the base texture set when the image has loaded + * @property width + * @type Number + */ + this.width = 100; + /** + * [read only] The height of the base texture set when the image has loaded + * @property height + * @type Number + */ + this.height = 100; + + /** + * The source that is loaded to create the texture + * @property source + * @type Image + */ + this.source = source//new Image(); + + if(!source)return; + + if(this.source instanceof Image) + { + if(this.source.complete) + { + this.hasLoaded = true; + this.width = this.source.width; + this.height = this.source.height; + + PIXI.texturesToUpdate.push(this); + } + else + { + + var scope = this; + this.source.onload = function(){ + + scope.hasLoaded = true; + scope.width = scope.source.width; + scope.height = scope.source.height; + + // add it to somewhere... + PIXI.texturesToUpdate.push(scope); + scope.dispatchEvent( { type: 'loaded', content: scope } ); + } + // this.image.src = imageUrl; + } + } + else + { + this.hasLoaded = true; + this.width = this.source.width; + this.height = this.source.height; + + PIXI.texturesToUpdate.push(this); + } + + this._powerOf2 = false; + +} + +PIXI.BaseTexture.constructor = PIXI.BaseTexture; + +PIXI.BaseTexture.prototype.destroy = function() +{ + if(this.source instanceof Image) + { + this.source.src = null; + } + this.source = null; + PIXI.texturesToDestroy.push(this); +} + +/** + * + * Helper function that returns a base texture based on an image url + * If the image is not in the base texture cache it will be created and loaded + * @static + * @method fromImage + * @param imageUrl {String} The image url of the texture + * @return BaseTexture + */ +PIXI.BaseTexture.fromImage = function(imageUrl, crossorigin) +{ + var baseTexture = PIXI.BaseTextureCache[imageUrl]; + if(!baseTexture) + { + var image = new Image(); + if (crossorigin) + { + image.crossOrigin = ''; + } + image.src = imageUrl; + baseTexture = new PIXI.BaseTexture(image); + PIXI.BaseTextureCache[imageUrl] = baseTexture; + } + + return baseTexture; +} + +/** + * @author Mat Groves http://matgroves.com/ @Doormat23 + */ + +PIXI.TextureCache = {}; +PIXI.FrameCache = {}; + +/** + * A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used + * @class Texture + * @extends EventTarget + * @constructor + * @param baseTexture {BaseTexture} + * @param frmae {Rectangle} + */ +PIXI.Texture = function(baseTexture, frame) +{ + PIXI.EventTarget.call( this ); + + if(!frame) + { + this.noFrame = true; + frame = new PIXI.Rectangle(0,0,1,1); + } + + this.trim = new PIXI.Point(); + + if(baseTexture instanceof PIXI.Texture) + baseTexture = baseTexture.baseTexture; + + /** + * The base texture of this texture + * @property baseTexture + * @type BaseTexture + */ + this.baseTexture = baseTexture; + + + + /** + * The frame specifies the region of the base texture that this texture uses + * @property frame + * @type #Rectangle + */ + this.frame = frame; + + this.scope = this; + + if(baseTexture.hasLoaded) + { + if(this.noFrame)frame = new PIXI.Rectangle(0,0, baseTexture.width, baseTexture.height); + //console.log(frame) + + this.setFrame(frame); + } + else + { + var scope = this; + baseTexture.addEventListener( 'loaded', function(){ scope.onBaseTextureLoaded()} ); + } +} + +PIXI.Texture.constructor = PIXI.Texture; + +PIXI.Texture.prototype.onBaseTextureLoaded = function(event) +{ + var baseTexture = this.baseTexture; + baseTexture.removeEventListener( 'loaded', this.onLoaded ); + + if(this.noFrame)this.frame = new PIXI.Rectangle(0,0, baseTexture.width, baseTexture.height); + this.noFrame = false; + this.width = this.frame.width; + this.height = this.frame.height; + + this.scope.dispatchEvent( { type: 'update', content: this } ); +} + +PIXI.Texture.prototype.destroy = function(destroyBase) +{ + if(destroyBase)this.baseTexture.destroy(); +} + +/** + * Specifies the rectangle region of the baseTexture + * @method setFrame + * @param frame {Rectangle} + */ +PIXI.Texture.prototype.setFrame = function(frame) +{ + this.frame = frame; + this.width = frame.width; + this.height = frame.height; + + if(frame.x + frame.width > this.baseTexture.width || frame.y + frame.height > this.baseTexture.height) + { + throw new Error("Texture Error: frame does not fit inside the base Texture dimensions " + this); + } + + this.updateFrame = true; + + PIXI.Texture.frameUpdates.push(this); + //this.dispatchEvent( { type: 'update', content: this } ); +} + +/** + * + * Helper function that returns a texture based on an image url + * If the image is not in the texture cache it will be created and loaded + * @static + * @method fromImage + * @param imageUrl {String} The image url of the texture + * @return Texture + */ +PIXI.Texture.fromImage = function(imageUrl, crossorigin) +{ + var texture = PIXI.TextureCache[imageUrl]; + + if(!texture) + { + texture = new PIXI.Texture(PIXI.BaseTexture.fromImage(imageUrl, crossorigin)); + PIXI.TextureCache[imageUrl] = texture; + } + + return texture; +} + +/** + * + * Helper function that returns a texture based on a frame id + * If the frame id is not in the texture cache an error will be thrown + * @method fromFrame + * @param frameId {String} The frame id of the texture + * @return Texture + */ +PIXI.Texture.fromFrame = function(frameId) +{ + var texture = PIXI.TextureCache[frameId]; + if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache " + this); + return texture; +} + +/** + * + * Helper function that returns a texture based on a canvas element + * If the canvas is not in the texture cache it will be created and loaded + * @static + * @method fromCanvas + * @param canvas {Canvas} The canvas element source of the texture + * @return Texture + */ +PIXI.Texture.fromCanvas = function(canvas) +{ + var baseTexture = new PIXI.BaseTexture(canvas); + return new PIXI.Texture(baseTexture); +} + + +/** + * + * Adds a texture to the textureCache. + * @static + * @method addTextureToCache + * @param texture {Texture} + * @param id {String} the id that the texture will be stored against. + */ +PIXI.Texture.addTextureToCache = function(texture, id) +{ + PIXI.TextureCache[id] = texture; +} + +/** + * + * Remove a texture from the textureCache. + * @static + * @method removeTextureFromCache + * @param id {String} the id of the texture to be removed + * @return {Texture} the texture that was removed + */ +PIXI.Texture.removeTextureFromCache = function(id) +{ + var texture = PIXI.TextureCache[id] + PIXI.TextureCache[id] = null; + return texture; +} + +// this is more for webGL.. it contains updated frames.. +PIXI.Texture.frameUpdates = []; + + +/** + * @author Mat Groves http://matgroves.com/ @Doormat23 + */ + +/** + * A RenderTexture is a special texture that allows any pixi displayObject to be rendered to it. + * @class RenderTexture + * @extends Texture + * @constructor + * @param width {Number} + * @param height {Number} + */ +PIXI.RenderTexture = function(width, height) +{ + PIXI.EventTarget.call( this ); + + this.width = width || 100; + this.height = height || 100; + + this.indetityMatrix = PIXI.mat3.create(); + + this.frame = new PIXI.Rectangle(0, 0, this.width, this.height); + + if(PIXI.gl) + { + this.initWebGL(); + } + else + { + this.initCanvas(); + } +} + +PIXI.RenderTexture.constructor = PIXI.RenderTexture; +PIXI.RenderTexture.prototype = Object.create( PIXI.Texture.prototype ); + +PIXI.RenderTexture.prototype.initWebGL = function() +{ + var gl = PIXI.gl; + this.glFramebuffer = gl.createFramebuffer(); + + gl.bindFramebuffer(gl.FRAMEBUFFER, this.glFramebuffer ); + + this.glFramebuffer.width = this.width; + this.glFramebuffer.height = this.height; + + this.baseTexture = new PIXI.BaseTexture(); + + this.baseTexture.width = this.width; + this.baseTexture.height = this.height; + + this.baseTexture._glTexture = gl.createTexture(); + gl.bindTexture(gl.TEXTURE_2D, this.baseTexture._glTexture); + + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, this.width, this.height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + + 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); + + this.baseTexture.isRender = true; + + gl.bindFramebuffer(gl.FRAMEBUFFER, this.glFramebuffer ); + gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.baseTexture._glTexture, 0); + + // create a projection matrix.. + this.projectionMatrix = PIXI.mat4.create(); + + this.projectionMatrix[5] = 2/this.height// * 0.5; + this.projectionMatrix[13] = -1; + + this.projectionMatrix[0] = 2/this.width; + this.projectionMatrix[12] = -1; + + // set the correct render function.. + this.render = this.renderWebGL; +} + +PIXI.RenderTexture.prototype.initCanvas = function() +{ + this.renderer = new PIXI.CanvasRenderer(this.width, this.height, null, 0); + + this.baseTexture = new PIXI.BaseTexture(this.renderer.view); + this.frame = new PIXI.Rectangle(0, 0, this.width, this.height); + + this.render = this.renderCanvas; +} + +/** + * This function will draw the display object to the texture. + * @method render + * @param displayObject {DisplayObject} + * @param clear {Boolean} If true the texture will be cleared before the displayObject is drawn + */ +PIXI.RenderTexture.prototype.renderWebGL = function(displayObject, clear) +{ + var gl = PIXI.gl; + + // enable the alpha color mask.. + gl.colorMask(true, true, true, true); + + gl.viewport(0, 0, this.width, this.height); + + gl.bindFramebuffer(gl.FRAMEBUFFER, this.glFramebuffer ); + + if(clear) + { + gl.clearColor(0,0,0, 0); + gl.clear(gl.COLOR_BUFFER_BIT); + } + + // THIS WILL MESS WITH HIT TESTING! + var children = displayObject.children; + + //TODO -? create a new one??? dont think so! + displayObject.worldTransform = PIXI.mat3.create();//sthis.indetityMatrix; + + for(var i=0,j=children.length; i|9N1b{+0CzoHzd}TvrKgS2afqR}W)na}W_T zM-y{m8GB<(b5(O=GcTt}bAAvIaB^#PZC7mtd0taTdq(5`$S``^1OA~wK=_3`0mi1b z=B~sh=9bnD0;IRy{iMX!W&)&I916?|05NkbYiVz1b2V>8byII!Qyw!?Awgn(Pu_n7 z_U5j}#Gdwc4lcZ&0;K=N%lohWpJ66a;{OtHwG|-!Uq)#wC=-i0I-3)7FtRb2GPAG{ zb8<4Wuyb&7vd|N=GPAHUG5@Cr^k8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%0;JH*sig~9j<-%Z36o%)r^z6LFbw5z8xpGFJT4@6plOwSQ}z+u z0PY*f8s}Ou`QO}7TMlG=xB|j*Xqj*Rb&--~H*Pz){eJ-l0CWm>{-|WX4FCWD07*qo IM6N<$g6^4=CjbBd literal 0 HcmV?d00001 diff --git a/examples/example 13 - Graphics/spinObj_02.png b/examples/example 13 - Graphics/spinObj_02.png new file mode 100644 index 0000000000000000000000000000000000000000..a140876d7e1c2f049a54f7510ab1733b3a3b4a0b GIT binary patch literal 37746 zcmbTdbx>VVvoCmXhXi+rpa*w%cMk6E9NdG4;O_43?h@SHo#5^eAWXh{-+eQGyqc++ zU3)L>{v;tYyNY=!~QF4kvXsaRd}uvTCQr27Ooz~ z&gK9SGe;A1QW<+=OLJ9oV>2(OF>`(Z0Lsc*UCUKVL7vyt(H?009~z*iJ@_9t0KhNg z2{tyhHFqU7F}JjK5Fo$q>?J3)HWMJ%piC;}=xk2P0c2w| zWoBU^<>Umiuyb&7vM`XcGPAHUG5BgdawZY3o#mm9f*pt!0h2nn@#LZnyovp#H z){YLO|3Nf1addMPApfW7f16+rR#5ogzz#0|%TfPa#^h-XW?}&{Guhk!$FBdPc5ziT z|G(AvKT^A>dx6cFRLxx+-JDJTt%n80|1kga-T%9w{}BGuhF8hi`ro1$+lf1xy4jmM zxXOqNkpG(jnpvCiii(JdF>^3WFiWzsaB{P-a5HnWiHL|xh)ObxOLDRD{13+eiI;_& zTbz?!lt)yAOOk~}f>nf@l|x*TTjXEK%FM|r{y)4j4lb_74yNY+BiH($-2cVP{r}3# zE9Pu&?CR*O?&xUuKM|m8<>>0@V&w=X6;tCRrBN_8wRZT=0PTMk=)dh1H+QynH#d`X zcC;t`FAwut{~t8?|F-bla-E|>)uTo?F7n)D0o zQ5dpWLxTKWVkj~ho7s`^4|!2ePk2h?G0OK42Ffo3=%fJ$0or!hOrEJ`V+~J-XIIZT z#hsOZpWiAvlyWO=wNt2q@eDf`EiV`JKb|zNTj{-13fb-~Qw2D2>G)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r@zJ0?C?pM2y>DxoKrdmm zP?X(Nb`ylK-olh2y=1q{mpS|3tc6}+tIS!lG=2@2hN7jv7-*I@5pY$RxARmFhTW*U1hbmcWu*bs%5t9wI1A~ctCG_Uy<94+Z0X(C zo44c3DHO7#n+9Bc8MvEcd*jH1KFbM6)?{@XrJ|r7GW<_RX=W#%H&jwnl)vGks58U8 zh(O@Pn%76T=n|Ax#WQBY_n4?6Sw;UhL{%DUGxgsujPCK@Dd27d=4Z1nMmkY-1XW#< z1sBDTy&NYe9Sw0^f5lCys3ywh8R56K<|I~HS($u$5w$CoY2SfisKMPc>hkR;6u5p( zUUDewu@O&=`WPa>R&m|XYh`P|t!$~4ezNchcFuIfVV#Q8C_Iwci^~-|rLp5w5BG(D z+2+Lo^kv{)9MG<<6`SiLLQt#n`s0YPE?eV$>@6x z%dDOji(3IS0N0hT)x%=GWXe|Ty{lQ*3d}|1xbfwbZ|cQ=9wwV#2JU)p$(l|~5Oud@ zWI#tQnvZyHoswy`ZETt7kF3golRHcSnG19zd@k98`L>#vgmk+Px zWo$x6fiA7$R#IP52VMJHzvv_;^$w#GHJeBPEi0$Ro6I8<$6 zucYLSxLl=FYWeAE5+~CO6De<*C_WuWlKm>H#)WWllgq%pbYLFXr7a8Ab<~Iw*D6#D zRhOfWs%)Anov84BE(9P%DhgrBA&yb;@Q{emrEq8HR90mTT-~DkhzDPoMf@^wFIk%5 zqlADS=!dHmUyYO=>aq}~k~XQ9?_x;HppBB$YCxe7!0wZpq9vZT%#Ql6kUjl%W=pqPQH@SSG zE(7=MEKilLn-xn}bsL8v0J>zydLT@uA_%L<@d{SCiUa#7OIB4Tn72-7>N0RIWosPI ziizK|wXz%)>ESX6)7mm${dH0X%P!wGaQpuP3;=(~rFKX*(9Zw>002ovPDHLkV1l!w B%W41s literal 0 HcmV?d00001 diff --git a/examples/example 13 - Graphics/spinObj_03.png b/examples/example 13 - Graphics/spinObj_03.png new file mode 100644 index 0000000000000000000000000000000000000000..82532c791e32b15ea1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.png b/examples/example 13 - Graphics/spinObj_04.png new file mode 100644 index 0000000000000000000000000000000000000000..9c790c370a456370c9c939e679141ca6ed4ff633 GIT binary patch literal 35136 zcmbSxWl$!~vL^1XgS)%CySux)!{F}jF!+nRySp>M;LeM?GdRr7cg{U`_s5Ohi0$aE zs;rMstz zs|ARNxs#~{v5bR>m4&K>iMhASqy;|+2)MP4y0*Kvf;_L8lLMp4KQxS94$gnMK|uJ0 zyqrzU>@3`gO)ac!90f>ky8B6qZOjEowKx=*6`aK^tZk%yTrJdm6xGdq?96z~NreQ7 z`Mr4m0ytQ>n-F_B*gLxMdI^yJ3zzqA`=4$mQsRG+xZ4Sk{#z++1!ZC}Cszw%4n{Tx zGiDYRVopv*7IqF!P8ND%R%RAfCg#5i z-DSiDNdG=zG`BJ56%`Q^W9DF%V3uTM;pApv;b!J$6A=-Y5S3&Wm*isQ`47hb#LFrs zCh?byT~vfil7&TrRfLCM{~xb0{Z)qPpYZrU!sS0*e`D~U=6?tO-<$uQJ{FFD=Zx#$ z$#M2ru>}GW?kFQJqVBbE*$ca6A*I38Rb_kQ*7u+w;4k1=&X<==9wtsqA`c3SLMZ}O zf4c-vd%EoDFX(sU-Pw21d+uBGEF178{tG%LMhgQ`Ryfigbw?D}T6V}Yfw)v7<)%k*B{1c5%l&QS(Jn$(jPoY$Jz9NaZ2 z@cb^JOnjqBo=n#O*?hWnegB=uh3Z4y9>4r>sUveEK^*jtzURq+p95Yc<1v9Qx%(%E z2_~tZ=jc5eK zHxq6|A_c&*p`gt7%Zq~-tH=)>U_P_7fB%wNmr)Zn=r;i$A@TiabxsIFs$Cb*9t3R> z2GH&|Z&uhe5FXhFE0GU*usR~rV?}IbHc&eV06ZE8W3ntri5~+;E6B{`vv-#K9G;OK z(STmB6!8*Al-e)Z8}wFy%+S#Kq!j9WG{(~$*t5-tRY4c}lAunRfsk;t8ZBEx+dDBy zD?w7z{G1Nkx~h%6OQ6N!#85fx57~~|?;OaQ_j*jKTChOOrIZ~Z_^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DxgLcD*$P2c<-%&(^L#pro^2=@OrWB2p0~bw<@02!dMkVAeLur>}^a8)QP; zq|&$wng2_!N~r!w*Np943u{^a*oQTjT;i zj$(6vM4?M?7WLbh0oP|iTWpv9yipob8cT}^l>#o|v{qn34hsEyX>7f54>UcNqWqXO z5j8n(XeF(747lMIaCh(KHlB~Ib+aWOHwQy(zcXaZelwp{WNszX`y5Qv-K1+OHW1 ze8_?_7*1EE1{=uCVp6E`+V~E}tV!HgZg|NB9rW~>d(bHU>C4pq7-DuJVjJ)^{R)t| z5xZd&Z-#{NO>c2G3*3+m^J!NiBwyDJ`g0ae+#%b%q=8m*0l}mOl9g@e-<*A!kD(nCuF)tO`#xb z0-|P}=-W(1t%Zq(lH6q%P@zGe)qaKAw2>DK5h%9V1$7s8CEa=pxHqnw5#w;+lh4B? zAD0_mTwBUb0bN6fs^G3+*e^C}aYHlZYlcPCG9ae8I|gW>tAcAUl4jINfgR1Q+xIST zM>9dGm{4aynhrnYGgS?7jm!Mtj83xwyixbTjR9(G1|Be_6E0rw}5+t z06FtDL6^;#O&c5SHAsP+k0WU^)A9`reQ7h!(dL1p9nLz$Tn+n{dA$YPYqG{!{&on9 xu4Qm({MT%0Pd&A{|C-Ww;BMh^%eVg*U;qpd%mH+{H3k3x002ovPDHLkV1ikY^>P3J literal 0 HcmV?d00001 diff --git a/examples/example 13 - Graphics/spinObj_05.png b/examples/example 13 - Graphics/spinObj_05.png new file mode 100644 index 0000000000000000000000000000000000000000..ebb28c84ca0e9830b6345ad75153fd51a58b0c77 GIT binary patch literal 36128 zcmbTbbC4&&w=dYXZQHhO+qP|E+S9ge+x)h>r)}FkZSVZ24uIi(pX6j>W%56p>C_u#L#q*DW zy}6q)k(a%lgDa00Kgoab<@wkCPd6h8(SMP++47V8w^Ca2N<^ZLF6Kn+46O8~Ow7zg z92^YHZ0sBy%ydL7Ow25dO#f~UdS*5rb`BmEPNM&Hk^Gb9VrIdkA|~;_Wc_>NC$VyK zbK+rS^z`&(@ML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4JAnB9{lClR<}9*GyKJq!o4GfCm@6Ta*fxa_ekt0e3CY*oq$ZMz*98 v;f!0cwA+%qnt<#2Xr6B^`>VYDe*p#nqevTQ!E#gZ00000NkvXXu0mjf42N4T literal 0 HcmV?d00001 diff --git a/examples/example 13 - Graphics/spinObj_06.png b/examples/example 13 - Graphics/spinObj_06.png new file mode 100644 index 0000000000000000000000000000000000000000..1dec5c810de56b3db1d402fe7d66096df65c528a GIT binary patch literal 36751 zcmbTdbCmDEw=dZ4Z`-zQ+qSLKwr$(C&C|AR+qT{3bkF(S`|g|h?6?0iEEh3N7ZrOm7k48kQy?J| z`(LJnQnp6srpl&9CZ3KHro2Evpca;@nl74hvfRe@w)95-p`rJ%b@;~(1jH-g;b3HJ zZR$e!%hcS`j*s}RtB;t_(u9v#gH4W6&OyY~!cx-9$yCKlUe(yk+L+6PSb(39*Ms{X zfUT*E5ut~zjh!>M2Osf&;d1{g|EHRPnDD zLUwj~CRR3fb|zXvW=1Av2F8CoI~@}%Hyb-QGY8@S+KB&2b22gGRu&ciU$Xw4@ey0N zxHxb#Fu1$B)4Q|K+dG*vFmZ8l{Re}YneHD2owKK%i;)MNoioY*Ac&ee8#`G#xLDfT z5&j3!=$E~#3m@@6P5;{jTL(G0{|#*C{J$La&t(iAMh*;2^o$I)w*Rr~zo?yEluiF{ zHU5v(&Z?dcrVPra&i1ZO#{b&GjO2fq|M~9!UC@6B|7pXm;AHu)QH*Rv?TuY+P3>Hy zMEQvSU79*bivK(K|DF8r?qh2Aug^IB z>l{ZjRBAv#(LGY4LaH8{*FBK!rW&r~?QWcB+ujC#_4=l2snWtoM2Q3JAc0^IxEA3b zxDCH|){h*|nHcltSnxMr+sB5?{o60>6ucXl+Ohf}f&cwt2F4u~`bw>IQ zxzYUH4>)9P`yN5&*5JA+tj3i3+()=3Hupvn?$E|KZ3NQa^TW!&bMFKkH?2c)0_Wia z#8Wvm9?f-utbsqF+0nps+h^+j;Jq!A`9rs3z$>qfc?AV(G06an%;nk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*JtC>J`&E_Wl*8z-fU}tR_&P?0p2t^-lKSw)xf@A1?~{wZbJJt*fAAR z3fn%=ieOJ;nkbexqW&#k&5}c0la`2!%j|Ms<*e7|CdfYE@;q5Jjh7Ap)kYp}+-}5W z=k2wLZbahkDsZvui+nt}BQxV~@j8bMc@}&Eha=jy-s2So-Uj^=E18#j%VjngQ-zSG;G?S2P5kh^@gA`VIRn*KJrj|OQrTd$Bj>5O3fwCXxM^eo zQ*X!QK>oIBX;&EIT6TkptZcLe#B|wr`BI4)-ed%AE?It^)Up z2X5UdrTbg~+1I68H{;YEr}H*D_Ci%?&@}4+>mtC{E`l4#_qugOh;+y7?27`p-+q;| ztqV_TR;i_@%07*qoM6N<$g4w&3IsgCw literal 0 HcmV?d00001 diff --git a/examples/example 13 - Graphics/spinObj_07.png b/examples/example 13 - Graphics/spinObj_07.png new file mode 100644 index 0000000000000000000000000000000000000000..e14a0215fbb470074651269a9484d1976121672c GIT binary patch literal 35407 zcmbTdb95$AyDu2qwr$(Ct&aW1Had1Xwrx9aIyO4y8{6rigP#7*x#!OOao5aRQ>$vL zp5NnLt5((CF={HZ$Or@oU|?X#@^Vrd|LTVSTyQY|%0?ufn|~F)hqRuDrn9w&x0#z2 zn7F00xfPi_z|6)$Lr+;rz`_~8V)h>z79W7iKQtJakf@J~ znT3Ou2bsB*jh&M)#cl5(1(}_tFoiC+GMloCq?N6moS&POrk{$Ig`a~3za@pJ2$_(N zz&{26D-Sa=AAqBiyMT`{#eeY?_}Bi=Fe?Swf01}N2vhvGQhLg2WRlKqR%F~PoXi$% z?CfMbJS^;7+&nz&Ok^Bv>>R9Y|4treb}j*K9sv$svj25Z{FCNpX)T~3CG)>z{p$%+ z*m`)l2(Yqxdwa8ZbFw(Q*|4(n^Yj0Q2L}i9KMH1dUndVUA7&?a%KzaYW#w++X6NEz z=j=rGAC6|`&Ym8^6#q2+ZxaA6%F6$nv6K7%a@0SUvHF;~u(GqTu>t`9vFpF6-90p{ z{%OFK&e32{kDH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=!#(oRB%5iuzylN3AH4dK=v_GUp*6>}A2?jEPM;dYA$_v3kj1W%V8< zEtXVZn)`z9pQa&s5pU0f&Y4$Ppej^YwW^NmV4x9gl?y4GrS1309}lAD2jrN~1>JQz z=eIAK5dydnt)$Ei>76!)vmf4T0Y!4VoTtS&1ZTX+u+_Fk{cLmT6h>jPnpj_T$foK@wnf7d^s@qc;A$0@vH#z^X6-OH5@!kkTp#m%vc}}AZ5`d*@9LKUF*&7m3Sr5fk;0l^B)_Cd*%)_?%<9U$Q z$6=yin9Iu5x$yf&Q%}w$xyr)O8E{usq{t<=D|odk8dmh|XrL1EI5=Ru8KJ0q?DKxi zp~MuJ!+@28HJGC7T0ewSVxm=iyh1m8`Sh__pSs2}QfC8L@o_m;UHZkitSWZvJ+534H zko??*v)Fyq9Pthip5O}{l*61&U!au z9A^^zeQWLkZ)9mt3%Ga&+|x3?qiFlU3(y?S>iXcOSMo+IjaZeLJuowhsNUZrl_H2& zz4{6SZh=P{E?7VrD___HLvKZv8<>EVHN>j>ER=3E z57y*7rIMr=WfZIeC`~n0H7}Td8|xsk;>z;rjJ_II%CX96SA@NuzYcJA`~L~te7GpN zvD8z;S}2d{|DawU+K01*KK+2n*>x z%%_|Pz%$@J8_*td6gvc?3b!l;RJ{-baGS9oI|N@8=wR-vz|F> zR&J%=A$ZgJm`~2YCoy%An*0C=asqR(q zJgPVOB+m>~gPXZ(0_u!9$^rBM3;#0}z4at`FT>!62eYtN_LY7Gn^gA4<^_wMD?fNG zyZ9M!pI1noVZZGgUsJ46*WqD>}^q@L=vkTmslCbKvwvdBJ)0 z&alCCNYA+iJOl3Y6Zg5ViMDO#YT6i#&BX(`dK4F{4zILOU>Jh5Di55~IP2hj$uCT5 z>I}Hgu{Eypw 50 * 50) + { + var perp3 = new PIXI.Point(perp.x - perp2.x, perp.y - perp2.y); + var dist3 = Math.sqrt(perp3.x*perp3.x + perp3.y*perp3.y); + perp3.x /= dist3; + perp3.y /= dist3; + perp3.x *= width; + perp3.y *= width; +// var perp = + verts.push(point2.x - perp3.x, point2.y -perp3.y); + verts.push(point2.x + perp3.x, point2.y +perp3.y); + verts.push(point2.x - perp3.x, point2.y -perp3.y); + // graphics.drawCircle(point2.x - (p.x-point2.x), point2.y - (p.y - point2.y), 4); + + } + else + { + + // context.fillRect(2,1,1,1); + verts.push(p.x , p.y); + verts.push(point2.x - (p.x-point2.x), point2.y - (p.y - point2.y));//, 4); + } + } + + var point1 = new PIXI.Point( points[(length-2)*2], points[(length-2)*2 + 1] ); + var point2 = new PIXI.Point( points[(length-1)*2], points[(length-1)*2 + 1] ); + + var perp = getPerp(point1, point2); + + var dist = Math.sqrt(perp.x*perp.x + perp.y*perp.y); + perp.x /= dist; + perp.y /= dist; + perp.x *= width; + perp.y *= width; + + verts.push(point2.x - perp.x , point2.y - perp.y) + verts.push(point2.x + perp.x , point2.y + perp.y) + + return new Float32Array(verts); +} + +function normalise(point) +{ + var dist = Math.sqrt(point.x * point.x + point.y * point.y); + return new PIXI.Point(point.x / dist, point.y / dist); +} + +function getPerp(point, point2) +{ + return new PIXI.Point(-(point.y - point2.y), point.x - point2.x); +} + +function lineIntersectLine(A,B,E,F) +{ + var ip; + var a1; + var a2; + var b1; + var b2; + var c1; + var c2; + + a1= B.y-A.y; + b1= A.x-B.x; + c1= B.x*A.y - A.x*B.y; + a2= F.y-E.y; + b2= E.x-F.x; + c2= F.x*E.y - E.x*F.y; + + var denom=a1*b2 - a2*b1; + + if (denom == 0) { + // return null; + denom+=1; + } + ip=new PIXI.Point(); + ip.x=(b1*c2 - b2*c1)/denom; + ip.y=(a2*c1 - a1*c2)/denom; + + //--------------------------------------------------- + //Do checks to see if intersection to endpoints + //distance is longer than actual Segments. + //Return null if it is with any. + //--------------------------------------------------- + + + return ip; +} + +/* +PIXI.Shape.prototype.convertPoints = function(points) +{ + var verts = [0, 0, 0, 0]; + + var total = points.length/2; +// var lastPoint = points[0]; + var lastPointX = points[0]; + var lastPointY = points[1]; + var nextPointX = 0; + var nextPointY = 0; + + var perp = {x:0, y:0}; + var pointX = points[0]; + var pointY = points[1]; + + for (var i = 1; i < total; i++) + { + + var pointX = points[i * 2]; + var pointY = points[i * 2 + 1]; + + var index = i * 4; + + if(i < points.length-2) + { + nextPointX = points[(i+1) * 2]; + nextPointY = points[(i+1) * 2 + 1]; + } + else + { + nextPointX = pointX; + nextPointY = pointY; + } + + perp.y = -(nextPointX - lastPointX); + perp.x = nextPointY - lastPointY; + + var ratio = (1 - (i / (total-1))) * 10; + if(ratio > 1)ratio = 1; + + var perpLength = Math.sqrt(perp.x * perp.x + perp.y * perp.y); + var num = 10; + perp.x /= perpLength; + perp.y /= perpLength; + + perp.x *= num; + perp.y *= num; + verts[index] = pointX + perp.x + verts[index+1] = pointY + perp.y + verts[index+2] = pointX - perp.x + verts[index+3] = pointY - perp.y + + lastPointX = pointX; + lastPointY = pointY; + } + + return new Float32Array(verts); +} +*/ +/** + * @private + */ +PIXI.Graphics.prototype.updateTransform = function() +{ + if(!this.visible)return; + + PIXI.DisplayObject.prototype.updateTransform.call( this ); + +} + diff --git a/src/pixi/primitives/Line.js b/src/pixi/primitives/Line.js new file mode 100644 index 0000000..282110d --- /dev/null +++ b/src/pixi/primitives/Line.js @@ -0,0 +1,37 @@ +/** + * @author Mat Groves http://matgroves.com/ @Doormat23 + */ + + +/** + * A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects. + * @class DisplayObjectContainer + * @extends DisplayObject + * @constructor + */ +PIXI.Line = function() +{ + PIXI.DisplayObject.call( this ); + + // style - color + // style - thickness + // alpha - +} + +// constructor +PIXI.Line.constructor = PIXI.Line; +PIXI.Line.prototype = Object.create( PIXI.DisplayObject.prototype ); + + + + +/** + * @private + */ +PIXI.DisplayObjectContainer.prototype.updateTransform = function() +{ + if(!this.visible)return; + + PIXI.DisplayObject.prototype.updateTransform.call( this ); + +} diff --git a/src/pixi/renderers/CanvasRenderer.js b/src/pixi/renderers/CanvasRenderer.js index 125cc9a..b35cdb9 100644 --- a/src/pixi/renderers/CanvasRenderer.js +++ b/src/pixi/renderers/CanvasRenderer.js @@ -197,6 +197,10 @@ PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject) { displayObject.renderCanvas(this); } + else if(displayObject instanceof PIXI.Graphics) + { + displayObject.render(this); + } // render! for (var i=0; i < displayObject.children.length; i++) diff --git a/src/pixi/renderers/WebGLRenderGroup.js b/src/pixi/renderers/WebGLRenderGroup.js index 75710a4..1f5a867 100644 --- a/src/pixi/renderers/WebGLRenderGroup.js +++ b/src/pixi/renderers/WebGLRenderGroup.js @@ -45,7 +45,6 @@ PIXI.WebGLRenderGroup.prototype.setRenderable = function(displayObject) PIXI.WebGLRenderGroup.prototype.render = function(projectionMatrix) { - PIXI.WebGLRenderer.updateTextures(); var gl = this.gl; @@ -75,6 +74,10 @@ PIXI.WebGLRenderGroup.prototype.render = function(projectionMatrix) { if(renderable.visible)this.renderStrip(renderable, projectionMatrix); } + else if(renderable instanceof PIXI.Graphics) + { + if(renderable.visible) renderable.renderWebGL(this, projectionMatrix); + } } } @@ -275,8 +278,9 @@ PIXI.WebGLRenderGroup.prototype.checkVisibility = function(displayObject, global child.textureChange = false; if(child.worldVisible) { - this.removeDisplayObject(child) - this.addDisplayObject(child) + this.removeDisplayObject(child); + this.addDisplayObject(child); + //this.updateTexture(child); } // update texture!! } @@ -288,6 +292,106 @@ PIXI.WebGLRenderGroup.prototype.checkVisibility = function(displayObject, global }; } +PIXI.WebGLRenderGroup.prototype.updateTexture = function(displayObject) +{ + // we know this exists.. + // is it in a batch.. + // check batch length + if(displayObject.batch.length == 1) + { + // just one! this guy! so simply swap the texture + displayObject.batch.texture = displayObject.texture.baseTexture; + return; + } + + // early out! + if(displayObject.batch.texture == displayObject.texture.baseTexture)return; + + + if(displayObject.batch.head == displayObject) + { + //console.log("HEAD") + var currentBatch = displayObject.batch; + + var index = this.batchs.indexOf( currentBatch ); + var previousBatch = this.batchs[index-1]; + currentBatch.remove(displayObject); + + if(previousBatch) + { + if(previousBatch.texture == displayObject.texture.baseTexture && previousBatch.blendMode == displayObject.blendMode) + { + previousBatch.insertAfter(displayObject, previousBatch.tail); + } + else + { + // add it before.. + var batch = PIXI.WebGLRenderer.getBatch(); + batch.init(displayObject); + this.batchs.splice(index-1, 0, batch); + } + + } + else + { + // we are 0! + var batch = PIXI.WebGLRenderer.getBatch(); + batch.init(displayObject); + this.batchs.splice(0, 0, batch); + } + + } + else if(displayObject.batch.tail == displayObject) + { + var currentBatch = displayObject.batch; + + var index = this.batchs.indexOf( currentBatch ); + var nextBatch = this.batchs[index+1]; + currentBatch.remove(displayObject); + + if(nextBatch) + { + if(nextBatch.texture == displayObject.texture.baseTexture && nextBatch.blendMode == displayObject.blendMode) + { + nextBatch.insertBefore(displayObject, nextBatch.head); + return; + } + else + { + // add it before.. + var batch = PIXI.WebGLRenderer.getBatch(); + batch.init(displayObject); + this.batchs.splice(index+1, 0, batch); + } + + } + else + { + // we are 0! + var batch = PIXI.WebGLRenderer.getBatch(); + batch.init(displayObject); + this.batchs.push(batch); + } + } + else + { + // console.log("MIDDLE") + var currentBatch = displayObject.batch; + + // split the batch into 2 + // AH! dont split on the current display object as the texture is wrong! + var splitBatch = currentBatch.split(displayObject); + + // now remove the display object + splitBatch.remove(displayObject); + + var batch = PIXI.WebGLRenderer.getBatch(); + var index = this.batchs.indexOf( currentBatch ); + batch.init(displayObject); + this.batchs.splice(index+1, 0, batch, splitBatch); + } +} + PIXI.WebGLRenderGroup.prototype.addDisplayObject = function(displayObject) { // add a child to the render group.. @@ -306,19 +410,16 @@ PIXI.WebGLRenderGroup.prototype.addDisplayObject = function(displayObject) var previousSprite = this.getPreviousRenderable(displayObject); var nextSprite = this.getNextRenderable(displayObject); - /* * so now we have the next renderable and the previous renderable * */ - if(displayObject instanceof PIXI.Sprite) { var previousBatch var nextBatch - //console.log( previousSprite) if(previousSprite instanceof PIXI.Sprite) { previousBatch = previousSprite.batch; @@ -415,6 +516,14 @@ PIXI.WebGLRenderGroup.prototype.addDisplayObject = function(displayObject) this.initStrip(displayObject); this.batchs.push(displayObject); } + else if(displayObject instanceof PIXI.Graphics) + { + //displayObject.initWebGL(this); + + // add to a batch!! + //this.initStrip(displayObject); + this.batchs.push(displayObject); + } // if its somthing else... then custom codes! this.batchUpdate = true; diff --git a/src/pixi/renderers/WebGLRenderer.js b/src/pixi/renderers/WebGLRenderer.js index acbf006..2b608c9 100644 --- a/src/pixi/renderers/WebGLRenderer.js +++ b/src/pixi/renderers/WebGLRenderer.js @@ -130,10 +130,10 @@ PIXI.WebGLRenderer.prototype.initShaders = function() gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute); shaderProgram.textureCoordAttribute = gl.getAttribLocation(shaderProgram, "aTextureCoord"); - gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute); + // gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute); shaderProgram.colorAttribute = gl.getAttribLocation(shaderProgram, "aColor"); - gl.enableVertexAttribArray(shaderProgram.colorAttribute); + // gl.enableVertexAttribArray(shaderProgram.colorAttribute); shaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, "uMVMatrix"); @@ -194,7 +194,9 @@ PIXI.WebGLRenderer.prototype.render = function(stage) gl.clearColor(stage.backgroundColorSplit[0],stage.backgroundColorSplit[1],stage.backgroundColorSplit[2], !this.transparent); gl.clear(gl.COLOR_BUFFER_BIT); - + // HACK TO TEST + PIXI.projectionMatrix = this.projectionMatrix; + this.stageRenderGroup.backgroundColor = stage.backgroundColorSplit; this.stageRenderGroup.render(this.projectionMatrix); From 74f5a3574c3a02fb988c7bbedaa9d227740e7a61 Mon Sep 17 00:00:00 2001 From: Mat Groves Date: Wed, 19 Jun 2013 18:20:06 +0100 Subject: [PATCH 02/68] Graphics Implemented --- bin/pixi.dev.js | 47 +- bin/pixi.js | 6 +- examples/example 1 - Basics/pixi.js | 47 +- examples/example 10 - Text/pixi.js | 47 +- examples/example 11 - RenderTexture/pixi.js | 47 +- examples/example 13 - Graphics/index.html | 47 +- examples/example 2 - SpriteSheet/pixi.js | 47 +- examples/example 3 - MovieClip/pixi.js | 47 +- examples/example 4 - Balls/pixi.js | 47 +- examples/example 5 - Morph/pixi.js | 47 +- examples/example 6 - Interactivity/pixi.js | 47 +- .../pixi.js | 47 +- examples/example 8 - Dragging/pixi.js | 47 +- examples/example 9 - Tiling Texture/pixi.js | 47 +- src/pixi/primitives/Graphics.js | 463 ++---------------- src/pixi/renderers/CanvasGraphics.js | 87 ++++ src/pixi/renderers/CanvasRenderer.js | 2 +- src/pixi/renderers/WebGLGraphics.js | 431 ++++++++++++++++ src/pixi/renderers/WebGLRenderGroup.js | 4 +- src/pixi/renderers/WebGLRenderer.js | 9 +- src/pixi/renderers/WebGLShaders.js | 34 ++ 21 files changed, 1124 insertions(+), 523 deletions(-) create mode 100644 src/pixi/renderers/CanvasGraphics.js create mode 100644 src/pixi/renderers/WebGLGraphics.js diff --git a/bin/pixi.dev.js b/bin/pixi.dev.js index 31f792b..9c9f528 100644 --- a/bin/pixi.dev.js +++ b/bin/pixi.dev.js @@ -4,7 +4,7 @@ * Copyright (c) 2012, Mat Groves * http://goodboydigital.com/ * - * Compiled: 2013-06-14 + * Compiled: 2013-06-19 * * Pixi.JS is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license.php @@ -2422,6 +2422,11 @@ PIXI.shaderVertexSrc = [ "}" ]; +/* + * primitive shader.. + */ + + PIXI.CompileVertexShader = function(gl, shaderSrc) { return PIXI._CompileShader(gl, shaderSrc, gl.VERTEX_SHADER); @@ -2447,6 +2452,35 @@ PIXI._CompileShader = function(gl, shaderSrc, shaderType) return shader; } +PIXI.activateDefaultShader = function() +{ + var gl = PIXI.gl; + var shaderProgram = PIXI.shaderProgram; + + gl.useProgram(shaderProgram); + + gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute); + gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute); + gl.enableVertexAttribArray(shaderProgram.colorAttribute); +} + +PIXI.activatePrimitiveShader = function() +{ + var gl = PIXI.gl; + + gl.disableVertexAttribArray(PIXI.shaderProgram.textureCoordAttribute); + gl.disableVertexAttribArray(PIXI.shaderProgram.colorAttribute); + + var shaderProgram2 = PIXI.shaderProgram2; + + gl.useProgram(shaderProgram2); + + gl.enableVertexAttribArray(shaderProgram2.vertexPositionAttribute); + gl.enableVertexAttribArray(PIXI.shaderProgram2.colorAttribute); + +} + + /** * @author Mat Groves http://matgroves.com/ @Doormat23 */ @@ -2505,9 +2539,9 @@ PIXI.WebGLRenderer = function(width, height, view, transparent) throw new Error(" This browser does not support webGL. Try using the canvas renderer" + this); } + PIXI.WebGLGraphics.initShaders(); this.initShaders(); - var gl = this.gl; PIXI.WebGLRenderer.gl = gl; @@ -2576,17 +2610,16 @@ PIXI.WebGLRenderer.prototype.initShaders = function() gl.useProgram(shaderProgram); shaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, "aVertexPosition"); - gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute); shaderProgram.textureCoordAttribute = gl.getAttribLocation(shaderProgram, "aTextureCoord"); - gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute); shaderProgram.colorAttribute = gl.getAttribLocation(shaderProgram, "aColor"); - gl.enableVertexAttribArray(shaderProgram.colorAttribute); shaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, "uMVMatrix"); shaderProgram.samplerUniform = gl.getUniformLocation(shaderProgram, "uSampler"); + + PIXI.activateDefaultShader(); } @@ -3427,7 +3460,7 @@ PIXI.WebGLRenderGroup.prototype.render = function(projectionMatrix) PIXI.WebGLRenderer.updateTextures(); var gl = this.gl; - + // set the flipped matrix.. gl.uniformMatrix4fv(PIXI.shaderProgram.mvMatrixUniform, false, projectionMatrix); @@ -3455,7 +3488,7 @@ PIXI.WebGLRenderGroup.prototype.render = function(projectionMatrix) } else if(renderable instanceof PIXI.Graphics) { - if(renderable.visible) renderable.renderWebGL(this, projectionMatrix); + if(renderable.visible) PIXI.WebGLGraphics.renderGraphics(renderable);//, projectionMatrix); } } diff --git a/bin/pixi.js b/bin/pixi.js index 0c19198..d838c38 100644 --- a/bin/pixi.js +++ b/bin/pixi.js @@ -4,10 +4,10 @@ * Copyright (c) 2012, Mat Groves * http://goodboydigital.com/ * - * Compiled: 2013-06-14 + * Compiled: 2013-06-19 * * Pixi.JS is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license.php */ -(function(){function t(t){return[(255&t>>16)/255,(255&t>>8)/255,(255&t)/255]}function e(){return r.Matrix="undefined"!=typeof Float32Array?Float32Array:Array,r.Matrix}var i=this,r=r||{};r.Point=function(t,e){this.x=t||0,this.y=e||0},r.Point.prototype.clone=function(){return new r.Point(this.x,this.y)},r.Point.constructor=r.Point,r.Rectangle=function(t,e,i,r){this.x=t||0,this.y=e||0,this.width=i||0,this.height=r||0},r.Rectangle.prototype.clone=function(){return new r.Rectangle(this.x,this.y,this.width,this.height)},r.Rectangle.constructor=r.Rectangle,r.DisplayObject=function(){this.position=new r.Point,this.scale=new r.Point(1,1),this.pivot=new r.Point(0,0),this.rotation=0,this.alpha=1,this.visible=!0,this.worldVisible=!1,this.parent=null,this.stage=null,this.hitArea=null,this.worldAlpha=1,this.color=[],this.worldTransform=r.mat3.create(),this.localTransform=r.mat3.create(),this.dynamic=!0,this._sr=0,this._cr=1,this.childIndex=0,this.renderable=!1,this.interactive=!1,this.buttonMode=!1},r.DisplayObject.constructor=r.DisplayObject,r.DisplayObject.prototype.setInteractive=function(t){this.interactive=t,this.stage&&(this.stage.dirty=!0)},r.DisplayObject.prototype.updateTransform=function(){this.rotation!=this.rotationCache&&(this.rotationCache=this.rotation,this._sr=Math.sin(this.rotation),this._cr=Math.cos(this.rotation));var t=this.localTransform,e=this.parent.worldTransform,i=this.worldTransform;t[0]=this._cr*this.scale.x,t[1]=-this._sr*this.scale.y,t[3]=this._sr*this.scale.x,t[4]=this._cr*this.scale.y;var r=this.pivot.x,s=this.pivot.y;t[2]=this.position.x-t[0]*r-s*t[1],t[5]=this.position.y-t[4]*s-r*t[3];var n=t[0],a=t[1],o=t[2],h=t[3],u=t[4],d=t[5],c=e[0],l=e[1],p=e[2],f=e[3],x=e[4],v=e[5];i[0]=c*n+l*h,i[1]=c*a+l*u,i[2]=c*o+l*d+p,i[3]=f*n+x*h,i[4]=f*a+x*u,i[5]=f*o+x*d+v,this.worldAlpha=this.alpha*this.parent.worldAlpha},r.DisplayObjectContainer=function(){r.DisplayObject.call(this),this.children=[],this.renderable=!1},r.DisplayObjectContainer.constructor=r.DisplayObjectContainer,r.DisplayObjectContainer.prototype=Object.create(r.DisplayObject.prototype),r.DisplayObjectContainer.prototype.addChild=function(t){void 0!=t.parent&&t.parent.removeChild(t),t.parent=this,t.childIndex=this.children.length,this.children.push(t),this.stage&&this.stage.__addChild(t),this.__renderGroup&&(t.__renderGroup&&t.__renderGroup.removeDisplayObjectAndChildren(t),this.__renderGroup.addDisplayObjectAndChildren(t))},r.DisplayObjectContainer.prototype.addChildAt=function(t,e){if(!(e>=0&&this.children.length>=e))throw Error(t+" The index "+e+" supplied is out of bounds "+this.children.length);void 0!=t.parent&&t.parent.removeChild(t),e==this.children.length?this.children.push(t):this.children.splice(e,0,t),t.parent=this,t.childIndex=e;for(var i=this.children.length,r=e;i>r;r++)this.children[r].childIndex=r;this.stage&&this.stage.__addChild(t),this.__renderGroup&&(t.__renderGroup&&t.__renderGroup.removeDisplayObjectAndChildren(t),this.__renderGroup.addDisplayObjectAndChildren(t))},r.DisplayObjectContainer.prototype.swapChildren=function(t,e){var i=this.children.indexOf(t),r=this.children.indexOf(e);if(-1===i||-1===r)throw Error(t+" Both the supplied DisplayObjects must be a child of the caller "+this);this.stage&&(this.stage.__removeChild(t),this.stage.__removeChild(e),this.stage.__addChild(t),this.stage.__addChild(e)),t.childIndex=r,e.childIndex=i,this.children[i]=e,this.children[r]=t},r.DisplayObjectContainer.prototype.getChildAt=function(t){if(t>=0&&this.children.length>t)return this.children[t];throw Error(child+" Both the supplied DisplayObjects must be a child of the caller "+this)},r.DisplayObjectContainer.prototype.removeChild=function(t){var e=this.children.indexOf(t);if(-1===e)throw Error(t+" The supplied DisplayObject must be a child of the caller "+this);this.stage&&this.stage.__removeChild(t),t.__renderGroup&&t.__renderGroup.removeDisplayObjectAndChildren(t),t.parent=void 0,this.children.splice(e,1);for(var i=e,r=this.children.length;r>i;i++)this.children[i].childIndex-=1},r.DisplayObjectContainer.prototype.updateTransform=function(){if(this.visible){r.DisplayObject.prototype.updateTransform.call(this);for(var t=0,e=this.children.length;e>t;t++)this.children[t].updateTransform()}},r.blendModes={},r.blendModes.NORMAL=0,r.blendModes.SCREEN=1,r.Sprite=function(t){r.DisplayObjectContainer.call(this),this.anchor=new r.Point,this.texture=t,this.blendMode=r.blendModes.NORMAL,this._width=0,this._height=0,t.baseTexture.hasLoaded?this.updateFrame=!0:(this.onTextureUpdateBind=this.onTextureUpdate.bind(this),this.texture.addEventListener("update",this.onTextureUpdateBind)),this.renderable=!0},r.Sprite.constructor=r.Sprite,r.Sprite.prototype=Object.create(r.DisplayObjectContainer.prototype),Object.defineProperty(r.Sprite.prototype,"width",{get:function(){return this.scale.x*this.texture.frame.width},set:function(t){this.scale.x=t/this.texture.frame.width,this._width=t}}),Object.defineProperty(r.Sprite.prototype,"height",{get:function(){return this.scale.y*this.texture.frame.height},set:function(t){this.scale.y=t/this.texture.frame.height,this._height=t}}),r.Sprite.prototype.setTexture=function(t){this.texture.baseTexture!=t.baseTexture&&(this.textureChange=!0),this.texture=t,this.updateFrame=!0},r.Sprite.prototype.onTextureUpdate=function(){this._width&&(this.scale.x=this._width/this.texture.frame.width),this._height&&(this.scale.y=this._height/this.texture.frame.height),this.updateFrame=!0},r.Sprite.fromFrame=function(t){var e=r.TextureCache[t];if(!e)throw Error("The frameId '"+t+"' does not exist in the texture cache"+this);return new r.Sprite(e)},r.Sprite.fromImage=function(t){var e=r.Texture.fromImage(t);return new r.Sprite(e)},r.MovieClip=function(t){r.Sprite.call(this,t[0]),this.textures=t,this.currentFrame=0,this.animationSpeed=1,this.loop=!0,this.onComplete=null,this.playing},r.MovieClip.constructor=r.MovieClip,r.MovieClip.prototype=Object.create(r.Sprite.prototype),r.MovieClip.prototype.stop=function(){this.playing=!1},r.MovieClip.prototype.play=function(){this.playing=!0},r.MovieClip.prototype.gotoAndStop=function(t){this.playing=!1,this.currentFrame=t;var e=0|this.currentFrame+.5;this.setTexture(this.textures[e%this.textures.length])},r.MovieClip.prototype.gotoAndPlay=function(t){this.currentFrame=t,this.playing=!0},r.MovieClip.prototype.updateTransform=function(){if(r.Sprite.prototype.updateTransform.call(this),this.playing){this.currentFrame+=this.animationSpeed;var t=0|this.currentFrame+.5;this.loop||this.textures.length>t?this.setTexture(this.textures[t%this.textures.length]):t>=this.textures.length&&(this.gotoAndStop(this.textures.length-1),this.onComplete&&this.onComplete())}},r.Text=function(t,e){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"),r.Sprite.call(this,r.Texture.fromCanvas(this.canvas)),this.setText(t),this.setStyle(e),this.updateText(),this.dirty=!1},r.Text.constructor=r.Text,r.Text.prototype=Object.create(r.Sprite.prototype),r.Text.prototype.setStyle=function(t){t=t||{},t.font=t.font||"bold 20pt Arial",t.fill=t.fill||"black",t.align=t.align||"left",t.strokeThickness=t.strokeThickness||0,t.wordWrap=t.wordWrap||!1,t.wordWrapWidth=t.wordWrapWidth||100,this.style=t,this.dirty=!0},r.Sprite.prototype.setText=function(t){this.text=""+t||" ",this.dirty=!0},r.Text.prototype.updateText=function(){this.context.font=this.style.font;var t=this.text;this.style.wordWrap&&(t=this.wordWrap(this.text));for(var e=t.split(/(?:\r\n|\r|\n)/),i=[],s=0,n=0;e.length>n;n++){var a=this.context.measureText(e[n]).width;i[n]=a,s=Math.max(s,a)}this.canvas.width=s+this.style.strokeThickness;var o=this.determineFontHeight("font: "+this.style.font+";")+this.style.strokeThickness;for(this.canvas.height=o*e.length,this.context.fillStyle=this.style.fill,this.context.font=this.style.font,this.context.strokeStyle=this.style.stroke,this.context.lineWidth=this.style.strokeThickness,this.context.textBaseline="top",n=0;e.length>n;n++){var h=new r.Point(this.style.strokeThickness/2,this.style.strokeThickness/2+n*o);"right"==this.style.align?h.x+=s-i[n]:"center"==this.style.align&&(h.x+=(s-i[n])/2),this.style.stroke&&this.style.strokeThickness&&this.context.strokeText(e[n],h.x,h.y),this.style.fill&&this.context.fillText(e[n],h.x,h.y)}this.updateTexture()},r.Text.prototype.updateTexture=function(){this.texture.baseTexture.width=this.canvas.width,this.texture.baseTexture.height=this.canvas.height,this.texture.frame.width=this.canvas.width,this.texture.frame.height=this.canvas.height,this._width=this.canvas.width,this._height=this.canvas.height,r.texturesToUpdate.push(this.texture.baseTexture)},r.Text.prototype.updateTransform=function(){this.dirty&&(this.updateText(),this.dirty=!1),r.Sprite.prototype.updateTransform.call(this)},r.Text.prototype.determineFontHeight=function(t){var e=r.Text.heightCache[t];if(!e){var i=document.getElementsByTagName("body")[0],s=document.createElement("div"),n=document.createTextNode("M");s.appendChild(n),s.setAttribute("style",t),i.appendChild(s),e=s.offsetHeight,r.Text.heightCache[t]=e,i.removeChild(s)}return e},r.Text.prototype.wordWrap=function(t){for(var e=function(t,e,i,r,s){var n=Math.floor((r-i)/2)+i;return n==i?1:s>=t.measureText(e.substring(0,n)).width?t.measureText(e.substring(0,n+1)).width>s?n:arguments.callee(t,e,n,r,s):arguments.callee(t,e,i,n,s)},i=function(t,i,r){if(r>=t.measureText(i).width||1>i.length)return i;var s=e(t,i,0,i.length,r);return i.substring(0,s)+"\n"+arguments.callee(t,i.substring(s),r)},r="",s=t.split("\n"),n=0;s.length>n;n++)r+=i(this.context,s[n],this.style.wordWrapWidth)+"\n";return r},r.Text.prototype.destroy=function(t){t&&this.texture.destroy()},r.Text.heightCache={},r.BitmapText=function(t,e){r.DisplayObjectContainer.call(this),this.setText(t),this.setStyle(e),this.updateText(),this.dirty=!1},r.BitmapText.constructor=r.BitmapText,r.BitmapText.prototype=Object.create(r.DisplayObjectContainer.prototype),r.BitmapText.prototype.setText=function(t){this.text=t||" ",this.dirty=!0},r.BitmapText.prototype.setStyle=function(t){t=t||{},t.align=t.align||"left",this.style=t;var e=t.font.split(" ");this.fontName=e[e.length-1],this.fontSize=e.length>=2?parseInt(e[e.length-2],10):r.BitmapText.fonts[this.fontName].size,this.dirty=!0},r.BitmapText.prototype.updateText=function(){for(var t=r.BitmapText.fonts[this.fontName],e=new r.Point,i=null,s=[],n=0,a=[],o=0,h=this.fontSize/t.size,u=0;this.text.length>u;u++){var d=this.text.charCodeAt(u);if(/(?:\r\n|\r|\n)/.test(this.text.charAt(u)))a.push(e.x),n=Math.max(n,e.x),o++,e.x=0,e.y+=t.lineHeight,i=null;else{var c=t.chars[d];c&&(i&&c[i]&&(e.x+=c.kerning[i]),s.push({texture:c.texture,line:o,charCode:d,position:new r.Point(e.x+c.xOffset,e.y+c.yOffset)}),e.x+=c.xAdvance,i=d)}}a.push(e.x),n=Math.max(n,e.x);var l=[];for(u=0;o>=u;u++){var p=0;"right"==this.style.align?p=n-a[u]:"center"==this.style.align&&(p=(n-a[u])/2),l.push(p)}for(u=0;s.length>u;u++){var f=new r.Sprite(s[u].texture);f.position.x=(s[u].position.x+l[s[u].line])*h,f.position.y=s[u].position.y*h,f.scale.x=f.scale.y=h,this.addChild(f)}this.width=e.x*h,this.height=(e.y+t.lineHeight)*h},r.BitmapText.prototype.updateTransform=function(){if(this.dirty){for(;this.children.length>0;)this.removeChild(this.getChildAt(0));this.updateText(),this.dirty=!1}r.DisplayObjectContainer.prototype.updateTransform.call(this)},r.BitmapText.fonts={},r.InteractionManager=function(t){this.stage=t,this.tempPoint=new r.Point,this.mouseoverEnabled=!0,this.mouse=new r.InteractionData,this.touchs={},this.pool=[],this.interactiveItems=[],this.last=0},r.InteractionManager.constructor=r.InteractionManager,r.InteractionManager.prototype.collectInteractiveSprite=function(t,e){for(var i=t.children,r=i.length,s=r-1;s>=0;s--){var n=i[s];n.interactive?(e.interactiveChildren=!0,this.interactiveItems.push(n),n.children.length>0&&this.collectInteractiveSprite(n,n)):(n.__iParent=null,n.children.length>0&&this.collectInteractiveSprite(n,e))}},r.InteractionManager.prototype.setTarget=function(t){window.navigator.msPointerEnabled&&(t.view.style["-ms-content-zooming"]="none",t.view.style["-ms-touch-action"]="none"),this.target=t,t.view.addEventListener("mousemove",this.onMouseMove.bind(this),!0),t.view.addEventListener("mousedown",this.onMouseDown.bind(this),!0),document.body.addEventListener("mouseup",this.onMouseUp.bind(this),!0),t.view.addEventListener("mouseout",this.onMouseUp.bind(this),!0),t.view.addEventListener("touchstart",this.onTouchStart.bind(this),!0),t.view.addEventListener("touchend",this.onTouchEnd.bind(this),!0),t.view.addEventListener("touchmove",this.onTouchMove.bind(this),!0)},r.InteractionManager.prototype.update=function(){if(this.target){var t=Date.now(),e=t-this.last;if(e=30*e/1e3,!(1>e)){if(this.last=t,this.dirty){this.dirty=!1;for(var i=this.interactiveItems.length,r=0;i>r;r++)this.interactiveItems[r].interactiveChildren=!1;this.interactiveItems=[],this.stage.interactive&&this.interactiveItems.push(this.stage),this.collectInteractiveSprite(this.stage,this.stage)}var s=this.interactiveItems.length;this.target.view.style.cursor="default";for(var r=0;s>r;r++){var n=this.interactiveItems[r];n.visible&&(n.mouseover||n.mouseout||n.buttonMode)&&(n.__hit=this.hitTest(n,this.mouse),n.__hit?(n.buttonMode&&(this.target.view.style.cursor="pointer"),n.__isOver||(n.mouseover&&n.mouseover(this.mouse),n.__isOver=!0)):n.__isOver&&(n.mouseout&&n.mouseout(this.mouse),n.__isOver=!1))}}}},r.InteractionManager.prototype.onMouseMove=function(t){t.preventDefault();var e=this.target.view.getBoundingClientRect();this.mouse.global.x=(t.clientX-e.left)*(this.target.width/e.width),this.mouse.global.y=(t.clientY-e.top)*(this.target.height/e.height);var i=this.interactiveItems.length;this.mouse.global;for(var r=0;i>r;r++){var s=this.interactiveItems[r];s.mousemove&&s.mousemove(this.mouse)}},r.InteractionManager.prototype.onMouseDown=function(t){t.preventDefault();var e=this.interactiveItems.length;this.mouse.global,this.stage;for(var i=0;e>i;i++){var r=this.interactiveItems[i];if((r.mousedown||r.click)&&(r.__mouseIsDown=!0,r.__hit=this.hitTest(r,this.mouse),r.__hit&&(r.mousedown&&r.mousedown(this.mouse),r.__isDown=!0,!r.interactiveChildren)))break}},r.InteractionManager.prototype.onMouseUp=function(t){t.preventDefault(),this.mouse.global;for(var e=this.interactiveItems.length,i=!1,r=0;e>r;r++){var s=this.interactiveItems[r];(s.mouseup||s.mouseupoutside||s.click)&&(s.__hit=this.hitTest(s,this.mouse),s.__hit&&!i?(s.mouseup&&s.mouseup(this.mouse),s.__isDown&&s.click&&s.click(this.mouse),s.interactiveChildren||(i=!0)):s.__isDown&&s.mouseupoutside&&s.mouseupoutside(this.mouse),s.__isDown=!1)}},r.InteractionManager.prototype.hitTest=function(t,e){var i=e.global;if(!t.visible)return!1;if(t instanceof r.Sprite){var s=t.worldTransform,n=s[0],a=s[1],o=s[2],h=s[3],u=s[4],d=s[5],c=1/(n*u+a*-h),l=u*c*i.x+-a*c*i.y+(d*a-o*u)*c,p=n*c*i.y+-h*c*i.x+(-d*n+o*h)*c,f=t.texture.frame.width,x=t.texture.frame.height,v=-f*t.anchor.x;if(l>v&&v+f>l){var g=-x*t.anchor.y;if(p>g&&g+x>p)return e.target=t,!0}}else if(t.hitArea){var s=t.worldTransform,b=t.hitArea,n=s[0],a=s[1],o=s[2],h=s[3],u=s[4],d=s[5],c=1/(n*u+a*-h),l=u*c*i.x+-a*c*i.y+(d*a-o*u)*c,p=n*c*i.y+-h*c*i.x+(-d*n+o*h)*c,v=b.x;if(l>v&&v+b.width>l){var g=b.y;if(p>g&&g+b.height>p)return!0}}for(var T=t.children.length,m=0;T>m;m++){var y=t.children[m],_=this.hitTest(y,e);if(_)return!0}return!1},r.InteractionManager.prototype.onTouchMove=function(t){t.preventDefault();for(var e=this.target.view.getBoundingClientRect(),i=t.changedTouches,r=0;i.length>r;r++){var s=i[r],n=this.touchs[s.identifier];n.global.x=(s.clientX-e.left)*(this.target.width/e.width),n.global.y=(s.clientY-e.top)*(this.target.height/e.height)}for(var a=this.interactiveItems.length,r=0;a>r;r++){var o=this.interactiveItems[r];o.touchmove&&o.touchmove(n)}},r.InteractionManager.prototype.onTouchStart=function(t){t.preventDefault();for(var e=this.target.view.getBoundingClientRect(),i=t.changedTouches,s=0;i.length>s;s++){var n=i[s],a=this.pool.pop();a||(a=new r.InteractionData),this.touchs[n.identifier]=a,a.global.x=(n.clientX-e.left)*(this.target.width/e.width),a.global.y=(n.clientY-e.top)*(this.target.height/e.height);for(var o=this.interactiveItems.length,h=0;o>h;h++){var u=this.interactiveItems[h];if((u.touchstart||u.tap)&&(u.__hit=this.hitTest(u,a),u.__hit&&(u.touchstart&&u.touchstart(a),u.__isDown=!0,u.__touchData=a,!u.interactiveChildren)))break}}},r.InteractionManager.prototype.onTouchEnd=function(t){t.preventDefault();for(var e=this.target.view.getBoundingClientRect(),i=t.changedTouches,r=0;i.length>r;r++){var s=i[r],n=this.touchs[s.identifier],a=!1;n.global.x=(s.clientX-e.left)*(this.target.width/e.width),n.global.y=(s.clientY-e.top)*(this.target.height/e.height);for(var o=this.interactiveItems.length,h=0;o>h;h++){var u=this.interactiveItems[h],d=u.__touchData;u.__hit=this.hitTest(u,n),d==n&&((u.touchend||u.tap)&&(u.__hit&&!a?(u.touchend&&u.touchend(n),u.__isDown&&u.tap&&u.tap(n),u.interactiveChildren||(a=!0)):u.__isDown&&u.touchendoutside&&u.touchendoutside(n),u.__isDown=!1),u.__touchData=null)}this.pool.push(n),this.touchs[s.identifier]=null}},r.InteractionData=function(){this.global=new r.Point,this.local=new r.Point,this.target},r.InteractionData.prototype.getLocalPosition=function(t){var e=t.worldTransform,i=this.global,s=e[0],n=e[1],a=e[2],o=e[3],h=e[4],u=e[5],d=1/(s*h+n*-o);return new r.Point(h*d*i.x+-n*d*i.y+(u*n-a*h)*d,s*d*i.y+-o*d*i.x+(-u*s+a*o)*d)},r.InteractionData.constructor=r.InteractionData,r.Stage=function(t,e){r.DisplayObjectContainer.call(this),this.worldTransform=r.mat3.create(),this.__childrenAdded=[],this.__childrenRemoved=[],this.childIndex=0,this.stage=this,this.stage.hitArea=new r.Rectangle(0,0,1e5,1e5),this.interactive=!!e,this.interactionManager=new r.InteractionManager(this),this.setBackgroundColor(t),this.worldVisible=!0},r.Stage.constructor=r.Stage,r.Stage.prototype=Object.create(r.DisplayObjectContainer.prototype),r.Stage.prototype.updateTransform=function(){this.worldAlpha=1;for(var t=0,e=this.children.length;e>t;t++)this.children[t].updateTransform();this.dirty&&(this.dirty=!1,this.interactionManager.dirty=!0),this.interactive&&this.interactionManager.update()},r.Stage.prototype.setBackgroundColor=function(e){this.backgroundColor=e||0,this.backgroundColorSplit=t(this.backgroundColor),this.backgroundColorString="#"+this.backgroundColor.toString(16)},r.Stage.prototype.getMousePosition=function(){return this.interactionManager.mouse.global},r.Stage.prototype.__addChild=function(t){if(t.interactive&&(this.dirty=!0),t.stage=this,t.children)for(var e=0;t.children.length>e;e++)this.__addChild(t.children[e])},r.Stage.prototype.__removeChild=function(t){if(t.interactive&&(this.dirty=!0),t.stage=void 0,t.children)for(var e=0,i=t.children.length;i>e;e++)this.__removeChild(t.children[e])},window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){window.setTimeout(t,1e3/60)}}(),"function"!=typeof Function.prototype.bind&&(Function.prototype.bind=function(){var t=Array.prototype.slice;return function(e){function i(){var n=s.concat(t.call(arguments));r.apply(this instanceof i?this:e,n)}var r=this,s=t.call(arguments,1);if("function"!=typeof r)throw new TypeError;return i.prototype=function n(t){return t&&(n.prototype=t),this instanceof n?void 0:new n}(r.prototype),i}}());var s=function(){var t=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(!window.ActiveXObject)return window.XMLHttpRequest?new XMLHttpRequest:!1;for(var e=0;t.length>e;e++)try{return new ActiveXObject(t[e])}catch(i){}};r.EventTarget=function(){var t={};this.addEventListener=this.on=function(e,i){void 0===t[e]&&(t[e]=[]),-1===t[e].indexOf(i)&&t[e].push(i)},this.dispatchEvent=this.emit=function(e){for(var i in t[e.type])t[e.type][i](e)},this.removeEventListener=this.off=function(e,i){var r=t[e].indexOf(i);-1!==r&&t[e].splice(r,1)}},e(),r.mat3={},r.mat3.create=function(){var t=new r.Matrix(9);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},r.mat4={},r.mat4.create=function(){var t=new r.Matrix(16);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},r.mat3.multiply=function(t,e,i){i||(i=t);var r=t[0],s=t[1],n=t[2],a=t[3],o=t[4],h=t[5],u=t[6],d=t[7],c=t[8],l=e[0],p=e[1],f=e[2],x=e[3],v=e[4],g=e[5],b=e[6],T=e[7],m=e[8];return i[0]=l*r+p*a+f*u,i[1]=l*s+p*o+f*d,i[2]=l*n+p*h+f*c,i[3]=x*r+v*a+g*u,i[4]=x*s+v*o+g*d,i[5]=x*n+v*h+g*c,i[6]=b*r+T*a+m*u,i[7]=b*s+T*o+m*d,i[8]=b*n+T*h+m*c,i},r.mat3.toMat4=function(t,e){return e||(e=r.mat4.create()),e[15]=1,e[14]=0,e[13]=0,e[12]=0,e[11]=0,e[10]=t[8],e[9]=t[7],e[8]=t[6],e[7]=0,e[6]=t[5],e[5]=t[4],e[4]=t[3],e[3]=0,e[2]=t[2],e[1]=t[1],e[0]=t[0],e},r.mat4.create=function(){var t=new r.Matrix(16);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},r.mat4.transpose=function(t,e){if(!e||t===e){var i=t[1],r=t[2],s=t[3],n=t[6],a=t[7],o=t[11];return t[1]=t[4],t[2]=t[8],t[3]=t[12],t[4]=i,t[6]=t[9],t[7]=t[13],t[8]=r,t[9]=n,t[11]=t[14],t[12]=s,t[13]=a,t[14]=o,t}return e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15],e},r.mat4.multiply=function(t,e,i){i||(i=t);var r=t[0],s=t[1],n=t[2],a=t[3],o=t[4],h=t[5],u=t[6],d=t[7],c=t[8],l=t[9],p=t[10],f=t[11],x=t[12],v=t[13],g=t[14],b=t[15],T=e[0],m=e[1],y=e[2],_=e[3];return i[0]=T*r+m*o+y*c+_*x,i[1]=T*s+m*h+y*l+_*v,i[2]=T*n+m*u+y*p+_*g,i[3]=T*a+m*d+y*f+_*b,T=e[4],m=e[5],y=e[6],_=e[7],i[4]=T*r+m*o+y*c+_*x,i[5]=T*s+m*h+y*l+_*v,i[6]=T*n+m*u+y*p+_*g,i[7]=T*a+m*d+y*f+_*b,T=e[8],m=e[9],y=e[10],_=e[11],i[8]=T*r+m*o+y*c+_*x,i[9]=T*s+m*h+y*l+_*v,i[10]=T*n+m*u+y*p+_*g,i[11]=T*a+m*d+y*f+_*b,T=e[12],m=e[13],y=e[14],_=e[15],i[12]=T*r+m*o+y*c+_*x,i[13]=T*s+m*h+y*l+_*v,i[14]=T*n+m*u+y*p+_*g,i[15]=T*a+m*d+y*f+_*b,i},r.autoDetectRenderer=function(t,e,i,s){t||(t=800),e||(e=600);var n=function(){try{return!!window.WebGLRenderingContext&&!!document.createElement("canvas").getContext("experimental-webgl")}catch(t){return!1}}();return n?new r.WebGLRenderer(t,e,i,s):new r.CanvasRenderer(t,e,i,s)},r.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;","}"],r.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;","}"],r.CompileVertexShader=function(t,e){return r._CompileShader(t,e,t.VERTEX_SHADER)},r.CompileFragmentShader=function(t,e){return r._CompileShader(t,e,t.FRAGMENT_SHADER)},r._CompileShader=function(t,e,i){var r=e.join("\n"),s=t.createShader(i);return t.shaderSource(s,r),t.compileShader(s),t.getShaderParameter(s,t.COMPILE_STATUS)?s:(alert(t.getShaderInfoLog(s)),null)},r._defaultFrame=new r.Rectangle(0,0,1,1),r.gl,r.WebGLRenderer=function(t,e,i,s){this.transparent=!!s,this.width=t||800,this.height=e||600,this.view=i||document.createElement("canvas"),this.view.width=this.width,this.view.height=this.height;var n=this;this.view.addEventListener("webglcontextlost",function(t){n.handleContextLost(t)},!1),this.view.addEventListener("webglcontextrestored",function(t){n.handleContextRestored(t)},!1),this.batchs=[];try{r.gl=this.gl=this.view.getContext("experimental-webgl",{alpha:this.transparent,antialias:!1,premultipliedAlpha:!1})}catch(a){throw Error(" This browser does not support webGL. Try using the canvas renderer"+this)}this.initShaders();var o=this.gl;r.WebGLRenderer.gl=o,this.batch=new r.WebGLBatch(o),o.disable(o.DEPTH_TEST),o.disable(o.CULL_FACE),o.enable(o.BLEND),o.colorMask(!0,!0,!0,this.transparent),this.projectionMatrix=r.mat4.create(),this.resize(this.width,this.height),this.contextLost=!1,this.stageRenderGroup=new r.WebGLRenderGroup(this.gl)},r.WebGLRenderer.constructor=r.WebGLRenderer,r.WebGLRenderer.getBatch=function(){return 0==r._batchs.length?new r.WebGLBatch(r.WebGLRenderer.gl):r._batchs.pop()},r.WebGLRenderer.returnBatch=function(t){t.clean(),r._batchs.push(t)},r.WebGLRenderer.prototype.initShaders=function(){var t=this.gl,e=r.CompileFragmentShader(t,r.shaderFragmentSrc),i=r.CompileVertexShader(t,r.shaderVertexSrc);r.shaderProgram=t.createProgram();var s=r.shaderProgram;t.attachShader(s,i),t.attachShader(s,e),t.linkProgram(s),t.getProgramParameter(s,t.LINK_STATUS)||alert("Could not initialise shaders"),t.useProgram(s),s.vertexPositionAttribute=t.getAttribLocation(s,"aVertexPosition"),t.enableVertexAttribArray(s.vertexPositionAttribute),s.textureCoordAttribute=t.getAttribLocation(s,"aTextureCoord"),t.enableVertexAttribArray(s.textureCoordAttribute),s.colorAttribute=t.getAttribLocation(s,"aColor"),t.enableVertexAttribArray(s.colorAttribute),s.mvMatrixUniform=t.getUniformLocation(s,"uMVMatrix"),s.samplerUniform=t.getUniformLocation(s,"uSampler")},r.WebGLRenderer.prototype.render=function(t){if(!this.contextLost){this.__stage!==t&&(this.__stage=t,this.stageRenderGroup.setRenderable(t)),r.WebGLRenderer.updateTextures(),t.updateTransform();var e=this.gl;if(e.colorMask(!0,!0,!0,this.transparent),e.viewport(0,0,this.width,this.height),e.bindFramebuffer(e.FRAMEBUFFER,null),e.clearColor(t.backgroundColorSplit[0],t.backgroundColorSplit[1],t.backgroundColorSplit[2],!this.transparent),e.clear(e.COLOR_BUFFER_BIT),r.projectionMatrix=this.projectionMatrix,this.stageRenderGroup.backgroundColor=t.backgroundColorSplit,this.stageRenderGroup.render(this.projectionMatrix),t.interactive&&(t._interactiveEventsAdded||(t._interactiveEventsAdded=!0,t.interactionManager.setTarget(this))),r.Texture.frameUpdates.length>0){for(var i=0;r.Texture.frameUpdates.length>i;i++)r.Texture.frameUpdates[i].updateFrame=!1;r.Texture.frameUpdates=[]}}},r.WebGLRenderer.updateTextures=function(){for(var t=0;r.texturesToUpdate.length>t;t++)this.updateTexture(r.texturesToUpdate[t]);for(var t=0;r.texturesToDestroy.length>t;t++)this.destroyTexture(r.texturesToDestroy[t]);r.texturesToUpdate=[],r.texturesToDestroy=[]},r.WebGLRenderer.updateTexture=function(t){var e=r.gl;t._glTexture||(t._glTexture=e.createTexture()),t.hasLoaded&&(e.bindTexture(e.TEXTURE_2D,t._glTexture),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,t.source),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),t._powerOf2?(e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.REPEAT)):(e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE)),e.bindTexture(e.TEXTURE_2D,null))},r.WebGLRenderer.prototype.destroyTexture=function(t){var e=this.gl;t._glTexture&&(t._glTexture=e.createTexture(),e.deleteTexture(e.TEXTURE_2D,t._glTexture))},r.WebGLRenderer.prototype.resize=function(t,e){this.width=t,this.height=e,this.view.width=t,this.view.height=e,this.gl.viewport(0,0,this.width,this.height);var i=this.projectionMatrix;i[0]=2/this.width,i[5]=-2/this.height,i[12]=-1,i[13]=1},r.WebGLRenderer.prototype.handleContextLost=function(t){t.preventDefault(),this.contextLost=!0},r.WebGLRenderer.prototype.handleContextRestored=function(){this.gl=this.view.getContext("experimental-webgl",{alpha:!0}),this.initShaders();for(var t=0;r.TextureCache.length>t;t++)this.updateTexture(r.TextureCache[t]);for(var t=0;this.batchs.length>t;t++)this.batchs[t].restoreLostContext(this.gl),this.batchs[t].dirty=!0;r._restoreBatchs(this.gl),this.contextLost=!1},r._batchs=[],r._getBatch=function(t){return 0==r._batchs.length?new r.WebGLBatch(t):r._batchs.pop()},r._returnBatch=function(t){t.clean(),r._batchs.push(t)},r._restoreBatchs=function(t){for(var e=0;r._batchs.length>e;e++)r._batchs[e].restoreLostContext(t)},r.WebGLBatch=function(t){this.gl=t,this.size=0,this.vertexBuffer=t.createBuffer(),this.indexBuffer=t.createBuffer(),this.uvBuffer=t.createBuffer(),this.colorBuffer=t.createBuffer(),this.blendMode=r.blendModes.NORMAL,this.dynamicSize=1},r.WebGLBatch.constructor=r.WebGLBatch,r.WebGLBatch.prototype.clean=function(){this.verticies=[],this.uvs=[],this.indices=[],this.colors=[],this.dynamicSize=1,this.texture=null,this.last=null,this.size=0,this.head,this.tail},r.WebGLBatch.prototype.restoreLostContext=function(t){this.gl=t,this.vertexBuffer=t.createBuffer(),this.indexBuffer=t.createBuffer(),this.uvBuffer=t.createBuffer(),this.colorBuffer=t.createBuffer()},r.WebGLBatch.prototype.init=function(t){t.batch=this,this.dirty=!0,this.blendMode=t.blendMode,this.texture=t.texture.baseTexture,this.head=t,this.tail=t,this.size=1,this.growBatch()},r.WebGLBatch.prototype.insertBefore=function(t,e){this.size++,t.batch=this,this.dirty=!0;var i=e.__prev;e.__prev=t,t.__next=e,i?(t.__prev=i,i.__next=t):this.head=t},r.WebGLBatch.prototype.insertAfter=function(t,e){this.size++,t.batch=this,this.dirty=!0;var i=e.__next;e.__next=t,t.__prev=e,i?(t.__next=i,i.__prev=t):this.tail=t},r.WebGLBatch.prototype.remove=function(t){return this.size--,0==this.size?(t.batch=null,t.__prev=null,t.__next=null,void 0):(t.__prev?t.__prev.__next=t.__next:(this.head=t.__next,this.head.__prev=null),t.__next?t.__next.__prev=t.__prev:(this.tail=t.__prev,this.tail.__next=null),t.batch=null,t.__next=null,t.__prev=null,this.dirty=!0,void 0)},r.WebGLBatch.prototype.split=function(t){this.dirty=!0;var e=new r.WebGLBatch(this.gl);e.init(t),e.texture=this.texture,e.tail=this.tail,this.tail=t.__prev,this.tail.__next=null,t.__prev=null;for(var i=0;t;)i++,t.batch=e,t=t.__next;return e.size=i,this.size-=i,e},r.WebGLBatch.prototype.merge=function(t){this.dirty=!0,this.tail.__next=t.head,t.head.__prev=this.tail,this.size+=t.size,this.tail=t.tail;for(var e=t.head;e;)e.batch=this,e=e.__next},r.WebGLBatch.prototype.growBatch=function(){var t=this.gl;this.dynamicSize=1==this.size?1:1.5*this.size,this.verticies=new Float32Array(8*this.dynamicSize),t.bindBuffer(t.ARRAY_BUFFER,this.vertexBuffer),t.bufferData(t.ARRAY_BUFFER,this.verticies,t.DYNAMIC_DRAW),this.uvs=new Float32Array(8*this.dynamicSize),t.bindBuffer(t.ARRAY_BUFFER,this.uvBuffer),t.bufferData(t.ARRAY_BUFFER,this.uvs,t.DYNAMIC_DRAW),this.dirtyUVS=!0,this.colors=new Float32Array(4*this.dynamicSize),t.bindBuffer(t.ARRAY_BUFFER,this.colorBuffer),t.bufferData(t.ARRAY_BUFFER,this.colors,t.DYNAMIC_DRAW),this.dirtyColors=!0,this.indices=new Uint16Array(6*this.dynamicSize);for(var e=this.indices.length/6,i=0;e>i;i++){var r=6*i,s=4*i;this.indices[r+0]=s+0,this.indices[r+1]=s+1,this.indices[r+2]=s+2,this.indices[r+3]=s+0,this.indices[r+4]=s+2,this.indices[r+5]=s+3}t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indexBuffer),t.bufferData(t.ELEMENT_ARRAY_BUFFER,this.indices,t.STATIC_DRAW)},r.WebGLBatch.prototype.refresh=function(){this.gl,this.dynamicSizes;s++)i=this.batchs[s],i instanceof r.WebGLBatch?this.batchs[s].render():i instanceof r.TilingSprite?i.visible&&this.renderTilingSprite(i,t):i instanceof r.Strip?i.visible&&this.renderStrip(i,t):i instanceof r.Graphics&&i.visible&&i.renderWebGL(this,t)},r.WebGLRenderGroup.prototype.renderSpecific=function(t,e){r.WebGLRenderer.updateTextures();var i=this.gl;this.checkVisibility(t,t.visible),i.uniformMatrix4fv(r.shaderProgram.mvMatrixUniform,!1,e);var s,n,a,o,h=t.renderable?t:this.getNextRenderable(t),u=h.batch;if(h instanceof r.Sprite){u=h.batch;var d=u.head;if(d==h)s=0;else for(s=1;d.__next!=h;)s++,d=d.__next}else u=h;for(var c,l=t,p=t;p.children.length>0;)p=p.children[p.children.length-1],p.renderable&&(l=p);if(l instanceof r.Sprite){c=l.batch;var d=c.head;if(d==l)a=0;else for(a=1;d.__next!=l;)a++,d=d.__next}else c=l;if(u==c)return u instanceof r.WebGLBatch?u.render(s,a+1):u instanceof r.TilingSprite?u.visible&&this.renderTilingSprite(u,e):u instanceof r.Strip?u.visible&&this.renderStrip(u,e):u instanceof r.CustomRenderable&&u.visible&&u.renderWebGL(this,e),void 0;n=this.batchs.indexOf(u),o=this.batchs.indexOf(c),u instanceof r.WebGLBatch?u.render(s):u instanceof r.TilingSprite?u.visible&&this.renderTilingSprite(u,e):u instanceof r.Strip?u.visible&&this.renderStrip(u,e):u instanceof r.CustomRenderable&&u.visible&&u.renderWebGL(this,e);for(var f=n+1;o>f;f++)renderable=this.batchs[f],renderable instanceof r.WebGLBatch?this.batchs[f].render():renderable instanceof r.TilingSprite?renderable.visible&&this.renderTilingSprite(renderable,e):renderable instanceof r.Strip?renderable.visible&&this.renderStrip(renderable,e):renderable instanceof r.CustomRenderable&&renderable.visible&&renderable.renderWebGL(this,e);c instanceof r.WebGLBatch?c.render(0,a+1):c instanceof r.TilingSprite?c.visible&&this.renderTilingSprite(c):c instanceof r.Strip?c.visible&&this.renderStrip(c):c instanceof r.CustomRenderable&&c.visible&&c.renderWebGL(this,e)},r.WebGLRenderGroup.prototype.checkVisibility=function(t,e){for(var i=t.children,r=0;i.length>r;r++){var s=i[r];s.worldVisible=s.visible&&e,s.textureChange&&(s.textureChange=!1,s.worldVisible&&(this.removeDisplayObject(s),this.addDisplayObject(s))),s.children.length>0&&this.checkVisibility(s,s.worldVisible)}},r.WebGLRenderGroup.prototype.updateTexture=function(t){if(1==t.batch.length)return t.batch.texture=t.texture.baseTexture,void 0;if(t.batch.texture!=t.texture.baseTexture)if(t.batch.head==t){var e=t.batch,i=this.batchs.indexOf(e),s=this.batchs[i-1];if(e.remove(t),s)if(s.texture==t.texture.baseTexture&&s.blendMode==t.blendMode)s.insertAfter(t,s.tail);else{var n=r.WebGLRenderer.getBatch();n.init(t),this.batchs.splice(i-1,0,n)}else{var n=r.WebGLRenderer.getBatch();n.init(t),this.batchs.splice(0,0,n)}}else if(t.batch.tail==t){var e=t.batch,i=this.batchs.indexOf(e),a=this.batchs[i+1];if(e.remove(t),a){if(a.texture==t.texture.baseTexture&&a.blendMode==t.blendMode)return a.insertBefore(t,a.head),void 0;var n=r.WebGLRenderer.getBatch();n.init(t),this.batchs.splice(i+1,0,n)}else{var n=r.WebGLRenderer.getBatch();n.init(t),this.batchs.push(n)}}else{var e=t.batch,o=e.split(t);o.remove(t);var n=r.WebGLRenderer.getBatch(),i=this.batchs.indexOf(e);n.init(t),this.batchs.splice(i+1,0,n,o)}},r.WebGLRenderGroup.prototype.addDisplayObject=function(t){if(t.__renderGroup&&t.__renderGroup.removeDisplayObjectAndChildren(t),t.__renderGroup=this,t.renderable){var e=this.getPreviousRenderable(t),i=this.getNextRenderable(t);if(t instanceof r.Sprite){var s,n;if(e instanceof r.Sprite){if(s=e.batch,s&&s.texture==t.texture.baseTexture&&s.blendMode==t.blendMode)return s.insertAfter(t,e),void 0}else s=e;if(i)if(i instanceof r.Sprite){if(n=i.batch){if(n.texture==t.texture.baseTexture&&n.blendMode==t.blendMode)return n.insertBefore(t,i),void 0;if(n==s){var a=s.split(i),o=r.WebGLRenderer.getBatch(),h=this.batchs.indexOf(s);return o.init(t),this.batchs.splice(h+1,0,o,a),void 0}}}else n=i;var o=r.WebGLRenderer.getBatch();if(o.init(t),s){var h=this.batchs.indexOf(s);this.batchs.splice(h+1,0,o)}else this.batchs.push(o)}else t instanceof r.TilingSprite?(this.initTilingSprite(t),this.batchs.push(t)):t instanceof r.Strip?(this.initStrip(t),this.batchs.push(t)):t instanceof r.Graphics&&this.batchs.push(t);this.batchUpdate=!0}},r.WebGLRenderGroup.prototype.addDisplayObjectAndChildren=function(t){this.addDisplayObject(t);for(var e=t.children,i=0;e.length>i;i++)this.addDisplayObjectAndChildren(e[i])},r.WebGLRenderGroup.prototype.removeDisplayObject=function(t){if(t.__renderGroup=null,t.renderable){var e;if(t instanceof r.Sprite){var i=t.batch;if(!i)return;i.remove(t),0==i.size&&(e=i)}else e=t;if(e){var s=this.batchs.indexOf(e);if(-1==s)return;if(0==s||s==this.batchs.length-1)return this.batchs.splice(s,1),e instanceof r.WebGLBatch&&r.WebGLRenderer.returnBatch(e),void 0;if(this.batchs[s-1]instanceof r.WebGLBatch&&this.batchs[s+1]instanceof r.WebGLBatch&&this.batchs[s-1].texture==this.batchs[s+1].texture&&this.batchs[s-1].blendMode==this.batchs[s+1].blendMode)return this.batchs[s-1].merge(this.batchs[s+1]),e instanceof r.WebGLBatch&&r.WebGLRenderer.returnBatch(e),r.WebGLRenderer.returnBatch(this.batchs[s+1]),this.batchs.splice(s,2),void 0;this.batchs.splice(s,1),e instanceof r.WebGLBatch&&r.WebGLRenderer.returnBatch(e)}}},r.WebGLRenderGroup.prototype.removeDisplayObjectAndChildren=function(t){if(t.__renderGroup==this){this.removeDisplayObject(t);for(var e=t.children,i=0;e.length>i;i++)this.removeDisplayObjectAndChildren(e[i])}},r.WebGLRenderGroup.prototype.getNextRenderable=function(t){var e=t;do{if(0==e.children.length){if(!e.parent)return null;for(;e.childIndex==e.parent.children.length-1;)if(e=e.parent,e==this.root||!e.parent){e=null;break}e&&(e=e.parent.children[e.childIndex+1])}else e=e.children[0];if(!e)break}while(!e.renderable||!e.__renderGroup);return e},r.WebGLRenderGroup.prototype.getPreviousRenderable=function(t){var e=t;do{if(0==e.childIndex){if(e=e.parent,!e)return null}else for(e=e.parent.children[e.childIndex-1];0!=e.children.length;)e=e.children[e.children.length-1];if(e==this.root)break}while(!e.renderable||!e.__renderGroup);return e},r.WebGLRenderGroup.prototype.initTilingSprite=function(t){var e=this.gl;t.verticies=new Float32Array([0,0,t.width,0,t.width,t.height,0,t.height]),t.uvs=new Float32Array([0,0,1,0,1,1,0,1]),t.colors=new Float32Array([1,1,1,1]),t.indices=new Uint16Array([0,1,3,2]),t._vertexBuffer=e.createBuffer(),t._indexBuffer=e.createBuffer(),t._uvBuffer=e.createBuffer(),t._colorBuffer=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,t._vertexBuffer),e.bufferData(e.ARRAY_BUFFER,t.verticies,e.STATIC_DRAW),e.bindBuffer(e.ARRAY_BUFFER,t._uvBuffer),e.bufferData(e.ARRAY_BUFFER,t.uvs,e.DYNAMIC_DRAW),e.bindBuffer(e.ARRAY_BUFFER,t._colorBuffer),e.bufferData(e.ARRAY_BUFFER,t.colors,e.STATIC_DRAW),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t._indexBuffer),e.bufferData(e.ELEMENT_ARRAY_BUFFER,t.indices,e.STATIC_DRAW),t.texture.baseTexture._glTexture?(e.bindTexture(e.TEXTURE_2D,t.texture.baseTexture._glTexture),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.REPEAT),t.texture.baseTexture._powerOf2=!0):t.texture.baseTexture._powerOf2=!0},r.WebGLRenderGroup.prototype.renderStrip=function(t,e){var i=this.gl,s=r.shaderProgram,n=r.mat3.toMat4(t.worldTransform);r.mat4.transpose(n),r.mat4.multiply(e,n,n),i.uniformMatrix4fv(s.mvMatrixUniform,!1,n),t.blendMode==r.blendModes.NORMAL?i.blendFunc(i.ONE,i.ONE_MINUS_SRC_ALPHA):i.blendFunc(i.ONE,i.ONE_MINUS_SRC_COLOR),t.dirty?(t.dirty=!1,i.bindBuffer(i.ARRAY_BUFFER,t._vertexBuffer),i.bufferData(i.ARRAY_BUFFER,t.verticies,i.STATIC_DRAW),i.vertexAttribPointer(s.vertexPositionAttribute,2,i.FLOAT,!1,0,0),i.bindBuffer(i.ARRAY_BUFFER,t._uvBuffer),i.bufferData(i.ARRAY_BUFFER,t.uvs,i.STATIC_DRAW),i.vertexAttribPointer(s.textureCoordAttribute,2,i.FLOAT,!1,0,0),i.activeTexture(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,t.texture.baseTexture._glTexture),i.bindBuffer(i.ARRAY_BUFFER,t._colorBuffer),i.bufferData(i.ARRAY_BUFFER,t.colors,i.STATIC_DRAW),i.vertexAttribPointer(s.colorAttribute,1,i.FLOAT,!1,0,0),i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,t._indexBuffer),i.bufferData(i.ELEMENT_ARRAY_BUFFER,t.indices,i.STATIC_DRAW)):(i.bindBuffer(i.ARRAY_BUFFER,t._vertexBuffer),i.bufferSubData(i.ARRAY_BUFFER,0,t.verticies),i.vertexAttribPointer(s.vertexPositionAttribute,2,i.FLOAT,!1,0,0),i.bindBuffer(i.ARRAY_BUFFER,t._uvBuffer),i.vertexAttribPointer(s.textureCoordAttribute,2,i.FLOAT,!1,0,0),i.activeTexture(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,t.texture.baseTexture._glTexture),i.bindBuffer(i.ARRAY_BUFFER,t._colorBuffer),i.vertexAttribPointer(s.colorAttribute,1,i.FLOAT,!1,0,0),i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,t._indexBuffer)),i.drawElements(i.TRIANGLE_STRIP,t.indices.length,i.UNSIGNED_SHORT,0),i.uniformMatrix4fv(s.mvMatrixUniform,!1,e)},r.WebGLRenderGroup.prototype.renderTilingSprite=function(t,e){var i=this.gl;r.shaderProgram;var s=t.tilePosition,n=t.tileScale,a=s.x/t.texture.baseTexture.width,o=s.y/t.texture.baseTexture.height,h=t.width/t.texture.baseTexture.width/n.x,u=t.height/t.texture.baseTexture.height/n.y;t.uvs[0]=0-a,t.uvs[1]=0-o,t.uvs[2]=1*h-a,t.uvs[3]=0-o,t.uvs[4]=1*h-a,t.uvs[5]=1*u-o,t.uvs[6]=0-a,t.uvs[7]=1*u-o,i.bindBuffer(i.ARRAY_BUFFER,t._uvBuffer),i.bufferSubData(i.ARRAY_BUFFER,0,t.uvs),this.renderStrip(t,e)},r.WebGLRenderer.prototype.initStrip=function(t){var e=this.gl;this.shaderProgram,t._vertexBuffer=e.createBuffer(),t._indexBuffer=e.createBuffer(),t._uvBuffer=e.createBuffer(),t._colorBuffer=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,t._vertexBuffer),e.bufferData(e.ARRAY_BUFFER,t.verticies,e.DYNAMIC_DRAW),e.bindBuffer(e.ARRAY_BUFFER,t._uvBuffer),e.bufferData(e.ARRAY_BUFFER,t.uvs,e.STATIC_DRAW),e.bindBuffer(e.ARRAY_BUFFER,t._colorBuffer),e.bufferData(e.ARRAY_BUFFER,t.colors,e.STATIC_DRAW),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t._indexBuffer),e.bufferData(e.ELEMENT_ARRAY_BUFFER,t.indices,e.STATIC_DRAW)},r.CanvasRenderer=function(t,e,i,r){this.transparent=r,this.width=t||800,this.height=e||600,this.refresh=!0,this.view=i||document.createElement("canvas"),this.view.width=this.width,this.view.height=this.height,this.count=0,this.context=this.view.getContext("2d")},r.CanvasRenderer.constructor=r.CanvasRenderer,r.CanvasRenderer.prototype.render=function(t){r.texturesToUpdate=[],r.texturesToDestroy=[],t.updateTransform(),this.view.style.backgroundColor==t.backgroundColorString||this.transparent||(this.view.style.backgroundColor=t.backgroundColorString),this.context.setTransform(1,0,0,1,0,0),this.context.clearRect(0,0,this.width,this.height),this.renderDisplayObject(t),t.interactive&&(t._interactiveEventsAdded||(t._interactiveEventsAdded=!0,t.interactionManager.setTarget(this))),r.Texture.frameUpdates.length>0&&(r.Texture.frameUpdates=[])},r.CanvasRenderer.prototype.resize=function(t,e){this.width=t,this.height=e,this.view.width=t,this.view.height=e},r.CanvasRenderer.prototype.renderDisplayObject=function(t){var e=t.worldTransform,i=this.context;if(t.visible){if(t instanceof r.Sprite){var s=t.texture.frame;s&&(i.globalAlpha=t.worldAlpha,i.setTransform(e[0],e[3],e[1],e[4],e[2],e[5]),i.drawImage(t.texture.baseTexture.source,s.x,s.y,s.width,s.height,t.anchor.x*-s.width,t.anchor.y*-s.height,s.width,s.height))}else t instanceof r.Strip?(i.setTransform(e[0],e[3],e[1],e[4],e[2],e[5]),this.renderStrip(t)):t instanceof r.TilingSprite?(i.setTransform(e[0],e[3],e[1],e[4],e[2],e[5]),this.renderTilingSprite(t)):t instanceof r.CustomRenderable?t.renderCanvas(this):t instanceof r.Graphics&&t.render(this);for(var n=0;t.children.length>n;n++)this.renderDisplayObject(t.children[n]);this.context.setTransform(1,0,0,1,0,0)}},r.CanvasRenderer.prototype.renderStripFlat=function(t){var e=this.context,i=t.verticies;t.uvs;var r=i.length/2;this.count++,e.beginPath();for(var s=1;r-2>s;s++){var n=2*s,a=i[n],o=i[n+2],h=i[n+4],u=i[n+1],d=i[n+3],c=i[n+5];e.moveTo(a,u),e.lineTo(o,d),e.lineTo(h,c)}e.fillStyle="#FF0000",e.fill(),e.closePath()},r.CanvasRenderer.prototype.renderTilingSprite=function(t){var e=this.context;t.__tilePattern||(t.__tilePattern=e.createPattern(t.texture.baseTexture.source,"repeat")),e.beginPath();var i=t.tilePosition,r=t.tileScale;e.scale(r.x,r.y),e.translate(i.x,i.y),e.fillStyle=t.__tilePattern,e.fillRect(-i.x,-i.y,t.width/r.x,t.height/r.y),e.scale(1/r.x,1/r.y),e.translate(-i.x,-i.y),e.closePath()},r.CanvasRenderer.prototype.renderStrip=function(t){var e=this.context,i=t.verticies,r=t.uvs,s=i.length/2;this.count++;for(var n=1;s-2>n;n++){var a=2*n,o=i[a],h=i[a+2],u=i[a+4],d=i[a+1],c=i[a+3],l=i[a+5],p=r[a]*t.texture.width,f=r[a+2]*t.texture.width,x=r[a+4]*t.texture.width,v=r[a+1]*t.texture.height,g=r[a+3]*t.texture.height,b=r[a+5]*t.texture.height;e.save(),e.beginPath(),e.moveTo(o,d),e.lineTo(h,c),e.lineTo(u,l),e.closePath(),e.clip();var T=p*g+v*x+f*b-g*x-v*f-p*b,m=o*g+v*u+h*b-g*u-v*h-o*b,y=p*h+o*x+f*u-h*x-o*f-p*u,_=p*g*u+v*h*x+o*f*b-o*g*x-v*f*u-p*h*b,R=d*g+v*l+c*b-g*l-v*c-d*b,w=p*c+d*x+f*l-c*x-d*f-p*l,A=p*g*l+v*c*x+d*f*b-d*g*x-v*f*l-p*c*b;e.transform(m/T,R/T,y/T,w/T,_/T,A/T),e.drawImage(t.texture.baseTexture.source,0,0),e.restore()}},r.Strip=function(t,e,i){r.DisplayObjectContainer.call(this),this.texture=t,this.blendMode=r.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(s){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=e,this.height=i,t.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},r.Strip.constructor=r.Strip,r.Strip.prototype=Object.create(r.DisplayObjectContainer.prototype),r.Strip.prototype.setTexture=function(t){this.texture=t,this.width=t.frame.width,this.height=t.frame.height,this.updateFrame=!0},r.Strip.prototype.onTextureUpdate=function(){this.updateFrame=!0},r.Rope=function(t,e){r.Strip.call(this,t),this.points=e;try{this.verticies=new Float32Array(4*e.length),this.uvs=new Float32Array(4*e.length),this.colors=new Float32Array(2*e.length),this.indices=new Uint16Array(2*e.length)}catch(i){this.verticies=verticies,this.uvs=uvs,this.colors=colors,this.indices=indices}this.refresh()},r.Rope.constructor=r.Rope,r.Rope.prototype=Object.create(r.Strip.prototype),r.Rope.prototype.refresh=function(){var t=this.points;if(!(1>t.length)){var e=this.uvs,i=this.indices,r=this.colors,s=t[0],n=t[0];this.count-=.2,e[0]=0,e[1]=1,e[2]=0,e[3]=1,r[0]=1,r[1]=1,i[0]=0,i[1]=1;for(var a=t.length,o=1;a>o;o++){var n=t[o],h=4*o,u=o/(a-1);o%2?(e[h]=u,e[h+1]=0,e[h+2]=u,e[h+3]=1):(e[h]=u,e[h+1]=0,e[h+2]=u,e[h+3]=1),h=2*o,r[h]=1,r[h+1]=1,h=2*o,i[h]=h,i[h+1]=h+1,s=n}}},r.Rope.prototype.updateTransform=function(){var t=this.points;if(!(1>t.length)){var e,i=this.verticies,s=t[0],n={x:0,y:0},a=t[0];this.count-=.2,i[0]=a.x+n.x,i[1]=a.y+n.y,i[2]=a.x-n.x,i[3]=a.y-n.y;for(var o=t.length,h=1;o>h;h++){var a=t[h],u=4*h;e=t.length-1>h?t[h+1]:a,n.y=-(e.x-s.x),n.x=e.y-s.y;var d=10*(1-h/(o-1));d>1&&(d=1);var c=Math.sqrt(n.x*n.x+n.y*n.y),l=this.texture.height/2;n.x/=c,n.y/=c,n.x*=l,n.y*=l,i[u]=a.x+n.x,i[u+1]=a.y+n.y,i[u+2]=a.x-n.x,i[u+3]=a.y-n.y,s=a}r.DisplayObjectContainer.prototype.updateTransform.call(this)}},r.Rope.prototype.setTexture=function(t){this.texture=t,this.updateFrame=!0},r.TilingSprite=function(t,e,i){r.DisplayObjectContainer.call(this),this.texture=t,this.width=e,this.height=i,this.renderable=!0,this.tileScale=new r.Point(1,1),this.tilePosition=new r.Point(0,0),this.blendMode=r.blendModes.NORMAL},r.TilingSprite.constructor=r.TilingSprite,r.TilingSprite.prototype=Object.create(r.DisplayObjectContainer.prototype),r.TilingSprite.prototype.setTexture=function(t){this.texture=t,this.updateFrame=!0},r.TilingSprite.prototype.onTextureUpdate=function(){this.updateFrame=!0},r.CustomRenderable=function(){r.DisplayObject.call(this)},r.CustomRenderable.constructor=r.CustomRenderable,r.CustomRenderable.prototype=Object.create(r.DisplayObject.prototype),r.CustomRenderable.prototype.renderCanvas=function(){},r.CustomRenderable.prototype.initWebGL=function(){},r.CustomRenderable.prototype.renderWebGL=function(){},r.BaseTextureCache={},r.texturesToUpdate=[],r.texturesToDestroy=[],r.BaseTexture=function(t){if(r.EventTarget.call(this),this.width=100,this.height=100,this.source=t,t){if(this.source instanceof Image)if(this.source.complete)this.hasLoaded=!0,this.width=this.source.width,this.height=this.source.height,r.texturesToUpdate.push(this);else{var e=this;this.source.onload=function(){e.hasLoaded=!0,e.width=e.source.width,e.height=e.source.height,r.texturesToUpdate.push(e),e.dispatchEvent({type:"loaded",content:e})}}else this.hasLoaded=!0,this.width=this.source.width,this.height=this.source.height,r.texturesToUpdate.push(this);this._powerOf2=!1}},r.BaseTexture.constructor=r.BaseTexture,r.BaseTexture.prototype.destroy=function(){this.source instanceof Image&&(this.source.src=null),this.source=null,r.texturesToDestroy.push(this)},r.BaseTexture.fromImage=function(t,e){var i=r.BaseTextureCache[t];if(!i){var s=new Image;e&&(s.crossOrigin=""),s.src=t,i=new r.BaseTexture(s),r.BaseTextureCache[t]=i}return i},r.TextureCache={},r.FrameCache={},r.Texture=function(t,e){if(r.EventTarget.call(this),e||(this.noFrame=!0,e=new r.Rectangle(0,0,1,1)),this.trim=new r.Point,t instanceof r.Texture&&(t=t.baseTexture),this.baseTexture=t,this.frame=e,this.scope=this,t.hasLoaded)this.noFrame&&(e=new r.Rectangle(0,0,t.width,t.height)),this.setFrame(e);else{var i=this;t.addEventListener("loaded",function(){i.onBaseTextureLoaded()})}},r.Texture.constructor=r.Texture,r.Texture.prototype.onBaseTextureLoaded=function(){var t=this.baseTexture;t.removeEventListener("loaded",this.onLoaded),this.noFrame&&(this.frame=new r.Rectangle(0,0,t.width,t.height)),this.noFrame=!1,this.width=this.frame.width,this.height=this.frame.height,this.scope.dispatchEvent({type:"update",content:this})},r.Texture.prototype.destroy=function(t){t&&this.baseTexture.destroy()},r.Texture.prototype.setFrame=function(t){if(this.frame=t,this.width=t.width,this.height=t.height,t.x+t.width>this.baseTexture.width||t.y+t.height>this.baseTexture.height)throw Error("Texture Error: frame does not fit inside the base Texture dimensions "+this);this.updateFrame=!0,r.Texture.frameUpdates.push(this)},r.Texture.fromImage=function(t,e){var i=r.TextureCache[t];return i||(i=new r.Texture(r.BaseTexture.fromImage(t,e)),r.TextureCache[t]=i),i},r.Texture.fromFrame=function(t){var e=r.TextureCache[t];if(!e)throw Error("The frameId '"+t+"' does not exist in the texture cache "+this);return e},r.Texture.fromCanvas=function(t){var e=new r.BaseTexture(t);return new r.Texture(e)},r.Texture.addTextureToCache=function(t,e){r.TextureCache[e]=t},r.Texture.removeTextureFromCache=function(t){var e=r.TextureCache[t];return r.TextureCache[t]=null,e},r.Texture.frameUpdates=[],r.RenderTexture=function(t,e){r.EventTarget.call(this),this.width=t||100,this.height=e||100,this.indetityMatrix=r.mat3.create(),this.frame=new r.Rectangle(0,0,this.width,this.height),r.gl?this.initWebGL():this.initCanvas()},r.RenderTexture.constructor=r.RenderTexture,r.RenderTexture.prototype=Object.create(r.Texture.prototype),r.RenderTexture.prototype.initWebGL=function(){var t=r.gl;this.glFramebuffer=t.createFramebuffer(),t.bindFramebuffer(t.FRAMEBUFFER,this.glFramebuffer),this.glFramebuffer.width=this.width,this.glFramebuffer.height=this.height,this.baseTexture=new r.BaseTexture,this.baseTexture.width=this.width,this.baseTexture.height=this.height,this.baseTexture._glTexture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.baseTexture._glTexture),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,this.width,this.height,0,t.RGBA,t.UNSIGNED_BYTE,null),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),this.baseTexture.isRender=!0,t.bindFramebuffer(t.FRAMEBUFFER,this.glFramebuffer),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,this.baseTexture._glTexture,0),this.projectionMatrix=r.mat4.create(),this.projectionMatrix[5]=2/this.height,this.projectionMatrix[13]=-1,this.projectionMatrix[0]=2/this.width,this.projectionMatrix[12]=-1,this.render=this.renderWebGL},r.RenderTexture.prototype.initCanvas=function(){this.renderer=new r.CanvasRenderer(this.width,this.height,null,0),this.baseTexture=new r.BaseTexture(this.renderer.view),this.frame=new r.Rectangle(0,0,this.width,this.height),this.render=this.renderCanvas},r.RenderTexture.prototype.renderWebGL=function(t,e){var i=r.gl;i.colorMask(!0,!0,!0,!0),i.viewport(0,0,this.width,this.height),i.bindFramebuffer(i.FRAMEBUFFER,this.glFramebuffer),e&&(i.clearColor(0,0,0,0),i.clear(i.COLOR_BUFFER_BIT));var s=t.children;t.worldTransform=r.mat3.create();for(var n=0,a=s.length;a>n;n++)s[n].updateTransform();var o=t.__renderGroup;o?t==o.root?o.render(this.projectionMatrix):o.renderSpecific(t,this.projectionMatrix):(this.renderGroup||(this.renderGroup=new r.WebGLRenderGroup(i)),this.renderGroup.setRenderable(t),this.renderGroup.render(this.projectionMatrix))},r.RenderTexture.prototype.renderCanvas=function(t,e){var i=t.children;t.worldTransform=r.mat3.create();for(var s=0,n=i.length;n>s;s++)i[s].updateTransform();e&&this.renderer.context.clearRect(0,0,this.width,this.height),this.renderer.renderDisplayObject(t),r.texturesToUpdate.push(this.baseTexture)},r.AssetLoader=function(t){r.EventTarget.call(this),this.assetURLs=t,this.crossorigin=!1,this.loadersByType={jpg:r.ImageLoader,jpeg:r.ImageLoader,png:r.ImageLoader,gif:r.ImageLoader,json:r.SpriteSheetLoader,xml:r.BitmapFontLoader,fnt:r.BitmapFontLoader}},r.AssetLoader.constructor=r.AssetLoader,r.AssetLoader.prototype.load=function(){var t=this;this.loadCount=this.assetURLs.length;for(var e=0;this.assetURLs.length>e;e++){var i=this.assetURLs[e],r=i.split(".").pop().toLowerCase(),s=this.loadersByType[r];if(!s)throw Error(r+" is an unsupported file type");var n=new s(i,this.crossorigin);n.addEventListener("loaded",function(){t.onAssetLoaded()}),n.load()}},r.AssetLoader.prototype.onAssetLoaded=function(){this.loadCount--,this.dispatchEvent({type:"onProgress",content:this}),this.onProgress&&this.onProgress(),0==this.loadCount&&(this.dispatchEvent({type:"onComplete",content:this}),this.onComplete&&this.onComplete())},r.JsonLoader=function(t,e){r.EventTarget.call(this),this.url=t,this.baseUrl=t.replace(/[^\/]*$/,""),this.crossorigin=e},r.JsonLoader.constructor=r.JsonLoader,r.JsonLoader.prototype.load=function(){this.ajaxRequest=new s;var t=this;this.ajaxRequest.onreadystatechange=function(){t.onJSONLoaded()},this.ajaxRequest.open("GET",this.url,!0),this.ajaxRequest.overrideMimeType&&this.ajaxRequest.overrideMimeType("application/json"),this.ajaxRequest.send(null)},r.JsonLoader.prototype.onJSONLoaded=function(){4==this.ajaxRequest.readyState&&(200==this.ajaxRequest.status||-1==window.location.href.indexOf("http")?(this.json=JSON.parse(this.ajaxRequest.responseText),this.onLoaded()):this.onError())},r.JsonLoader.prototype.onLoaded=function(){this.dispatchEvent({type:"loaded",content:this})},r.JsonLoader.prototype.onError=function(){this.dispatchEvent({type:"error",content:this})},r.SpriteSheetLoader=function(t,e){r.EventTarget.call(this),this.url=t,this.baseUrl=t.replace(/[^\/]*$/,""),this.texture=null,this.frames={},this.crossorigin=e},r.SpriteSheetLoader.constructor=r.SpriteSheetLoader,r.SpriteSheetLoader.prototype.load=function(){var t=this,e=new r.JsonLoader(this.url,this.crossorigin);e.addEventListener("loaded",function(e){t.json=e.content.json,t.onJSONLoaded()}),e.load()},r.SpriteSheetLoader.prototype.onJSONLoaded=function(){var t=this,e=this.baseUrl+this.json.meta.image,i=new r.ImageLoader(e,this.crossorigin),s=this.json.frames;this.texture=i.texture.baseTexture,i.addEventListener("loaded",function(){t.onLoaded()});for(var n in s){var a=s[n].frame;a&&(r.TextureCache[n]=new r.Texture(this.texture,{x:a.x,y:a.y,width:a.w,height:a.h}),s[n].trimmed&&(r.TextureCache[n].realSize=s[n].spriteSourceSize,r.TextureCache[n].trim.x=0))}i.load()},r.SpriteSheetLoader.prototype.onLoaded=function(){this.dispatchEvent({type:"loaded",content:this})},r.ImageLoader=function(t,e){r.EventTarget.call(this),this.texture=r.Texture.fromImage(t,e)},r.ImageLoader.constructor=r.ImageLoader,r.ImageLoader.prototype.load=function(){if(this.texture.baseTexture.hasLoaded)this.onLoaded();else{var t=this;this.texture.baseTexture.addEventListener("loaded",function(){t.onLoaded()})}},r.ImageLoader.prototype.onLoaded=function(){this.dispatchEvent({type:"loaded",content:this})},r.BitmapFontLoader=function(t,e){r.EventTarget.call(this),this.url=t,this.baseUrl=t.replace(/[^\/]*$/,""),this.texture=null,this.crossorigin=e},r.BitmapFontLoader.constructor=r.BitmapFontLoader,r.BitmapFontLoader.prototype.load=function(){this.ajaxRequest=new XMLHttpRequest;var t=this;this.ajaxRequest.onreadystatechange=function(){t.onXMLLoaded()},this.ajaxRequest.open("GET",this.url,!0),this.ajaxRequest.overrideMimeType&&this.ajaxRequest.overrideMimeType("application/xml"),this.ajaxRequest.send(null)},r.BitmapFontLoader.prototype.onXMLLoaded=function(){if(4==this.ajaxRequest.readyState&&(200==this.ajaxRequest.status||-1==window.location.href.indexOf("http"))){var t=this.baseUrl+this.ajaxRequest.responseXML.getElementsByTagName("page")[0].attributes.getNamedItem("file").nodeValue,e=new r.ImageLoader(t,this.crossorigin);this.texture=e.texture.baseTexture;var i={},s=this.ajaxRequest.responseXML.getElementsByTagName("info")[0],n=this.ajaxRequest.responseXML.getElementsByTagName("common")[0];i.font=s.attributes.getNamedItem("face").nodeValue,i.size=parseInt(s.attributes.getNamedItem("size").nodeValue,10),i.lineHeight=parseInt(n.attributes.getNamedItem("lineHeight").nodeValue,10),i.chars={};for(var a=this.ajaxRequest.responseXML.getElementsByTagName("char"),o=0;a.length>o;o++){var h=parseInt(a[o].attributes.getNamedItem("id").nodeValue,10),u={x:parseInt(a[o].attributes.getNamedItem("x").nodeValue,10),y:parseInt(a[o].attributes.getNamedItem("y").nodeValue,10),width:parseInt(a[o].attributes.getNamedItem("width").nodeValue,10),height:parseInt(a[o].attributes.getNamedItem("height").nodeValue,10)};r.TextureCache[h]=new r.Texture(this.texture,u),i.chars[h]={xOffset:parseInt(a[o].attributes.getNamedItem("xoffset").nodeValue,10),yOffset:parseInt(a[o].attributes.getNamedItem("yoffset").nodeValue,10),xAdvance:parseInt(a[o].attributes.getNamedItem("xadvance").nodeValue,10),kerning:{},texture:new r.Texture(this.texture,u)}}var d=this.ajaxRequest.responseXML.getElementsByTagName("kerning");for(o=0;d.length>o;o++){var c=parseInt(d[o].attributes.getNamedItem("first").nodeValue,10),l=parseInt(d[o].attributes.getNamedItem("second").nodeValue,10),p=parseInt(d[o].attributes.getNamedItem("amount").nodeValue,10);i.chars[l].kerning[c]=p}r.BitmapText.fonts[i.font]=i;var f=this;e.addEventListener("loaded",function(){f.onLoaded()}),e.load()}},r.BitmapFontLoader.prototype.onLoaded=function(){this.dispatchEvent({type:"loaded",content:this})},"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=r),exports.PIXI=r):i.PIXI=r}).call(this); \ No newline at end of file +(function(){function t(t){return[(255&t>>16)/255,(255&t>>8)/255,(255&t)/255]}function e(){return r.Matrix="undefined"!=typeof Float32Array?Float32Array:Array,r.Matrix}var i=this,r=r||{};r.Point=function(t,e){this.x=t||0,this.y=e||0},r.Point.prototype.clone=function(){return new r.Point(this.x,this.y)},r.Point.constructor=r.Point,r.Rectangle=function(t,e,i,r){this.x=t||0,this.y=e||0,this.width=i||0,this.height=r||0},r.Rectangle.prototype.clone=function(){return new r.Rectangle(this.x,this.y,this.width,this.height)},r.Rectangle.constructor=r.Rectangle,r.DisplayObject=function(){this.position=new r.Point,this.scale=new r.Point(1,1),this.pivot=new r.Point(0,0),this.rotation=0,this.alpha=1,this.visible=!0,this.worldVisible=!1,this.parent=null,this.stage=null,this.hitArea=null,this.worldAlpha=1,this.color=[],this.worldTransform=r.mat3.create(),this.localTransform=r.mat3.create(),this.dynamic=!0,this._sr=0,this._cr=1,this.childIndex=0,this.renderable=!1,this.interactive=!1,this.buttonMode=!1},r.DisplayObject.constructor=r.DisplayObject,r.DisplayObject.prototype.setInteractive=function(t){this.interactive=t,this.stage&&(this.stage.dirty=!0)},r.DisplayObject.prototype.updateTransform=function(){this.rotation!=this.rotationCache&&(this.rotationCache=this.rotation,this._sr=Math.sin(this.rotation),this._cr=Math.cos(this.rotation));var t=this.localTransform,e=this.parent.worldTransform,i=this.worldTransform;t[0]=this._cr*this.scale.x,t[1]=-this._sr*this.scale.y,t[3]=this._sr*this.scale.x,t[4]=this._cr*this.scale.y;var r=this.pivot.x,s=this.pivot.y;t[2]=this.position.x-t[0]*r-s*t[1],t[5]=this.position.y-t[4]*s-r*t[3];var n=t[0],a=t[1],o=t[2],h=t[3],u=t[4],d=t[5],c=e[0],l=e[1],p=e[2],f=e[3],x=e[4],v=e[5];i[0]=c*n+l*h,i[1]=c*a+l*u,i[2]=c*o+l*d+p,i[3]=f*n+x*h,i[4]=f*a+x*u,i[5]=f*o+x*d+v,this.worldAlpha=this.alpha*this.parent.worldAlpha},r.DisplayObjectContainer=function(){r.DisplayObject.call(this),this.children=[],this.renderable=!1},r.DisplayObjectContainer.constructor=r.DisplayObjectContainer,r.DisplayObjectContainer.prototype=Object.create(r.DisplayObject.prototype),r.DisplayObjectContainer.prototype.addChild=function(t){void 0!=t.parent&&t.parent.removeChild(t),t.parent=this,t.childIndex=this.children.length,this.children.push(t),this.stage&&this.stage.__addChild(t),this.__renderGroup&&(t.__renderGroup&&t.__renderGroup.removeDisplayObjectAndChildren(t),this.__renderGroup.addDisplayObjectAndChildren(t))},r.DisplayObjectContainer.prototype.addChildAt=function(t,e){if(!(e>=0&&this.children.length>=e))throw Error(t+" The index "+e+" supplied is out of bounds "+this.children.length);void 0!=t.parent&&t.parent.removeChild(t),e==this.children.length?this.children.push(t):this.children.splice(e,0,t),t.parent=this,t.childIndex=e;for(var i=this.children.length,r=e;i>r;r++)this.children[r].childIndex=r;this.stage&&this.stage.__addChild(t),this.__renderGroup&&(t.__renderGroup&&t.__renderGroup.removeDisplayObjectAndChildren(t),this.__renderGroup.addDisplayObjectAndChildren(t))},r.DisplayObjectContainer.prototype.swapChildren=function(t,e){var i=this.children.indexOf(t),r=this.children.indexOf(e);if(-1===i||-1===r)throw Error(t+" Both the supplied DisplayObjects must be a child of the caller "+this);this.stage&&(this.stage.__removeChild(t),this.stage.__removeChild(e),this.stage.__addChild(t),this.stage.__addChild(e)),t.childIndex=r,e.childIndex=i,this.children[i]=e,this.children[r]=t},r.DisplayObjectContainer.prototype.getChildAt=function(t){if(t>=0&&this.children.length>t)return this.children[t];throw Error(child+" Both the supplied DisplayObjects must be a child of the caller "+this)},r.DisplayObjectContainer.prototype.removeChild=function(t){var e=this.children.indexOf(t);if(-1===e)throw Error(t+" The supplied DisplayObject must be a child of the caller "+this);this.stage&&this.stage.__removeChild(t),t.__renderGroup&&t.__renderGroup.removeDisplayObjectAndChildren(t),t.parent=void 0,this.children.splice(e,1);for(var i=e,r=this.children.length;r>i;i++)this.children[i].childIndex-=1},r.DisplayObjectContainer.prototype.updateTransform=function(){if(this.visible){r.DisplayObject.prototype.updateTransform.call(this);for(var t=0,e=this.children.length;e>t;t++)this.children[t].updateTransform()}},r.blendModes={},r.blendModes.NORMAL=0,r.blendModes.SCREEN=1,r.Sprite=function(t){r.DisplayObjectContainer.call(this),this.anchor=new r.Point,this.texture=t,this.blendMode=r.blendModes.NORMAL,this._width=0,this._height=0,t.baseTexture.hasLoaded?this.updateFrame=!0:(this.onTextureUpdateBind=this.onTextureUpdate.bind(this),this.texture.addEventListener("update",this.onTextureUpdateBind)),this.renderable=!0},r.Sprite.constructor=r.Sprite,r.Sprite.prototype=Object.create(r.DisplayObjectContainer.prototype),Object.defineProperty(r.Sprite.prototype,"width",{get:function(){return this.scale.x*this.texture.frame.width},set:function(t){this.scale.x=t/this.texture.frame.width,this._width=t}}),Object.defineProperty(r.Sprite.prototype,"height",{get:function(){return this.scale.y*this.texture.frame.height},set:function(t){this.scale.y=t/this.texture.frame.height,this._height=t}}),r.Sprite.prototype.setTexture=function(t){this.texture.baseTexture!=t.baseTexture&&(this.textureChange=!0),this.texture=t,this.updateFrame=!0},r.Sprite.prototype.onTextureUpdate=function(){this._width&&(this.scale.x=this._width/this.texture.frame.width),this._height&&(this.scale.y=this._height/this.texture.frame.height),this.updateFrame=!0},r.Sprite.fromFrame=function(t){var e=r.TextureCache[t];if(!e)throw Error("The frameId '"+t+"' does not exist in the texture cache"+this);return new r.Sprite(e)},r.Sprite.fromImage=function(t){var e=r.Texture.fromImage(t);return new r.Sprite(e)},r.MovieClip=function(t){r.Sprite.call(this,t[0]),this.textures=t,this.currentFrame=0,this.animationSpeed=1,this.loop=!0,this.onComplete=null,this.playing},r.MovieClip.constructor=r.MovieClip,r.MovieClip.prototype=Object.create(r.Sprite.prototype),r.MovieClip.prototype.stop=function(){this.playing=!1},r.MovieClip.prototype.play=function(){this.playing=!0},r.MovieClip.prototype.gotoAndStop=function(t){this.playing=!1,this.currentFrame=t;var e=0|this.currentFrame+.5;this.setTexture(this.textures[e%this.textures.length])},r.MovieClip.prototype.gotoAndPlay=function(t){this.currentFrame=t,this.playing=!0},r.MovieClip.prototype.updateTransform=function(){if(r.Sprite.prototype.updateTransform.call(this),this.playing){this.currentFrame+=this.animationSpeed;var t=0|this.currentFrame+.5;this.loop||this.textures.length>t?this.setTexture(this.textures[t%this.textures.length]):t>=this.textures.length&&(this.gotoAndStop(this.textures.length-1),this.onComplete&&this.onComplete())}},r.Text=function(t,e){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"),r.Sprite.call(this,r.Texture.fromCanvas(this.canvas)),this.setText(t),this.setStyle(e),this.updateText(),this.dirty=!1},r.Text.constructor=r.Text,r.Text.prototype=Object.create(r.Sprite.prototype),r.Text.prototype.setStyle=function(t){t=t||{},t.font=t.font||"bold 20pt Arial",t.fill=t.fill||"black",t.align=t.align||"left",t.strokeThickness=t.strokeThickness||0,t.wordWrap=t.wordWrap||!1,t.wordWrapWidth=t.wordWrapWidth||100,this.style=t,this.dirty=!0},r.Sprite.prototype.setText=function(t){this.text=""+t||" ",this.dirty=!0},r.Text.prototype.updateText=function(){this.context.font=this.style.font;var t=this.text;this.style.wordWrap&&(t=this.wordWrap(this.text));for(var e=t.split(/(?:\r\n|\r|\n)/),i=[],s=0,n=0;e.length>n;n++){var a=this.context.measureText(e[n]).width;i[n]=a,s=Math.max(s,a)}this.canvas.width=s+this.style.strokeThickness;var o=this.determineFontHeight("font: "+this.style.font+";")+this.style.strokeThickness;for(this.canvas.height=o*e.length,this.context.fillStyle=this.style.fill,this.context.font=this.style.font,this.context.strokeStyle=this.style.stroke,this.context.lineWidth=this.style.strokeThickness,this.context.textBaseline="top",n=0;e.length>n;n++){var h=new r.Point(this.style.strokeThickness/2,this.style.strokeThickness/2+n*o);"right"==this.style.align?h.x+=s-i[n]:"center"==this.style.align&&(h.x+=(s-i[n])/2),this.style.stroke&&this.style.strokeThickness&&this.context.strokeText(e[n],h.x,h.y),this.style.fill&&this.context.fillText(e[n],h.x,h.y)}this.updateTexture()},r.Text.prototype.updateTexture=function(){this.texture.baseTexture.width=this.canvas.width,this.texture.baseTexture.height=this.canvas.height,this.texture.frame.width=this.canvas.width,this.texture.frame.height=this.canvas.height,this._width=this.canvas.width,this._height=this.canvas.height,r.texturesToUpdate.push(this.texture.baseTexture)},r.Text.prototype.updateTransform=function(){this.dirty&&(this.updateText(),this.dirty=!1),r.Sprite.prototype.updateTransform.call(this)},r.Text.prototype.determineFontHeight=function(t){var e=r.Text.heightCache[t];if(!e){var i=document.getElementsByTagName("body")[0],s=document.createElement("div"),n=document.createTextNode("M");s.appendChild(n),s.setAttribute("style",t),i.appendChild(s),e=s.offsetHeight,r.Text.heightCache[t]=e,i.removeChild(s)}return e},r.Text.prototype.wordWrap=function(t){for(var e=function(t,e,i,r,s){var n=Math.floor((r-i)/2)+i;return n==i?1:s>=t.measureText(e.substring(0,n)).width?t.measureText(e.substring(0,n+1)).width>s?n:arguments.callee(t,e,n,r,s):arguments.callee(t,e,i,n,s)},i=function(t,i,r){if(r>=t.measureText(i).width||1>i.length)return i;var s=e(t,i,0,i.length,r);return i.substring(0,s)+"\n"+arguments.callee(t,i.substring(s),r)},r="",s=t.split("\n"),n=0;s.length>n;n++)r+=i(this.context,s[n],this.style.wordWrapWidth)+"\n";return r},r.Text.prototype.destroy=function(t){t&&this.texture.destroy()},r.Text.heightCache={},r.BitmapText=function(t,e){r.DisplayObjectContainer.call(this),this.setText(t),this.setStyle(e),this.updateText(),this.dirty=!1},r.BitmapText.constructor=r.BitmapText,r.BitmapText.prototype=Object.create(r.DisplayObjectContainer.prototype),r.BitmapText.prototype.setText=function(t){this.text=t||" ",this.dirty=!0},r.BitmapText.prototype.setStyle=function(t){t=t||{},t.align=t.align||"left",this.style=t;var e=t.font.split(" ");this.fontName=e[e.length-1],this.fontSize=e.length>=2?parseInt(e[e.length-2],10):r.BitmapText.fonts[this.fontName].size,this.dirty=!0},r.BitmapText.prototype.updateText=function(){for(var t=r.BitmapText.fonts[this.fontName],e=new r.Point,i=null,s=[],n=0,a=[],o=0,h=this.fontSize/t.size,u=0;this.text.length>u;u++){var d=this.text.charCodeAt(u);if(/(?:\r\n|\r|\n)/.test(this.text.charAt(u)))a.push(e.x),n=Math.max(n,e.x),o++,e.x=0,e.y+=t.lineHeight,i=null;else{var c=t.chars[d];c&&(i&&c[i]&&(e.x+=c.kerning[i]),s.push({texture:c.texture,line:o,charCode:d,position:new r.Point(e.x+c.xOffset,e.y+c.yOffset)}),e.x+=c.xAdvance,i=d)}}a.push(e.x),n=Math.max(n,e.x);var l=[];for(u=0;o>=u;u++){var p=0;"right"==this.style.align?p=n-a[u]:"center"==this.style.align&&(p=(n-a[u])/2),l.push(p)}for(u=0;s.length>u;u++){var f=new r.Sprite(s[u].texture);f.position.x=(s[u].position.x+l[s[u].line])*h,f.position.y=s[u].position.y*h,f.scale.x=f.scale.y=h,this.addChild(f)}this.width=e.x*h,this.height=(e.y+t.lineHeight)*h},r.BitmapText.prototype.updateTransform=function(){if(this.dirty){for(;this.children.length>0;)this.removeChild(this.getChildAt(0));this.updateText(),this.dirty=!1}r.DisplayObjectContainer.prototype.updateTransform.call(this)},r.BitmapText.fonts={},r.InteractionManager=function(t){this.stage=t,this.tempPoint=new r.Point,this.mouseoverEnabled=!0,this.mouse=new r.InteractionData,this.touchs={},this.pool=[],this.interactiveItems=[],this.last=0},r.InteractionManager.constructor=r.InteractionManager,r.InteractionManager.prototype.collectInteractiveSprite=function(t,e){for(var i=t.children,r=i.length,s=r-1;s>=0;s--){var n=i[s];n.interactive?(e.interactiveChildren=!0,this.interactiveItems.push(n),n.children.length>0&&this.collectInteractiveSprite(n,n)):(n.__iParent=null,n.children.length>0&&this.collectInteractiveSprite(n,e))}},r.InteractionManager.prototype.setTarget=function(t){window.navigator.msPointerEnabled&&(t.view.style["-ms-content-zooming"]="none",t.view.style["-ms-touch-action"]="none"),this.target=t,t.view.addEventListener("mousemove",this.onMouseMove.bind(this),!0),t.view.addEventListener("mousedown",this.onMouseDown.bind(this),!0),document.body.addEventListener("mouseup",this.onMouseUp.bind(this),!0),t.view.addEventListener("mouseout",this.onMouseUp.bind(this),!0),t.view.addEventListener("touchstart",this.onTouchStart.bind(this),!0),t.view.addEventListener("touchend",this.onTouchEnd.bind(this),!0),t.view.addEventListener("touchmove",this.onTouchMove.bind(this),!0)},r.InteractionManager.prototype.update=function(){if(this.target){var t=Date.now(),e=t-this.last;if(e=30*e/1e3,!(1>e)){if(this.last=t,this.dirty){this.dirty=!1;for(var i=this.interactiveItems.length,r=0;i>r;r++)this.interactiveItems[r].interactiveChildren=!1;this.interactiveItems=[],this.stage.interactive&&this.interactiveItems.push(this.stage),this.collectInteractiveSprite(this.stage,this.stage)}var s=this.interactiveItems.length;this.target.view.style.cursor="default";for(var r=0;s>r;r++){var n=this.interactiveItems[r];n.visible&&(n.mouseover||n.mouseout||n.buttonMode)&&(n.__hit=this.hitTest(n,this.mouse),n.__hit?(n.buttonMode&&(this.target.view.style.cursor="pointer"),n.__isOver||(n.mouseover&&n.mouseover(this.mouse),n.__isOver=!0)):n.__isOver&&(n.mouseout&&n.mouseout(this.mouse),n.__isOver=!1))}}}},r.InteractionManager.prototype.onMouseMove=function(t){t.preventDefault();var e=this.target.view.getBoundingClientRect();this.mouse.global.x=(t.clientX-e.left)*(this.target.width/e.width),this.mouse.global.y=(t.clientY-e.top)*(this.target.height/e.height);var i=this.interactiveItems.length;this.mouse.global;for(var r=0;i>r;r++){var s=this.interactiveItems[r];s.mousemove&&s.mousemove(this.mouse)}},r.InteractionManager.prototype.onMouseDown=function(t){t.preventDefault();var e=this.interactiveItems.length;this.mouse.global,this.stage;for(var i=0;e>i;i++){var r=this.interactiveItems[i];if((r.mousedown||r.click)&&(r.__mouseIsDown=!0,r.__hit=this.hitTest(r,this.mouse),r.__hit&&(r.mousedown&&r.mousedown(this.mouse),r.__isDown=!0,!r.interactiveChildren)))break}},r.InteractionManager.prototype.onMouseUp=function(t){t.preventDefault(),this.mouse.global;for(var e=this.interactiveItems.length,i=!1,r=0;e>r;r++){var s=this.interactiveItems[r];(s.mouseup||s.mouseupoutside||s.click)&&(s.__hit=this.hitTest(s,this.mouse),s.__hit&&!i?(s.mouseup&&s.mouseup(this.mouse),s.__isDown&&s.click&&s.click(this.mouse),s.interactiveChildren||(i=!0)):s.__isDown&&s.mouseupoutside&&s.mouseupoutside(this.mouse),s.__isDown=!1)}},r.InteractionManager.prototype.hitTest=function(t,e){var i=e.global;if(!t.visible)return!1;if(t instanceof r.Sprite){var s=t.worldTransform,n=s[0],a=s[1],o=s[2],h=s[3],u=s[4],d=s[5],c=1/(n*u+a*-h),l=u*c*i.x+-a*c*i.y+(d*a-o*u)*c,p=n*c*i.y+-h*c*i.x+(-d*n+o*h)*c,f=t.texture.frame.width,x=t.texture.frame.height,v=-f*t.anchor.x;if(l>v&&v+f>l){var b=-x*t.anchor.y;if(p>b&&b+x>p)return e.target=t,!0}}else if(t.hitArea){var s=t.worldTransform,g=t.hitArea,n=s[0],a=s[1],o=s[2],h=s[3],u=s[4],d=s[5],c=1/(n*u+a*-h),l=u*c*i.x+-a*c*i.y+(d*a-o*u)*c,p=n*c*i.y+-h*c*i.x+(-d*n+o*h)*c,v=g.x;if(l>v&&v+g.width>l){var b=g.y;if(p>b&&b+g.height>p)return!0}}for(var m=t.children.length,T=0;m>T;T++){var y=t.children[T],_=this.hitTest(y,e);if(_)return!0}return!1},r.InteractionManager.prototype.onTouchMove=function(t){t.preventDefault();for(var e=this.target.view.getBoundingClientRect(),i=t.changedTouches,r=0;i.length>r;r++){var s=i[r],n=this.touchs[s.identifier];n.global.x=(s.clientX-e.left)*(this.target.width/e.width),n.global.y=(s.clientY-e.top)*(this.target.height/e.height)}for(var a=this.interactiveItems.length,r=0;a>r;r++){var o=this.interactiveItems[r];o.touchmove&&o.touchmove(n)}},r.InteractionManager.prototype.onTouchStart=function(t){t.preventDefault();for(var e=this.target.view.getBoundingClientRect(),i=t.changedTouches,s=0;i.length>s;s++){var n=i[s],a=this.pool.pop();a||(a=new r.InteractionData),this.touchs[n.identifier]=a,a.global.x=(n.clientX-e.left)*(this.target.width/e.width),a.global.y=(n.clientY-e.top)*(this.target.height/e.height);for(var o=this.interactiveItems.length,h=0;o>h;h++){var u=this.interactiveItems[h];if((u.touchstart||u.tap)&&(u.__hit=this.hitTest(u,a),u.__hit&&(u.touchstart&&u.touchstart(a),u.__isDown=!0,u.__touchData=a,!u.interactiveChildren)))break}}},r.InteractionManager.prototype.onTouchEnd=function(t){t.preventDefault();for(var e=this.target.view.getBoundingClientRect(),i=t.changedTouches,r=0;i.length>r;r++){var s=i[r],n=this.touchs[s.identifier],a=!1;n.global.x=(s.clientX-e.left)*(this.target.width/e.width),n.global.y=(s.clientY-e.top)*(this.target.height/e.height);for(var o=this.interactiveItems.length,h=0;o>h;h++){var u=this.interactiveItems[h],d=u.__touchData;u.__hit=this.hitTest(u,n),d==n&&((u.touchend||u.tap)&&(u.__hit&&!a?(u.touchend&&u.touchend(n),u.__isDown&&u.tap&&u.tap(n),u.interactiveChildren||(a=!0)):u.__isDown&&u.touchendoutside&&u.touchendoutside(n),u.__isDown=!1),u.__touchData=null)}this.pool.push(n),this.touchs[s.identifier]=null}},r.InteractionData=function(){this.global=new r.Point,this.local=new r.Point,this.target},r.InteractionData.prototype.getLocalPosition=function(t){var e=t.worldTransform,i=this.global,s=e[0],n=e[1],a=e[2],o=e[3],h=e[4],u=e[5],d=1/(s*h+n*-o);return new r.Point(h*d*i.x+-n*d*i.y+(u*n-a*h)*d,s*d*i.y+-o*d*i.x+(-u*s+a*o)*d)},r.InteractionData.constructor=r.InteractionData,r.Stage=function(t,e){r.DisplayObjectContainer.call(this),this.worldTransform=r.mat3.create(),this.__childrenAdded=[],this.__childrenRemoved=[],this.childIndex=0,this.stage=this,this.stage.hitArea=new r.Rectangle(0,0,1e5,1e5),this.interactive=!!e,this.interactionManager=new r.InteractionManager(this),this.setBackgroundColor(t),this.worldVisible=!0},r.Stage.constructor=r.Stage,r.Stage.prototype=Object.create(r.DisplayObjectContainer.prototype),r.Stage.prototype.updateTransform=function(){this.worldAlpha=1;for(var t=0,e=this.children.length;e>t;t++)this.children[t].updateTransform();this.dirty&&(this.dirty=!1,this.interactionManager.dirty=!0),this.interactive&&this.interactionManager.update()},r.Stage.prototype.setBackgroundColor=function(e){this.backgroundColor=e||0,this.backgroundColorSplit=t(this.backgroundColor),this.backgroundColorString="#"+this.backgroundColor.toString(16)},r.Stage.prototype.getMousePosition=function(){return this.interactionManager.mouse.global},r.Stage.prototype.__addChild=function(t){if(t.interactive&&(this.dirty=!0),t.stage=this,t.children)for(var e=0;t.children.length>e;e++)this.__addChild(t.children[e])},r.Stage.prototype.__removeChild=function(t){if(t.interactive&&(this.dirty=!0),t.stage=void 0,t.children)for(var e=0,i=t.children.length;i>e;e++)this.__removeChild(t.children[e])},window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){window.setTimeout(t,1e3/60)}}(),"function"!=typeof Function.prototype.bind&&(Function.prototype.bind=function(){var t=Array.prototype.slice;return function(e){function i(){var n=s.concat(t.call(arguments));r.apply(this instanceof i?this:e,n)}var r=this,s=t.call(arguments,1);if("function"!=typeof r)throw new TypeError;return i.prototype=function n(t){return t&&(n.prototype=t),this instanceof n?void 0:new n}(r.prototype),i}}());var s=function(){var t=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(!window.ActiveXObject)return window.XMLHttpRequest?new XMLHttpRequest:!1;for(var e=0;t.length>e;e++)try{return new ActiveXObject(t[e])}catch(i){}};r.EventTarget=function(){var t={};this.addEventListener=this.on=function(e,i){void 0===t[e]&&(t[e]=[]),-1===t[e].indexOf(i)&&t[e].push(i)},this.dispatchEvent=this.emit=function(e){for(var i in t[e.type])t[e.type][i](e)},this.removeEventListener=this.off=function(e,i){var r=t[e].indexOf(i);-1!==r&&t[e].splice(r,1)}},e(),r.mat3={},r.mat3.create=function(){var t=new r.Matrix(9);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},r.mat4={},r.mat4.create=function(){var t=new r.Matrix(16);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},r.mat3.multiply=function(t,e,i){i||(i=t);var r=t[0],s=t[1],n=t[2],a=t[3],o=t[4],h=t[5],u=t[6],d=t[7],c=t[8],l=e[0],p=e[1],f=e[2],x=e[3],v=e[4],b=e[5],g=e[6],m=e[7],T=e[8];return i[0]=l*r+p*a+f*u,i[1]=l*s+p*o+f*d,i[2]=l*n+p*h+f*c,i[3]=x*r+v*a+b*u,i[4]=x*s+v*o+b*d,i[5]=x*n+v*h+b*c,i[6]=g*r+m*a+T*u,i[7]=g*s+m*o+T*d,i[8]=g*n+m*h+T*c,i},r.mat3.toMat4=function(t,e){return e||(e=r.mat4.create()),e[15]=1,e[14]=0,e[13]=0,e[12]=0,e[11]=0,e[10]=t[8],e[9]=t[7],e[8]=t[6],e[7]=0,e[6]=t[5],e[5]=t[4],e[4]=t[3],e[3]=0,e[2]=t[2],e[1]=t[1],e[0]=t[0],e},r.mat4.create=function(){var t=new r.Matrix(16);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},r.mat4.transpose=function(t,e){if(!e||t===e){var i=t[1],r=t[2],s=t[3],n=t[6],a=t[7],o=t[11];return t[1]=t[4],t[2]=t[8],t[3]=t[12],t[4]=i,t[6]=t[9],t[7]=t[13],t[8]=r,t[9]=n,t[11]=t[14],t[12]=s,t[13]=a,t[14]=o,t}return e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15],e},r.mat4.multiply=function(t,e,i){i||(i=t);var r=t[0],s=t[1],n=t[2],a=t[3],o=t[4],h=t[5],u=t[6],d=t[7],c=t[8],l=t[9],p=t[10],f=t[11],x=t[12],v=t[13],b=t[14],g=t[15],m=e[0],T=e[1],y=e[2],_=e[3];return i[0]=m*r+T*o+y*c+_*x,i[1]=m*s+T*h+y*l+_*v,i[2]=m*n+T*u+y*p+_*b,i[3]=m*a+T*d+y*f+_*g,m=e[4],T=e[5],y=e[6],_=e[7],i[4]=m*r+T*o+y*c+_*x,i[5]=m*s+T*h+y*l+_*v,i[6]=m*n+T*u+y*p+_*b,i[7]=m*a+T*d+y*f+_*g,m=e[8],T=e[9],y=e[10],_=e[11],i[8]=m*r+T*o+y*c+_*x,i[9]=m*s+T*h+y*l+_*v,i[10]=m*n+T*u+y*p+_*b,i[11]=m*a+T*d+y*f+_*g,m=e[12],T=e[13],y=e[14],_=e[15],i[12]=m*r+T*o+y*c+_*x,i[13]=m*s+T*h+y*l+_*v,i[14]=m*n+T*u+y*p+_*b,i[15]=m*a+T*d+y*f+_*g,i},r.autoDetectRenderer=function(t,e,i,s){t||(t=800),e||(e=600);var n=function(){try{return!!window.WebGLRenderingContext&&!!document.createElement("canvas").getContext("experimental-webgl")}catch(t){return!1}}();return n?new r.WebGLRenderer(t,e,i,s):new r.CanvasRenderer(t,e,i,s)},r.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;","}"],r.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;","}"],r.CompileVertexShader=function(t,e){return r._CompileShader(t,e,t.VERTEX_SHADER)},r.CompileFragmentShader=function(t,e){return r._CompileShader(t,e,t.FRAGMENT_SHADER)},r._CompileShader=function(t,e,i){var r=e.join("\n"),s=t.createShader(i);return t.shaderSource(s,r),t.compileShader(s),t.getShaderParameter(s,t.COMPILE_STATUS)?s:(alert(t.getShaderInfoLog(s)),null)},r.activateDefaultShader=function(){var t=r.gl,e=r.shaderProgram;t.useProgram(e),t.enableVertexAttribArray(e.vertexPositionAttribute),t.enableVertexAttribArray(e.textureCoordAttribute),t.enableVertexAttribArray(e.colorAttribute)},r.activatePrimitiveShader=function(){var t=r.gl;t.disableVertexAttribArray(r.shaderProgram.textureCoordAttribute),t.disableVertexAttribArray(r.shaderProgram.colorAttribute);var e=r.shaderProgram2;t.useProgram(e),t.enableVertexAttribArray(e.vertexPositionAttribute),t.enableVertexAttribArray(r.shaderProgram2.colorAttribute)},r._defaultFrame=new r.Rectangle(0,0,1,1),r.gl,r.WebGLRenderer=function(t,e,i,s){this.transparent=!!s,this.width=t||800,this.height=e||600,this.view=i||document.createElement("canvas"),this.view.width=this.width,this.view.height=this.height;var n=this;this.view.addEventListener("webglcontextlost",function(t){n.handleContextLost(t)},!1),this.view.addEventListener("webglcontextrestored",function(t){n.handleContextRestored(t)},!1),this.batchs=[];try{r.gl=this.gl=this.view.getContext("experimental-webgl",{alpha:this.transparent,antialias:!1,premultipliedAlpha:!1})}catch(a){throw Error(" This browser does not support webGL. Try using the canvas renderer"+this)}r.WebGLGraphics.initShaders(),this.initShaders();var o=this.gl;r.WebGLRenderer.gl=o,this.batch=new r.WebGLBatch(o),o.disable(o.DEPTH_TEST),o.disable(o.CULL_FACE),o.enable(o.BLEND),o.colorMask(!0,!0,!0,this.transparent),this.projectionMatrix=r.mat4.create(),this.resize(this.width,this.height),this.contextLost=!1,this.stageRenderGroup=new r.WebGLRenderGroup(this.gl)},r.WebGLRenderer.constructor=r.WebGLRenderer,r.WebGLRenderer.getBatch=function(){return 0==r._batchs.length?new r.WebGLBatch(r.WebGLRenderer.gl):r._batchs.pop()},r.WebGLRenderer.returnBatch=function(t){t.clean(),r._batchs.push(t)},r.WebGLRenderer.prototype.initShaders=function(){var t=this.gl,e=r.CompileFragmentShader(t,r.shaderFragmentSrc),i=r.CompileVertexShader(t,r.shaderVertexSrc);r.shaderProgram=t.createProgram();var s=r.shaderProgram;t.attachShader(s,i),t.attachShader(s,e),t.linkProgram(s),t.getProgramParameter(s,t.LINK_STATUS)||alert("Could not initialise shaders"),t.useProgram(s),s.vertexPositionAttribute=t.getAttribLocation(s,"aVertexPosition"),s.textureCoordAttribute=t.getAttribLocation(s,"aTextureCoord"),s.colorAttribute=t.getAttribLocation(s,"aColor"),s.mvMatrixUniform=t.getUniformLocation(s,"uMVMatrix"),s.samplerUniform=t.getUniformLocation(s,"uSampler"),r.activateDefaultShader()},r.WebGLRenderer.prototype.render=function(t){if(!this.contextLost){this.__stage!==t&&(this.__stage=t,this.stageRenderGroup.setRenderable(t)),r.WebGLRenderer.updateTextures(),t.updateTransform();var e=this.gl;if(e.colorMask(!0,!0,!0,this.transparent),e.viewport(0,0,this.width,this.height),e.bindFramebuffer(e.FRAMEBUFFER,null),e.clearColor(t.backgroundColorSplit[0],t.backgroundColorSplit[1],t.backgroundColorSplit[2],!this.transparent),e.clear(e.COLOR_BUFFER_BIT),r.projectionMatrix=this.projectionMatrix,this.stageRenderGroup.backgroundColor=t.backgroundColorSplit,this.stageRenderGroup.render(this.projectionMatrix),t.interactive&&(t._interactiveEventsAdded||(t._interactiveEventsAdded=!0,t.interactionManager.setTarget(this))),r.Texture.frameUpdates.length>0){for(var i=0;r.Texture.frameUpdates.length>i;i++)r.Texture.frameUpdates[i].updateFrame=!1;r.Texture.frameUpdates=[]}}},r.WebGLRenderer.updateTextures=function(){for(var t=0;r.texturesToUpdate.length>t;t++)this.updateTexture(r.texturesToUpdate[t]);for(var t=0;r.texturesToDestroy.length>t;t++)this.destroyTexture(r.texturesToDestroy[t]);r.texturesToUpdate=[],r.texturesToDestroy=[]},r.WebGLRenderer.updateTexture=function(t){var e=r.gl;t._glTexture||(t._glTexture=e.createTexture()),t.hasLoaded&&(e.bindTexture(e.TEXTURE_2D,t._glTexture),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,t.source),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),t._powerOf2?(e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.REPEAT)):(e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE)),e.bindTexture(e.TEXTURE_2D,null))},r.WebGLRenderer.prototype.destroyTexture=function(t){var e=this.gl;t._glTexture&&(t._glTexture=e.createTexture(),e.deleteTexture(e.TEXTURE_2D,t._glTexture))},r.WebGLRenderer.prototype.resize=function(t,e){this.width=t,this.height=e,this.view.width=t,this.view.height=e,this.gl.viewport(0,0,this.width,this.height);var i=this.projectionMatrix;i[0]=2/this.width,i[5]=-2/this.height,i[12]=-1,i[13]=1},r.WebGLRenderer.prototype.handleContextLost=function(t){t.preventDefault(),this.contextLost=!0},r.WebGLRenderer.prototype.handleContextRestored=function(){this.gl=this.view.getContext("experimental-webgl",{alpha:!0}),this.initShaders();for(var t=0;r.TextureCache.length>t;t++)this.updateTexture(r.TextureCache[t]);for(var t=0;this.batchs.length>t;t++)this.batchs[t].restoreLostContext(this.gl),this.batchs[t].dirty=!0;r._restoreBatchs(this.gl),this.contextLost=!1},r._batchs=[],r._getBatch=function(t){return 0==r._batchs.length?new r.WebGLBatch(t):r._batchs.pop()},r._returnBatch=function(t){t.clean(),r._batchs.push(t)},r._restoreBatchs=function(t){for(var e=0;r._batchs.length>e;e++)r._batchs[e].restoreLostContext(t)},r.WebGLBatch=function(t){this.gl=t,this.size=0,this.vertexBuffer=t.createBuffer(),this.indexBuffer=t.createBuffer(),this.uvBuffer=t.createBuffer(),this.colorBuffer=t.createBuffer(),this.blendMode=r.blendModes.NORMAL,this.dynamicSize=1},r.WebGLBatch.constructor=r.WebGLBatch,r.WebGLBatch.prototype.clean=function(){this.verticies=[],this.uvs=[],this.indices=[],this.colors=[],this.dynamicSize=1,this.texture=null,this.last=null,this.size=0,this.head,this.tail},r.WebGLBatch.prototype.restoreLostContext=function(t){this.gl=t,this.vertexBuffer=t.createBuffer(),this.indexBuffer=t.createBuffer(),this.uvBuffer=t.createBuffer(),this.colorBuffer=t.createBuffer()},r.WebGLBatch.prototype.init=function(t){t.batch=this,this.dirty=!0,this.blendMode=t.blendMode,this.texture=t.texture.baseTexture,this.head=t,this.tail=t,this.size=1,this.growBatch()},r.WebGLBatch.prototype.insertBefore=function(t,e){this.size++,t.batch=this,this.dirty=!0;var i=e.__prev;e.__prev=t,t.__next=e,i?(t.__prev=i,i.__next=t):this.head=t},r.WebGLBatch.prototype.insertAfter=function(t,e){this.size++,t.batch=this,this.dirty=!0;var i=e.__next;e.__next=t,t.__prev=e,i?(t.__next=i,i.__prev=t):this.tail=t},r.WebGLBatch.prototype.remove=function(t){return this.size--,0==this.size?(t.batch=null,t.__prev=null,t.__next=null,void 0):(t.__prev?t.__prev.__next=t.__next:(this.head=t.__next,this.head.__prev=null),t.__next?t.__next.__prev=t.__prev:(this.tail=t.__prev,this.tail.__next=null),t.batch=null,t.__next=null,t.__prev=null,this.dirty=!0,void 0)},r.WebGLBatch.prototype.split=function(t){this.dirty=!0;var e=new r.WebGLBatch(this.gl);e.init(t),e.texture=this.texture,e.tail=this.tail,this.tail=t.__prev,this.tail.__next=null,t.__prev=null;for(var i=0;t;)i++,t.batch=e,t=t.__next;return e.size=i,this.size-=i,e},r.WebGLBatch.prototype.merge=function(t){this.dirty=!0,this.tail.__next=t.head,t.head.__prev=this.tail,this.size+=t.size,this.tail=t.tail;for(var e=t.head;e;)e.batch=this,e=e.__next},r.WebGLBatch.prototype.growBatch=function(){var t=this.gl;this.dynamicSize=1==this.size?1:1.5*this.size,this.verticies=new Float32Array(8*this.dynamicSize),t.bindBuffer(t.ARRAY_BUFFER,this.vertexBuffer),t.bufferData(t.ARRAY_BUFFER,this.verticies,t.DYNAMIC_DRAW),this.uvs=new Float32Array(8*this.dynamicSize),t.bindBuffer(t.ARRAY_BUFFER,this.uvBuffer),t.bufferData(t.ARRAY_BUFFER,this.uvs,t.DYNAMIC_DRAW),this.dirtyUVS=!0,this.colors=new Float32Array(4*this.dynamicSize),t.bindBuffer(t.ARRAY_BUFFER,this.colorBuffer),t.bufferData(t.ARRAY_BUFFER,this.colors,t.DYNAMIC_DRAW),this.dirtyColors=!0,this.indices=new Uint16Array(6*this.dynamicSize);for(var e=this.indices.length/6,i=0;e>i;i++){var r=6*i,s=4*i;this.indices[r+0]=s+0,this.indices[r+1]=s+1,this.indices[r+2]=s+2,this.indices[r+3]=s+0,this.indices[r+4]=s+2,this.indices[r+5]=s+3}t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indexBuffer),t.bufferData(t.ELEMENT_ARRAY_BUFFER,this.indices,t.STATIC_DRAW)},r.WebGLBatch.prototype.refresh=function(){this.gl,this.dynamicSizes;s++)i=this.batchs[s],i instanceof r.WebGLBatch?this.batchs[s].render():i instanceof r.TilingSprite?i.visible&&this.renderTilingSprite(i,t):i instanceof r.Strip?i.visible&&this.renderStrip(i,t):i instanceof r.Graphics&&i.visible&&r.WebGLGraphics.renderGraphics(i)},r.WebGLRenderGroup.prototype.renderSpecific=function(t,e){r.WebGLRenderer.updateTextures();var i=this.gl;this.checkVisibility(t,t.visible),i.uniformMatrix4fv(r.shaderProgram.mvMatrixUniform,!1,e);var s,n,a,o,h=t.renderable?t:this.getNextRenderable(t),u=h.batch;if(h instanceof r.Sprite){u=h.batch;var d=u.head;if(d==h)s=0;else for(s=1;d.__next!=h;)s++,d=d.__next}else u=h;for(var c,l=t,p=t;p.children.length>0;)p=p.children[p.children.length-1],p.renderable&&(l=p);if(l instanceof r.Sprite){c=l.batch;var d=c.head;if(d==l)a=0;else for(a=1;d.__next!=l;)a++,d=d.__next}else c=l;if(u==c)return u instanceof r.WebGLBatch?u.render(s,a+1):u instanceof r.TilingSprite?u.visible&&this.renderTilingSprite(u,e):u instanceof r.Strip?u.visible&&this.renderStrip(u,e):u instanceof r.CustomRenderable&&u.visible&&u.renderWebGL(this,e),void 0;n=this.batchs.indexOf(u),o=this.batchs.indexOf(c),u instanceof r.WebGLBatch?u.render(s):u instanceof r.TilingSprite?u.visible&&this.renderTilingSprite(u,e):u instanceof r.Strip?u.visible&&this.renderStrip(u,e):u instanceof r.CustomRenderable&&u.visible&&u.renderWebGL(this,e);for(var f=n+1;o>f;f++)renderable=this.batchs[f],renderable instanceof r.WebGLBatch?this.batchs[f].render():renderable instanceof r.TilingSprite?renderable.visible&&this.renderTilingSprite(renderable,e):renderable instanceof r.Strip?renderable.visible&&this.renderStrip(renderable,e):renderable instanceof r.CustomRenderable&&renderable.visible&&renderable.renderWebGL(this,e);c instanceof r.WebGLBatch?c.render(0,a+1):c instanceof r.TilingSprite?c.visible&&this.renderTilingSprite(c):c instanceof r.Strip?c.visible&&this.renderStrip(c):c instanceof r.CustomRenderable&&c.visible&&c.renderWebGL(this,e)},r.WebGLRenderGroup.prototype.checkVisibility=function(t,e){for(var i=t.children,r=0;i.length>r;r++){var s=i[r];s.worldVisible=s.visible&&e,s.textureChange&&(s.textureChange=!1,s.worldVisible&&(this.removeDisplayObject(s),this.addDisplayObject(s))),s.children.length>0&&this.checkVisibility(s,s.worldVisible)}},r.WebGLRenderGroup.prototype.updateTexture=function(t){if(1==t.batch.length)return t.batch.texture=t.texture.baseTexture,void 0;if(t.batch.texture!=t.texture.baseTexture)if(t.batch.head==t){var e=t.batch,i=this.batchs.indexOf(e),s=this.batchs[i-1];if(e.remove(t),s)if(s.texture==t.texture.baseTexture&&s.blendMode==t.blendMode)s.insertAfter(t,s.tail);else{var n=r.WebGLRenderer.getBatch();n.init(t),this.batchs.splice(i-1,0,n)}else{var n=r.WebGLRenderer.getBatch();n.init(t),this.batchs.splice(0,0,n)}}else if(t.batch.tail==t){var e=t.batch,i=this.batchs.indexOf(e),a=this.batchs[i+1];if(e.remove(t),a){if(a.texture==t.texture.baseTexture&&a.blendMode==t.blendMode)return a.insertBefore(t,a.head),void 0;var n=r.WebGLRenderer.getBatch();n.init(t),this.batchs.splice(i+1,0,n)}else{var n=r.WebGLRenderer.getBatch();n.init(t),this.batchs.push(n)}}else{var e=t.batch,o=e.split(t);o.remove(t);var n=r.WebGLRenderer.getBatch(),i=this.batchs.indexOf(e);n.init(t),this.batchs.splice(i+1,0,n,o)}},r.WebGLRenderGroup.prototype.addDisplayObject=function(t){if(t.__renderGroup&&t.__renderGroup.removeDisplayObjectAndChildren(t),t.__renderGroup=this,t.renderable){var e=this.getPreviousRenderable(t),i=this.getNextRenderable(t);if(t instanceof r.Sprite){var s,n;if(e instanceof r.Sprite){if(s=e.batch,s&&s.texture==t.texture.baseTexture&&s.blendMode==t.blendMode)return s.insertAfter(t,e),void 0}else s=e;if(i)if(i instanceof r.Sprite){if(n=i.batch){if(n.texture==t.texture.baseTexture&&n.blendMode==t.blendMode)return n.insertBefore(t,i),void 0;if(n==s){var a=s.split(i),o=r.WebGLRenderer.getBatch(),h=this.batchs.indexOf(s);return o.init(t),this.batchs.splice(h+1,0,o,a),void 0}}}else n=i;var o=r.WebGLRenderer.getBatch();if(o.init(t),s){var h=this.batchs.indexOf(s);this.batchs.splice(h+1,0,o)}else this.batchs.push(o)}else t instanceof r.TilingSprite?(this.initTilingSprite(t),this.batchs.push(t)):t instanceof r.Strip?(this.initStrip(t),this.batchs.push(t)):t instanceof r.Graphics&&this.batchs.push(t);this.batchUpdate=!0}},r.WebGLRenderGroup.prototype.addDisplayObjectAndChildren=function(t){this.addDisplayObject(t);for(var e=t.children,i=0;e.length>i;i++)this.addDisplayObjectAndChildren(e[i])},r.WebGLRenderGroup.prototype.removeDisplayObject=function(t){if(t.__renderGroup=null,t.renderable){var e;if(t instanceof r.Sprite){var i=t.batch;if(!i)return;i.remove(t),0==i.size&&(e=i)}else e=t;if(e){var s=this.batchs.indexOf(e);if(-1==s)return;if(0==s||s==this.batchs.length-1)return this.batchs.splice(s,1),e instanceof r.WebGLBatch&&r.WebGLRenderer.returnBatch(e),void 0;if(this.batchs[s-1]instanceof r.WebGLBatch&&this.batchs[s+1]instanceof r.WebGLBatch&&this.batchs[s-1].texture==this.batchs[s+1].texture&&this.batchs[s-1].blendMode==this.batchs[s+1].blendMode)return this.batchs[s-1].merge(this.batchs[s+1]),e instanceof r.WebGLBatch&&r.WebGLRenderer.returnBatch(e),r.WebGLRenderer.returnBatch(this.batchs[s+1]),this.batchs.splice(s,2),void 0;this.batchs.splice(s,1),e instanceof r.WebGLBatch&&r.WebGLRenderer.returnBatch(e)}}},r.WebGLRenderGroup.prototype.removeDisplayObjectAndChildren=function(t){if(t.__renderGroup==this){this.removeDisplayObject(t);for(var e=t.children,i=0;e.length>i;i++)this.removeDisplayObjectAndChildren(e[i])}},r.WebGLRenderGroup.prototype.getNextRenderable=function(t){var e=t;do{if(0==e.children.length){if(!e.parent)return null;for(;e.childIndex==e.parent.children.length-1;)if(e=e.parent,e==this.root||!e.parent){e=null;break}e&&(e=e.parent.children[e.childIndex+1])}else e=e.children[0];if(!e)break}while(!e.renderable||!e.__renderGroup);return e},r.WebGLRenderGroup.prototype.getPreviousRenderable=function(t){var e=t;do{if(0==e.childIndex){if(e=e.parent,!e)return null}else for(e=e.parent.children[e.childIndex-1];0!=e.children.length;)e=e.children[e.children.length-1];if(e==this.root)break}while(!e.renderable||!e.__renderGroup);return e},r.WebGLRenderGroup.prototype.initTilingSprite=function(t){var e=this.gl;t.verticies=new Float32Array([0,0,t.width,0,t.width,t.height,0,t.height]),t.uvs=new Float32Array([0,0,1,0,1,1,0,1]),t.colors=new Float32Array([1,1,1,1]),t.indices=new Uint16Array([0,1,3,2]),t._vertexBuffer=e.createBuffer(),t._indexBuffer=e.createBuffer(),t._uvBuffer=e.createBuffer(),t._colorBuffer=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,t._vertexBuffer),e.bufferData(e.ARRAY_BUFFER,t.verticies,e.STATIC_DRAW),e.bindBuffer(e.ARRAY_BUFFER,t._uvBuffer),e.bufferData(e.ARRAY_BUFFER,t.uvs,e.DYNAMIC_DRAW),e.bindBuffer(e.ARRAY_BUFFER,t._colorBuffer),e.bufferData(e.ARRAY_BUFFER,t.colors,e.STATIC_DRAW),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t._indexBuffer),e.bufferData(e.ELEMENT_ARRAY_BUFFER,t.indices,e.STATIC_DRAW),t.texture.baseTexture._glTexture?(e.bindTexture(e.TEXTURE_2D,t.texture.baseTexture._glTexture),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.REPEAT),t.texture.baseTexture._powerOf2=!0):t.texture.baseTexture._powerOf2=!0},r.WebGLRenderGroup.prototype.renderStrip=function(t,e){var i=this.gl,s=r.shaderProgram,n=r.mat3.toMat4(t.worldTransform);r.mat4.transpose(n),r.mat4.multiply(e,n,n),i.uniformMatrix4fv(s.mvMatrixUniform,!1,n),t.blendMode==r.blendModes.NORMAL?i.blendFunc(i.ONE,i.ONE_MINUS_SRC_ALPHA):i.blendFunc(i.ONE,i.ONE_MINUS_SRC_COLOR),t.dirty?(t.dirty=!1,i.bindBuffer(i.ARRAY_BUFFER,t._vertexBuffer),i.bufferData(i.ARRAY_BUFFER,t.verticies,i.STATIC_DRAW),i.vertexAttribPointer(s.vertexPositionAttribute,2,i.FLOAT,!1,0,0),i.bindBuffer(i.ARRAY_BUFFER,t._uvBuffer),i.bufferData(i.ARRAY_BUFFER,t.uvs,i.STATIC_DRAW),i.vertexAttribPointer(s.textureCoordAttribute,2,i.FLOAT,!1,0,0),i.activeTexture(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,t.texture.baseTexture._glTexture),i.bindBuffer(i.ARRAY_BUFFER,t._colorBuffer),i.bufferData(i.ARRAY_BUFFER,t.colors,i.STATIC_DRAW),i.vertexAttribPointer(s.colorAttribute,1,i.FLOAT,!1,0,0),i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,t._indexBuffer),i.bufferData(i.ELEMENT_ARRAY_BUFFER,t.indices,i.STATIC_DRAW)):(i.bindBuffer(i.ARRAY_BUFFER,t._vertexBuffer),i.bufferSubData(i.ARRAY_BUFFER,0,t.verticies),i.vertexAttribPointer(s.vertexPositionAttribute,2,i.FLOAT,!1,0,0),i.bindBuffer(i.ARRAY_BUFFER,t._uvBuffer),i.vertexAttribPointer(s.textureCoordAttribute,2,i.FLOAT,!1,0,0),i.activeTexture(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,t.texture.baseTexture._glTexture),i.bindBuffer(i.ARRAY_BUFFER,t._colorBuffer),i.vertexAttribPointer(s.colorAttribute,1,i.FLOAT,!1,0,0),i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,t._indexBuffer)),i.drawElements(i.TRIANGLE_STRIP,t.indices.length,i.UNSIGNED_SHORT,0),i.uniformMatrix4fv(s.mvMatrixUniform,!1,e)},r.WebGLRenderGroup.prototype.renderTilingSprite=function(t,e){var i=this.gl;r.shaderProgram;var s=t.tilePosition,n=t.tileScale,a=s.x/t.texture.baseTexture.width,o=s.y/t.texture.baseTexture.height,h=t.width/t.texture.baseTexture.width/n.x,u=t.height/t.texture.baseTexture.height/n.y;t.uvs[0]=0-a,t.uvs[1]=0-o,t.uvs[2]=1*h-a,t.uvs[3]=0-o,t.uvs[4]=1*h-a,t.uvs[5]=1*u-o,t.uvs[6]=0-a,t.uvs[7]=1*u-o,i.bindBuffer(i.ARRAY_BUFFER,t._uvBuffer),i.bufferSubData(i.ARRAY_BUFFER,0,t.uvs),this.renderStrip(t,e)},r.WebGLRenderer.prototype.initStrip=function(t){var e=this.gl;this.shaderProgram,t._vertexBuffer=e.createBuffer(),t._indexBuffer=e.createBuffer(),t._uvBuffer=e.createBuffer(),t._colorBuffer=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,t._vertexBuffer),e.bufferData(e.ARRAY_BUFFER,t.verticies,e.DYNAMIC_DRAW),e.bindBuffer(e.ARRAY_BUFFER,t._uvBuffer),e.bufferData(e.ARRAY_BUFFER,t.uvs,e.STATIC_DRAW),e.bindBuffer(e.ARRAY_BUFFER,t._colorBuffer),e.bufferData(e.ARRAY_BUFFER,t.colors,e.STATIC_DRAW),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t._indexBuffer),e.bufferData(e.ELEMENT_ARRAY_BUFFER,t.indices,e.STATIC_DRAW)},r.CanvasRenderer=function(t,e,i,r){this.transparent=r,this.width=t||800,this.height=e||600,this.refresh=!0,this.view=i||document.createElement("canvas"),this.view.width=this.width,this.view.height=this.height,this.count=0,this.context=this.view.getContext("2d")},r.CanvasRenderer.constructor=r.CanvasRenderer,r.CanvasRenderer.prototype.render=function(t){r.texturesToUpdate=[],r.texturesToDestroy=[],t.updateTransform(),this.view.style.backgroundColor==t.backgroundColorString||this.transparent||(this.view.style.backgroundColor=t.backgroundColorString),this.context.setTransform(1,0,0,1,0,0),this.context.clearRect(0,0,this.width,this.height),this.renderDisplayObject(t),t.interactive&&(t._interactiveEventsAdded||(t._interactiveEventsAdded=!0,t.interactionManager.setTarget(this))),r.Texture.frameUpdates.length>0&&(r.Texture.frameUpdates=[])},r.CanvasRenderer.prototype.resize=function(t,e){this.width=t,this.height=e,this.view.width=t,this.view.height=e},r.CanvasRenderer.prototype.renderDisplayObject=function(t){var e=t.worldTransform,i=this.context;if(t.visible){if(t instanceof r.Sprite){var s=t.texture.frame;s&&(i.globalAlpha=t.worldAlpha,i.setTransform(e[0],e[3],e[1],e[4],e[2],e[5]),i.drawImage(t.texture.baseTexture.source,s.x,s.y,s.width,s.height,t.anchor.x*-s.width,t.anchor.y*-s.height,s.width,s.height))}else t instanceof r.Strip?(i.setTransform(e[0],e[3],e[1],e[4],e[2],e[5]),this.renderStrip(t)):t instanceof r.TilingSprite?(i.setTransform(e[0],e[3],e[1],e[4],e[2],e[5]),this.renderTilingSprite(t)):t instanceof r.CustomRenderable?t.renderCanvas(this):t instanceof r.Graphics&&t.render(this);for(var n=0;t.children.length>n;n++)this.renderDisplayObject(t.children[n]);this.context.setTransform(1,0,0,1,0,0)}},r.CanvasRenderer.prototype.renderStripFlat=function(t){var e=this.context,i=t.verticies;t.uvs;var r=i.length/2;this.count++,e.beginPath();for(var s=1;r-2>s;s++){var n=2*s,a=i[n],o=i[n+2],h=i[n+4],u=i[n+1],d=i[n+3],c=i[n+5];e.moveTo(a,u),e.lineTo(o,d),e.lineTo(h,c)}e.fillStyle="#FF0000",e.fill(),e.closePath()},r.CanvasRenderer.prototype.renderTilingSprite=function(t){var e=this.context;t.__tilePattern||(t.__tilePattern=e.createPattern(t.texture.baseTexture.source,"repeat")),e.beginPath();var i=t.tilePosition,r=t.tileScale;e.scale(r.x,r.y),e.translate(i.x,i.y),e.fillStyle=t.__tilePattern,e.fillRect(-i.x,-i.y,t.width/r.x,t.height/r.y),e.scale(1/r.x,1/r.y),e.translate(-i.x,-i.y),e.closePath()},r.CanvasRenderer.prototype.renderStrip=function(t){var e=this.context,i=t.verticies,r=t.uvs,s=i.length/2;this.count++;for(var n=1;s-2>n;n++){var a=2*n,o=i[a],h=i[a+2],u=i[a+4],d=i[a+1],c=i[a+3],l=i[a+5],p=r[a]*t.texture.width,f=r[a+2]*t.texture.width,x=r[a+4]*t.texture.width,v=r[a+1]*t.texture.height,b=r[a+3]*t.texture.height,g=r[a+5]*t.texture.height;e.save(),e.beginPath(),e.moveTo(o,d),e.lineTo(h,c),e.lineTo(u,l),e.closePath(),e.clip();var m=p*b+v*x+f*g-b*x-v*f-p*g,T=o*b+v*u+h*g-b*u-v*h-o*g,y=p*h+o*x+f*u-h*x-o*f-p*u,_=p*b*u+v*h*x+o*f*g-o*b*x-v*f*u-p*h*g,R=d*b+v*l+c*g-b*l-v*c-d*g,w=p*c+d*x+f*l-c*x-d*f-p*l,A=p*b*l+v*c*x+d*f*g-d*b*x-v*f*l-p*c*g;e.transform(T/m,R/m,y/m,w/m,_/m,A/m),e.drawImage(t.texture.baseTexture.source,0,0),e.restore()}},r.Strip=function(t,e,i){r.DisplayObjectContainer.call(this),this.texture=t,this.blendMode=r.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(s){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=e,this.height=i,t.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},r.Strip.constructor=r.Strip,r.Strip.prototype=Object.create(r.DisplayObjectContainer.prototype),r.Strip.prototype.setTexture=function(t){this.texture=t,this.width=t.frame.width,this.height=t.frame.height,this.updateFrame=!0},r.Strip.prototype.onTextureUpdate=function(){this.updateFrame=!0},r.Rope=function(t,e){r.Strip.call(this,t),this.points=e;try{this.verticies=new Float32Array(4*e.length),this.uvs=new Float32Array(4*e.length),this.colors=new Float32Array(2*e.length),this.indices=new Uint16Array(2*e.length)}catch(i){this.verticies=verticies,this.uvs=uvs,this.colors=colors,this.indices=indices}this.refresh()},r.Rope.constructor=r.Rope,r.Rope.prototype=Object.create(r.Strip.prototype),r.Rope.prototype.refresh=function(){var t=this.points;if(!(1>t.length)){var e=this.uvs,i=this.indices,r=this.colors,s=t[0],n=t[0];this.count-=.2,e[0]=0,e[1]=1,e[2]=0,e[3]=1,r[0]=1,r[1]=1,i[0]=0,i[1]=1;for(var a=t.length,o=1;a>o;o++){var n=t[o],h=4*o,u=o/(a-1);o%2?(e[h]=u,e[h+1]=0,e[h+2]=u,e[h+3]=1):(e[h]=u,e[h+1]=0,e[h+2]=u,e[h+3]=1),h=2*o,r[h]=1,r[h+1]=1,h=2*o,i[h]=h,i[h+1]=h+1,s=n}}},r.Rope.prototype.updateTransform=function(){var t=this.points;if(!(1>t.length)){var e,i=this.verticies,s=t[0],n={x:0,y:0},a=t[0];this.count-=.2,i[0]=a.x+n.x,i[1]=a.y+n.y,i[2]=a.x-n.x,i[3]=a.y-n.y;for(var o=t.length,h=1;o>h;h++){var a=t[h],u=4*h;e=t.length-1>h?t[h+1]:a,n.y=-(e.x-s.x),n.x=e.y-s.y;var d=10*(1-h/(o-1));d>1&&(d=1);var c=Math.sqrt(n.x*n.x+n.y*n.y),l=this.texture.height/2;n.x/=c,n.y/=c,n.x*=l,n.y*=l,i[u]=a.x+n.x,i[u+1]=a.y+n.y,i[u+2]=a.x-n.x,i[u+3]=a.y-n.y,s=a}r.DisplayObjectContainer.prototype.updateTransform.call(this)}},r.Rope.prototype.setTexture=function(t){this.texture=t,this.updateFrame=!0},r.TilingSprite=function(t,e,i){r.DisplayObjectContainer.call(this),this.texture=t,this.width=e,this.height=i,this.renderable=!0,this.tileScale=new r.Point(1,1),this.tilePosition=new r.Point(0,0),this.blendMode=r.blendModes.NORMAL},r.TilingSprite.constructor=r.TilingSprite,r.TilingSprite.prototype=Object.create(r.DisplayObjectContainer.prototype),r.TilingSprite.prototype.setTexture=function(t){this.texture=t,this.updateFrame=!0},r.TilingSprite.prototype.onTextureUpdate=function(){this.updateFrame=!0},r.CustomRenderable=function(){r.DisplayObject.call(this)},r.CustomRenderable.constructor=r.CustomRenderable,r.CustomRenderable.prototype=Object.create(r.DisplayObject.prototype),r.CustomRenderable.prototype.renderCanvas=function(){},r.CustomRenderable.prototype.initWebGL=function(){},r.CustomRenderable.prototype.renderWebGL=function(){},r.BaseTextureCache={},r.texturesToUpdate=[],r.texturesToDestroy=[],r.BaseTexture=function(t){if(r.EventTarget.call(this),this.width=100,this.height=100,this.source=t,t){if(this.source instanceof Image)if(this.source.complete)this.hasLoaded=!0,this.width=this.source.width,this.height=this.source.height,r.texturesToUpdate.push(this);else{var e=this;this.source.onload=function(){e.hasLoaded=!0,e.width=e.source.width,e.height=e.source.height,r.texturesToUpdate.push(e),e.dispatchEvent({type:"loaded",content:e})}}else this.hasLoaded=!0,this.width=this.source.width,this.height=this.source.height,r.texturesToUpdate.push(this);this._powerOf2=!1}},r.BaseTexture.constructor=r.BaseTexture,r.BaseTexture.prototype.destroy=function(){this.source instanceof Image&&(this.source.src=null),this.source=null,r.texturesToDestroy.push(this)},r.BaseTexture.fromImage=function(t,e){var i=r.BaseTextureCache[t];if(!i){var s=new Image;e&&(s.crossOrigin=""),s.src=t,i=new r.BaseTexture(s),r.BaseTextureCache[t]=i}return i},r.TextureCache={},r.FrameCache={},r.Texture=function(t,e){if(r.EventTarget.call(this),e||(this.noFrame=!0,e=new r.Rectangle(0,0,1,1)),this.trim=new r.Point,t instanceof r.Texture&&(t=t.baseTexture),this.baseTexture=t,this.frame=e,this.scope=this,t.hasLoaded)this.noFrame&&(e=new r.Rectangle(0,0,t.width,t.height)),this.setFrame(e);else{var i=this;t.addEventListener("loaded",function(){i.onBaseTextureLoaded()})}},r.Texture.constructor=r.Texture,r.Texture.prototype.onBaseTextureLoaded=function(){var t=this.baseTexture;t.removeEventListener("loaded",this.onLoaded),this.noFrame&&(this.frame=new r.Rectangle(0,0,t.width,t.height)),this.noFrame=!1,this.width=this.frame.width,this.height=this.frame.height,this.scope.dispatchEvent({type:"update",content:this})},r.Texture.prototype.destroy=function(t){t&&this.baseTexture.destroy()},r.Texture.prototype.setFrame=function(t){if(this.frame=t,this.width=t.width,this.height=t.height,t.x+t.width>this.baseTexture.width||t.y+t.height>this.baseTexture.height)throw Error("Texture Error: frame does not fit inside the base Texture dimensions "+this);this.updateFrame=!0,r.Texture.frameUpdates.push(this)},r.Texture.fromImage=function(t,e){var i=r.TextureCache[t];return i||(i=new r.Texture(r.BaseTexture.fromImage(t,e)),r.TextureCache[t]=i),i},r.Texture.fromFrame=function(t){var e=r.TextureCache[t];if(!e)throw Error("The frameId '"+t+"' does not exist in the texture cache "+this);return e},r.Texture.fromCanvas=function(t){var e=new r.BaseTexture(t);return new r.Texture(e)},r.Texture.addTextureToCache=function(t,e){r.TextureCache[e]=t},r.Texture.removeTextureFromCache=function(t){var e=r.TextureCache[t];return r.TextureCache[t]=null,e},r.Texture.frameUpdates=[],r.RenderTexture=function(t,e){r.EventTarget.call(this),this.width=t||100,this.height=e||100,this.indetityMatrix=r.mat3.create(),this.frame=new r.Rectangle(0,0,this.width,this.height),r.gl?this.initWebGL():this.initCanvas()},r.RenderTexture.constructor=r.RenderTexture,r.RenderTexture.prototype=Object.create(r.Texture.prototype),r.RenderTexture.prototype.initWebGL=function(){var t=r.gl;this.glFramebuffer=t.createFramebuffer(),t.bindFramebuffer(t.FRAMEBUFFER,this.glFramebuffer),this.glFramebuffer.width=this.width,this.glFramebuffer.height=this.height,this.baseTexture=new r.BaseTexture,this.baseTexture.width=this.width,this.baseTexture.height=this.height,this.baseTexture._glTexture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.baseTexture._glTexture),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,this.width,this.height,0,t.RGBA,t.UNSIGNED_BYTE,null),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),this.baseTexture.isRender=!0,t.bindFramebuffer(t.FRAMEBUFFER,this.glFramebuffer),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,this.baseTexture._glTexture,0),this.projectionMatrix=r.mat4.create(),this.projectionMatrix[5]=2/this.height,this.projectionMatrix[13]=-1,this.projectionMatrix[0]=2/this.width,this.projectionMatrix[12]=-1,this.render=this.renderWebGL},r.RenderTexture.prototype.initCanvas=function(){this.renderer=new r.CanvasRenderer(this.width,this.height,null,0),this.baseTexture=new r.BaseTexture(this.renderer.view),this.frame=new r.Rectangle(0,0,this.width,this.height),this.render=this.renderCanvas},r.RenderTexture.prototype.renderWebGL=function(t,e){var i=r.gl;i.colorMask(!0,!0,!0,!0),i.viewport(0,0,this.width,this.height),i.bindFramebuffer(i.FRAMEBUFFER,this.glFramebuffer),e&&(i.clearColor(0,0,0,0),i.clear(i.COLOR_BUFFER_BIT));var s=t.children;t.worldTransform=r.mat3.create();for(var n=0,a=s.length;a>n;n++)s[n].updateTransform();var o=t.__renderGroup;o?t==o.root?o.render(this.projectionMatrix):o.renderSpecific(t,this.projectionMatrix):(this.renderGroup||(this.renderGroup=new r.WebGLRenderGroup(i)),this.renderGroup.setRenderable(t),this.renderGroup.render(this.projectionMatrix))},r.RenderTexture.prototype.renderCanvas=function(t,e){var i=t.children;t.worldTransform=r.mat3.create();for(var s=0,n=i.length;n>s;s++)i[s].updateTransform();e&&this.renderer.context.clearRect(0,0,this.width,this.height),this.renderer.renderDisplayObject(t),r.texturesToUpdate.push(this.baseTexture)},r.AssetLoader=function(t){r.EventTarget.call(this),this.assetURLs=t,this.crossorigin=!1,this.loadersByType={jpg:r.ImageLoader,jpeg:r.ImageLoader,png:r.ImageLoader,gif:r.ImageLoader,json:r.SpriteSheetLoader,xml:r.BitmapFontLoader,fnt:r.BitmapFontLoader}},r.AssetLoader.constructor=r.AssetLoader,r.AssetLoader.prototype.load=function(){var t=this;this.loadCount=this.assetURLs.length;for(var e=0;this.assetURLs.length>e;e++){var i=this.assetURLs[e],r=i.split(".").pop().toLowerCase(),s=this.loadersByType[r];if(!s)throw Error(r+" is an unsupported file type");var n=new s(i,this.crossorigin);n.addEventListener("loaded",function(){t.onAssetLoaded()}),n.load()}},r.AssetLoader.prototype.onAssetLoaded=function(){this.loadCount--,this.dispatchEvent({type:"onProgress",content:this}),this.onProgress&&this.onProgress(),0==this.loadCount&&(this.dispatchEvent({type:"onComplete",content:this}),this.onComplete&&this.onComplete())},r.JsonLoader=function(t,e){r.EventTarget.call(this),this.url=t,this.baseUrl=t.replace(/[^\/]*$/,""),this.crossorigin=e},r.JsonLoader.constructor=r.JsonLoader,r.JsonLoader.prototype.load=function(){this.ajaxRequest=new s;var t=this;this.ajaxRequest.onreadystatechange=function(){t.onJSONLoaded()},this.ajaxRequest.open("GET",this.url,!0),this.ajaxRequest.overrideMimeType&&this.ajaxRequest.overrideMimeType("application/json"),this.ajaxRequest.send(null)},r.JsonLoader.prototype.onJSONLoaded=function(){4==this.ajaxRequest.readyState&&(200==this.ajaxRequest.status||-1==window.location.href.indexOf("http")?(this.json=JSON.parse(this.ajaxRequest.responseText),this.onLoaded()):this.onError())},r.JsonLoader.prototype.onLoaded=function(){this.dispatchEvent({type:"loaded",content:this})},r.JsonLoader.prototype.onError=function(){this.dispatchEvent({type:"error",content:this})},r.SpriteSheetLoader=function(t,e){r.EventTarget.call(this),this.url=t,this.baseUrl=t.replace(/[^\/]*$/,""),this.texture=null,this.frames={},this.crossorigin=e},r.SpriteSheetLoader.constructor=r.SpriteSheetLoader,r.SpriteSheetLoader.prototype.load=function(){var t=this,e=new r.JsonLoader(this.url,this.crossorigin);e.addEventListener("loaded",function(e){t.json=e.content.json,t.onJSONLoaded()}),e.load()},r.SpriteSheetLoader.prototype.onJSONLoaded=function(){var t=this,e=this.baseUrl+this.json.meta.image,i=new r.ImageLoader(e,this.crossorigin),s=this.json.frames;this.texture=i.texture.baseTexture,i.addEventListener("loaded",function(){t.onLoaded()});for(var n in s){var a=s[n].frame;a&&(r.TextureCache[n]=new r.Texture(this.texture,{x:a.x,y:a.y,width:a.w,height:a.h}),s[n].trimmed&&(r.TextureCache[n].realSize=s[n].spriteSourceSize,r.TextureCache[n].trim.x=0))}i.load()},r.SpriteSheetLoader.prototype.onLoaded=function(){this.dispatchEvent({type:"loaded",content:this})},r.ImageLoader=function(t,e){r.EventTarget.call(this),this.texture=r.Texture.fromImage(t,e)},r.ImageLoader.constructor=r.ImageLoader,r.ImageLoader.prototype.load=function(){if(this.texture.baseTexture.hasLoaded)this.onLoaded();else{var t=this;this.texture.baseTexture.addEventListener("loaded",function(){t.onLoaded()})}},r.ImageLoader.prototype.onLoaded=function(){this.dispatchEvent({type:"loaded",content:this})},r.BitmapFontLoader=function(t,e){r.EventTarget.call(this),this.url=t,this.baseUrl=t.replace(/[^\/]*$/,""),this.texture=null,this.crossorigin=e},r.BitmapFontLoader.constructor=r.BitmapFontLoader,r.BitmapFontLoader.prototype.load=function(){this.ajaxRequest=new XMLHttpRequest;var t=this;this.ajaxRequest.onreadystatechange=function(){t.onXMLLoaded()},this.ajaxRequest.open("GET",this.url,!0),this.ajaxRequest.overrideMimeType&&this.ajaxRequest.overrideMimeType("application/xml"),this.ajaxRequest.send(null)},r.BitmapFontLoader.prototype.onXMLLoaded=function(){if(4==this.ajaxRequest.readyState&&(200==this.ajaxRequest.status||-1==window.location.href.indexOf("http"))){var t=this.baseUrl+this.ajaxRequest.responseXML.getElementsByTagName("page")[0].attributes.getNamedItem("file").nodeValue,e=new r.ImageLoader(t,this.crossorigin);this.texture=e.texture.baseTexture;var i={},s=this.ajaxRequest.responseXML.getElementsByTagName("info")[0],n=this.ajaxRequest.responseXML.getElementsByTagName("common")[0];i.font=s.attributes.getNamedItem("face").nodeValue,i.size=parseInt(s.attributes.getNamedItem("size").nodeValue,10),i.lineHeight=parseInt(n.attributes.getNamedItem("lineHeight").nodeValue,10),i.chars={};for(var a=this.ajaxRequest.responseXML.getElementsByTagName("char"),o=0;a.length>o;o++){var h=parseInt(a[o].attributes.getNamedItem("id").nodeValue,10),u={x:parseInt(a[o].attributes.getNamedItem("x").nodeValue,10),y:parseInt(a[o].attributes.getNamedItem("y").nodeValue,10),width:parseInt(a[o].attributes.getNamedItem("width").nodeValue,10),height:parseInt(a[o].attributes.getNamedItem("height").nodeValue,10)};r.TextureCache[h]=new r.Texture(this.texture,u),i.chars[h]={xOffset:parseInt(a[o].attributes.getNamedItem("xoffset").nodeValue,10),yOffset:parseInt(a[o].attributes.getNamedItem("yoffset").nodeValue,10),xAdvance:parseInt(a[o].attributes.getNamedItem("xadvance").nodeValue,10),kerning:{},texture:new r.Texture(this.texture,u)}}var d=this.ajaxRequest.responseXML.getElementsByTagName("kerning");for(o=0;d.length>o;o++){var c=parseInt(d[o].attributes.getNamedItem("first").nodeValue,10),l=parseInt(d[o].attributes.getNamedItem("second").nodeValue,10),p=parseInt(d[o].attributes.getNamedItem("amount").nodeValue,10);i.chars[l].kerning[c]=p}r.BitmapText.fonts[i.font]=i;var f=this;e.addEventListener("loaded",function(){f.onLoaded()}),e.load()}},r.BitmapFontLoader.prototype.onLoaded=function(){this.dispatchEvent({type:"loaded",content:this})},"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=r),exports.PIXI=r):i.PIXI=r}).call(this); \ No newline at end of file diff --git a/examples/example 1 - Basics/pixi.js b/examples/example 1 - Basics/pixi.js index 31f792b..9c9f528 100644 --- a/examples/example 1 - Basics/pixi.js +++ b/examples/example 1 - Basics/pixi.js @@ -4,7 +4,7 @@ * Copyright (c) 2012, Mat Groves * http://goodboydigital.com/ * - * Compiled: 2013-06-14 + * Compiled: 2013-06-19 * * Pixi.JS is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license.php @@ -2422,6 +2422,11 @@ PIXI.shaderVertexSrc = [ "}" ]; +/* + * primitive shader.. + */ + + PIXI.CompileVertexShader = function(gl, shaderSrc) { return PIXI._CompileShader(gl, shaderSrc, gl.VERTEX_SHADER); @@ -2447,6 +2452,35 @@ PIXI._CompileShader = function(gl, shaderSrc, shaderType) return shader; } +PIXI.activateDefaultShader = function() +{ + var gl = PIXI.gl; + var shaderProgram = PIXI.shaderProgram; + + gl.useProgram(shaderProgram); + + gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute); + gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute); + gl.enableVertexAttribArray(shaderProgram.colorAttribute); +} + +PIXI.activatePrimitiveShader = function() +{ + var gl = PIXI.gl; + + gl.disableVertexAttribArray(PIXI.shaderProgram.textureCoordAttribute); + gl.disableVertexAttribArray(PIXI.shaderProgram.colorAttribute); + + var shaderProgram2 = PIXI.shaderProgram2; + + gl.useProgram(shaderProgram2); + + gl.enableVertexAttribArray(shaderProgram2.vertexPositionAttribute); + gl.enableVertexAttribArray(PIXI.shaderProgram2.colorAttribute); + +} + + /** * @author Mat Groves http://matgroves.com/ @Doormat23 */ @@ -2505,9 +2539,9 @@ PIXI.WebGLRenderer = function(width, height, view, transparent) throw new Error(" This browser does not support webGL. Try using the canvas renderer" + this); } + PIXI.WebGLGraphics.initShaders(); this.initShaders(); - var gl = this.gl; PIXI.WebGLRenderer.gl = gl; @@ -2576,17 +2610,16 @@ PIXI.WebGLRenderer.prototype.initShaders = function() gl.useProgram(shaderProgram); shaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, "aVertexPosition"); - gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute); shaderProgram.textureCoordAttribute = gl.getAttribLocation(shaderProgram, "aTextureCoord"); - gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute); shaderProgram.colorAttribute = gl.getAttribLocation(shaderProgram, "aColor"); - gl.enableVertexAttribArray(shaderProgram.colorAttribute); shaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, "uMVMatrix"); shaderProgram.samplerUniform = gl.getUniformLocation(shaderProgram, "uSampler"); + + PIXI.activateDefaultShader(); } @@ -3427,7 +3460,7 @@ PIXI.WebGLRenderGroup.prototype.render = function(projectionMatrix) PIXI.WebGLRenderer.updateTextures(); var gl = this.gl; - + // set the flipped matrix.. gl.uniformMatrix4fv(PIXI.shaderProgram.mvMatrixUniform, false, projectionMatrix); @@ -3455,7 +3488,7 @@ PIXI.WebGLRenderGroup.prototype.render = function(projectionMatrix) } else if(renderable instanceof PIXI.Graphics) { - if(renderable.visible) renderable.renderWebGL(this, projectionMatrix); + if(renderable.visible) PIXI.WebGLGraphics.renderGraphics(renderable);//, projectionMatrix); } } diff --git a/examples/example 10 - Text/pixi.js b/examples/example 10 - Text/pixi.js index 31f792b..9c9f528 100644 --- a/examples/example 10 - Text/pixi.js +++ b/examples/example 10 - Text/pixi.js @@ -4,7 +4,7 @@ * Copyright (c) 2012, Mat Groves * http://goodboydigital.com/ * - * Compiled: 2013-06-14 + * Compiled: 2013-06-19 * * Pixi.JS is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license.php @@ -2422,6 +2422,11 @@ PIXI.shaderVertexSrc = [ "}" ]; +/* + * primitive shader.. + */ + + PIXI.CompileVertexShader = function(gl, shaderSrc) { return PIXI._CompileShader(gl, shaderSrc, gl.VERTEX_SHADER); @@ -2447,6 +2452,35 @@ PIXI._CompileShader = function(gl, shaderSrc, shaderType) return shader; } +PIXI.activateDefaultShader = function() +{ + var gl = PIXI.gl; + var shaderProgram = PIXI.shaderProgram; + + gl.useProgram(shaderProgram); + + gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute); + gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute); + gl.enableVertexAttribArray(shaderProgram.colorAttribute); +} + +PIXI.activatePrimitiveShader = function() +{ + var gl = PIXI.gl; + + gl.disableVertexAttribArray(PIXI.shaderProgram.textureCoordAttribute); + gl.disableVertexAttribArray(PIXI.shaderProgram.colorAttribute); + + var shaderProgram2 = PIXI.shaderProgram2; + + gl.useProgram(shaderProgram2); + + gl.enableVertexAttribArray(shaderProgram2.vertexPositionAttribute); + gl.enableVertexAttribArray(PIXI.shaderProgram2.colorAttribute); + +} + + /** * @author Mat Groves http://matgroves.com/ @Doormat23 */ @@ -2505,9 +2539,9 @@ PIXI.WebGLRenderer = function(width, height, view, transparent) throw new Error(" This browser does not support webGL. Try using the canvas renderer" + this); } + PIXI.WebGLGraphics.initShaders(); this.initShaders(); - var gl = this.gl; PIXI.WebGLRenderer.gl = gl; @@ -2576,17 +2610,16 @@ PIXI.WebGLRenderer.prototype.initShaders = function() gl.useProgram(shaderProgram); shaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, "aVertexPosition"); - gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute); shaderProgram.textureCoordAttribute = gl.getAttribLocation(shaderProgram, "aTextureCoord"); - gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute); shaderProgram.colorAttribute = gl.getAttribLocation(shaderProgram, "aColor"); - gl.enableVertexAttribArray(shaderProgram.colorAttribute); shaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, "uMVMatrix"); shaderProgram.samplerUniform = gl.getUniformLocation(shaderProgram, "uSampler"); + + PIXI.activateDefaultShader(); } @@ -3427,7 +3460,7 @@ PIXI.WebGLRenderGroup.prototype.render = function(projectionMatrix) PIXI.WebGLRenderer.updateTextures(); var gl = this.gl; - + // set the flipped matrix.. gl.uniformMatrix4fv(PIXI.shaderProgram.mvMatrixUniform, false, projectionMatrix); @@ -3455,7 +3488,7 @@ PIXI.WebGLRenderGroup.prototype.render = function(projectionMatrix) } else if(renderable instanceof PIXI.Graphics) { - if(renderable.visible) renderable.renderWebGL(this, projectionMatrix); + if(renderable.visible) PIXI.WebGLGraphics.renderGraphics(renderable);//, projectionMatrix); } } diff --git a/examples/example 11 - RenderTexture/pixi.js b/examples/example 11 - RenderTexture/pixi.js index 31f792b..9c9f528 100644 --- a/examples/example 11 - RenderTexture/pixi.js +++ b/examples/example 11 - RenderTexture/pixi.js @@ -4,7 +4,7 @@ * Copyright (c) 2012, Mat Groves * http://goodboydigital.com/ * - * Compiled: 2013-06-14 + * Compiled: 2013-06-19 * * Pixi.JS is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license.php @@ -2422,6 +2422,11 @@ PIXI.shaderVertexSrc = [ "}" ]; +/* + * primitive shader.. + */ + + PIXI.CompileVertexShader = function(gl, shaderSrc) { return PIXI._CompileShader(gl, shaderSrc, gl.VERTEX_SHADER); @@ -2447,6 +2452,35 @@ PIXI._CompileShader = function(gl, shaderSrc, shaderType) return shader; } +PIXI.activateDefaultShader = function() +{ + var gl = PIXI.gl; + var shaderProgram = PIXI.shaderProgram; + + gl.useProgram(shaderProgram); + + gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute); + gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute); + gl.enableVertexAttribArray(shaderProgram.colorAttribute); +} + +PIXI.activatePrimitiveShader = function() +{ + var gl = PIXI.gl; + + gl.disableVertexAttribArray(PIXI.shaderProgram.textureCoordAttribute); + gl.disableVertexAttribArray(PIXI.shaderProgram.colorAttribute); + + var shaderProgram2 = PIXI.shaderProgram2; + + gl.useProgram(shaderProgram2); + + gl.enableVertexAttribArray(shaderProgram2.vertexPositionAttribute); + gl.enableVertexAttribArray(PIXI.shaderProgram2.colorAttribute); + +} + + /** * @author Mat Groves http://matgroves.com/ @Doormat23 */ @@ -2505,9 +2539,9 @@ PIXI.WebGLRenderer = function(width, height, view, transparent) throw new Error(" This browser does not support webGL. Try using the canvas renderer" + this); } + PIXI.WebGLGraphics.initShaders(); this.initShaders(); - var gl = this.gl; PIXI.WebGLRenderer.gl = gl; @@ -2576,17 +2610,16 @@ PIXI.WebGLRenderer.prototype.initShaders = function() gl.useProgram(shaderProgram); shaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, "aVertexPosition"); - gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute); shaderProgram.textureCoordAttribute = gl.getAttribLocation(shaderProgram, "aTextureCoord"); - gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute); shaderProgram.colorAttribute = gl.getAttribLocation(shaderProgram, "aColor"); - gl.enableVertexAttribArray(shaderProgram.colorAttribute); shaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, "uMVMatrix"); shaderProgram.samplerUniform = gl.getUniformLocation(shaderProgram, "uSampler"); + + PIXI.activateDefaultShader(); } @@ -3427,7 +3460,7 @@ PIXI.WebGLRenderGroup.prototype.render = function(projectionMatrix) PIXI.WebGLRenderer.updateTextures(); var gl = this.gl; - + // set the flipped matrix.. gl.uniformMatrix4fv(PIXI.shaderProgram.mvMatrixUniform, false, projectionMatrix); @@ -3455,7 +3488,7 @@ PIXI.WebGLRenderGroup.prototype.render = function(projectionMatrix) } else if(renderable instanceof PIXI.Graphics) { - if(renderable.visible) renderable.renderWebGL(this, projectionMatrix); + if(renderable.visible) PIXI.WebGLGraphics.renderGraphics(renderable);//, projectionMatrix); } } diff --git a/examples/example 13 - Graphics/index.html b/examples/example 13 - Graphics/index.html index f3fe742..f91cd3f 100644 --- a/examples/example 13 - Graphics/index.html +++ b/examples/example 13 - Graphics/index.html @@ -10,8 +10,10 @@ } - + + + @@ -29,7 +31,7 @@ var renderer = PIXI.autoDetectRenderer(800, 600); // set the canvas width and height to fill the screen -// renderer.view.style.width = window.innerWidth + "px"; + // renderer.view.style.width = window.innerWidth + "px"; //renderer.view.style.height = window.innerHeight + "px"; renderer.view.style.display = "block"; @@ -41,14 +43,34 @@ var graphics = new PIXI.Graphics(); - graphics.lineStyle(3, 0xff0000); + graphics.lineStyle(10, 0x30FF00, 0.5); graphics.moveTo(50,50); - graphics.lineTo(100, 100); + graphics.lineTo(250, 50); + //graphics.lineTo(100, 100); graphics.lineTo(250, 220); + graphics.lineTo(50, 220); + + graphics.lineTo(150, 50); + + graphics.lineStyle(2, 0x30FFFF, 1); + +// graphics.beginFill(0xFF794B); + graphics.drawRect(250, 250, 300, 100); + graphics.drawCircle(350, 350,100); + graphics.endFill(); - graphics.lineTo(150, 20); + graphics.lineTo(250, 50); + + graphics.lineStyle(10, 0xFF0000, 1); + graphics.moveTo(400,400); + graphics.lineTo(550, 50); + + graphics.lineStyle(30, 0xFF0000, 1); + graphics.moveTo(400,100); + graphics.lineTo(550, 50); +// graphics.lineTo(92, 20); //graphics.lineTo(450, 223); /* @@ -63,20 +85,21 @@ points.push(point1, point2, point3, new Point(350, 220), new Point(450, 223)); */ - //graphics.lineTo(410,300); + graphics.lineTo(410,300); + graphics.lineTo(450,320); + graphics.lineTo(570,350); + graphics.lineTo(580,120); + graphics.lineTo(630,120); + var sprite = PIXI.Sprite.fromImage("spinObj_01.png"); - //graphics.lineTo(450,320); - //graphics.lineTo(570,350); - //graphics.lineTo(580,120); -// graphics.lineTo(630,120); - + stage.addChild(sprite); stage.addChild(graphics); requestAnimFrame(animate); - renderer.render(stage); function animate() { + renderer.render(stage); requestAnimFrame( animate ); } diff --git a/examples/example 2 - SpriteSheet/pixi.js b/examples/example 2 - SpriteSheet/pixi.js index 31f792b..9c9f528 100644 --- a/examples/example 2 - SpriteSheet/pixi.js +++ b/examples/example 2 - SpriteSheet/pixi.js @@ -4,7 +4,7 @@ * Copyright (c) 2012, Mat Groves * http://goodboydigital.com/ * - * Compiled: 2013-06-14 + * Compiled: 2013-06-19 * * Pixi.JS is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license.php @@ -2422,6 +2422,11 @@ PIXI.shaderVertexSrc = [ "}" ]; +/* + * primitive shader.. + */ + + PIXI.CompileVertexShader = function(gl, shaderSrc) { return PIXI._CompileShader(gl, shaderSrc, gl.VERTEX_SHADER); @@ -2447,6 +2452,35 @@ PIXI._CompileShader = function(gl, shaderSrc, shaderType) return shader; } +PIXI.activateDefaultShader = function() +{ + var gl = PIXI.gl; + var shaderProgram = PIXI.shaderProgram; + + gl.useProgram(shaderProgram); + + gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute); + gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute); + gl.enableVertexAttribArray(shaderProgram.colorAttribute); +} + +PIXI.activatePrimitiveShader = function() +{ + var gl = PIXI.gl; + + gl.disableVertexAttribArray(PIXI.shaderProgram.textureCoordAttribute); + gl.disableVertexAttribArray(PIXI.shaderProgram.colorAttribute); + + var shaderProgram2 = PIXI.shaderProgram2; + + gl.useProgram(shaderProgram2); + + gl.enableVertexAttribArray(shaderProgram2.vertexPositionAttribute); + gl.enableVertexAttribArray(PIXI.shaderProgram2.colorAttribute); + +} + + /** * @author Mat Groves http://matgroves.com/ @Doormat23 */ @@ -2505,9 +2539,9 @@ PIXI.WebGLRenderer = function(width, height, view, transparent) throw new Error(" This browser does not support webGL. Try using the canvas renderer" + this); } + PIXI.WebGLGraphics.initShaders(); this.initShaders(); - var gl = this.gl; PIXI.WebGLRenderer.gl = gl; @@ -2576,17 +2610,16 @@ PIXI.WebGLRenderer.prototype.initShaders = function() gl.useProgram(shaderProgram); shaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, "aVertexPosition"); - gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute); shaderProgram.textureCoordAttribute = gl.getAttribLocation(shaderProgram, "aTextureCoord"); - gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute); shaderProgram.colorAttribute = gl.getAttribLocation(shaderProgram, "aColor"); - gl.enableVertexAttribArray(shaderProgram.colorAttribute); shaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, "uMVMatrix"); shaderProgram.samplerUniform = gl.getUniformLocation(shaderProgram, "uSampler"); + + PIXI.activateDefaultShader(); } @@ -3427,7 +3460,7 @@ PIXI.WebGLRenderGroup.prototype.render = function(projectionMatrix) PIXI.WebGLRenderer.updateTextures(); var gl = this.gl; - + // set the flipped matrix.. gl.uniformMatrix4fv(PIXI.shaderProgram.mvMatrixUniform, false, projectionMatrix); @@ -3455,7 +3488,7 @@ PIXI.WebGLRenderGroup.prototype.render = function(projectionMatrix) } else if(renderable instanceof PIXI.Graphics) { - if(renderable.visible) renderable.renderWebGL(this, projectionMatrix); + if(renderable.visible) PIXI.WebGLGraphics.renderGraphics(renderable);//, projectionMatrix); } } diff --git a/examples/example 3 - MovieClip/pixi.js b/examples/example 3 - MovieClip/pixi.js index 31f792b..9c9f528 100755 --- a/examples/example 3 - MovieClip/pixi.js +++ b/examples/example 3 - MovieClip/pixi.js @@ -4,7 +4,7 @@ * Copyright (c) 2012, Mat Groves * http://goodboydigital.com/ * - * Compiled: 2013-06-14 + * Compiled: 2013-06-19 * * Pixi.JS is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license.php @@ -2422,6 +2422,11 @@ PIXI.shaderVertexSrc = [ "}" ]; +/* + * primitive shader.. + */ + + PIXI.CompileVertexShader = function(gl, shaderSrc) { return PIXI._CompileShader(gl, shaderSrc, gl.VERTEX_SHADER); @@ -2447,6 +2452,35 @@ PIXI._CompileShader = function(gl, shaderSrc, shaderType) return shader; } +PIXI.activateDefaultShader = function() +{ + var gl = PIXI.gl; + var shaderProgram = PIXI.shaderProgram; + + gl.useProgram(shaderProgram); + + gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute); + gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute); + gl.enableVertexAttribArray(shaderProgram.colorAttribute); +} + +PIXI.activatePrimitiveShader = function() +{ + var gl = PIXI.gl; + + gl.disableVertexAttribArray(PIXI.shaderProgram.textureCoordAttribute); + gl.disableVertexAttribArray(PIXI.shaderProgram.colorAttribute); + + var shaderProgram2 = PIXI.shaderProgram2; + + gl.useProgram(shaderProgram2); + + gl.enableVertexAttribArray(shaderProgram2.vertexPositionAttribute); + gl.enableVertexAttribArray(PIXI.shaderProgram2.colorAttribute); + +} + + /** * @author Mat Groves http://matgroves.com/ @Doormat23 */ @@ -2505,9 +2539,9 @@ PIXI.WebGLRenderer = function(width, height, view, transparent) throw new Error(" This browser does not support webGL. Try using the canvas renderer" + this); } + PIXI.WebGLGraphics.initShaders(); this.initShaders(); - var gl = this.gl; PIXI.WebGLRenderer.gl = gl; @@ -2576,17 +2610,16 @@ PIXI.WebGLRenderer.prototype.initShaders = function() gl.useProgram(shaderProgram); shaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, "aVertexPosition"); - gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute); shaderProgram.textureCoordAttribute = gl.getAttribLocation(shaderProgram, "aTextureCoord"); - gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute); shaderProgram.colorAttribute = gl.getAttribLocation(shaderProgram, "aColor"); - gl.enableVertexAttribArray(shaderProgram.colorAttribute); shaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, "uMVMatrix"); shaderProgram.samplerUniform = gl.getUniformLocation(shaderProgram, "uSampler"); + + PIXI.activateDefaultShader(); } @@ -3427,7 +3460,7 @@ PIXI.WebGLRenderGroup.prototype.render = function(projectionMatrix) PIXI.WebGLRenderer.updateTextures(); var gl = this.gl; - + // set the flipped matrix.. gl.uniformMatrix4fv(PIXI.shaderProgram.mvMatrixUniform, false, projectionMatrix); @@ -3455,7 +3488,7 @@ PIXI.WebGLRenderGroup.prototype.render = function(projectionMatrix) } else if(renderable instanceof PIXI.Graphics) { - if(renderable.visible) renderable.renderWebGL(this, projectionMatrix); + if(renderable.visible) PIXI.WebGLGraphics.renderGraphics(renderable);//, projectionMatrix); } } diff --git a/examples/example 4 - Balls/pixi.js b/examples/example 4 - Balls/pixi.js index 31f792b..9c9f528 100644 --- a/examples/example 4 - Balls/pixi.js +++ b/examples/example 4 - Balls/pixi.js @@ -4,7 +4,7 @@ * Copyright (c) 2012, Mat Groves * http://goodboydigital.com/ * - * Compiled: 2013-06-14 + * Compiled: 2013-06-19 * * Pixi.JS is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license.php @@ -2422,6 +2422,11 @@ PIXI.shaderVertexSrc = [ "}" ]; +/* + * primitive shader.. + */ + + PIXI.CompileVertexShader = function(gl, shaderSrc) { return PIXI._CompileShader(gl, shaderSrc, gl.VERTEX_SHADER); @@ -2447,6 +2452,35 @@ PIXI._CompileShader = function(gl, shaderSrc, shaderType) return shader; } +PIXI.activateDefaultShader = function() +{ + var gl = PIXI.gl; + var shaderProgram = PIXI.shaderProgram; + + gl.useProgram(shaderProgram); + + gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute); + gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute); + gl.enableVertexAttribArray(shaderProgram.colorAttribute); +} + +PIXI.activatePrimitiveShader = function() +{ + var gl = PIXI.gl; + + gl.disableVertexAttribArray(PIXI.shaderProgram.textureCoordAttribute); + gl.disableVertexAttribArray(PIXI.shaderProgram.colorAttribute); + + var shaderProgram2 = PIXI.shaderProgram2; + + gl.useProgram(shaderProgram2); + + gl.enableVertexAttribArray(shaderProgram2.vertexPositionAttribute); + gl.enableVertexAttribArray(PIXI.shaderProgram2.colorAttribute); + +} + + /** * @author Mat Groves http://matgroves.com/ @Doormat23 */ @@ -2505,9 +2539,9 @@ PIXI.WebGLRenderer = function(width, height, view, transparent) throw new Error(" This browser does not support webGL. Try using the canvas renderer" + this); } + PIXI.WebGLGraphics.initShaders(); this.initShaders(); - var gl = this.gl; PIXI.WebGLRenderer.gl = gl; @@ -2576,17 +2610,16 @@ PIXI.WebGLRenderer.prototype.initShaders = function() gl.useProgram(shaderProgram); shaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, "aVertexPosition"); - gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute); shaderProgram.textureCoordAttribute = gl.getAttribLocation(shaderProgram, "aTextureCoord"); - gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute); shaderProgram.colorAttribute = gl.getAttribLocation(shaderProgram, "aColor"); - gl.enableVertexAttribArray(shaderProgram.colorAttribute); shaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, "uMVMatrix"); shaderProgram.samplerUniform = gl.getUniformLocation(shaderProgram, "uSampler"); + + PIXI.activateDefaultShader(); } @@ -3427,7 +3460,7 @@ PIXI.WebGLRenderGroup.prototype.render = function(projectionMatrix) PIXI.WebGLRenderer.updateTextures(); var gl = this.gl; - + // set the flipped matrix.. gl.uniformMatrix4fv(PIXI.shaderProgram.mvMatrixUniform, false, projectionMatrix); @@ -3455,7 +3488,7 @@ PIXI.WebGLRenderGroup.prototype.render = function(projectionMatrix) } else if(renderable instanceof PIXI.Graphics) { - if(renderable.visible) renderable.renderWebGL(this, projectionMatrix); + if(renderable.visible) PIXI.WebGLGraphics.renderGraphics(renderable);//, projectionMatrix); } } diff --git a/examples/example 5 - Morph/pixi.js b/examples/example 5 - Morph/pixi.js index 31f792b..9c9f528 100644 --- a/examples/example 5 - Morph/pixi.js +++ b/examples/example 5 - Morph/pixi.js @@ -4,7 +4,7 @@ * Copyright (c) 2012, Mat Groves * http://goodboydigital.com/ * - * Compiled: 2013-06-14 + * Compiled: 2013-06-19 * * Pixi.JS is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license.php @@ -2422,6 +2422,11 @@ PIXI.shaderVertexSrc = [ "}" ]; +/* + * primitive shader.. + */ + + PIXI.CompileVertexShader = function(gl, shaderSrc) { return PIXI._CompileShader(gl, shaderSrc, gl.VERTEX_SHADER); @@ -2447,6 +2452,35 @@ PIXI._CompileShader = function(gl, shaderSrc, shaderType) return shader; } +PIXI.activateDefaultShader = function() +{ + var gl = PIXI.gl; + var shaderProgram = PIXI.shaderProgram; + + gl.useProgram(shaderProgram); + + gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute); + gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute); + gl.enableVertexAttribArray(shaderProgram.colorAttribute); +} + +PIXI.activatePrimitiveShader = function() +{ + var gl = PIXI.gl; + + gl.disableVertexAttribArray(PIXI.shaderProgram.textureCoordAttribute); + gl.disableVertexAttribArray(PIXI.shaderProgram.colorAttribute); + + var shaderProgram2 = PIXI.shaderProgram2; + + gl.useProgram(shaderProgram2); + + gl.enableVertexAttribArray(shaderProgram2.vertexPositionAttribute); + gl.enableVertexAttribArray(PIXI.shaderProgram2.colorAttribute); + +} + + /** * @author Mat Groves http://matgroves.com/ @Doormat23 */ @@ -2505,9 +2539,9 @@ PIXI.WebGLRenderer = function(width, height, view, transparent) throw new Error(" This browser does not support webGL. Try using the canvas renderer" + this); } + PIXI.WebGLGraphics.initShaders(); this.initShaders(); - var gl = this.gl; PIXI.WebGLRenderer.gl = gl; @@ -2576,17 +2610,16 @@ PIXI.WebGLRenderer.prototype.initShaders = function() gl.useProgram(shaderProgram); shaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, "aVertexPosition"); - gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute); shaderProgram.textureCoordAttribute = gl.getAttribLocation(shaderProgram, "aTextureCoord"); - gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute); shaderProgram.colorAttribute = gl.getAttribLocation(shaderProgram, "aColor"); - gl.enableVertexAttribArray(shaderProgram.colorAttribute); shaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, "uMVMatrix"); shaderProgram.samplerUniform = gl.getUniformLocation(shaderProgram, "uSampler"); + + PIXI.activateDefaultShader(); } @@ -3427,7 +3460,7 @@ PIXI.WebGLRenderGroup.prototype.render = function(projectionMatrix) PIXI.WebGLRenderer.updateTextures(); var gl = this.gl; - + // set the flipped matrix.. gl.uniformMatrix4fv(PIXI.shaderProgram.mvMatrixUniform, false, projectionMatrix); @@ -3455,7 +3488,7 @@ PIXI.WebGLRenderGroup.prototype.render = function(projectionMatrix) } else if(renderable instanceof PIXI.Graphics) { - if(renderable.visible) renderable.renderWebGL(this, projectionMatrix); + if(renderable.visible) PIXI.WebGLGraphics.renderGraphics(renderable);//, projectionMatrix); } } diff --git a/examples/example 6 - Interactivity/pixi.js b/examples/example 6 - Interactivity/pixi.js index 31f792b..9c9f528 100644 --- a/examples/example 6 - Interactivity/pixi.js +++ b/examples/example 6 - Interactivity/pixi.js @@ -4,7 +4,7 @@ * Copyright (c) 2012, Mat Groves * http://goodboydigital.com/ * - * Compiled: 2013-06-14 + * Compiled: 2013-06-19 * * Pixi.JS is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license.php @@ -2422,6 +2422,11 @@ PIXI.shaderVertexSrc = [ "}" ]; +/* + * primitive shader.. + */ + + PIXI.CompileVertexShader = function(gl, shaderSrc) { return PIXI._CompileShader(gl, shaderSrc, gl.VERTEX_SHADER); @@ -2447,6 +2452,35 @@ PIXI._CompileShader = function(gl, shaderSrc, shaderType) return shader; } +PIXI.activateDefaultShader = function() +{ + var gl = PIXI.gl; + var shaderProgram = PIXI.shaderProgram; + + gl.useProgram(shaderProgram); + + gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute); + gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute); + gl.enableVertexAttribArray(shaderProgram.colorAttribute); +} + +PIXI.activatePrimitiveShader = function() +{ + var gl = PIXI.gl; + + gl.disableVertexAttribArray(PIXI.shaderProgram.textureCoordAttribute); + gl.disableVertexAttribArray(PIXI.shaderProgram.colorAttribute); + + var shaderProgram2 = PIXI.shaderProgram2; + + gl.useProgram(shaderProgram2); + + gl.enableVertexAttribArray(shaderProgram2.vertexPositionAttribute); + gl.enableVertexAttribArray(PIXI.shaderProgram2.colorAttribute); + +} + + /** * @author Mat Groves http://matgroves.com/ @Doormat23 */ @@ -2505,9 +2539,9 @@ PIXI.WebGLRenderer = function(width, height, view, transparent) throw new Error(" This browser does not support webGL. Try using the canvas renderer" + this); } + PIXI.WebGLGraphics.initShaders(); this.initShaders(); - var gl = this.gl; PIXI.WebGLRenderer.gl = gl; @@ -2576,17 +2610,16 @@ PIXI.WebGLRenderer.prototype.initShaders = function() gl.useProgram(shaderProgram); shaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, "aVertexPosition"); - gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute); shaderProgram.textureCoordAttribute = gl.getAttribLocation(shaderProgram, "aTextureCoord"); - gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute); shaderProgram.colorAttribute = gl.getAttribLocation(shaderProgram, "aColor"); - gl.enableVertexAttribArray(shaderProgram.colorAttribute); shaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, "uMVMatrix"); shaderProgram.samplerUniform = gl.getUniformLocation(shaderProgram, "uSampler"); + + PIXI.activateDefaultShader(); } @@ -3427,7 +3460,7 @@ PIXI.WebGLRenderGroup.prototype.render = function(projectionMatrix) PIXI.WebGLRenderer.updateTextures(); var gl = this.gl; - + // set the flipped matrix.. gl.uniformMatrix4fv(PIXI.shaderProgram.mvMatrixUniform, false, projectionMatrix); @@ -3455,7 +3488,7 @@ PIXI.WebGLRenderGroup.prototype.render = function(projectionMatrix) } else if(renderable instanceof PIXI.Graphics) { - if(renderable.visible) renderable.renderWebGL(this, projectionMatrix); + if(renderable.visible) PIXI.WebGLGraphics.renderGraphics(renderable);//, projectionMatrix); } } diff --git a/examples/example 7 - Transparent Background/pixi.js b/examples/example 7 - Transparent Background/pixi.js index 31f792b..9c9f528 100644 --- a/examples/example 7 - Transparent Background/pixi.js +++ b/examples/example 7 - Transparent Background/pixi.js @@ -4,7 +4,7 @@ * Copyright (c) 2012, Mat Groves * http://goodboydigital.com/ * - * Compiled: 2013-06-14 + * Compiled: 2013-06-19 * * Pixi.JS is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license.php @@ -2422,6 +2422,11 @@ PIXI.shaderVertexSrc = [ "}" ]; +/* + * primitive shader.. + */ + + PIXI.CompileVertexShader = function(gl, shaderSrc) { return PIXI._CompileShader(gl, shaderSrc, gl.VERTEX_SHADER); @@ -2447,6 +2452,35 @@ PIXI._CompileShader = function(gl, shaderSrc, shaderType) return shader; } +PIXI.activateDefaultShader = function() +{ + var gl = PIXI.gl; + var shaderProgram = PIXI.shaderProgram; + + gl.useProgram(shaderProgram); + + gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute); + gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute); + gl.enableVertexAttribArray(shaderProgram.colorAttribute); +} + +PIXI.activatePrimitiveShader = function() +{ + var gl = PIXI.gl; + + gl.disableVertexAttribArray(PIXI.shaderProgram.textureCoordAttribute); + gl.disableVertexAttribArray(PIXI.shaderProgram.colorAttribute); + + var shaderProgram2 = PIXI.shaderProgram2; + + gl.useProgram(shaderProgram2); + + gl.enableVertexAttribArray(shaderProgram2.vertexPositionAttribute); + gl.enableVertexAttribArray(PIXI.shaderProgram2.colorAttribute); + +} + + /** * @author Mat Groves http://matgroves.com/ @Doormat23 */ @@ -2505,9 +2539,9 @@ PIXI.WebGLRenderer = function(width, height, view, transparent) throw new Error(" This browser does not support webGL. Try using the canvas renderer" + this); } + PIXI.WebGLGraphics.initShaders(); this.initShaders(); - var gl = this.gl; PIXI.WebGLRenderer.gl = gl; @@ -2576,17 +2610,16 @@ PIXI.WebGLRenderer.prototype.initShaders = function() gl.useProgram(shaderProgram); shaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, "aVertexPosition"); - gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute); shaderProgram.textureCoordAttribute = gl.getAttribLocation(shaderProgram, "aTextureCoord"); - gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute); shaderProgram.colorAttribute = gl.getAttribLocation(shaderProgram, "aColor"); - gl.enableVertexAttribArray(shaderProgram.colorAttribute); shaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, "uMVMatrix"); shaderProgram.samplerUniform = gl.getUniformLocation(shaderProgram, "uSampler"); + + PIXI.activateDefaultShader(); } @@ -3427,7 +3460,7 @@ PIXI.WebGLRenderGroup.prototype.render = function(projectionMatrix) PIXI.WebGLRenderer.updateTextures(); var gl = this.gl; - + // set the flipped matrix.. gl.uniformMatrix4fv(PIXI.shaderProgram.mvMatrixUniform, false, projectionMatrix); @@ -3455,7 +3488,7 @@ PIXI.WebGLRenderGroup.prototype.render = function(projectionMatrix) } else if(renderable instanceof PIXI.Graphics) { - if(renderable.visible) renderable.renderWebGL(this, projectionMatrix); + if(renderable.visible) PIXI.WebGLGraphics.renderGraphics(renderable);//, projectionMatrix); } } diff --git a/examples/example 8 - Dragging/pixi.js b/examples/example 8 - Dragging/pixi.js index 31f792b..9c9f528 100644 --- a/examples/example 8 - Dragging/pixi.js +++ b/examples/example 8 - Dragging/pixi.js @@ -4,7 +4,7 @@ * Copyright (c) 2012, Mat Groves * http://goodboydigital.com/ * - * Compiled: 2013-06-14 + * Compiled: 2013-06-19 * * Pixi.JS is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license.php @@ -2422,6 +2422,11 @@ PIXI.shaderVertexSrc = [ "}" ]; +/* + * primitive shader.. + */ + + PIXI.CompileVertexShader = function(gl, shaderSrc) { return PIXI._CompileShader(gl, shaderSrc, gl.VERTEX_SHADER); @@ -2447,6 +2452,35 @@ PIXI._CompileShader = function(gl, shaderSrc, shaderType) return shader; } +PIXI.activateDefaultShader = function() +{ + var gl = PIXI.gl; + var shaderProgram = PIXI.shaderProgram; + + gl.useProgram(shaderProgram); + + gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute); + gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute); + gl.enableVertexAttribArray(shaderProgram.colorAttribute); +} + +PIXI.activatePrimitiveShader = function() +{ + var gl = PIXI.gl; + + gl.disableVertexAttribArray(PIXI.shaderProgram.textureCoordAttribute); + gl.disableVertexAttribArray(PIXI.shaderProgram.colorAttribute); + + var shaderProgram2 = PIXI.shaderProgram2; + + gl.useProgram(shaderProgram2); + + gl.enableVertexAttribArray(shaderProgram2.vertexPositionAttribute); + gl.enableVertexAttribArray(PIXI.shaderProgram2.colorAttribute); + +} + + /** * @author Mat Groves http://matgroves.com/ @Doormat23 */ @@ -2505,9 +2539,9 @@ PIXI.WebGLRenderer = function(width, height, view, transparent) throw new Error(" This browser does not support webGL. Try using the canvas renderer" + this); } + PIXI.WebGLGraphics.initShaders(); this.initShaders(); - var gl = this.gl; PIXI.WebGLRenderer.gl = gl; @@ -2576,17 +2610,16 @@ PIXI.WebGLRenderer.prototype.initShaders = function() gl.useProgram(shaderProgram); shaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, "aVertexPosition"); - gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute); shaderProgram.textureCoordAttribute = gl.getAttribLocation(shaderProgram, "aTextureCoord"); - gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute); shaderProgram.colorAttribute = gl.getAttribLocation(shaderProgram, "aColor"); - gl.enableVertexAttribArray(shaderProgram.colorAttribute); shaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, "uMVMatrix"); shaderProgram.samplerUniform = gl.getUniformLocation(shaderProgram, "uSampler"); + + PIXI.activateDefaultShader(); } @@ -3427,7 +3460,7 @@ PIXI.WebGLRenderGroup.prototype.render = function(projectionMatrix) PIXI.WebGLRenderer.updateTextures(); var gl = this.gl; - + // set the flipped matrix.. gl.uniformMatrix4fv(PIXI.shaderProgram.mvMatrixUniform, false, projectionMatrix); @@ -3455,7 +3488,7 @@ PIXI.WebGLRenderGroup.prototype.render = function(projectionMatrix) } else if(renderable instanceof PIXI.Graphics) { - if(renderable.visible) renderable.renderWebGL(this, projectionMatrix); + if(renderable.visible) PIXI.WebGLGraphics.renderGraphics(renderable);//, projectionMatrix); } } diff --git a/examples/example 9 - Tiling Texture/pixi.js b/examples/example 9 - Tiling Texture/pixi.js index 31f792b..9c9f528 100644 --- a/examples/example 9 - Tiling Texture/pixi.js +++ b/examples/example 9 - Tiling Texture/pixi.js @@ -4,7 +4,7 @@ * Copyright (c) 2012, Mat Groves * http://goodboydigital.com/ * - * Compiled: 2013-06-14 + * Compiled: 2013-06-19 * * Pixi.JS is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license.php @@ -2422,6 +2422,11 @@ PIXI.shaderVertexSrc = [ "}" ]; +/* + * primitive shader.. + */ + + PIXI.CompileVertexShader = function(gl, shaderSrc) { return PIXI._CompileShader(gl, shaderSrc, gl.VERTEX_SHADER); @@ -2447,6 +2452,35 @@ PIXI._CompileShader = function(gl, shaderSrc, shaderType) return shader; } +PIXI.activateDefaultShader = function() +{ + var gl = PIXI.gl; + var shaderProgram = PIXI.shaderProgram; + + gl.useProgram(shaderProgram); + + gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute); + gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute); + gl.enableVertexAttribArray(shaderProgram.colorAttribute); +} + +PIXI.activatePrimitiveShader = function() +{ + var gl = PIXI.gl; + + gl.disableVertexAttribArray(PIXI.shaderProgram.textureCoordAttribute); + gl.disableVertexAttribArray(PIXI.shaderProgram.colorAttribute); + + var shaderProgram2 = PIXI.shaderProgram2; + + gl.useProgram(shaderProgram2); + + gl.enableVertexAttribArray(shaderProgram2.vertexPositionAttribute); + gl.enableVertexAttribArray(PIXI.shaderProgram2.colorAttribute); + +} + + /** * @author Mat Groves http://matgroves.com/ @Doormat23 */ @@ -2505,9 +2539,9 @@ PIXI.WebGLRenderer = function(width, height, view, transparent) throw new Error(" This browser does not support webGL. Try using the canvas renderer" + this); } + PIXI.WebGLGraphics.initShaders(); this.initShaders(); - var gl = this.gl; PIXI.WebGLRenderer.gl = gl; @@ -2576,17 +2610,16 @@ PIXI.WebGLRenderer.prototype.initShaders = function() gl.useProgram(shaderProgram); shaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, "aVertexPosition"); - gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute); shaderProgram.textureCoordAttribute = gl.getAttribLocation(shaderProgram, "aTextureCoord"); - gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute); shaderProgram.colorAttribute = gl.getAttribLocation(shaderProgram, "aColor"); - gl.enableVertexAttribArray(shaderProgram.colorAttribute); shaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, "uMVMatrix"); shaderProgram.samplerUniform = gl.getUniformLocation(shaderProgram, "uSampler"); + + PIXI.activateDefaultShader(); } @@ -3427,7 +3460,7 @@ PIXI.WebGLRenderGroup.prototype.render = function(projectionMatrix) PIXI.WebGLRenderer.updateTextures(); var gl = this.gl; - + // set the flipped matrix.. gl.uniformMatrix4fv(PIXI.shaderProgram.mvMatrixUniform, false, projectionMatrix); @@ -3455,7 +3488,7 @@ PIXI.WebGLRenderGroup.prototype.render = function(projectionMatrix) } else if(renderable instanceof PIXI.Graphics) { - if(renderable.visible) renderable.renderWebGL(this, projectionMatrix); + if(renderable.visible) PIXI.WebGLGraphics.renderGraphics(renderable);//, projectionMatrix); } } diff --git a/src/pixi/primitives/Graphics.js b/src/pixi/primitives/Graphics.js index f1ab4a5..a97762c 100644 --- a/src/pixi/primitives/Graphics.js +++ b/src/pixi/primitives/Graphics.js @@ -18,33 +18,45 @@ PIXI.Graphics = function() // style - color // style - thickness // alpha - + this.fillAlpha = 1; - this.paths = []; - this.currentPath = {points:[]}; + this.lineWidth = 2; + this.lineColor = "#FF0000"; - // path has a - // line? - // fill? - // + this.graphicsData = []; - this.colors = new Float32Array([100]); - -// this.indices = new Uint16Array([0, 1, 2, 3]); } +// SOME TYPES: +PIXI.Graphics.POLY = 0; +PIXI.Graphics.RECT = 1; +PIXI.Graphics.CIRC = 2; + // constructor PIXI.Graphics.constructor = PIXI.Graphics; PIXI.Graphics.prototype = Object.create( PIXI.DisplayObjectContainer.prototype ); -PIXI.Graphics.prototype.lineStyle = function(thickness, color) +PIXI.Graphics.prototype.lineStyle = function(lineWidth, color, alpha) { + this.lineWidth = lineWidth || 0; + this.lineColor = color || 0; + this.lineAlpha = (alpha == undefined) ? 1 : alpha; + + this.currentPath = {lineWidth:this.lineWidth, lineColor:this.lineColor, lineAlpha:this.lineAlpha, points:[], type:PIXI.Graphics.POLY}; + this.graphicsData.push(this.currentPath); + + // TODO store the last position of the line in the current } PIXI.Graphics.prototype.moveTo = function(x, y) { + this.currentPath = {lineWidth:this.lineWidth, lineColor:this.lineColor, lineAlpha:this.lineAlpha, points:[], type:PIXI.Graphics.POLY}; + this.currentPath.points.push(x, y); + + this.graphicsData.push(this.currentPath); } PIXI.Graphics.prototype.lineTo = function(x, y) @@ -52,421 +64,40 @@ PIXI.Graphics.prototype.lineTo = function(x, y) this.currentPath.points.push(x, y); } -PIXI.Graphics.prototype.render = function(renderer) +PIXI.Graphics.prototype.beginFill = function(color, alpha) { - - var context = renderer.context; - var points = this.currentPath.points; - var length = this.currentPath.points.length / 2; - - context.lineWidth = 40; - context.globalAlpha = 1; - - context.strokeStyle="#FF0000"; - - context.beginPath(); - - - context.moveTo( points[0], points[1] ) - - for (var i=1; i < length; i++) { - context.lineTo( points[i * 2], points[i * 2 + 1] ); - }; - - context.stroke(); - -} -/* -PIXI.Graphics.prototype.render = function() -{ - var context = renderer.context; - var points = this.currentPath.points; - var length = this.currentPath.points.length / 2; - - context.lineWidth = 5; - context.globalAlpha = 1; - - context.strokeStyle="#FF0000"; - -// graphics.clear(); -// graphics.lineStyle(3, 0xFF0000); - context.beginPath(); - - // DRAW the Line - context.moveTo(points[0], points[1]); - - for (var i = 1; i < length; i++) - { - var linex = points[i* 2]; - var liney = points[i*2 + 1]; - context.lineTo(linex, liney); - - } - - context.stroke() - context.lineWidth = 2; - - context.beginPath(); - - var newVerts = PIXI.Shape.convertPoints(points); - - for (var i = 1; i < newVerts.length/2; i++) - { - var linex = newVerts[i* 2]; - var liney = newVerts[i*2 + 1]; - context.lineTo(linex, liney); - - } - - context.stroke(); - - return; -} -*/ - - - -PIXI.Graphics.prototype.renderWebGL = function(renderer) -{ - if(!this.shape) - { - this.shape = new PIXI.Shape(this.currentPath.points); - } - - this.shape.draw(); - - /* - var context = renderer.context; - var points = this.currentPath.points; - var length = this.currentPath.points.length / 2; - - context.globalAlpha = 1; - - context.strokeStyle="#FF0000"; - - context.beginPath(); - - context.moveTo( points[0], points[1] ) - - for (var i=1; i < length; i++) { - context.lineTo( points[i * 2], points[i * 2 + 1] ); - }; - - context.stroke(); - */ - - //console.log("@@") - - // ----- lines ------ // + this.filling = true; + this.fillColor = color || 0; + this.fillAlpha = alpha || 1; } -PIXI.Shape = function(points) +PIXI.Graphics.prototype.endFill = function() { - this.points = new Float32Array(points); - - var gl = PIXI.gl; - - this.buffer = gl.createBuffer(); - gl.bindBuffer(gl.ARRAY_BUFFER, this.buffer); - gl.bufferData(gl.ARRAY_BUFFER, this.points, gl.STATIC_DRAW); - - this.initShaders(); - + this.filling = false; + this.fillColor = null; + this.fillAlpha = 1; } -PIXI.primitiveShaderFragmentSrc = [ - "precision mediump float;", - //"uniform vec4 color;", - "void main(void) {", - "gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);", - "}" -]; - -PIXI.primitiveShaderVertexSrc = [ - "attribute vec2 aVertexPosition;", - "uniform mat4 uMVMatrix;", - "void main(void) {", - "gl_Position = uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);", - "}" -]; - -PIXI.Shape.prototype.initShaders = function() -{ - var gl = PIXI.gl; - var fragmentShader = PIXI.CompileFragmentShader(gl, PIXI.primitiveShaderFragmentSrc); - var vertexShader = PIXI.CompileVertexShader(gl, PIXI.primitiveShaderVertexSrc); - - PIXI.shaderProgram2 = gl.createProgram(); - - var shaderProgram = PIXI.shaderProgram2; - - gl.attachShader(shaderProgram, vertexShader); - gl.attachShader(shaderProgram, fragmentShader); - gl.linkProgram(shaderProgram); - - if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) { - alert("Could not initialise shaders"); - } - - gl.useProgram(shaderProgram); - - shaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, "aVertexPosition"); - gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute); - - // shaderProgram.textureCoordAttribute = gl.getAttribLocation(shaderProgram, "aTextureCoord"); - // gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute); - - ///shaderProgram.colorAttribute = gl.getAttribLocation(shaderProgram, "color"); - //gl.enableVertexAttribArray(shaderProgram.colorAttribute); - - //shaderProgram.color = gl.getUniformLocation(shaderProgram, "color"); - //console.log(shaderProgram.color) - //gl.uniform4f(shaderProgram.color, 1.0, 0.0, 0.0, 1.0); - - shaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, "uMVMatrix"); -} - -PIXI.Shape.constructor = PIXI.Shape; - - -PIXI.Shape.prototype.draw = function() -{ - var gl = PIXI.gl; - gl.useProgram(PIXI.shaderProgram2); - gl.lineWidth(5); - - var webGLPoints = PIXI.Shape.convertPoints(this.points); - - - -// console.log(PIXI.shaderProgram2.mvMatrixUniform) - gl.uniformMatrix4fv(PIXI.shaderProgram2.mvMatrixUniform, false, PIXI.projectionMatrix ); - gl.vertexAttribPointer(PIXI.shaderProgram2.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.buffer); -// gl.bufferSubData(gl.ARRAY_BUFFER, 0, webGLPoints) - gl.bufferData(gl.ARRAY_BUFFER, webGLPoints, gl.STATIC_DRAW); - - - gl.drawArrays(gl.TRIANGLE_STRIP, 0, webGLPoints.length/2); - - gl.useProgram(PIXI.shaderProgram); -} - - -PIXI.Shape.convertPoints = function(points) -{ - var verts = [];//0, 0, 0, 0]; - - var length = points.length / 2; - - // DRAW the Line - verts.push(points[0], points[1]) - - var width = 20; - - // i = 0 // - var point1 = new PIXI.Point( points[0], points[1] ); - var point2 = new PIXI.Point( points[2], points[3] ); - var perp = getPerp(point1, point2); - var dist = Math.sqrt(perp.x*perp.x + perp.y*perp.y); - perp.x /= dist; - perp.y /= dist; - perp.x *= width; - perp.y *= width; - - verts.push(points[0] - perp.x , points[1] - perp.y) - verts.push(points[0] + perp.x , points[1] + perp.y) - for (var i = 1; i < length-1; i++) - { - var point1 = new PIXI.Point( points[(i-1)*2],points[(i-1)*2 + 1] ); - var point2 = new PIXI.Point(points[(i)*2],points[(i)*2 + 1] ); - var point3 = new PIXI.Point(points[(i+1)*2],points[(i+1)*2 + 1] ); - - - - var perp = getPerp(point1, point2); - var dist = Math.sqrt(perp.x*perp.x + perp.y*perp.y); - perp.x /= dist; - perp.y /= dist; - perp.x *= width; - perp.y *= width; - - var perp2 = getPerp(point2, point3); - var dist2 = Math.sqrt(perp2.x*perp2.x + perp2.y*perp2.y); - perp2.x /= dist2; - perp2.y /= dist2; - perp2.x *= width; - perp2.y *= width; - - - var p1 = new PIXI.Point(-perp.x+ point2.x , -perp.y+point2.y); - var p1_ = new PIXI.Point(-perp.x+ point1.x, -perp.y+point1.y); - - var p2 = new PIXI.Point(-perp2.x+ point2.x , -perp2.y+point2.y ); - var p2_ = new PIXI.Point(-perp2.x+ point3.x , -perp2.y+point3.y ); - - var p = lineIntersectLine(p1, p1_, p2, p2_); - - var pdist = (p.x -point2.x) * (p.x -point2.x) + (p.y -point2.y) + (p.y -point2.y); - - if(pdist > 50 * 50) - { - var perp3 = new PIXI.Point(perp.x - perp2.x, perp.y - perp2.y); - var dist3 = Math.sqrt(perp3.x*perp3.x + perp3.y*perp3.y); - perp3.x /= dist3; - perp3.y /= dist3; - perp3.x *= width; - perp3.y *= width; -// var perp = - verts.push(point2.x - perp3.x, point2.y -perp3.y); - verts.push(point2.x + perp3.x, point2.y +perp3.y); - verts.push(point2.x - perp3.x, point2.y -perp3.y); - // graphics.drawCircle(point2.x - (p.x-point2.x), point2.y - (p.y - point2.y), 4); - - } - else - { - - // context.fillRect(2,1,1,1); - verts.push(p.x , p.y); - verts.push(point2.x - (p.x-point2.x), point2.y - (p.y - point2.y));//, 4); - } - } - - var point1 = new PIXI.Point( points[(length-2)*2], points[(length-2)*2 + 1] ); - var point2 = new PIXI.Point( points[(length-1)*2], points[(length-1)*2 + 1] ); - - var perp = getPerp(point1, point2); - - var dist = Math.sqrt(perp.x*perp.x + perp.y*perp.y); - perp.x /= dist; - perp.y /= dist; - perp.x *= width; - perp.y *= width; - - verts.push(point2.x - perp.x , point2.y - perp.y) - verts.push(point2.x + perp.x , point2.y + perp.y) - - return new Float32Array(verts); -} - -function normalise(point) -{ - var dist = Math.sqrt(point.x * point.x + point.y * point.y); - return new PIXI.Point(point.x / dist, point.y / dist); -} - -function getPerp(point, point2) -{ - return new PIXI.Point(-(point.y - point2.y), point.x - point2.x); -} - -function lineIntersectLine(A,B,E,F) -{ - var ip; - var a1; - var a2; - var b1; - var b2; - var c1; - var c2; - - a1= B.y-A.y; - b1= A.x-B.x; - c1= B.x*A.y - A.x*B.y; - a2= F.y-E.y; - b2= E.x-F.x; - c2= F.x*E.y - E.x*F.y; - - var denom=a1*b2 - a2*b1; - - if (denom == 0) { - // return null; - denom+=1; - } - ip=new PIXI.Point(); - ip.x=(b1*c2 - b2*c1)/denom; - ip.y=(a2*c1 - a1*c2)/denom; - - //--------------------------------------------------- - //Do checks to see if intersection to endpoints - //distance is longer than actual Segments. - //Return null if it is with any. - //--------------------------------------------------- - - - return ip; -} - -/* -PIXI.Shape.prototype.convertPoints = function(points) -{ - var verts = [0, 0, 0, 0]; - - var total = points.length/2; -// var lastPoint = points[0]; - var lastPointX = points[0]; - var lastPointY = points[1]; - var nextPointX = 0; - var nextPointY = 0; - - var perp = {x:0, y:0}; - var pointX = points[0]; - var pointY = points[1]; - - for (var i = 1; i < total; i++) - { - - var pointX = points[i * 2]; - var pointY = points[i * 2 + 1]; - - var index = i * 4; - - if(i < points.length-2) - { - nextPointX = points[(i+1) * 2]; - nextPointY = points[(i+1) * 2 + 1]; - } - else - { - nextPointX = pointX; - nextPointY = pointY; - } - - perp.y = -(nextPointX - lastPointX); - perp.x = nextPointY - lastPointY; - - var ratio = (1 - (i / (total-1))) * 10; - if(ratio > 1)ratio = 1; - - var perpLength = Math.sqrt(perp.x * perp.x + perp.y * perp.y); - var num = 10; - perp.x /= perpLength; - perp.y /= perpLength; - - perp.x *= num; - perp.y *= num; - verts[index] = pointX + perp.x - verts[index+1] = pointY + perp.y - verts[index+2] = pointX - perp.x - verts[index+3] = pointY - perp.y - - lastPointX = pointX; - lastPointY = pointY; - } - - return new Float32Array(verts); -} -*/ -/** - * @private - */ PIXI.Graphics.prototype.updateTransform = function() { if(!this.visible)return; - PIXI.DisplayObject.prototype.updateTransform.call( this ); - } +PIXI.Graphics.prototype.drawRect = function( x, y, width, height ) +{ + this.currentPath = {lineWidth:this.lineWidth, lineColor:this.lineColor, lineAlpha:this.lineAlpha, + fillColor:this.fillColor, fillAlpha:this.fillAlpha, fill:this.filling, + points:[x, y, width, height], type:PIXI.Graphics.RECT}; + + this.graphicsData.push(this.currentPath); +} + +PIXI.Graphics.prototype.drawCircle = function( x, y, radius) +{ + this.currentPath = {lineWidth:this.lineWidth, lineColor:this.lineColor, lineAlpha:this.lineAlpha, + fillColor:this.fillColor, fillAlpha:this.fillAlpha, fill:this.filling, + points:[x, y, radius], type:PIXI.Graphics.CIRC}; + + this.graphicsData.push(this.currentPath); +} diff --git a/src/pixi/renderers/CanvasGraphics.js b/src/pixi/renderers/CanvasGraphics.js new file mode 100644 index 0000000..2396467 --- /dev/null +++ b/src/pixi/renderers/CanvasGraphics.js @@ -0,0 +1,87 @@ +/** + * @author Mat Groves http://matgroves.com/ @Doormat23 + */ + + +/** + * A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects. + * @class DisplayObjectContainer + * @extends DisplayObject + * @constructor + */ +PIXI.CanvasGraphics = function() +{ + +} + +// constructor + +PIXI.CanvasGraphics.renderGraphics = function(graphics, context) +{ + + for (var i=0; i < graphics.graphicsData.length; i++) + { + var data = graphics.graphicsData[i]; + var points = data.points; + + context.strokeStyle = "#" + data.lineColor.toString(16); + + context.lineWidth = data.lineWidth; + context.globalAlpha = data.lineAlpha; + + if(data.type == PIXI.Graphics.POLY) + { + if(data.lineWidth <= 0)continue; + + context.beginPath(); + + context.moveTo(points[0], points[1]); + + for (var j=1; j < points.length/2; j++) + { + context.lineTo(points[j * 2], points[j * 2 + 1]); + } + + // if the first and last point are the same close the path - much neater :) + if(points[0] == points[points.length-2] && points[1] == points[points.length-1]) + { + context.closePath(); + } + + context.stroke(); + } + else if(data.type == PIXI.Graphics.RECT) + { + // TODO - need to be Undefined! + if(data.fillColor) + { + context.fillStyle = "#" + data.fillColor.toString(16); + context.fillRect(points[0], points[1], points[2], points[3]); + + } + if(data.lineWidth) + { + context.strokeRect(points[0], points[1], points[2], points[3]); + } + } + else if(data.type == PIXI.Graphics.CIRC) + { + // TODO - need to be Undefined! + context.beginPath(); + context.arc(points[0], points[1], points[2],0,2*Math.PI); + context.closePath(); + + if(data.fill) + { + context.fillStyle = "#" + data.fillColor.toString(16); + context.fill(); + } + if(data.lineWidth) + { + context.stroke(); + } + } + + + }; +} diff --git a/src/pixi/renderers/CanvasRenderer.js b/src/pixi/renderers/CanvasRenderer.js index b35cdb9..a654685 100644 --- a/src/pixi/renderers/CanvasRenderer.js +++ b/src/pixi/renderers/CanvasRenderer.js @@ -199,7 +199,7 @@ PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject) } else if(displayObject instanceof PIXI.Graphics) { - displayObject.render(this); + PIXI.CanvasGraphics.renderGraphics(displayObject, context); } // render! diff --git a/src/pixi/renderers/WebGLGraphics.js b/src/pixi/renderers/WebGLGraphics.js new file mode 100644 index 0000000..f1fe1dd --- /dev/null +++ b/src/pixi/renderers/WebGLGraphics.js @@ -0,0 +1,431 @@ +/** + * @author Mat Groves http://matgroves.com/ @Doormat23 + */ + + +/** + * A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects. + * @class DisplayObjectContainer + * @extends DisplayObject + * @constructor + */ +PIXI.WebGLGraphics = function() +{ + +} + +// constructor +PIXI.WebGLGraphics.constructor = PIXI.WebGLGraphics; + +PIXI.WebGLGraphics.renderGraphics = function(graphics) +{ + PIXI.activatePrimitiveShader(); + var gl = PIXI.gl; + + // graphicsObject + // a collection of "shapes" (mainly lines right now!) + ///this.shape.draw(); + if(!graphics._webGL)PIXI.WebGLGraphics.initGraphics(graphics); + + gl.uniformMatrix4fv(PIXI.shaderProgram2.mvMatrixUniform, false, PIXI.projectionMatrix ); + + gl.bindBuffer(gl.ARRAY_BUFFER, graphics._webGL.buffer); + gl.vertexAttribPointer(PIXI.shaderProgram2.vertexPositionAttribute, 2, gl.FLOAT, false, 4 * 6, 0); + gl.vertexAttribPointer(PIXI.shaderProgram2.colorAttribute, 4, gl.FLOAT, false,4 * 6, 2 * 4); + + //shaderProgram.colorAttribute + +// ulong idx, long size, ulong type, bool norm, long stride, ulong offset ) + gl.drawArrays(gl.TRIANGLE_STRIP, 0, graphics._webGL.points.length/6); + + PIXI.activateDefaultShader(); +} + +PIXI.WebGLGraphics.initGraphics = function(graphics) +{ + graphics._webGL = {points:[], lastPosition:new PIXI.Point()}; + + for (var i=0; i < graphics.graphicsData.length; i++) + { + var data = graphics.graphicsData[i]; + + if(data.type == PIXI.Graphics.POLY) + { + if(data.lineWidth > 0) + { + PIXI.WebGLGraphics.buildLine(data, graphics._webGL); + } + } + else if(data.type == PIXI.Graphics.RECT) + { + PIXI.WebGLGraphics.buildRectangle(data, graphics._webGL); + } + else if(data.type == PIXI.Graphics.CIRC) + { + PIXI.WebGLGraphics.buildCircle(data, graphics._webGL); + } + }; + + // convert to points + graphics._webGL.points = new Float32Array(graphics._webGL.points); + + var gl = PIXI.gl; + + graphics._webGL.buffer = gl.createBuffer(); + + gl.bindBuffer(gl.ARRAY_BUFFER, graphics._webGL.buffer); + gl.bufferData(gl.ARRAY_BUFFER, graphics._webGL.points, gl.STATIC_DRAW); +} + + +PIXI.WebGLGraphics.buildRectangle = function(graphicsData, webGLData) +{ + // --- // + // need to convert points to a nice regular data + // + var rectData = graphicsData.points; + var x = rectData[0]; + var y = rectData[1]; + var width = rectData[2]; + var height = rectData[3]; + + + if(graphicsData.fill) + { + var color = HEXtoRGB(graphicsData.fillColor); + var alpha = graphicsData.fillAlpha; + + var r = color[0] * alpha; + var g = color[1] * alpha; + var b = color[2] * alpha; + + var verts = webGLData.points; + + // dead triangle + verts.push(webGLData.lastPosition.x, webGLData.lastPosition.y, 1, 1, 1, 1); + verts.push(x, y, 1, 1, 1, 1); + + // start + verts.push(x, y); + verts.push(r, g, b, alpha); + + verts.push(x + width, y); + verts.push(r, g, b, alpha); + + verts.push(x , y + height); + verts.push(r, g, b, alpha); + + verts.push(x + width, y + height); + verts.push(r, g, b, alpha); + + webGLData.lastPosition.x = x + width; + webGLData.lastPosition.y = y + height; + } + + if(graphicsData.lineWidth) + { + graphicsData.points = [x, y, + x + width, y, + x + width, y + height, + x, y + height, + x, y]; + + PIXI.WebGLGraphics.buildLine(graphicsData, webGLData); + } + +} + +PIXI.WebGLGraphics.buildCircle = function(graphicsData, webGLData) +{ + // --- // + // need to convert points to a nice regular data + // + var rectData = graphicsData.points; + var x = rectData[0]; + var y = rectData[1]; + var radius = rectData[2]; + + var totalSegs = 40 + var seg = (Math.PI * 2) / totalSegs ; + + if(graphicsData.fill) + { + var color = HEXtoRGB(graphicsData.fillColor); + var alpha = graphicsData.fillAlpha; + + var r = color[0] * alpha; + var g = color[1] * alpha; + var b = color[2] * alpha; + + var verts = webGLData.points; + + verts.push(webGLData.lastPosition.x, webGLData.lastPosition.y, 1, 1, 1, 1); + verts.push(x, y, 1, 1, 1, 1); + + for (var i=0; i < totalSegs + 1 ; i++) + { + verts.push(x,y); + verts.push(r, g, b, alpha); + + verts.push(x + Math.sin(seg * i) * radius, + y + Math.cos(seg * i) * radius); + + verts.push(r, g, b, alpha); + }; + + verts.push(x,y); + verts.push(1, 0, 0, 1); + + webGLData.lastPosition.x = x; + webGLData.lastPosition.y = y; + } + + if(graphicsData.lineWidth) + { + graphicsData.points = []; + + for (var i=0; i < totalSegs + 1; i++) + { + graphicsData.points.push(x + Math.sin(seg * i) * radius, + y + Math.cos(seg * i) * radius) + }; + + PIXI.WebGLGraphics.buildLine(graphicsData, webGLData); + } + +} + +PIXI.WebGLGraphics.buildLine = function(graphicsData, webGLData) +{ + var wrap = true; + var points = graphicsData.points; + if(points.length == 0)return; + + // get first and last point.. figure out the middle! + var firstPoint = new PIXI.Point( points[0], points[1] ); + var lastPoint = new PIXI.Point( points[points.length - 2], points[points.length - 1] ); + + // if the first point is the last point - goona have issues :) + if(firstPoint.x == lastPoint.x && firstPoint.y == lastPoint.y) + { + points.pop(); + points.pop(); + + lastPoint = new PIXI.Point( points[points.length - 2], points[points.length - 1] ); + + var midPointX = lastPoint.x + (firstPoint.x - lastPoint.x) *0.5; + var midPointY = lastPoint.y + (firstPoint.y - lastPoint.y) *0.5; + + points.unshift(midPointX, midPointY); + points.push(midPointX, midPointY) + } + + var verts = webGLData.points; + + var length = points.length / 2; + + // DRAW the Line + var width = graphicsData.lineWidth / 2; + + var color = HEXtoRGB(graphicsData.lineColor); + var alpha = graphicsData.lineAlpha; + var r = color[0] * alpha; + var g = color[1] * alpha; + var b = color[2] * alpha; + + // i = 0 // + var point1 = new PIXI.Point( points[0], points[1] ); + var point2 = new PIXI.Point( points[2], points[3] ); + var perp = getPerp(point1, point2); + var dist = Math.sqrt(perp.x*perp.x + perp.y*perp.y); + + perp.x /= dist; + perp.y /= dist; + perp.x *= width; + perp.y *= width; + + // insert dead triangle! + verts.push(webGLData.lastPosition.x, webGLData.lastPosition.y, 1, 1, 1, 1); + verts.push(points[0] - perp.x , points[1] - perp.y, 1, 1, 1, 1); + + + // start + verts.push(points[0] - perp.x , points[1] - perp.y); + verts.push(r, g, b, alpha); + + verts.push(points[0] + perp.x , points[1] + perp.y); + verts.push(r, g, b, alpha); + + for (var i = 1; i < length-1; i++) + { + var point1 = new PIXI.Point( points[(i-1)*2],points[(i-1)*2 + 1] ); + var point2 = new PIXI.Point(points[(i)*2],points[(i)*2 + 1] ); + var point3 = new PIXI.Point(points[(i+1)*2],points[(i+1)*2 + 1] ); + + var perp = getPerp(point1, point2); + var dist = Math.sqrt(perp.x*perp.x + perp.y*perp.y); + perp.x /= dist; + perp.y /= dist; + perp.x *= width; + perp.y *= width; + + var perp2 = getPerp(point2, point3); + var dist2 = Math.sqrt(perp2.x*perp2.x + perp2.y*perp2.y); + perp2.x /= dist2; + perp2.y /= dist2; + perp2.x *= width; + perp2.y *= width; + + var p1 = new PIXI.Point(-perp.x+ point2.x , -perp.y+point2.y); + var p1_ = new PIXI.Point(-perp.x+ point1.x, -perp.y+point1.y); + + var p2 = new PIXI.Point(-perp2.x+ point2.x , -perp2.y+point2.y ); + var p2_ = new PIXI.Point(-perp2.x+ point3.x , -perp2.y+point3.y ); + + var p = lineIntersectLine(p1, p1_, p2, p2_); + + var pdist = (p.x -point2.x) * (p.x -point2.x) + (p.y -point2.y) + (p.y -point2.y); + + if(pdist > 140 * 140) + { + var perp3 = new PIXI.Point(perp.x - perp2.x, perp.y - perp2.y); + var dist3 = Math.sqrt(perp3.x*perp3.x + perp3.y*perp3.y); + perp3.x /= dist3; + perp3.y /= dist3; + perp3.x *= width; + perp3.y *= width; + + verts.push(point2.x - perp3.x, point2.y -perp3.y); + verts.push(r, g, b, alpha); + + verts.push(point2.x + perp3.x, point2.y +perp3.y); + verts.push(r, g, b, alpha); + + verts.push(point2.x - perp3.x, point2.y -perp3.y); + verts.push(r, g, b, alpha); + } + else + { + verts.push(p.x , p.y); + verts.push(r, g, b, alpha); + + verts.push(point2.x - (p.x-point2.x), point2.y - (p.y - point2.y));//, 4); + verts.push(r, g, b, alpha); + } + } + + var point1 = new PIXI.Point( points[(length-2)*2], points[(length-2)*2 + 1] ); + var point2 = new PIXI.Point( points[(length-1)*2], points[(length-1)*2 + 1] ); + + var perp = getPerp(point1, point2); + var dist = Math.sqrt(perp.x*perp.x + perp.y*perp.y); + perp.x /= dist; + perp.y /= dist; + perp.x *= width; + perp.y *= width; + verts.push(point2.x - perp.x , point2.y - perp.y) + verts.push(r, g, b, alpha); + + verts.push(point2.x + perp.x , point2.y + perp.y) + verts.push(r, g, b, alpha); + + // set last triangle! + webGLData.lastPosition.x = point2.x + perp.x; + webGLData.lastPosition.y = point2.y + perp.y; + +} + +function HEXtoRGB(hex) { + return [(hex >> 16 & 0xFF) / 255, ( hex >> 8 & 0xFF) / 255, (hex & 0xFF)/ 255]; +} + + +function normalise(point) +{ + var dist = Math.sqrt(point.x * point.x + point.y * point.y); + return new PIXI.Point(point.x / dist, point.y / dist); +} + +function getPerp(point, point2) +{ + return new PIXI.Point(-(point.y - point2.y), point.x - point2.x); +} + +function lineIntersectLine(A,B,E,F) +{ + var ip; + var a1; + var a2; + var b1; + var b2; + var c1; + var c2; + + a1= B.y-A.y; + b1= A.x-B.x; + c1= B.x*A.y - A.x*B.y; + a2= F.y-E.y; + b2= E.x-F.x; + c2= F.x*E.y - E.x*F.y; + + var denom=a1*b2 - a2*b1; + + if (denom == 0) { + // return null; + console.log("!") + denom+=1; + } + ip=new PIXI.Point(); + ip.x=(b1*c2 - b2*c1)/denom; + ip.y=(a2*c1 - a1*c2)/denom; + + return ip; +} + + + +PIXI.primitiveShaderFragmentSrc = [ + "precision mediump float;", + "varying vec4 vColor;", + "void main(void) {", + "gl_FragColor = vColor;", + "}" +]; + +PIXI.primitiveShaderVertexSrc = [ + "attribute vec2 aVertexPosition;", + "attribute vec4 aColor;", + "uniform mat4 uMVMatrix;", + "varying vec4 vColor;", + "void main(void) {", + "gl_Position = uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);", + "vColor = aColor;", + "}" +]; + + +PIXI.WebGLGraphics.initShaders = function() +{ + var gl = PIXI.gl; + var fragmentShader = PIXI.CompileFragmentShader(gl, PIXI.primitiveShaderFragmentSrc); + var vertexShader = PIXI.CompileVertexShader(gl, PIXI.primitiveShaderVertexSrc); + + PIXI.shaderProgram2 = gl.createProgram(); + + var shaderProgram = PIXI.shaderProgram2; + + gl.attachShader(shaderProgram, vertexShader); + gl.attachShader(shaderProgram, fragmentShader); + gl.linkProgram(shaderProgram); + + if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) { + alert("Could not initialise shaders"); + } + + gl.useProgram(shaderProgram); + + shaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, "aVertexPosition"); + shaderProgram.colorAttribute = gl.getAttribLocation(shaderProgram, "aColor"); + + shaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, "uMVMatrix"); +} diff --git a/src/pixi/renderers/WebGLRenderGroup.js b/src/pixi/renderers/WebGLRenderGroup.js index 1f5a867..1d36d4d 100644 --- a/src/pixi/renderers/WebGLRenderGroup.js +++ b/src/pixi/renderers/WebGLRenderGroup.js @@ -48,7 +48,7 @@ PIXI.WebGLRenderGroup.prototype.render = function(projectionMatrix) PIXI.WebGLRenderer.updateTextures(); var gl = this.gl; - + // set the flipped matrix.. gl.uniformMatrix4fv(PIXI.shaderProgram.mvMatrixUniform, false, projectionMatrix); @@ -76,7 +76,7 @@ PIXI.WebGLRenderGroup.prototype.render = function(projectionMatrix) } else if(renderable instanceof PIXI.Graphics) { - if(renderable.visible) renderable.renderWebGL(this, projectionMatrix); + if(renderable.visible) PIXI.WebGLGraphics.renderGraphics(renderable);//, projectionMatrix); } } diff --git a/src/pixi/renderers/WebGLRenderer.js b/src/pixi/renderers/WebGLRenderer.js index 2b608c9..7b43b52 100644 --- a/src/pixi/renderers/WebGLRenderer.js +++ b/src/pixi/renderers/WebGLRenderer.js @@ -34,7 +34,7 @@ PIXI.WebGLRenderer = function(width, height, view, transparent) this.view = view || document.createElement( 'canvas' ); this.view.width = this.width; - this.view.height = this.height; + this.view.height = this.height; // deal with losing context.. var scope = this; @@ -56,9 +56,9 @@ PIXI.WebGLRenderer = function(width, height, view, transparent) throw new Error(" This browser does not support webGL. Try using the canvas renderer" + this); } + PIXI.WebGLGraphics.initShaders(); this.initShaders(); - var gl = this.gl; PIXI.WebGLRenderer.gl = gl; @@ -127,17 +127,16 @@ PIXI.WebGLRenderer.prototype.initShaders = function() gl.useProgram(shaderProgram); shaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, "aVertexPosition"); - gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute); shaderProgram.textureCoordAttribute = gl.getAttribLocation(shaderProgram, "aTextureCoord"); - // gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute); shaderProgram.colorAttribute = gl.getAttribLocation(shaderProgram, "aColor"); - // gl.enableVertexAttribArray(shaderProgram.colorAttribute); shaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, "uMVMatrix"); shaderProgram.samplerUniform = gl.getUniformLocation(shaderProgram, "uSampler"); + + PIXI.activateDefaultShader(); } diff --git a/src/pixi/renderers/WebGLShaders.js b/src/pixi/renderers/WebGLShaders.js index 100c9aa..139ede9 100644 --- a/src/pixi/renderers/WebGLShaders.js +++ b/src/pixi/renderers/WebGLShaders.js @@ -28,6 +28,11 @@ PIXI.shaderVertexSrc = [ "}" ]; +/* + * primitive shader.. + */ + + PIXI.CompileVertexShader = function(gl, shaderSrc) { return PIXI._CompileShader(gl, shaderSrc, gl.VERTEX_SHADER); @@ -52,3 +57,32 @@ PIXI._CompileShader = function(gl, shaderSrc, shaderType) return shader; } + +PIXI.activateDefaultShader = function() +{ + var gl = PIXI.gl; + var shaderProgram = PIXI.shaderProgram; + + gl.useProgram(shaderProgram); + + gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute); + gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute); + gl.enableVertexAttribArray(shaderProgram.colorAttribute); +} + +PIXI.activatePrimitiveShader = function() +{ + var gl = PIXI.gl; + + gl.disableVertexAttribArray(PIXI.shaderProgram.textureCoordAttribute); + gl.disableVertexAttribArray(PIXI.shaderProgram.colorAttribute); + + var shaderProgram2 = PIXI.shaderProgram2; + + gl.useProgram(shaderProgram2); + + gl.enableVertexAttribArray(shaderProgram2.vertexPositionAttribute); + gl.enableVertexAttribArray(PIXI.shaderProgram2.colorAttribute); + +} + From 6d166cbf7afb3b9be751fc989918f88e16b093be Mon Sep 17 00:00:00 2001 From: Mat Groves Date: Wed, 19 Jun 2013 21:16:00 +0100 Subject: [PATCH 03/68] Interaction Prevent Default fix --- src/pixi/InteractionManager.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/pixi/InteractionManager.js b/src/pixi/InteractionManager.js index bb88a5f..c475d95 100644 --- a/src/pixi/InteractionManager.js +++ b/src/pixi/InteractionManager.js @@ -217,6 +217,8 @@ PIXI.InteractionManager.prototype.onMouseMove = function(event) PIXI.InteractionManager.prototype.onMouseDown = function(event) { + event.preventDefault(); + // loop through inteaction tree... // hit test each item! -> // get interactive items under point?? @@ -253,6 +255,8 @@ PIXI.InteractionManager.prototype.onMouseDown = function(event) PIXI.InteractionManager.prototype.onMouseUp = function(event) { + + var global = this.mouse.global; @@ -407,6 +411,8 @@ PIXI.InteractionManager.prototype.onTouchMove = function(event) PIXI.InteractionManager.prototype.onTouchStart = function(event) { + event.preventDefault(); + var rect = this.target.view.getBoundingClientRect(); var changedTouches = event.changedTouches; From e0db0632330f90bece5f23aa8e4846aba6fc42c6 Mon Sep 17 00:00:00 2001 From: Mat Groves Date: Thu, 20 Jun 2013 16:28:32 +0100 Subject: [PATCH 04/68] Graphics Updated --- examples/example 13 - Graphics/index.html | 13 ++++++++- src/pixi/primitives/Graphics.js | 10 +++++++ src/pixi/renderers/CanvasGraphics.js | 9 ++++--- src/pixi/renderers/WebGLGraphics.js | 33 ++++++++++++++++------- src/pixi/renderers/WebGLRenderGroup.js | 19 ++++++++++--- 5 files changed, 66 insertions(+), 18 deletions(-) diff --git a/examples/example 13 - Graphics/index.html b/examples/example 13 - Graphics/index.html index f91cd3f..8587309 100644 --- a/examples/example 13 - Graphics/index.html +++ b/examples/example 13 - Graphics/index.html @@ -24,7 +24,9 @@ // create an new instance of a pixi stage - var stage = new PIXI.Stage(0x000000); + var stage = new PIXI.Stage(0x000000, true); + + stage.setInteractive(true); // create a renderer instance //var renderer = new PIXI.CanvasRenderer(800, 600);//PIXI.autoDetectRenderer(800, 600); @@ -96,11 +98,20 @@ stage.addChild(sprite); stage.addChild(graphics); + stage.click = function() + { + graphics.clear(); + } + requestAnimFrame(animate); function animate() { renderer.render(stage); requestAnimFrame( animate ); + graphics.lineStyle(Math.random() * 30, Math.random() * 0xFFFFFF, 0.8); + + graphics.moveTo(Math.random() * 600,Math.random() * 600); + graphics.lineTo(Math.random() * 600,Math.random() * 600); } diff --git a/src/pixi/primitives/Graphics.js b/src/pixi/primitives/Graphics.js index a97762c..1c82d2b 100644 --- a/src/pixi/primitives/Graphics.js +++ b/src/pixi/primitives/Graphics.js @@ -62,6 +62,7 @@ PIXI.Graphics.prototype.moveTo = function(x, y) PIXI.Graphics.prototype.lineTo = function(x, y) { this.currentPath.points.push(x, y); + this.dirty = true; } PIXI.Graphics.prototype.beginFill = function(color, alpha) @@ -91,6 +92,7 @@ PIXI.Graphics.prototype.drawRect = function( x, y, width, height ) points:[x, y, width, height], type:PIXI.Graphics.RECT}; this.graphicsData.push(this.currentPath); + this.dirty = true; } PIXI.Graphics.prototype.drawCircle = function( x, y, radius) @@ -100,4 +102,12 @@ PIXI.Graphics.prototype.drawCircle = function( x, y, radius) points:[x, y, radius], type:PIXI.Graphics.CIRC}; this.graphicsData.push(this.currentPath); + this.dirty = true; +} + +PIXI.Graphics.prototype.clear = function() +{ + this.dirty = true; + this.clearDirty = true; + this.graphicsData = []; } diff --git a/src/pixi/renderers/CanvasGraphics.js b/src/pixi/renderers/CanvasGraphics.js index 2396467..fa26d3f 100644 --- a/src/pixi/renderers/CanvasGraphics.js +++ b/src/pixi/renderers/CanvasGraphics.js @@ -24,8 +24,8 @@ PIXI.CanvasGraphics.renderGraphics = function(graphics, context) var data = graphics.graphicsData[i]; var points = data.points; - context.strokeStyle = "#" + data.lineColor.toString(16); - + context.strokeStyle = color = '#' + ('00000' + ( data.lineColor | 0).toString(16)).substr(-6); + context.lineWidth = data.lineWidth; context.globalAlpha = data.lineAlpha; @@ -55,7 +55,8 @@ PIXI.CanvasGraphics.renderGraphics = function(graphics, context) // TODO - need to be Undefined! if(data.fillColor) { - context.fillStyle = "#" + data.fillColor.toString(16); + context.fillStyle = color = '#' + ('00000' + ( data.fillColor | 0).toString(16)).substr(-6); + context.fillRect(points[0], points[1], points[2], points[3]); } @@ -73,7 +74,7 @@ PIXI.CanvasGraphics.renderGraphics = function(graphics, context) if(data.fill) { - context.fillStyle = "#" + data.fillColor.toString(16); + context.fillStyle = color = '#' + ('00000' + ( data.fillColor | 0).toString(16)).substr(-6); context.fill(); } if(data.lineWidth) diff --git a/src/pixi/renderers/WebGLGraphics.js b/src/pixi/renderers/WebGLGraphics.js index f1fe1dd..949d283 100644 --- a/src/pixi/renderers/WebGLGraphics.js +++ b/src/pixi/renderers/WebGLGraphics.js @@ -25,7 +25,22 @@ PIXI.WebGLGraphics.renderGraphics = function(graphics) // graphicsObject // a collection of "shapes" (mainly lines right now!) ///this.shape.draw(); - if(!graphics._webGL)PIXI.WebGLGraphics.initGraphics(graphics); + if(!graphics._webGL)graphics._webGL = {points:[], lastPosition:new PIXI.Point(), lastIndex:0, buffer:gl.createBuffer()}; + + if(graphics.dirty) + { + graphics.dirty = false; + + if(graphics.clearDirty) + { + graphics.clearDirty = false; + graphics._webGL.lastIndex = 0; + graphics._webGL.points = []; + + } + + PIXI.WebGLGraphics.initGraphics(graphics); + } gl.uniformMatrix4fv(PIXI.shaderProgram2.mvMatrixUniform, false, PIXI.projectionMatrix ); @@ -36,16 +51,14 @@ PIXI.WebGLGraphics.renderGraphics = function(graphics) //shaderProgram.colorAttribute // ulong idx, long size, ulong type, bool norm, long stride, ulong offset ) - gl.drawArrays(gl.TRIANGLE_STRIP, 0, graphics._webGL.points.length/6); + gl.drawArrays(gl.TRIANGLE_STRIP, 0, graphics._webGL.glPoints.length/6); PIXI.activateDefaultShader(); } PIXI.WebGLGraphics.initGraphics = function(graphics) { - graphics._webGL = {points:[], lastPosition:new PIXI.Point()}; - - for (var i=0; i < graphics.graphicsData.length; i++) + for (var i=graphics._webGL.lastIndex; i < graphics.graphicsData.length; i++) { var data = graphics.graphicsData[i]; @@ -66,15 +79,15 @@ PIXI.WebGLGraphics.initGraphics = function(graphics) } }; + //console.log(graphics._webGL.lastIndex - graphics.graphicsData.length ) + graphics._webGL.lastIndex = graphics.graphicsData.length; + // convert to points - graphics._webGL.points = new Float32Array(graphics._webGL.points); + graphics._webGL.glPoints = new Float32Array(graphics._webGL.points); var gl = PIXI.gl; - - graphics._webGL.buffer = gl.createBuffer(); - gl.bindBuffer(gl.ARRAY_BUFFER, graphics._webGL.buffer); - gl.bufferData(gl.ARRAY_BUFFER, graphics._webGL.points, gl.STATIC_DRAW); + gl.bufferData(gl.ARRAY_BUFFER, graphics._webGL.glPoints, gl.STATIC_DRAW); } diff --git a/src/pixi/renderers/WebGLRenderGroup.js b/src/pixi/renderers/WebGLRenderGroup.js index 1d36d4d..a193406 100644 --- a/src/pixi/renderers/WebGLRenderGroup.js +++ b/src/pixi/renderers/WebGLRenderGroup.js @@ -190,7 +190,10 @@ PIXI.WebGLRenderGroup.prototype.renderSpecific = function(displayObject, project { if(startBatch.visible) startBatch.renderWebGL(this, projectionMatrix); } - + else if(renderable instanceof PIXI.Graphics) + { + if(renderable.visible) PIXI.WebGLGraphics.renderGraphics(renderable);//, projectionMatrix); + } return; } @@ -215,7 +218,10 @@ PIXI.WebGLRenderGroup.prototype.renderSpecific = function(displayObject, project { if(startBatch.visible) startBatch.renderWebGL(this, projectionMatrix); } - + else if(renderable instanceof PIXI.Graphics) + { + if(renderable.visible) PIXI.WebGLGraphics.renderGraphics(renderable);//, projectionMatrix); + } // DO the middle batchs.. for (var i=startBatchIndex+1; i < endBatchIndex; i++) { @@ -237,7 +243,10 @@ PIXI.WebGLRenderGroup.prototype.renderSpecific = function(displayObject, project { if(renderable.visible) renderable.renderWebGL(this, projectionMatrix); } - + else if(renderable instanceof PIXI.Graphics) + { + if(renderable.visible) PIXI.WebGLGraphics.renderGraphics(renderable);//, projectionMatrix); + } } // DO the last batch.. @@ -257,6 +266,10 @@ PIXI.WebGLRenderGroup.prototype.renderSpecific = function(displayObject, project { if(endBatch.visible) endBatch.renderWebGL(this, projectionMatrix); } + else if(renderable instanceof PIXI.Graphics) + { + if(renderable.visible) PIXI.WebGLGraphics.renderGraphics(renderable);//, projectionMatrix); + } } PIXI.WebGLRenderGroup.prototype.checkVisibility = function(displayObject, globalVisible) From 2ad9002a79a24002aeaded642a36a227a47dd243 Mon Sep 17 00:00:00 2001 From: Mat Groves Date: Thu, 20 Jun 2013 17:38:12 +0100 Subject: [PATCH 05/68] Src folder restructured --- Gruntfile.js | 35 +- bin/pixi.dev.js | 1146 ++++-- bin/pixi.js | 8 +- docs/classes/BitmapText.html | 76 +- docs/classes/CanvasRenderer.html | 14 +- docs/classes/CustomRenderable.html | 64 +- docs/classes/DisplayObject.html | 230 +- docs/classes/DisplayObjectContainer.html | 80 +- docs/classes/InteractionData.html | 10 +- docs/classes/InteractionManager.html | 178 + docs/classes/MovieClip.html | 112 +- docs/classes/Point.html | 10 +- docs/classes/Polygon.html | 6 +- docs/classes/Rectangle.html | 14 +- docs/classes/Spine.html | 76 +- docs/classes/Sprite.html | 96 +- docs/classes/Stage.html | 86 +- docs/classes/Text.html | 88 +- docs/classes/TilingSprite.html | 76 +- docs/classes/WebGLBatch.html | 20 +- docs/classes/WebGLRenderer.html | 8 +- docs/data.json | 2384 ++++++------- .../files/src_pixi_InteractionManager.js.html | 8 +- ...nt.js.html => src_pixi_core_Point.js.html} | 4 +- ....js.html => src_pixi_core_Polygon.js.html} | 4 +- ...s.html => src_pixi_core_Rectangle.js.html} | 4 +- ...=> src_pixi_display_DisplayObject.js.html} | 4 +- ...xi_display_DisplayObjectContainer.js.html} | 4 +- ...tml => src_pixi_display_MovieClip.js.html} | 4 +- ...s.html => src_pixi_display_Sprite.js.html} | 4 +- ...js.html => src_pixi_display_Stage.js.html} | 4 +- .../src_pixi_primitives_Graphics.js.html | 273 ++ ...xi_renderers_canvas_CanvasGraphics.js.html | 248 ++ ...i_renderers_canvas_CanvasRenderer.js.html} | 8 +- ...c_pixi_renderers_webgl_WebGLBatch.js.html} | 4 +- ...pixi_renderers_webgl_WebGLGraphics.js.html | 603 ++++ ..._renderers_webgl_WebGLRenderGroup.js.html} | 41 +- ...ixi_renderers_webgl_WebGLRenderer.js.html} | 17 +- ...pixi_renderers_webgl_WebGLShaders.js.html} | 38 +- docs/modules/PIXI.html | 2 +- examples/example 1 - Basics/pixi.js | 1146 ++++-- examples/example 10 - Text/pixi.js | 1146 ++++-- examples/example 11 - RenderTexture/pixi.js | 1146 ++++-- examples/example 12 - Spine/pixi.js | 1213 +++++-- examples/example 13 - Graphics/index.html | 4 +- examples/example 13 - Graphics/pixi.js | 3147 +++++++++++++++-- examples/example 2 - SpriteSheet/pixi.js | 1146 ++++-- examples/example 3 - MovieClip/pixi.js | 1146 ++++-- examples/example 4 - Balls/pixi.js | 1146 ++++-- examples/example 5 - Morph/pixi.js | 1146 ++++-- examples/example 6 - Interactivity/pixi.js | 1146 ++++-- .../pixi.js | 1146 ++++-- examples/example 8 - Dragging/pixi.js | 1146 ++++-- examples/example 9 - Tiling Texture/pixi.js | 1146 ++++-- src/pixi/{utils => core}/Matrix.js | 0 src/pixi/{ => core}/Point.js | 0 src/pixi/{ => core}/Polygon.js | 0 src/pixi/{ => core}/Rectangle.js | 0 src/pixi/{ => display}/DisplayObject.js | 0 .../{ => display}/DisplayObjectContainer.js | 0 src/pixi/{ => display}/MovieClip.js | 0 src/pixi/{ => display}/Sprite.js | 0 src/pixi/{ => display}/Stage.js | 0 src/pixi/primitives/Line.js | 37 - .../renderers/{ => canvas}/CanvasGraphics.js | 0 .../renderers/{ => canvas}/CanvasRenderer.js | 0 src/pixi/renderers/{ => webgl}/WebGLBatch.js | 0 .../renderers/{ => webgl}/WebGLGraphics.js | 3 +- .../renderers/{ => webgl}/WebGLRenderGroup.js | 0 .../renderers/{ => webgl}/WebGLRenderer.js | 0 .../renderers/{ => webgl}/WebGLShaders.js | 0 71 files changed, 17728 insertions(+), 5373 deletions(-) rename docs/files/{src_pixi_Point.js.html => src_pixi_core_Point.js.html} (98%) rename docs/files/{src_pixi_Polygon.js.html => src_pixi_core_Polygon.js.html} (98%) rename docs/files/{src_pixi_Rectangle.js.html => src_pixi_core_Rectangle.js.html} (98%) rename docs/files/{src_pixi_DisplayObject.js.html => src_pixi_display_DisplayObject.js.html} (99%) rename docs/files/{src_pixi_DisplayObjectContainer.js.html => src_pixi_display_DisplayObjectContainer.js.html} (98%) rename docs/files/{src_pixi_MovieClip.js.html => src_pixi_display_MovieClip.js.html} (98%) rename docs/files/{src_pixi_Sprite.js.html => src_pixi_display_Sprite.js.html} (98%) rename docs/files/{src_pixi_Stage.js.html => src_pixi_display_Stage.js.html} (98%) create mode 100644 docs/files/src_pixi_primitives_Graphics.js.html create mode 100644 docs/files/src_pixi_renderers_canvas_CanvasGraphics.js.html rename docs/files/{src_pixi_renderers_CanvasRenderer.js.html => src_pixi_renderers_canvas_CanvasRenderer.js.html} (98%) rename docs/files/{src_pixi_renderers_WebGLBatch.js.html => src_pixi_renderers_webgl_WebGLBatch.js.html} (99%) create mode 100644 docs/files/src_pixi_renderers_webgl_WebGLGraphics.js.html rename docs/files/{src_pixi_renderers_WebGLRenderGroup.js.html => src_pixi_renderers_webgl_WebGLRenderGroup.js.html} (96%) rename docs/files/{src_pixi_renderers_WebGLRenderer.js.html => src_pixi_renderers_webgl_WebGLRenderer.js.html} (97%) rename docs/files/{src_pixi_renderers_WebGLShaders.js.html => src_pixi_renderers_webgl_WebGLShaders.js.html} (88%) rename src/pixi/{utils => core}/Matrix.js (100%) rename src/pixi/{ => core}/Point.js (100%) rename src/pixi/{ => core}/Polygon.js (100%) rename src/pixi/{ => core}/Rectangle.js (100%) rename src/pixi/{ => display}/DisplayObject.js (100%) rename src/pixi/{ => display}/DisplayObjectContainer.js (100%) rename src/pixi/{ => display}/MovieClip.js (100%) rename src/pixi/{ => display}/Sprite.js (100%) rename src/pixi/{ => display}/Stage.js (100%) delete mode 100644 src/pixi/primitives/Line.js rename src/pixi/renderers/{ => canvas}/CanvasGraphics.js (100%) rename src/pixi/renderers/{ => canvas}/CanvasRenderer.js (100%) rename src/pixi/renderers/{ => webgl}/WebGLBatch.js (100%) rename src/pixi/renderers/{ => webgl}/WebGLGraphics.js (99%) rename src/pixi/renderers/{ => webgl}/WebGLRenderGroup.js (100%) rename src/pixi/renderers/{ => webgl}/WebGLRenderer.js (100%) rename src/pixi/renderers/{ => webgl}/WebGLShaders.js (100%) diff --git a/Gruntfile.js b/Gruntfile.js index b3b8ac7..e4c2b5d 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -11,27 +11,29 @@ module.exports = function(grunt) { srcFiles = [ '<%= dirs.src %>/Intro.js', '<%= dirs.src %>/Pixi.js', - '<%= dirs.src %>/Point.js', - '<%= dirs.src %>/Rectangle.js', - '<%= dirs.src %>/Polygon.js', - '<%= dirs.src %>/DisplayObject.js', - '<%= dirs.src %>/DisplayObjectContainer.js', - '<%= dirs.src %>/Sprite.js', - '<%= dirs.src %>/MovieClip.js', + '<%= dirs.src %>/core/Point.js', + '<%= dirs.src %>/core/Rectangle.js', + '<%= dirs.src %>/core/Polygon.js', + '<%= dirs.src %>/core/Matrix.js', + '<%= dirs.src %>/display/DisplayObject.js', + '<%= dirs.src %>/display/DisplayObjectContainer.js', + '<%= dirs.src %>/display/Sprite.js', + '<%= dirs.src %>/display/MovieClip.js', '<%= dirs.src %>/text/Text.js', '<%= dirs.src %>/text/BitmapText.js', - '<%= dirs.src %>/Text.js', '<%= dirs.src %>/InteractionManager.js', - '<%= dirs.src %>/Stage.js', + '<%= dirs.src %>/display/Stage.js', '<%= dirs.src %>/utils/Utils.js', '<%= dirs.src %>/utils/EventTarget.js', - '<%= dirs.src %>/utils/Matrix.js', '<%= dirs.src %>/utils/Detector.js', - '<%= dirs.src %>/renderers/WebGLShaders.js', - '<%= dirs.src %>/renderers/WebGLRenderer.js', - '<%= dirs.src %>/renderers/WebGLBatch.js', - '<%= dirs.src %>/renderers/WebGLRenderGroup.js', - '<%= dirs.src %>/renderers/CanvasRenderer.js', + '<%= dirs.src %>/renderers/webgl/WebGLShaders.js', + '<%= dirs.src %>/renderers/webgl/WebGLGraphics.js', + '<%= dirs.src %>/renderers/webgl/WebGLRenderer.js', + '<%= dirs.src %>/renderers/webgl/WebGLBatch.js', + '<%= dirs.src %>/renderers/webgl/WebGLRenderGroup.js', + '<%= dirs.src %>/renderers/canvas/CanvasRenderer.js', + '<%= dirs.src %>/renderers/canvas/CanvasGraphics.js', + '<%= dirs.src %>/primitives/Graphics.js', '<%= dirs.src %>/extras/Strip.js', '<%= dirs.src %>/extras/Rope.js', '<%= dirs.src %>/extras/TilingSprite.js', @@ -116,7 +118,8 @@ module.exports = function(grunt) { 'examples/example 9 - Tiling Texture', 'examples/example 10 - Text', 'examples/example 11 - RenderTexture', - 'examples/example 12 - Spine' + 'examples/example 12 - Spine', + 'examples/example 13 - Graphics' ] }, connect: { diff --git a/bin/pixi.dev.js b/bin/pixi.dev.js index 95e4690..21e9a00 100644 --- a/bin/pixi.dev.js +++ b/bin/pixi.dev.js @@ -4,7 +4,7 @@ * Copyright (c) 2012, Mat Groves * http://goodboydigital.com/ * - * Compiled: 2013-06-19 + * Compiled: 2013-06-20 * * Pixi.JS is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license.php @@ -155,6 +155,239 @@ PIXI.Polygon.clone = function() PIXI.Polygon.constructor = PIXI.Polygon; + + +/* + * A lighter version of the rad gl-matrix created by Brandon Jones, Colin MacKenzie IV + * you both rock! + */ + +function determineMatrixArrayType() { + PIXI.Matrix = (typeof Float32Array !== 'undefined') ? Float32Array : Array; + return PIXI.Matrix; +} + +determineMatrixArrayType(); + +PIXI.mat3 = {}; + +PIXI.mat3.create = function() +{ + var matrix = new PIXI.Matrix(9); + + matrix[0] = 1; + matrix[1] = 0; + matrix[2] = 0; + matrix[3] = 0; + matrix[4] = 1; + matrix[5] = 0; + matrix[6] = 0; + matrix[7] = 0; + matrix[8] = 1; + + return matrix; +} + +PIXI.mat4 = {}; + +PIXI.mat4.create = function() +{ + var matrix = new PIXI.Matrix(16); + + matrix[0] = 1; + matrix[1] = 0; + matrix[2] = 0; + matrix[3] = 0; + matrix[4] = 0; + matrix[5] = 1; + matrix[6] = 0; + matrix[7] = 0; + matrix[8] = 0; + matrix[9] = 0; + matrix[10] = 1; + matrix[11] = 0; + matrix[12] = 0; + matrix[13] = 0; + matrix[14] = 0; + matrix[15] = 1; + + return matrix; +} + +PIXI.mat3.multiply = function (mat, mat2, dest) +{ + if (!dest) { dest = mat; } + + // Cache the matrix values (makes for huge speed increases!) + var a00 = mat[0], a01 = mat[1], a02 = mat[2], + a10 = mat[3], a11 = mat[4], a12 = mat[5], + a20 = mat[6], a21 = mat[7], a22 = mat[8], + + b00 = mat2[0], b01 = mat2[1], b02 = mat2[2], + b10 = mat2[3], b11 = mat2[4], b12 = mat2[5], + b20 = mat2[6], b21 = mat2[7], b22 = mat2[8]; + + dest[0] = b00 * a00 + b01 * a10 + b02 * a20; + dest[1] = b00 * a01 + b01 * a11 + b02 * a21; + dest[2] = b00 * a02 + b01 * a12 + b02 * a22; + + dest[3] = b10 * a00 + b11 * a10 + b12 * a20; + dest[4] = b10 * a01 + b11 * a11 + b12 * a21; + dest[5] = b10 * a02 + b11 * a12 + b12 * a22; + + dest[6] = b20 * a00 + b21 * a10 + b22 * a20; + dest[7] = b20 * a01 + b21 * a11 + b22 * a21; + dest[8] = b20 * a02 + b21 * a12 + b22 * a22; + + return dest; +} + + +PIXI.mat3.toMat4 = function (mat, dest) +{ + if (!dest) { dest = PIXI.mat4.create(); } + + dest[15] = 1; + dest[14] = 0; + dest[13] = 0; + dest[12] = 0; + + dest[11] = 0; + dest[10] = mat[8]; + dest[9] = mat[7]; + dest[8] = mat[6]; + + dest[7] = 0; + dest[6] = mat[5]; + dest[5] = mat[4]; + dest[4] = mat[3]; + + dest[3] = 0; + dest[2] = mat[2]; + dest[1] = mat[1]; + dest[0] = mat[0]; + + return dest; +} + + +///// + + +PIXI.mat4.create = function() +{ + var matrix = new PIXI.Matrix(16); + + matrix[0] = 1; + matrix[1] = 0; + matrix[2] = 0; + matrix[3] = 0; + matrix[4] = 0; + matrix[5] = 1; + matrix[6] = 0; + matrix[7] = 0; + matrix[8] = 0; + matrix[9] = 0; + matrix[10] = 1; + matrix[11] = 0; + matrix[12] = 0; + matrix[13] = 0; + matrix[14] = 0; + matrix[15] = 1; + + return matrix; +} + +PIXI.mat4.transpose = function (mat, dest) +{ + // If we are transposing ourselves we can skip a few steps but have to cache some values + if (!dest || mat === dest) + { + var a01 = mat[1], a02 = mat[2], a03 = mat[3], + a12 = mat[6], a13 = mat[7], + a23 = mat[11]; + + mat[1] = mat[4]; + mat[2] = mat[8]; + mat[3] = mat[12]; + mat[4] = a01; + mat[6] = mat[9]; + mat[7] = mat[13]; + mat[8] = a02; + mat[9] = a12; + mat[11] = mat[14]; + mat[12] = a03; + mat[13] = a13; + mat[14] = a23; + return mat; + } + + dest[0] = mat[0]; + dest[1] = mat[4]; + dest[2] = mat[8]; + dest[3] = mat[12]; + dest[4] = mat[1]; + dest[5] = mat[5]; + dest[6] = mat[9]; + dest[7] = mat[13]; + dest[8] = mat[2]; + dest[9] = mat[6]; + dest[10] = mat[10]; + dest[11] = mat[14]; + dest[12] = mat[3]; + dest[13] = mat[7]; + dest[14] = mat[11]; + dest[15] = mat[15]; + return dest; +} + +PIXI.mat4.multiply = function (mat, mat2, dest) +{ + if (!dest) { dest = mat; } + + // Cache the matrix values (makes for huge speed increases!) + var a00 = mat[ 0], a01 = mat[ 1], a02 = mat[ 2], a03 = mat[3]; + var a10 = mat[ 4], a11 = mat[ 5], a12 = mat[ 6], a13 = mat[7]; + var a20 = mat[ 8], a21 = mat[ 9], a22 = mat[10], a23 = mat[11]; + var a30 = mat[12], a31 = mat[13], a32 = mat[14], a33 = mat[15]; + + // Cache only the current line of the second matrix + var b0 = mat2[0], b1 = mat2[1], b2 = mat2[2], b3 = mat2[3]; + dest[0] = b0*a00 + b1*a10 + b2*a20 + b3*a30; + dest[1] = b0*a01 + b1*a11 + b2*a21 + b3*a31; + dest[2] = b0*a02 + b1*a12 + b2*a22 + b3*a32; + dest[3] = b0*a03 + b1*a13 + b2*a23 + b3*a33; + + b0 = mat2[4]; + b1 = mat2[5]; + b2 = mat2[6]; + b3 = mat2[7]; + dest[4] = b0*a00 + b1*a10 + b2*a20 + b3*a30; + dest[5] = b0*a01 + b1*a11 + b2*a21 + b3*a31; + dest[6] = b0*a02 + b1*a12 + b2*a22 + b3*a32; + dest[7] = b0*a03 + b1*a13 + b2*a23 + b3*a33; + + b0 = mat2[8]; + b1 = mat2[9]; + b2 = mat2[10]; + b3 = mat2[11]; + dest[8] = b0*a00 + b1*a10 + b2*a20 + b3*a30; + dest[9] = b0*a01 + b1*a11 + b2*a21 + b3*a31; + dest[10] = b0*a02 + b1*a12 + b2*a22 + b3*a32; + dest[11] = b0*a03 + b1*a13 + b2*a23 + b3*a33; + + b0 = mat2[12]; + b1 = mat2[13]; + b2 = mat2[14]; + b3 = mat2[15]; + dest[12] = b0*a00 + b1*a10 + b2*a20 + b3*a30; + dest[13] = b0*a01 + b1*a11 + b2*a21 + b3*a31; + dest[14] = b0*a02 + b1*a12 + b2*a22 + b3*a32; + dest[15] = b0*a03 + b1*a13 + b2*a23 + b3*a33; + + return dest; +} + /** * @author Mat Groves http://matgroves.com/ @Doormat23 */ @@ -1583,6 +1816,8 @@ PIXI.InteractionManager.prototype.onMouseMove = function(event) PIXI.InteractionManager.prototype.onMouseDown = function(event) { + event.preventDefault(); + // loop through inteaction tree... // hit test each item! -> // get interactive items under point?? @@ -1619,6 +1854,8 @@ PIXI.InteractionManager.prototype.onMouseDown = function(event) PIXI.InteractionManager.prototype.onMouseUp = function(event) { + + var global = this.mouse.global; @@ -1773,6 +2010,8 @@ PIXI.InteractionManager.prototype.onTouchMove = function(event) PIXI.InteractionManager.prototype.onTouchStart = function(event) { + event.preventDefault(); + var rect = this.target.view.getBoundingClientRect(); var changedTouches = event.changedTouches; @@ -2187,239 +2426,6 @@ PIXI.EventTarget = function () { }; - - -/* - * A lighter version of the rad gl-matrix created by Brandon Jones, Colin MacKenzie IV - * you both rock! - */ - -function determineMatrixArrayType() { - PIXI.Matrix = (typeof Float32Array !== 'undefined') ? Float32Array : Array; - return PIXI.Matrix; -} - -determineMatrixArrayType(); - -PIXI.mat3 = {}; - -PIXI.mat3.create = function() -{ - var matrix = new PIXI.Matrix(9); - - matrix[0] = 1; - matrix[1] = 0; - matrix[2] = 0; - matrix[3] = 0; - matrix[4] = 1; - matrix[5] = 0; - matrix[6] = 0; - matrix[7] = 0; - matrix[8] = 1; - - return matrix; -} - -PIXI.mat4 = {}; - -PIXI.mat4.create = function() -{ - var matrix = new PIXI.Matrix(16); - - matrix[0] = 1; - matrix[1] = 0; - matrix[2] = 0; - matrix[3] = 0; - matrix[4] = 0; - matrix[5] = 1; - matrix[6] = 0; - matrix[7] = 0; - matrix[8] = 0; - matrix[9] = 0; - matrix[10] = 1; - matrix[11] = 0; - matrix[12] = 0; - matrix[13] = 0; - matrix[14] = 0; - matrix[15] = 1; - - return matrix; -} - -PIXI.mat3.multiply = function (mat, mat2, dest) -{ - if (!dest) { dest = mat; } - - // Cache the matrix values (makes for huge speed increases!) - var a00 = mat[0], a01 = mat[1], a02 = mat[2], - a10 = mat[3], a11 = mat[4], a12 = mat[5], - a20 = mat[6], a21 = mat[7], a22 = mat[8], - - b00 = mat2[0], b01 = mat2[1], b02 = mat2[2], - b10 = mat2[3], b11 = mat2[4], b12 = mat2[5], - b20 = mat2[6], b21 = mat2[7], b22 = mat2[8]; - - dest[0] = b00 * a00 + b01 * a10 + b02 * a20; - dest[1] = b00 * a01 + b01 * a11 + b02 * a21; - dest[2] = b00 * a02 + b01 * a12 + b02 * a22; - - dest[3] = b10 * a00 + b11 * a10 + b12 * a20; - dest[4] = b10 * a01 + b11 * a11 + b12 * a21; - dest[5] = b10 * a02 + b11 * a12 + b12 * a22; - - dest[6] = b20 * a00 + b21 * a10 + b22 * a20; - dest[7] = b20 * a01 + b21 * a11 + b22 * a21; - dest[8] = b20 * a02 + b21 * a12 + b22 * a22; - - return dest; -} - - -PIXI.mat3.toMat4 = function (mat, dest) -{ - if (!dest) { dest = PIXI.mat4.create(); } - - dest[15] = 1; - dest[14] = 0; - dest[13] = 0; - dest[12] = 0; - - dest[11] = 0; - dest[10] = mat[8]; - dest[9] = mat[7]; - dest[8] = mat[6]; - - dest[7] = 0; - dest[6] = mat[5]; - dest[5] = mat[4]; - dest[4] = mat[3]; - - dest[3] = 0; - dest[2] = mat[2]; - dest[1] = mat[1]; - dest[0] = mat[0]; - - return dest; -} - - -///// - - -PIXI.mat4.create = function() -{ - var matrix = new PIXI.Matrix(16); - - matrix[0] = 1; - matrix[1] = 0; - matrix[2] = 0; - matrix[3] = 0; - matrix[4] = 0; - matrix[5] = 1; - matrix[6] = 0; - matrix[7] = 0; - matrix[8] = 0; - matrix[9] = 0; - matrix[10] = 1; - matrix[11] = 0; - matrix[12] = 0; - matrix[13] = 0; - matrix[14] = 0; - matrix[15] = 1; - - return matrix; -} - -PIXI.mat4.transpose = function (mat, dest) -{ - // If we are transposing ourselves we can skip a few steps but have to cache some values - if (!dest || mat === dest) - { - var a01 = mat[1], a02 = mat[2], a03 = mat[3], - a12 = mat[6], a13 = mat[7], - a23 = mat[11]; - - mat[1] = mat[4]; - mat[2] = mat[8]; - mat[3] = mat[12]; - mat[4] = a01; - mat[6] = mat[9]; - mat[7] = mat[13]; - mat[8] = a02; - mat[9] = a12; - mat[11] = mat[14]; - mat[12] = a03; - mat[13] = a13; - mat[14] = a23; - return mat; - } - - dest[0] = mat[0]; - dest[1] = mat[4]; - dest[2] = mat[8]; - dest[3] = mat[12]; - dest[4] = mat[1]; - dest[5] = mat[5]; - dest[6] = mat[9]; - dest[7] = mat[13]; - dest[8] = mat[2]; - dest[9] = mat[6]; - dest[10] = mat[10]; - dest[11] = mat[14]; - dest[12] = mat[3]; - dest[13] = mat[7]; - dest[14] = mat[11]; - dest[15] = mat[15]; - return dest; -} - -PIXI.mat4.multiply = function (mat, mat2, dest) -{ - if (!dest) { dest = mat; } - - // Cache the matrix values (makes for huge speed increases!) - var a00 = mat[ 0], a01 = mat[ 1], a02 = mat[ 2], a03 = mat[3]; - var a10 = mat[ 4], a11 = mat[ 5], a12 = mat[ 6], a13 = mat[7]; - var a20 = mat[ 8], a21 = mat[ 9], a22 = mat[10], a23 = mat[11]; - var a30 = mat[12], a31 = mat[13], a32 = mat[14], a33 = mat[15]; - - // Cache only the current line of the second matrix - var b0 = mat2[0], b1 = mat2[1], b2 = mat2[2], b3 = mat2[3]; - dest[0] = b0*a00 + b1*a10 + b2*a20 + b3*a30; - dest[1] = b0*a01 + b1*a11 + b2*a21 + b3*a31; - dest[2] = b0*a02 + b1*a12 + b2*a22 + b3*a32; - dest[3] = b0*a03 + b1*a13 + b2*a23 + b3*a33; - - b0 = mat2[4]; - b1 = mat2[5]; - b2 = mat2[6]; - b3 = mat2[7]; - dest[4] = b0*a00 + b1*a10 + b2*a20 + b3*a30; - dest[5] = b0*a01 + b1*a11 + b2*a21 + b3*a31; - dest[6] = b0*a02 + b1*a12 + b2*a22 + b3*a32; - dest[7] = b0*a03 + b1*a13 + b2*a23 + b3*a33; - - b0 = mat2[8]; - b1 = mat2[9]; - b2 = mat2[10]; - b3 = mat2[11]; - dest[8] = b0*a00 + b1*a10 + b2*a20 + b3*a30; - dest[9] = b0*a01 + b1*a11 + b2*a21 + b3*a31; - dest[10] = b0*a02 + b1*a12 + b2*a22 + b3*a32; - dest[11] = b0*a03 + b1*a13 + b2*a23 + b3*a33; - - b0 = mat2[12]; - b1 = mat2[13]; - b2 = mat2[14]; - b3 = mat2[15]; - dest[12] = b0*a00 + b1*a10 + b2*a20 + b3*a30; - dest[13] = b0*a01 + b1*a11 + b2*a21 + b3*a31; - dest[14] = b0*a02 + b1*a12 + b2*a22 + b3*a32; - dest[15] = b0*a03 + b1*a13 + b2*a23 + b3*a33; - - return dest; -} - /** * @author Mat Groves http://matgroves.com/ @Doormat23 */ @@ -2543,6 +2549,450 @@ PIXI.activatePrimitiveShader = function() } +/** + * @author Mat Groves http://matgroves.com/ @Doormat23 + */ + + +/** + * A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects. + * @class DisplayObjectContainer + * @extends DisplayObject + * @constructor + */ +PIXI.WebGLGraphics = function() +{ + +} + +// constructor +PIXI.WebGLGraphics.constructor = PIXI.WebGLGraphics; + +PIXI.WebGLGraphics.renderGraphics = function(graphics) +{ + PIXI.activatePrimitiveShader(); + var gl = PIXI.gl; + + // graphicsObject + // a collection of "shapes" (mainly lines right now!) + ///this.shape.draw(); + if(!graphics._webGL)graphics._webGL = {points:[], lastPosition:new PIXI.Point(), lastIndex:0, buffer:gl.createBuffer()}; + + if(graphics.dirty) + { + graphics.dirty = false; + + if(graphics.clearDirty) + { + graphics.clearDirty = false; + + graphics._webGL.lastIndex = 0; + graphics._webGL.points = []; + } + + PIXI.WebGLGraphics.initGraphics(graphics); + } + + gl.uniformMatrix4fv(PIXI.shaderProgram2.mvMatrixUniform, false, PIXI.projectionMatrix ); + + gl.bindBuffer(gl.ARRAY_BUFFER, graphics._webGL.buffer); + gl.vertexAttribPointer(PIXI.shaderProgram2.vertexPositionAttribute, 2, gl.FLOAT, false, 4 * 6, 0); + gl.vertexAttribPointer(PIXI.shaderProgram2.colorAttribute, 4, gl.FLOAT, false,4 * 6, 2 * 4); + + //shaderProgram.colorAttribute + + gl.drawArrays(gl.TRIANGLE_STRIP, 0, graphics._webGL.glPoints.length/6); + + PIXI.activateDefaultShader(); +} + +PIXI.WebGLGraphics.initGraphics = function(graphics) +{ + for (var i=graphics._webGL.lastIndex; i < graphics.graphicsData.length; i++) + { + var data = graphics.graphicsData[i]; + + if(data.type == PIXI.Graphics.POLY) + { + if(data.lineWidth > 0) + { + PIXI.WebGLGraphics.buildLine(data, graphics._webGL); + } + } + else if(data.type == PIXI.Graphics.RECT) + { + PIXI.WebGLGraphics.buildRectangle(data, graphics._webGL); + } + else if(data.type == PIXI.Graphics.CIRC) + { + PIXI.WebGLGraphics.buildCircle(data, graphics._webGL); + } + }; + + //console.log(graphics._webGL.lastIndex - graphics.graphicsData.length ) + graphics._webGL.lastIndex = graphics.graphicsData.length; + + // convert to points + graphics._webGL.glPoints = new Float32Array(graphics._webGL.points); + + var gl = PIXI.gl; + gl.bindBuffer(gl.ARRAY_BUFFER, graphics._webGL.buffer); + gl.bufferData(gl.ARRAY_BUFFER, graphics._webGL.glPoints, gl.STATIC_DRAW); +} + + +PIXI.WebGLGraphics.buildRectangle = function(graphicsData, webGLData) +{ + // --- // + // need to convert points to a nice regular data + // + var rectData = graphicsData.points; + var x = rectData[0]; + var y = rectData[1]; + var width = rectData[2]; + var height = rectData[3]; + + + if(graphicsData.fill) + { + var color = HEXtoRGB(graphicsData.fillColor); + var alpha = graphicsData.fillAlpha; + + var r = color[0] * alpha; + var g = color[1] * alpha; + var b = color[2] * alpha; + + var verts = webGLData.points; + + // dead triangle + verts.push(webGLData.lastPosition.x, webGLData.lastPosition.y, 1, 1, 1, 1); + verts.push(x, y, 1, 1, 1, 1); + + // start + verts.push(x, y); + verts.push(r, g, b, alpha); + + verts.push(x + width, y); + verts.push(r, g, b, alpha); + + verts.push(x , y + height); + verts.push(r, g, b, alpha); + + verts.push(x + width, y + height); + verts.push(r, g, b, alpha); + + webGLData.lastPosition.x = x + width; + webGLData.lastPosition.y = y + height; + } + + if(graphicsData.lineWidth) + { + graphicsData.points = [x, y, + x + width, y, + x + width, y + height, + x, y + height, + x, y]; + + PIXI.WebGLGraphics.buildLine(graphicsData, webGLData); + } + +} + +PIXI.WebGLGraphics.buildCircle = function(graphicsData, webGLData) +{ + // --- // + // need to convert points to a nice regular data + // + var rectData = graphicsData.points; + var x = rectData[0]; + var y = rectData[1]; + var radius = rectData[2]; + + var totalSegs = 40 + var seg = (Math.PI * 2) / totalSegs ; + + if(graphicsData.fill) + { + var color = HEXtoRGB(graphicsData.fillColor); + var alpha = graphicsData.fillAlpha; + + var r = color[0] * alpha; + var g = color[1] * alpha; + var b = color[2] * alpha; + + var verts = webGLData.points; + + verts.push(webGLData.lastPosition.x, webGLData.lastPosition.y, 1, 1, 1, 1); + verts.push(x, y, 1, 1, 1, 1); + + for (var i=0; i < totalSegs + 1 ; i++) + { + verts.push(x,y); + verts.push(r, g, b, alpha); + + verts.push(x + Math.sin(seg * i) * radius, + y + Math.cos(seg * i) * radius); + + verts.push(r, g, b, alpha); + }; + + verts.push(x,y); + verts.push(1, 0, 0, 1); + + webGLData.lastPosition.x = x; + webGLData.lastPosition.y = y; + } + + if(graphicsData.lineWidth) + { + graphicsData.points = []; + + for (var i=0; i < totalSegs + 1; i++) + { + graphicsData.points.push(x + Math.sin(seg * i) * radius, + y + Math.cos(seg * i) * radius) + }; + + PIXI.WebGLGraphics.buildLine(graphicsData, webGLData); + } + +} + +PIXI.WebGLGraphics.buildLine = function(graphicsData, webGLData) +{ + var wrap = true; + var points = graphicsData.points; + if(points.length == 0)return; + + // get first and last point.. figure out the middle! + var firstPoint = new PIXI.Point( points[0], points[1] ); + var lastPoint = new PIXI.Point( points[points.length - 2], points[points.length - 1] ); + + // if the first point is the last point - goona have issues :) + if(firstPoint.x == lastPoint.x && firstPoint.y == lastPoint.y) + { + points.pop(); + points.pop(); + + lastPoint = new PIXI.Point( points[points.length - 2], points[points.length - 1] ); + + var midPointX = lastPoint.x + (firstPoint.x - lastPoint.x) *0.5; + var midPointY = lastPoint.y + (firstPoint.y - lastPoint.y) *0.5; + + points.unshift(midPointX, midPointY); + points.push(midPointX, midPointY) + } + + var verts = webGLData.points; + + var length = points.length / 2; + + // DRAW the Line + var width = graphicsData.lineWidth / 2; + + var color = HEXtoRGB(graphicsData.lineColor); + var alpha = graphicsData.lineAlpha; + var r = color[0] * alpha; + var g = color[1] * alpha; + var b = color[2] * alpha; + + // i = 0 // + var point1 = new PIXI.Point( points[0], points[1] ); + var point2 = new PIXI.Point( points[2], points[3] ); + var perp = getPerp(point1, point2); + var dist = Math.sqrt(perp.x*perp.x + perp.y*perp.y); + + perp.x /= dist; + perp.y /= dist; + perp.x *= width; + perp.y *= width; + + // insert dead triangle! + verts.push(webGLData.lastPosition.x, webGLData.lastPosition.y, 1, 1, 1, 1); + verts.push(points[0] - perp.x , points[1] - perp.y, 1, 1, 1, 1); + + + // start + verts.push(points[0] - perp.x , points[1] - perp.y); + verts.push(r, g, b, alpha); + + verts.push(points[0] + perp.x , points[1] + perp.y); + verts.push(r, g, b, alpha); + + for (var i = 1; i < length-1; i++) + { + var point1 = new PIXI.Point( points[(i-1)*2],points[(i-1)*2 + 1] ); + var point2 = new PIXI.Point(points[(i)*2],points[(i)*2 + 1] ); + var point3 = new PIXI.Point(points[(i+1)*2],points[(i+1)*2 + 1] ); + + var perp = getPerp(point1, point2); + var dist = Math.sqrt(perp.x*perp.x + perp.y*perp.y); + perp.x /= dist; + perp.y /= dist; + perp.x *= width; + perp.y *= width; + + var perp2 = getPerp(point2, point3); + var dist2 = Math.sqrt(perp2.x*perp2.x + perp2.y*perp2.y); + perp2.x /= dist2; + perp2.y /= dist2; + perp2.x *= width; + perp2.y *= width; + + var p1 = new PIXI.Point(-perp.x+ point2.x , -perp.y+point2.y); + var p1_ = new PIXI.Point(-perp.x+ point1.x, -perp.y+point1.y); + + var p2 = new PIXI.Point(-perp2.x+ point2.x , -perp2.y+point2.y ); + var p2_ = new PIXI.Point(-perp2.x+ point3.x , -perp2.y+point3.y ); + + var p = lineIntersectLine(p1, p1_, p2, p2_); + + var pdist = (p.x -point2.x) * (p.x -point2.x) + (p.y -point2.y) + (p.y -point2.y); + + if(pdist > 140 * 140) + { + var perp3 = new PIXI.Point(perp.x - perp2.x, perp.y - perp2.y); + var dist3 = Math.sqrt(perp3.x*perp3.x + perp3.y*perp3.y); + perp3.x /= dist3; + perp3.y /= dist3; + perp3.x *= width; + perp3.y *= width; + + verts.push(point2.x - perp3.x, point2.y -perp3.y); + verts.push(r, g, b, alpha); + + verts.push(point2.x + perp3.x, point2.y +perp3.y); + verts.push(r, g, b, alpha); + + verts.push(point2.x - perp3.x, point2.y -perp3.y); + verts.push(r, g, b, alpha); + } + else + { + verts.push(p.x , p.y); + verts.push(r, g, b, alpha); + + verts.push(point2.x - (p.x-point2.x), point2.y - (p.y - point2.y));//, 4); + verts.push(r, g, b, alpha); + } + } + + var point1 = new PIXI.Point( points[(length-2)*2], points[(length-2)*2 + 1] ); + var point2 = new PIXI.Point( points[(length-1)*2], points[(length-1)*2 + 1] ); + + var perp = getPerp(point1, point2); + var dist = Math.sqrt(perp.x*perp.x + perp.y*perp.y); + perp.x /= dist; + perp.y /= dist; + perp.x *= width; + perp.y *= width; + verts.push(point2.x - perp.x , point2.y - perp.y) + verts.push(r, g, b, alpha); + + verts.push(point2.x + perp.x , point2.y + perp.y) + verts.push(r, g, b, alpha); + + // set last triangle! + webGLData.lastPosition.x = point2.x + perp.x; + webGLData.lastPosition.y = point2.y + perp.y; + +} + +function HEXtoRGB(hex) { + return [(hex >> 16 & 0xFF) / 255, ( hex >> 8 & 0xFF) / 255, (hex & 0xFF)/ 255]; +} + + +function normalise(point) +{ + var dist = Math.sqrt(point.x * point.x + point.y * point.y); + return new PIXI.Point(point.x / dist, point.y / dist); +} + +function getPerp(point, point2) +{ + return new PIXI.Point(-(point.y - point2.y), point.x - point2.x); +} + +function lineIntersectLine(A,B,E,F) +{ + var ip; + var a1; + var a2; + var b1; + var b2; + var c1; + var c2; + + a1= B.y-A.y; + b1= A.x-B.x; + c1= B.x*A.y - A.x*B.y; + a2= F.y-E.y; + b2= E.x-F.x; + c2= F.x*E.y - E.x*F.y; + + var denom=a1*b2 - a2*b1; + + if (denom == 0) { + // return null; + console.log("!") + denom+=1; + } + ip=new PIXI.Point(); + ip.x=(b1*c2 - b2*c1)/denom; + ip.y=(a2*c1 - a1*c2)/denom; + + return ip; +} + + + +PIXI.primitiveShaderFragmentSrc = [ + "precision mediump float;", + "varying vec4 vColor;", + "void main(void) {", + "gl_FragColor = vColor;", + "}" +]; + +PIXI.primitiveShaderVertexSrc = [ + "attribute vec2 aVertexPosition;", + "attribute vec4 aColor;", + "uniform mat4 uMVMatrix;", + "varying vec4 vColor;", + "void main(void) {", + "gl_Position = uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);", + "vColor = aColor;", + "}" +]; + + +PIXI.WebGLGraphics.initShaders = function() +{ + var gl = PIXI.gl; + var fragmentShader = PIXI.CompileFragmentShader(gl, PIXI.primitiveShaderFragmentSrc); + var vertexShader = PIXI.CompileVertexShader(gl, PIXI.primitiveShaderVertexSrc); + + PIXI.shaderProgram2 = gl.createProgram(); + + var shaderProgram = PIXI.shaderProgram2; + + gl.attachShader(shaderProgram, vertexShader); + gl.attachShader(shaderProgram, fragmentShader); + gl.linkProgram(shaderProgram); + + if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) { + alert("Could not initialise shaders"); + } + + gl.useProgram(shaderProgram); + + shaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, "aVertexPosition"); + shaderProgram.colorAttribute = gl.getAttribLocation(shaderProgram, "aColor"); + + shaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, "uMVMatrix"); +} + /** * @author Mat Groves http://matgroves.com/ @Doormat23 */ @@ -2579,7 +3029,7 @@ PIXI.WebGLRenderer = function(width, height, view, transparent) this.view = view || document.createElement( 'canvas' ); this.view.width = this.width; - this.view.height = this.height; + this.view.height = this.height; // deal with losing context.. var scope = this; @@ -3664,7 +4114,10 @@ PIXI.WebGLRenderGroup.prototype.renderSpecific = function(displayObject, project { if(startBatch.visible) startBatch.renderWebGL(this, projectionMatrix); } - + else if(renderable instanceof PIXI.Graphics) + { + if(renderable.visible) PIXI.WebGLGraphics.renderGraphics(renderable);//, projectionMatrix); + } return; } @@ -3689,7 +4142,10 @@ PIXI.WebGLRenderGroup.prototype.renderSpecific = function(displayObject, project { if(startBatch.visible) startBatch.renderWebGL(this, projectionMatrix); } - + else if(renderable instanceof PIXI.Graphics) + { + if(renderable.visible) PIXI.WebGLGraphics.renderGraphics(renderable);//, projectionMatrix); + } // DO the middle batchs.. for (var i=startBatchIndex+1; i < endBatchIndex; i++) { @@ -3711,7 +4167,10 @@ PIXI.WebGLRenderGroup.prototype.renderSpecific = function(displayObject, project { if(renderable.visible) renderable.renderWebGL(this, projectionMatrix); } - + else if(renderable instanceof PIXI.Graphics) + { + if(renderable.visible) PIXI.WebGLGraphics.renderGraphics(renderable);//, projectionMatrix); + } } // DO the last batch.. @@ -3731,6 +4190,10 @@ PIXI.WebGLRenderGroup.prototype.renderSpecific = function(displayObject, project { if(endBatch.visible) endBatch.renderWebGL(this, projectionMatrix); } + else if(renderable instanceof PIXI.Graphics) + { + if(renderable.visible) PIXI.WebGLGraphics.renderGraphics(renderable);//, projectionMatrix); + } } PIXI.WebGLRenderGroup.prototype.checkVisibility = function(displayObject, globalVisible) @@ -4591,7 +5054,7 @@ PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject) } else if(displayObject instanceof PIXI.Graphics) { - displayObject.render(this); + PIXI.CanvasGraphics.renderGraphics(displayObject, context); } // render! @@ -4739,6 +5202,209 @@ PIXI.CanvasRenderer.prototype.renderStrip = function(strip) +/** + * @author Mat Groves http://matgroves.com/ @Doormat23 + */ + + +/** + * A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects. + * @class DisplayObjectContainer + * @extends DisplayObject + * @constructor + */ +PIXI.CanvasGraphics = function() +{ + +} + +// constructor + +PIXI.CanvasGraphics.renderGraphics = function(graphics, context) +{ + + for (var i=0; i < graphics.graphicsData.length; i++) + { + var data = graphics.graphicsData[i]; + var points = data.points; + + context.strokeStyle = color = '#' + ('00000' + ( data.lineColor | 0).toString(16)).substr(-6); + + context.lineWidth = data.lineWidth; + context.globalAlpha = data.lineAlpha; + + if(data.type == PIXI.Graphics.POLY) + { + if(data.lineWidth <= 0)continue; + + context.beginPath(); + + context.moveTo(points[0], points[1]); + + for (var j=1; j < points.length/2; j++) + { + context.lineTo(points[j * 2], points[j * 2 + 1]); + } + + // if the first and last point are the same close the path - much neater :) + if(points[0] == points[points.length-2] && points[1] == points[points.length-1]) + { + context.closePath(); + } + + context.stroke(); + } + else if(data.type == PIXI.Graphics.RECT) + { + // TODO - need to be Undefined! + if(data.fillColor) + { + context.fillStyle = color = '#' + ('00000' + ( data.fillColor | 0).toString(16)).substr(-6); + + context.fillRect(points[0], points[1], points[2], points[3]); + + } + if(data.lineWidth) + { + context.strokeRect(points[0], points[1], points[2], points[3]); + } + } + else if(data.type == PIXI.Graphics.CIRC) + { + // TODO - need to be Undefined! + context.beginPath(); + context.arc(points[0], points[1], points[2],0,2*Math.PI); + context.closePath(); + + if(data.fill) + { + context.fillStyle = color = '#' + ('00000' + ( data.fillColor | 0).toString(16)).substr(-6); + context.fill(); + } + if(data.lineWidth) + { + context.stroke(); + } + } + + + }; +} + +/** + * @author Mat Groves http://matgroves.com/ @Doormat23 + */ + + +/** + * A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects. + * @class DisplayObjectContainer + * @extends DisplayObject + * @constructor + */ +PIXI.Graphics = function() +{ + PIXI.DisplayObjectContainer.call( this ); + + this.renderable = true; + + // style - color + // style - thickness + // alpha - + this.fillAlpha = 1; + + this.lineWidth = 2; + this.lineColor = "#FF0000"; + + this.graphicsData = []; + +} + +// SOME TYPES: +PIXI.Graphics.POLY = 0; +PIXI.Graphics.RECT = 1; +PIXI.Graphics.CIRC = 2; + +// constructor +PIXI.Graphics.constructor = PIXI.Graphics; +PIXI.Graphics.prototype = Object.create( PIXI.DisplayObjectContainer.prototype ); + +PIXI.Graphics.prototype.lineStyle = function(lineWidth, color, alpha) +{ + + this.lineWidth = lineWidth || 0; + this.lineColor = color || 0; + this.lineAlpha = (alpha == undefined) ? 1 : alpha; + + this.currentPath = {lineWidth:this.lineWidth, lineColor:this.lineColor, lineAlpha:this.lineAlpha, points:[], type:PIXI.Graphics.POLY}; + this.graphicsData.push(this.currentPath); + + // TODO store the last position of the line in the current +} + + +PIXI.Graphics.prototype.moveTo = function(x, y) +{ + this.currentPath = {lineWidth:this.lineWidth, lineColor:this.lineColor, lineAlpha:this.lineAlpha, points:[], type:PIXI.Graphics.POLY}; + + this.currentPath.points.push(x, y); + + this.graphicsData.push(this.currentPath); +} + +PIXI.Graphics.prototype.lineTo = function(x, y) +{ + this.currentPath.points.push(x, y); + this.dirty = true; +} + +PIXI.Graphics.prototype.beginFill = function(color, alpha) +{ + this.filling = true; + this.fillColor = color || 0; + this.fillAlpha = alpha || 1; +} + +PIXI.Graphics.prototype.endFill = function() +{ + this.filling = false; + this.fillColor = null; + this.fillAlpha = 1; +} + +PIXI.Graphics.prototype.updateTransform = function() +{ + if(!this.visible)return; + PIXI.DisplayObject.prototype.updateTransform.call( this ); +} + +PIXI.Graphics.prototype.drawRect = function( x, y, width, height ) +{ + this.currentPath = {lineWidth:this.lineWidth, lineColor:this.lineColor, lineAlpha:this.lineAlpha, + fillColor:this.fillColor, fillAlpha:this.fillAlpha, fill:this.filling, + points:[x, y, width, height], type:PIXI.Graphics.RECT}; + + this.graphicsData.push(this.currentPath); + this.dirty = true; +} + +PIXI.Graphics.prototype.drawCircle = function( x, y, radius) +{ + this.currentPath = {lineWidth:this.lineWidth, lineColor:this.lineColor, lineAlpha:this.lineAlpha, + fillColor:this.fillColor, fillAlpha:this.fillAlpha, fill:this.filling, + points:[x, y, radius], type:PIXI.Graphics.CIRC}; + + this.graphicsData.push(this.currentPath); + this.dirty = true; +} + +PIXI.Graphics.prototype.clear = function() +{ + this.dirty = true; + this.clearDirty = true; + this.graphicsData = []; +} + /** * @author Mat Groves http://matgroves.com/ */ @@ -5079,7 +5745,7 @@ PIXI.TilingSprite.prototype.onTextureUpdate = function(event) * See example 12 (http://www.goodboydigital.com/pixijs/examples/12/) to see a working example and check out the source * @class Spine * @constructor - * @extends + * @extends DisplayObjectContainer * @param {String} url the url of the spine anim file to be used */ PIXI.Spine = function(url) diff --git a/bin/pixi.js b/bin/pixi.js index 913b16e..e0f06cb 100644 --- a/bin/pixi.js +++ b/bin/pixi.js @@ -4,11 +4,11 @@ * Copyright (c) 2012, Mat Groves * http://goodboydigital.com/ * - * Compiled: 2013-06-19 + * Compiled: 2013-06-20 * * Pixi.JS is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license.php */ -(function(){function t(t){return[(255&t>>16)/255,(255&t>>8)/255,(255&t)/255]}function e(){return n.Matrix="undefined"!=typeof Float32Array?Float32Array:Array,n.Matrix}var i=this,n=n||{};n.Point=function(t,e){this.x=t||0,this.y=e||0},n.Point.prototype.clone=function(){return new n.Point(this.x,this.y)},n.Point.constructor=n.Point,n.Rectangle=function(t,e,i,r){this.x=t||0,this.y=e||0,this.width=i||0,this.height=r||0},n.Rectangle.prototype.clone=function(){return new n.Rectangle(this.x,this.y,this.width,this.height)},n.Rectangle.constructor=n.Rectangle,n.Polygon=function(t){this.points=t},n.Polygon.clone=function(){for(var t=[],e=0;this.points.length>e;e++)t.push(this.points[e].clone());return new n.Polygon(t)},n.Polygon.constructor=n.Polygon,n.DisplayObject=function(){this.position=new n.Point,this.scale=new n.Point(1,1),this.pivot=new n.Point(0,0),this.rotation=0,this.alpha=1,this.visible=!0,this.worldVisible=!1,this.parent=null,this.stage=null,this.hitArea=null,this.worldAlpha=1,this.color=[],this.worldTransform=n.mat3.create(),this.localTransform=n.mat3.create(),this.dynamic=!0,this._sr=0,this._cr=1,this.childIndex=0,this.renderable=!1,this.interactive=!1,this.buttonMode=!1},n.DisplayObject.constructor=n.DisplayObject,n.DisplayObject.prototype.setInteractive=function(t){this.interactive=t,this.stage&&(this.stage.dirty=!0)},n.DisplayObject.prototype.updateTransform=function(){this.rotation!=this.rotationCache&&(this.rotationCache=this.rotation,this._sr=Math.sin(this.rotation),this._cr=Math.cos(this.rotation));var t=this.localTransform,e=this.parent.worldTransform,i=this.worldTransform;t[0]=this._cr*this.scale.x,t[1]=-this._sr*this.scale.y,t[3]=this._sr*this.scale.x,t[4]=this._cr*this.scale.y;var r=this.pivot.x,n=this.pivot.y;t[2]=this.position.x-t[0]*r-n*t[1],t[5]=this.position.y-t[4]*n-r*t[3];var s=t[0],a=t[1],o=t[2],h=t[3],l=t[4],u=t[5],c=e[0],d=e[1],p=e[2],f=e[3],m=e[4],v=e[5];i[0]=c*s+d*h,i[1]=c*a+d*l,i[2]=c*o+d*u+p,i[3]=f*s+m*h,i[4]=f*a+m*l,i[5]=f*o+m*u+v,this.worldAlpha=this.alpha*this.parent.worldAlpha},n.DisplayObjectContainer=function(){n.DisplayObject.call(this),this.children=[],this.renderable=!1},n.DisplayObjectContainer.constructor=n.DisplayObjectContainer,n.DisplayObjectContainer.prototype=Object.create(n.DisplayObject.prototype),n.DisplayObjectContainer.prototype.addChild=function(t){void 0!=t.parent&&t.parent.removeChild(t),t.parent=this,t.childIndex=this.children.length,this.children.push(t),this.stage&&this.stage.__addChild(t),this.__renderGroup&&(t.__renderGroup&&t.__renderGroup.removeDisplayObjectAndChildren(t),this.__renderGroup.addDisplayObjectAndChildren(t))},n.DisplayObjectContainer.prototype.addChildAt=function(t,e){if(!(e>=0&&this.children.length>=e))throw Error(t+" The index "+e+" supplied is out of bounds "+this.children.length);void 0!=t.parent&&t.parent.removeChild(t),e==this.children.length?this.children.push(t):this.children.splice(e,0,t),t.parent=this,t.childIndex=e;for(var i=this.children.length,r=e;i>r;r++)this.children[r].childIndex=r;this.stage&&this.stage.__addChild(t),this.__renderGroup&&(t.__renderGroup&&t.__renderGroup.removeDisplayObjectAndChildren(t),this.__renderGroup.addDisplayObjectAndChildren(t))},n.DisplayObjectContainer.prototype.swapChildren=function(t,e){var i=this.children.indexOf(t),r=this.children.indexOf(e);if(-1===i||-1===r)throw Error(t+" Both the supplied DisplayObjects must be a child of the caller "+this);this.stage&&(this.stage.__removeChild(t),this.stage.__removeChild(e),this.stage.__addChild(t),this.stage.__addChild(e)),t.childIndex=r,e.childIndex=i,this.children[i]=e,this.children[r]=t},n.DisplayObjectContainer.prototype.getChildAt=function(t){if(t>=0&&this.children.length>t)return this.children[t];throw Error(child+" Both the supplied DisplayObjects must be a child of the caller "+this)},n.DisplayObjectContainer.prototype.removeChild=function(t){var e=this.children.indexOf(t);if(-1===e)throw Error(t+" The supplied DisplayObject must be a child of the caller "+this);this.stage&&this.stage.__removeChild(t),t.__renderGroup&&t.__renderGroup.removeDisplayObjectAndChildren(t),t.parent=void 0,this.children.splice(e,1);for(var i=e,r=this.children.length;r>i;i++)this.children[i].childIndex-=1},n.DisplayObjectContainer.prototype.updateTransform=function(){if(this.visible){n.DisplayObject.prototype.updateTransform.call(this);for(var t=0,e=this.children.length;e>t;t++)this.children[t].updateTransform()}},n.blendModes={},n.blendModes.NORMAL=0,n.blendModes.SCREEN=1,n.Sprite=function(t){n.DisplayObjectContainer.call(this),this.anchor=new n.Point,this.texture=t,this.blendMode=n.blendModes.NORMAL,this._width=0,this._height=0,t.baseTexture.hasLoaded?this.updateFrame=!0:(this.onTextureUpdateBind=this.onTextureUpdate.bind(this),this.texture.addEventListener("update",this.onTextureUpdateBind)),this.renderable=!0},n.Sprite.constructor=n.Sprite,n.Sprite.prototype=Object.create(n.DisplayObjectContainer.prototype),Object.defineProperty(n.Sprite.prototype,"width",{get:function(){return this.scale.x*this.texture.frame.width},set:function(t){this.scale.x=t/this.texture.frame.width,this._width=t}}),Object.defineProperty(n.Sprite.prototype,"height",{get:function(){return this.scale.y*this.texture.frame.height},set:function(t){this.scale.y=t/this.texture.frame.height,this._height=t}}),n.Sprite.prototype.setTexture=function(t){this.texture.baseTexture!=t.baseTexture&&(this.textureChange=!0),this.texture=t,this.updateFrame=!0},n.Sprite.prototype.onTextureUpdate=function(){this._width&&(this.scale.x=this._width/this.texture.frame.width),this._height&&(this.scale.y=this._height/this.texture.frame.height),this.updateFrame=!0},n.Sprite.fromFrame=function(t){var e=n.TextureCache[t];if(!e)throw Error("The frameId '"+t+"' does not exist in the texture cache"+this);return new n.Sprite(e)},n.Sprite.fromImage=function(t){var e=n.Texture.fromImage(t);return new n.Sprite(e)},n.MovieClip=function(t){n.Sprite.call(this,t[0]),this.textures=t,this.currentFrame=0,this.animationSpeed=1,this.loop=!0,this.onComplete=null,this.playing},n.MovieClip.constructor=n.MovieClip,n.MovieClip.prototype=Object.create(n.Sprite.prototype),n.MovieClip.prototype.stop=function(){this.playing=!1},n.MovieClip.prototype.play=function(){this.playing=!0},n.MovieClip.prototype.gotoAndStop=function(t){this.playing=!1,this.currentFrame=t;var e=0|this.currentFrame+.5;this.setTexture(this.textures[e%this.textures.length])},n.MovieClip.prototype.gotoAndPlay=function(t){this.currentFrame=t,this.playing=!0},n.MovieClip.prototype.updateTransform=function(){if(n.Sprite.prototype.updateTransform.call(this),this.playing){this.currentFrame+=this.animationSpeed;var t=0|this.currentFrame+.5;this.loop||this.textures.length>t?this.setTexture(this.textures[t%this.textures.length]):t>=this.textures.length&&(this.gotoAndStop(this.textures.length-1),this.onComplete&&this.onComplete())}},n.Text=function(t,e){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"),n.Sprite.call(this,n.Texture.fromCanvas(this.canvas)),this.setText(t),this.setStyle(e),this.updateText(),this.dirty=!1},n.Text.constructor=n.Text,n.Text.prototype=Object.create(n.Sprite.prototype),n.Text.prototype.setStyle=function(t){t=t||{},t.font=t.font||"bold 20pt Arial",t.fill=t.fill||"black",t.align=t.align||"left",t.stroke=t.stroke||"black",t.strokeThickness=t.strokeThickness||0,t.wordWrap=t.wordWrap||!1,t.wordWrapWidth=t.wordWrapWidth||100,this.style=t,this.dirty=!0},n.Sprite.prototype.setText=function(t){this.text=""+t||" ",this.dirty=!0},n.Text.prototype.updateText=function(){this.context.font=this.style.font;var t=this.text;this.style.wordWrap&&(t=this.wordWrap(this.text));for(var e=t.split(/(?:\r\n|\r|\n)/),i=[],r=0,s=0;e.length>s;s++){var a=this.context.measureText(e[s]).width;i[s]=a,r=Math.max(r,a)}this.canvas.width=r+this.style.strokeThickness;var o=this.determineFontHeight("font: "+this.style.font+";")+this.style.strokeThickness;for(this.canvas.height=o*e.length,this.context.fillStyle=this.style.fill,this.context.font=this.style.font,this.context.strokeStyle=this.style.stroke,this.context.lineWidth=this.style.strokeThickness,this.context.textBaseline="top",s=0;e.length>s;s++){var h=new n.Point(this.style.strokeThickness/2,this.style.strokeThickness/2+s*o);"right"==this.style.align?h.x+=r-i[s]:"center"==this.style.align&&(h.x+=(r-i[s])/2),this.style.stroke&&this.style.strokeThickness&&this.context.strokeText(e[s],h.x,h.y),this.style.fill&&this.context.fillText(e[s],h.x,h.y)}this.updateTexture()},n.Text.prototype.updateTexture=function(){this.texture.baseTexture.width=this.canvas.width,this.texture.baseTexture.height=this.canvas.height,this.texture.frame.width=this.canvas.width,this.texture.frame.height=this.canvas.height,this._width=this.canvas.width,this._height=this.canvas.height,n.texturesToUpdate.push(this.texture.baseTexture)},n.Text.prototype.updateTransform=function(){this.dirty&&(this.updateText(),this.dirty=!1),n.Sprite.prototype.updateTransform.call(this)},n.Text.prototype.determineFontHeight=function(t){var e=n.Text.heightCache[t];if(!e){var i=document.getElementsByTagName("body")[0],r=document.createElement("div"),s=document.createTextNode("M");r.appendChild(s),r.setAttribute("style",t+";position:absolute;top:0;left:0"),i.appendChild(r),e=r.offsetHeight,n.Text.heightCache[t]=e,i.removeChild(r)}return e},n.Text.prototype.wordWrap=function(t){for(var e=function(t,e,i,r,n){var s=Math.floor((r-i)/2)+i;return s==i?1:n>=t.measureText(e.substring(0,s)).width?t.measureText(e.substring(0,s+1)).width>n?s:arguments.callee(t,e,s,r,n):arguments.callee(t,e,i,s,n)},i=function(t,i,r){if(r>=t.measureText(i).width||1>i.length)return i;var n=e(t,i,0,i.length,r);return i.substring(0,n)+"\n"+arguments.callee(t,i.substring(n),r)},r="",n=t.split("\n"),s=0;n.length>s;s++)r+=i(this.context,n[s],this.style.wordWrapWidth)+"\n";return r},n.Text.prototype.destroy=function(t){t&&this.texture.destroy()},n.Text.heightCache={},n.BitmapText=function(t,e){n.DisplayObjectContainer.call(this),this.setText(t),this.setStyle(e),this.updateText(),this.dirty=!1},n.BitmapText.constructor=n.BitmapText,n.BitmapText.prototype=Object.create(n.DisplayObjectContainer.prototype),n.BitmapText.prototype.setText=function(t){this.text=t||" ",this.dirty=!0},n.BitmapText.prototype.setStyle=function(t){t=t||{},t.align=t.align||"left",this.style=t;var e=t.font.split(" ");this.fontName=e[e.length-1],this.fontSize=e.length>=2?parseInt(e[e.length-2],10):n.BitmapText.fonts[this.fontName].size,this.dirty=!0},n.BitmapText.prototype.updateText=function(){for(var t=n.BitmapText.fonts[this.fontName],e=new n.Point,i=null,r=[],s=0,a=[],o=0,h=this.fontSize/t.size,l=0;this.text.length>l;l++){var u=this.text.charCodeAt(l);if(/(?:\r\n|\r|\n)/.test(this.text.charAt(l)))a.push(e.x),s=Math.max(s,e.x),o++,e.x=0,e.y+=t.lineHeight,i=null;else{var c=t.chars[u];c&&(i&&c[i]&&(e.x+=c.kerning[i]),r.push({texture:c.texture,line:o,charCode:u,position:new n.Point(e.x+c.xOffset,e.y+c.yOffset)}),e.x+=c.xAdvance,i=u)}}a.push(e.x),s=Math.max(s,e.x);var d=[];for(l=0;o>=l;l++){var p=0;"right"==this.style.align?p=s-a[l]:"center"==this.style.align&&(p=(s-a[l])/2),d.push(p)}for(l=0;r.length>l;l++){var f=new n.Sprite(r[l].texture);f.position.x=(r[l].position.x+d[r[l].line])*h,f.position.y=r[l].position.y*h,f.scale.x=f.scale.y=h,this.addChild(f)}this.width=e.x*h,this.height=(e.y+t.lineHeight)*h},n.BitmapText.prototype.updateTransform=function(){if(this.dirty){for(;this.children.length>0;)this.removeChild(this.getChildAt(0));this.updateText(),this.dirty=!1}n.DisplayObjectContainer.prototype.updateTransform.call(this)},n.BitmapText.fonts={},n.InteractionManager=function(t){this.stage=t,this.tempPoint=new n.Point,this.mouseoverEnabled=!0,this.mouse=new n.InteractionData,this.touchs={},this.pool=[],this.interactiveItems=[],this.last=0},n.InteractionManager.constructor=n.InteractionManager,n.InteractionManager.prototype.collectInteractiveSprite=function(t,e){for(var i=t.children,r=i.length,n=r-1;n>=0;n--){var s=i[n];s.visible&&(s.interactive?(e.interactiveChildren=!0,this.interactiveItems.push(s),s.children.length>0&&this.collectInteractiveSprite(s,s)):(s.__iParent=null,s.children.length>0&&this.collectInteractiveSprite(s,e)))}},n.InteractionManager.prototype.setTarget=function(t){window.navigator.msPointerEnabled&&(t.view.style["-ms-content-zooming"]="none",t.view.style["-ms-touch-action"]="none"),this.target=t,t.view.addEventListener("mousemove",this.onMouseMove.bind(this),!0),t.view.addEventListener("mousedown",this.onMouseDown.bind(this),!0),document.body.addEventListener("mouseup",this.onMouseUp.bind(this),!0),t.view.addEventListener("mouseout",this.onMouseUp.bind(this),!0),t.view.addEventListener("touchstart",this.onTouchStart.bind(this),!0),t.view.addEventListener("touchend",this.onTouchEnd.bind(this),!0),t.view.addEventListener("touchmove",this.onTouchMove.bind(this),!0)},n.InteractionManager.prototype.update=function(){if(this.target){var t=Date.now(),e=t-this.last;if(e=30*e/1e3,!(1>e)){if(this.last=t,this.dirty){this.dirty=!1,this.interactiveItems.length;for(var i=0;this.interactiveItems.length>i;i++)this.interactiveItems[i].interactiveChildren=!1;this.interactiveItems=[],this.stage.interactive&&this.interactiveItems.push(this.stage),this.collectInteractiveSprite(this.stage,this.stage)}var r=this.interactiveItems.length;this.target.view.style.cursor="default";for(var i=0;r>i;i++){var n=this.interactiveItems[i];n.visible&&(n.mouseover||n.mouseout||n.buttonMode)&&(n.__hit=this.hitTest(n,this.mouse),n.__hit?(n.buttonMode&&(this.target.view.style.cursor="pointer"),n.__isOver||(n.mouseover&&n.mouseover(this.mouse),n.__isOver=!0)):n.__isOver&&(n.mouseout&&n.mouseout(this.mouse),n.__isOver=!1))}}}},n.InteractionManager.prototype.onMouseMove=function(t){var e=this.target.view.getBoundingClientRect();this.mouse.global.x=(t.clientX-e.left)*(this.target.width/e.width),this.mouse.global.y=(t.clientY-e.top)*(this.target.height/e.height);var i=this.interactiveItems.length;this.mouse.global;for(var r=0;i>r;r++){var n=this.interactiveItems[r];n.mousemove&&n.mousemove(this.mouse)}},n.InteractionManager.prototype.onMouseDown=function(){var t=this.interactiveItems.length;this.mouse.global,this.stage;for(var e=0;t>e;e++){var i=this.interactiveItems[e];if((i.mousedown||i.click)&&(i.__mouseIsDown=!0,i.__hit=this.hitTest(i,this.mouse),i.__hit&&(i.mousedown&&i.mousedown(this.mouse),i.__isDown=!0,!i.interactiveChildren)))break}},n.InteractionManager.prototype.onMouseUp=function(){this.mouse.global;for(var t=this.interactiveItems.length,e=!1,i=0;t>i;i++){var r=this.interactiveItems[i];(r.mouseup||r.mouseupoutside||r.click)&&(r.__hit=this.hitTest(r,this.mouse),r.__hit&&!e?(r.mouseup&&r.mouseup(this.mouse),r.__isDown&&r.click&&r.click(this.mouse),r.interactiveChildren||(e=!0)):r.__isDown&&r.mouseupoutside&&r.mouseupoutside(this.mouse),r.__isDown=!1)}},n.InteractionManager.prototype.hitTest=function(t,e){var i=e.global;if(!t.visible)return!1;var r=t instanceof n.Sprite,s=t.worldTransform,a=s[0],o=s[1],h=s[2],l=s[3],u=s[4],c=s[5],d=1/(a*u+o*-l),p=u*d*i.x+-o*d*i.y+(c*o-h*u)*d,f=a*d*i.y+-l*d*i.x+(-c*a+h*l)*d;if(t.hitArea){var m=t.hitArea;if(t.hitArea instanceof n.Polygon){for(var v=!1,g=0,x=t.hitArea.points.length-1;t.hitArea.points.length>g;x=g++){var b=t.hitArea.points[g].x,T=t.hitArea.points[g].y,y=t.hitArea.points[x].x,w=t.hitArea.points[x].y,_=T>f!=w>f&&(y-b)*(f-T)/(w-T)+b>p;_&&(v=!v)}if(v)return r&&(e.target=t),!0}else{var R=m.x;if(p>R&&R+m.width>p){var A=m.y;if(f>A&&A+m.height>f)return r&&(e.target=t),!0}}}else if(r){var A,S=t.texture.frame.width,L=t.texture.frame.height,R=-S*t.anchor.x;if(p>R&&R+S>p&&(A=-L*t.anchor.y,f>A&&A+L>f))return e.target=t,!0}for(var C=t.children.length,g=0;C>g;g++){var E=t.children[g],B=this.hitTest(E,e);if(B)return!0}return!1},n.InteractionManager.prototype.onTouchMove=function(t){for(var e=this.target.view.getBoundingClientRect(),i=t.changedTouches,r=0;i.length>r;r++){var n=i[r],s=this.touchs[n.identifier];s.global.x=(n.clientX-e.left)*(this.target.width/e.width),s.global.y=(n.clientY-e.top)*(this.target.height/e.height)}for(var a=this.interactiveItems.length,r=0;a>r;r++){var o=this.interactiveItems[r];o.touchmove&&o.touchmove(s)}},n.InteractionManager.prototype.onTouchStart=function(t){for(var e=this.target.view.getBoundingClientRect(),i=t.changedTouches,r=0;i.length>r;r++){var s=i[r],a=this.pool.pop();a||(a=new n.InteractionData),this.touchs[s.identifier]=a,a.global.x=(s.clientX-e.left)*(this.target.width/e.width),a.global.y=(s.clientY-e.top)*(this.target.height/e.height);for(var o=this.interactiveItems.length,h=0;o>h;h++){var l=this.interactiveItems[h];if((l.touchstart||l.tap)&&(l.__hit=this.hitTest(l,a),l.__hit&&(l.touchstart&&l.touchstart(a),l.__isDown=!0,l.__touchData=a,!l.interactiveChildren)))break}}},n.InteractionManager.prototype.onTouchEnd=function(t){for(var e=this.target.view.getBoundingClientRect(),i=t.changedTouches,r=0;i.length>r;r++){var n=i[r],s=this.touchs[n.identifier],a=!1;s.global.x=(n.clientX-e.left)*(this.target.width/e.width),s.global.y=(n.clientY-e.top)*(this.target.height/e.height);for(var o=this.interactiveItems.length,h=0;o>h;h++){var l=this.interactiveItems[h],u=l.__touchData;l.__hit=this.hitTest(l,s),u==s&&((l.touchend||l.tap)&&(l.__hit&&!a?(l.touchend&&l.touchend(s),l.__isDown&&l.tap&&l.tap(s),l.interactiveChildren||(a=!0)):l.__isDown&&l.touchendoutside&&l.touchendoutside(s),l.__isDown=!1),l.__touchData=null)}this.pool.push(s),this.touchs[n.identifier]=null}},n.InteractionData=function(){this.global=new n.Point,this.local=new n.Point,this.target},n.InteractionData.prototype.getLocalPosition=function(t){var e=t.worldTransform,i=this.global,r=e[0],s=e[1],a=e[2],o=e[3],h=e[4],l=e[5],u=1/(r*h+s*-o);return new n.Point(h*u*i.x+-s*u*i.y+(l*s-a*h)*u,r*u*i.y+-o*u*i.x+(-l*r+a*o)*u)},n.InteractionData.constructor=n.InteractionData,n.Stage=function(t,e){n.DisplayObjectContainer.call(this),this.worldTransform=n.mat3.create(),this.__childrenAdded=[],this.__childrenRemoved=[],this.childIndex=0,this.stage=this,this.stage.hitArea=new n.Rectangle(0,0,1e5,1e5),this.interactive=!!e,this.interactionManager=new n.InteractionManager(this),this.setBackgroundColor(t),this.worldVisible=!0,this.stage.dirty=!0},n.Stage.constructor=n.Stage,n.Stage.prototype=Object.create(n.DisplayObjectContainer.prototype),n.Stage.prototype.updateTransform=function(){this.worldAlpha=1;for(var t=0,e=this.children.length;e>t;t++)this.children[t].updateTransform();this.dirty&&(this.dirty=!1,this.interactionManager.dirty=!0),this.interactive&&this.interactionManager.update()},n.Stage.prototype.setBackgroundColor=function(e){this.backgroundColor=e||0,this.backgroundColorSplit=t(this.backgroundColor);var i=this.backgroundColor.toString(16);i="000000".substr(0,6-i.length)+i,this.backgroundColorString="#"+i},n.Stage.prototype.getMousePosition=function(){return this.interactionManager.mouse.global},n.Stage.prototype.__addChild=function(t){if(t.interactive&&(this.dirty=!0),t.stage=this,t.children)for(var e=0;t.children.length>e;e++)this.__addChild(t.children[e])},n.Stage.prototype.__removeChild=function(t){if(t.interactive&&(this.dirty=!0),t.stage=void 0,t.children)for(var e=0,i=t.children.length;i>e;e++)this.__removeChild(t.children[e])};for(var s=0,o=["ms","moz","webkit","o"],h=0;o.length>h&&!window.requestAnimationFrame;++h)window.requestAnimationFrame=window[o[h]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[o[h]+"CancelAnimationFrame"]||window[o[h]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(t){var e=(new Date).getTime(),i=Math.max(0,16-(e-s)),r=window.setTimeout(function(){t(e+i)},i);return s=e+i,r}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)}),window.requestAnimFrame=window.requestAnimationFrame,"function"!=typeof Function.prototype.bind&&(Function.prototype.bind=function(){var t=Array.prototype.slice;return function(e){function i(){var s=n.concat(t.call(arguments));r.apply(this instanceof i?this:e,s)}var r=this,n=t.call(arguments,1);if("function"!=typeof r)throw new TypeError;return i.prototype=function s(t){return t&&(s.prototype=t),this instanceof s?void 0:new s}(r.prototype),i}}());var l=n.AjaxRequest=function(){var t=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(!window.ActiveXObject)return window.XMLHttpRequest?new XMLHttpRequest:!1;for(var e=0;t.length>e;e++)try{return new ActiveXObject(t[e])}catch(i){}};n.EventTarget=function(){var t={};this.addEventListener=this.on=function(e,i){void 0===t[e]&&(t[e]=[]),-1===t[e].indexOf(i)&&t[e].push(i)},this.dispatchEvent=this.emit=function(e){for(var i in t[e.type])t[e.type][i](e)},this.removeEventListener=this.off=function(e,i){var r=t[e].indexOf(i);-1!==r&&t[e].splice(r,1)}},e(),n.mat3={},n.mat3.create=function(){var t=new n.Matrix(9);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},n.mat4={},n.mat4.create=function(){var t=new n.Matrix(16);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},n.mat3.multiply=function(t,e,i){i||(i=t);var r=t[0],n=t[1],s=t[2],a=t[3],o=t[4],h=t[5],l=t[6],u=t[7],c=t[8],d=e[0],p=e[1],f=e[2],m=e[3],v=e[4],g=e[5],x=e[6],b=e[7],T=e[8];return i[0]=d*r+p*a+f*l,i[1]=d*n+p*o+f*u,i[2]=d*s+p*h+f*c,i[3]=m*r+v*a+g*l,i[4]=m*n+v*o+g*u,i[5]=m*s+v*h+g*c,i[6]=x*r+b*a+T*l,i[7]=x*n+b*o+T*u,i[8]=x*s+b*h+T*c,i},n.mat3.toMat4=function(t,e){return e||(e=n.mat4.create()),e[15]=1,e[14]=0,e[13]=0,e[12]=0,e[11]=0,e[10]=t[8],e[9]=t[7],e[8]=t[6],e[7]=0,e[6]=t[5],e[5]=t[4],e[4]=t[3],e[3]=0,e[2]=t[2],e[1]=t[1],e[0]=t[0],e},n.mat4.create=function(){var t=new n.Matrix(16);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},n.mat4.transpose=function(t,e){if(!e||t===e){var i=t[1],r=t[2],n=t[3],s=t[6],a=t[7],o=t[11];return t[1]=t[4],t[2]=t[8],t[3]=t[12],t[4]=i,t[6]=t[9],t[7]=t[13],t[8]=r,t[9]=s,t[11]=t[14],t[12]=n,t[13]=a,t[14]=o,t}return e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15],e},n.mat4.multiply=function(t,e,i){i||(i=t);var r=t[0],n=t[1],s=t[2],a=t[3],o=t[4],h=t[5],l=t[6],u=t[7],c=t[8],d=t[9],p=t[10],f=t[11],m=t[12],v=t[13],g=t[14],x=t[15],b=e[0],T=e[1],y=e[2],w=e[3];return i[0]=b*r+T*o+y*c+w*m,i[1]=b*n+T*h+y*d+w*v,i[2]=b*s+T*l+y*p+w*g,i[3]=b*a+T*u+y*f+w*x,b=e[4],T=e[5],y=e[6],w=e[7],i[4]=b*r+T*o+y*c+w*m,i[5]=b*n+T*h+y*d+w*v,i[6]=b*s+T*l+y*p+w*g,i[7]=b*a+T*u+y*f+w*x,b=e[8],T=e[9],y=e[10],w=e[11],i[8]=b*r+T*o+y*c+w*m,i[9]=b*n+T*h+y*d+w*v,i[10]=b*s+T*l+y*p+w*g,i[11]=b*a+T*u+y*f+w*x,b=e[12],T=e[13],y=e[14],w=e[15],i[12]=b*r+T*o+y*c+w*m,i[13]=b*n+T*h+y*d+w*v,i[14]=b*s+T*l+y*p+w*g,i[15]=b*a+T*u+y*f+w*x,i},n.autoDetectRenderer=function(t,e,i,r){t||(t=800),e||(e=600);var s=function(){try{return!!window.WebGLRenderingContext&&!!document.createElement("canvas").getContext("experimental-webgl")}catch(t){return!1}}();return s?new n.WebGLRenderer(t,e,i,r):new n.CanvasRenderer(t,e,i,r)},n.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;","}"],n.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;","}"],n.CompileVertexShader=function(t,e){return n._CompileShader(t,e,t.VERTEX_SHADER)},n.CompileFragmentShader=function(t,e){return n._CompileShader(t,e,t.FRAGMENT_SHADER)},n._CompileShader=function(t,e,i){var r=e.join("\n"),n=t.createShader(i);return t.shaderSource(n,r),t.compileShader(n),t.getShaderParameter(n,t.COMPILE_STATUS)?n:(alert(t.getShaderInfoLog(n)),null)},n._defaultFrame=new n.Rectangle(0,0,1,1),n.gl,n.WebGLRenderer=function(t,e,i,r){this.transparent=!!r,this.width=t||800,this.height=e||600,this.view=i||document.createElement("canvas"),this.view.width=this.width,this.view.height=this.height;var s=this;this.view.addEventListener("webglcontextlost",function(t){s.handleContextLost(t)},!1),this.view.addEventListener("webglcontextrestored",function(t){s.handleContextRestored(t)},!1),this.batchs=[];try{n.gl=this.gl=this.view.getContext("experimental-webgl",{alpha:this.transparent,antialias:!1,premultipliedAlpha:!1})}catch(a){throw Error(" This browser does not support webGL. Try using the canvas renderer"+this)}this.initShaders();var o=this.gl;n.WebGLRenderer.gl=o,this.batch=new n.WebGLBatch(o),o.disable(o.DEPTH_TEST),o.disable(o.CULL_FACE),o.enable(o.BLEND),o.colorMask(!0,!0,!0,this.transparent),this.projectionMatrix=n.mat4.create(),this.resize(this.width,this.height),this.contextLost=!1,this.stageRenderGroup=new n.WebGLRenderGroup(this.gl)},n.WebGLRenderer.constructor=n.WebGLRenderer,n.WebGLRenderer.getBatch=function(){return 0==n._batchs.length?new n.WebGLBatch(n.WebGLRenderer.gl):n._batchs.pop()},n.WebGLRenderer.returnBatch=function(t){t.clean(),n._batchs.push(t)},n.WebGLRenderer.prototype.initShaders=function(){var t=this.gl,e=n.CompileFragmentShader(t,n.shaderFragmentSrc),i=n.CompileVertexShader(t,n.shaderVertexSrc);n.shaderProgram=t.createProgram();var r=n.shaderProgram;t.attachShader(r,i),t.attachShader(r,e),t.linkProgram(r),t.getProgramParameter(r,t.LINK_STATUS)||alert("Could not initialise shaders"),t.useProgram(r),r.vertexPositionAttribute=t.getAttribLocation(r,"aVertexPosition"),t.enableVertexAttribArray(r.vertexPositionAttribute),r.textureCoordAttribute=t.getAttribLocation(r,"aTextureCoord"),t.enableVertexAttribArray(r.textureCoordAttribute),r.colorAttribute=t.getAttribLocation(r,"aColor"),t.enableVertexAttribArray(r.colorAttribute),r.mvMatrixUniform=t.getUniformLocation(r,"uMVMatrix"),r.samplerUniform=t.getUniformLocation(r,"uSampler")},n.WebGLRenderer.prototype.render=function(t){if(!this.contextLost){this.__stage!==t&&(this.__stage=t,this.stageRenderGroup.setRenderable(t)),n.WebGLRenderer.updateTextures(),t.updateTransform();var e=this.gl;if(e.colorMask(!0,!0,!0,this.transparent),e.viewport(0,0,this.width,this.height),e.bindFramebuffer(e.FRAMEBUFFER,null),e.clearColor(t.backgroundColorSplit[0],t.backgroundColorSplit[1],t.backgroundColorSplit[2],!this.transparent),e.clear(e.COLOR_BUFFER_BIT),this.stageRenderGroup.backgroundColor=t.backgroundColorSplit,this.stageRenderGroup.render(this.projectionMatrix),t.interactive&&(t._interactiveEventsAdded||(t._interactiveEventsAdded=!0,t.interactionManager.setTarget(this))),n.Texture.frameUpdates.length>0){for(var i=0;n.Texture.frameUpdates.length>i;i++)n.Texture.frameUpdates[i].updateFrame=!1;n.Texture.frameUpdates=[]}}},n.WebGLRenderer.updateTextures=function(){for(var t=0;n.texturesToUpdate.length>t;t++)this.updateTexture(n.texturesToUpdate[t]);for(var t=0;n.texturesToDestroy.length>t;t++)this.destroyTexture(n.texturesToDestroy[t]);n.texturesToUpdate=[],n.texturesToDestroy=[]},n.WebGLRenderer.updateTexture=function(t){var e=n.gl;t._glTexture||(t._glTexture=e.createTexture()),t.hasLoaded&&(e.bindTexture(e.TEXTURE_2D,t._glTexture),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,t.source),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),t._powerOf2?(e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.REPEAT)):(e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE)),e.bindTexture(e.TEXTURE_2D,null))},n.WebGLRenderer.prototype.destroyTexture=function(t){var e=this.gl;t._glTexture&&(t._glTexture=e.createTexture(),e.deleteTexture(e.TEXTURE_2D,t._glTexture))},n.WebGLRenderer.prototype.resize=function(t,e){this.width=t,this.height=e,this.view.width=t,this.view.height=e,this.gl.viewport(0,0,this.width,this.height);var i=this.projectionMatrix;i[0]=2/this.width,i[5]=-2/this.height,i[12]=-1,i[13]=1},n.WebGLRenderer.prototype.handleContextLost=function(t){t.preventDefault(),this.contextLost=!0},n.WebGLRenderer.prototype.handleContextRestored=function(){this.gl=this.view.getContext("experimental-webgl",{alpha:!0}),this.initShaders();for(var t=0;n.TextureCache.length>t;t++)this.updateTexture(n.TextureCache[t]);for(var t=0;this.batchs.length>t;t++)this.batchs[t].restoreLostContext(this.gl),this.batchs[t].dirty=!0;n._restoreBatchs(this.gl),this.contextLost=!1},n._batchs=[],n._getBatch=function(t){return 0==n._batchs.length?new n.WebGLBatch(t):n._batchs.pop()},n._returnBatch=function(t){t.clean(),n._batchs.push(t)},n._restoreBatchs=function(t){for(var e=0;n._batchs.length>e;e++)n._batchs[e].restoreLostContext(t)},n.WebGLBatch=function(t){this.gl=t,this.size=0,this.vertexBuffer=t.createBuffer(),this.indexBuffer=t.createBuffer(),this.uvBuffer=t.createBuffer(),this.colorBuffer=t.createBuffer(),this.blendMode=n.blendModes.NORMAL,this.dynamicSize=1},n.WebGLBatch.constructor=n.WebGLBatch,n.WebGLBatch.prototype.clean=function(){this.verticies=[],this.uvs=[],this.indices=[],this.colors=[],this.dynamicSize=1,this.texture=null,this.last=null,this.size=0,this.head,this.tail},n.WebGLBatch.prototype.restoreLostContext=function(t){this.gl=t,this.vertexBuffer=t.createBuffer(),this.indexBuffer=t.createBuffer(),this.uvBuffer=t.createBuffer(),this.colorBuffer=t.createBuffer()},n.WebGLBatch.prototype.init=function(t){t.batch=this,this.dirty=!0,this.blendMode=t.blendMode,this.texture=t.texture.baseTexture,this.head=t,this.tail=t,this.size=1,this.growBatch()},n.WebGLBatch.prototype.insertBefore=function(t,e){this.size++,t.batch=this,this.dirty=!0;var i=e.__prev;e.__prev=t,t.__next=e,i?(t.__prev=i,i.__next=t):this.head=t},n.WebGLBatch.prototype.insertAfter=function(t,e){this.size++,t.batch=this,this.dirty=!0;var i=e.__next;e.__next=t,t.__prev=e,i?(t.__next=i,i.__prev=t):this.tail=t},n.WebGLBatch.prototype.remove=function(t){return this.size--,0==this.size?(t.batch=null,t.__prev=null,t.__next=null,void 0):(t.__prev?t.__prev.__next=t.__next:(this.head=t.__next,this.head.__prev=null),t.__next?t.__next.__prev=t.__prev:(this.tail=t.__prev,this.tail.__next=null),t.batch=null,t.__next=null,t.__prev=null,this.dirty=!0,void 0)},n.WebGLBatch.prototype.split=function(t){this.dirty=!0;var e=new n.WebGLBatch(this.gl);e.init(t),e.texture=this.texture,e.tail=this.tail,this.tail=t.__prev,this.tail.__next=null,t.__prev=null;for(var i=0;t;)i++,t.batch=e,t=t.__next;return e.size=i,this.size-=i,e},n.WebGLBatch.prototype.merge=function(t){this.dirty=!0,this.tail.__next=t.head,t.head.__prev=this.tail,this.size+=t.size,this.tail=t.tail;for(var e=t.head;e;)e.batch=this,e=e.__next},n.WebGLBatch.prototype.growBatch=function(){var t=this.gl;this.dynamicSize=1==this.size?1:1.5*this.size,this.verticies=new Float32Array(8*this.dynamicSize),t.bindBuffer(t.ARRAY_BUFFER,this.vertexBuffer),t.bufferData(t.ARRAY_BUFFER,this.verticies,t.DYNAMIC_DRAW),this.uvs=new Float32Array(8*this.dynamicSize),t.bindBuffer(t.ARRAY_BUFFER,this.uvBuffer),t.bufferData(t.ARRAY_BUFFER,this.uvs,t.DYNAMIC_DRAW),this.dirtyUVS=!0,this.colors=new Float32Array(4*this.dynamicSize),t.bindBuffer(t.ARRAY_BUFFER,this.colorBuffer),t.bufferData(t.ARRAY_BUFFER,this.colors,t.DYNAMIC_DRAW),this.dirtyColors=!0,this.indices=new Uint16Array(6*this.dynamicSize);for(var e=this.indices.length/6,i=0;e>i;i++){var r=6*i,n=4*i;this.indices[r+0]=n+0,this.indices[r+1]=n+1,this.indices[r+2]=n+2,this.indices[r+3]=n+0,this.indices[r+4]=n+2,this.indices[r+5]=n+3}t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indexBuffer),t.bufferData(t.ELEMENT_ARRAY_BUFFER,this.indices,t.STATIC_DRAW)},n.WebGLBatch.prototype.refresh=function(){this.gl,this.dynamicSizer;r++)i=this.batchs[r],i instanceof n.WebGLBatch?this.batchs[r].render():i instanceof n.TilingSprite?i.visible&&this.renderTilingSprite(i,t):i instanceof n.Strip&&i.visible&&this.renderStrip(i,t)},n.WebGLRenderGroup.prototype.renderSpecific=function(t,e){n.WebGLRenderer.updateTextures();var i=this.gl;this.checkVisibility(t,t.visible),i.uniformMatrix4fv(n.shaderProgram.mvMatrixUniform,!1,e);var r,s,a,o,h=t.renderable?t:this.getNextRenderable(t),l=h.batch;if(h instanceof n.Sprite){l=h.batch;var u=l.head;if(u==h)r=0;else for(r=1;u.__next!=h;)r++,u=u.__next}else l=h;for(var c,d=t,p=t;p.children.length>0;)p=p.children[p.children.length-1],p.renderable&&(d=p);if(d instanceof n.Sprite){c=d.batch;var u=c.head;if(u==d)a=0;else for(a=1;u.__next!=d;)a++,u=u.__next}else c=d;if(l==c)return l instanceof n.WebGLBatch?l.render(r,a+1):l instanceof n.TilingSprite?l.visible&&this.renderTilingSprite(l,e):l instanceof n.Strip?l.visible&&this.renderStrip(l,e):l instanceof n.CustomRenderable&&l.visible&&l.renderWebGL(this,e),void 0;s=this.batchs.indexOf(l),o=this.batchs.indexOf(c),l instanceof n.WebGLBatch?l.render(r):l instanceof n.TilingSprite?l.visible&&this.renderTilingSprite(l,e):l instanceof n.Strip?l.visible&&this.renderStrip(l,e):l instanceof n.CustomRenderable&&l.visible&&l.renderWebGL(this,e);for(var f=s+1;o>f;f++)renderable=this.batchs[f],renderable instanceof n.WebGLBatch?this.batchs[f].render():renderable instanceof n.TilingSprite?renderable.visible&&this.renderTilingSprite(renderable,e):renderable instanceof n.Strip?renderable.visible&&this.renderStrip(renderable,e):renderable instanceof n.CustomRenderable&&renderable.visible&&renderable.renderWebGL(this,e);c instanceof n.WebGLBatch?c.render(0,a+1):c instanceof n.TilingSprite?c.visible&&this.renderTilingSprite(c):c instanceof n.Strip?c.visible&&this.renderStrip(c):c instanceof n.CustomRenderable&&c.visible&&c.renderWebGL(this,e)},n.WebGLRenderGroup.prototype.checkVisibility=function(t,e){for(var i=t.children,r=0;i.length>r;r++){var n=i[r];n.worldVisible=n.visible&&e,n.textureChange&&(n.textureChange=!1,n.worldVisible&&(this.removeDisplayObject(n),this.addDisplayObject(n))),n.children.length>0&&this.checkVisibility(n,n.worldVisible)}},n.WebGLRenderGroup.prototype.updateTexture=function(t){if(1==t.batch.length)return t.batch.texture=t.texture.baseTexture,void 0;if(t.batch.texture!=t.texture.baseTexture)if(t.batch.head==t){var e=t.batch,i=this.batchs.indexOf(e),r=this.batchs[i-1];if(e.remove(t),r)if(r.texture==t.texture.baseTexture&&r.blendMode==t.blendMode)r.insertAfter(t,r.tail);else{var s=n.WebGLRenderer.getBatch();s.init(t),this.batchs.splice(i-1,0,s)}else{var s=n.WebGLRenderer.getBatch();s.init(t),this.batchs.splice(0,0,s)}}else if(t.batch.tail==t){var e=t.batch,i=this.batchs.indexOf(e),a=this.batchs[i+1];if(e.remove(t),a){if(a.texture==t.texture.baseTexture&&a.blendMode==t.blendMode)return a.insertBefore(t,a.head),void 0;var s=n.WebGLRenderer.getBatch();s.init(t),this.batchs.splice(i+1,0,s)}else{var s=n.WebGLRenderer.getBatch();s.init(t),this.batchs.push(s)}}else{var e=t.batch,o=e.split(t);o.remove(t);var s=n.WebGLRenderer.getBatch(),i=this.batchs.indexOf(e);s.init(t),this.batchs.splice(i+1,0,s,o)}},n.WebGLRenderGroup.prototype.addDisplayObject=function(t){if(t.__renderGroup&&t.__renderGroup.removeDisplayObjectAndChildren(t),t.__renderGroup=this,t.renderable){var e=this.getPreviousRenderable(t),i=this.getNextRenderable(t);if(t instanceof n.Sprite){var r,s;if(e instanceof n.Sprite){if(r=e.batch,r&&r.texture==t.texture.baseTexture&&r.blendMode==t.blendMode)return r.insertAfter(t,e),void 0}else r=e;if(i)if(i instanceof n.Sprite){if(s=i.batch){if(s.texture==t.texture.baseTexture&&s.blendMode==t.blendMode)return s.insertBefore(t,i),void 0;if(s==r){var a=r.split(i),o=n.WebGLRenderer.getBatch(),h=this.batchs.indexOf(r);return o.init(t),this.batchs.splice(h+1,0,o,a),void 0}}}else s=i;var o=n.WebGLRenderer.getBatch();if(o.init(t),r){var h=this.batchs.indexOf(r);this.batchs.splice(h+1,0,o)}else this.batchs.push(o)}else t instanceof n.TilingSprite?(this.initTilingSprite(t),this.batchs.push(t)):t instanceof n.Strip&&(this.initStrip(t),this.batchs.push(t));this.batchUpdate=!0}},n.WebGLRenderGroup.prototype.addDisplayObjectAndChildren=function(t){this.addDisplayObject(t);for(var e=t.children,i=0;e.length>i;i++)this.addDisplayObjectAndChildren(e[i])},n.WebGLRenderGroup.prototype.removeDisplayObject=function(t){if(t.__renderGroup=null,t.renderable){var e;if(t instanceof n.Sprite){var i=t.batch;if(!i)return;i.remove(t),0==i.size&&(e=i)}else e=t;if(e){var r=this.batchs.indexOf(e);if(-1==r)return;if(0==r||r==this.batchs.length-1)return this.batchs.splice(r,1),e instanceof n.WebGLBatch&&n.WebGLRenderer.returnBatch(e),void 0;if(this.batchs[r-1]instanceof n.WebGLBatch&&this.batchs[r+1]instanceof n.WebGLBatch&&this.batchs[r-1].texture==this.batchs[r+1].texture&&this.batchs[r-1].blendMode==this.batchs[r+1].blendMode)return this.batchs[r-1].merge(this.batchs[r+1]),e instanceof n.WebGLBatch&&n.WebGLRenderer.returnBatch(e),n.WebGLRenderer.returnBatch(this.batchs[r+1]),this.batchs.splice(r,2),void 0;this.batchs.splice(r,1),e instanceof n.WebGLBatch&&n.WebGLRenderer.returnBatch(e)}}},n.WebGLRenderGroup.prototype.removeDisplayObjectAndChildren=function(t){if(t.__renderGroup==this){this.removeDisplayObject(t);for(var e=t.children,i=0;e.length>i;i++)this.removeDisplayObjectAndChildren(e[i])}},n.WebGLRenderGroup.prototype.getNextRenderable=function(t){var e=t;do{if(0==e.children.length){if(!e.parent)return null;for(;e.childIndex==e.parent.children.length-1;)if(e=e.parent,e==this.root||!e.parent){e=null;break}e&&(e=e.parent.children[e.childIndex+1])}else e=e.children[0];if(!e)break}while(!e.renderable||!e.__renderGroup);return e},n.WebGLRenderGroup.prototype.getPreviousRenderable=function(t){var e=t;do{if(0==e.childIndex){if(e=e.parent,!e)return null}else for(e=e.parent.children[e.childIndex-1];0!=e.children.length;)e=e.children[e.children.length-1];if(e==this.root)break}while(!e.renderable||!e.__renderGroup);return e},n.WebGLRenderGroup.prototype.initTilingSprite=function(t){var e=this.gl;t.verticies=new Float32Array([0,0,t.width,0,t.width,t.height,0,t.height]),t.uvs=new Float32Array([0,0,1,0,1,1,0,1]),t.colors=new Float32Array([1,1,1,1]),t.indices=new Uint16Array([0,1,3,2]),t._vertexBuffer=e.createBuffer(),t._indexBuffer=e.createBuffer(),t._uvBuffer=e.createBuffer(),t._colorBuffer=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,t._vertexBuffer),e.bufferData(e.ARRAY_BUFFER,t.verticies,e.STATIC_DRAW),e.bindBuffer(e.ARRAY_BUFFER,t._uvBuffer),e.bufferData(e.ARRAY_BUFFER,t.uvs,e.DYNAMIC_DRAW),e.bindBuffer(e.ARRAY_BUFFER,t._colorBuffer),e.bufferData(e.ARRAY_BUFFER,t.colors,e.STATIC_DRAW),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t._indexBuffer),e.bufferData(e.ELEMENT_ARRAY_BUFFER,t.indices,e.STATIC_DRAW),t.texture.baseTexture._glTexture?(e.bindTexture(e.TEXTURE_2D,t.texture.baseTexture._glTexture),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.REPEAT),t.texture.baseTexture._powerOf2=!0):t.texture.baseTexture._powerOf2=!0},n.WebGLRenderGroup.prototype.renderStrip=function(t,e){var i=this.gl,r=n.shaderProgram,s=n.mat3.toMat4(t.worldTransform);n.mat4.transpose(s),n.mat4.multiply(e,s,s),i.uniformMatrix4fv(r.mvMatrixUniform,!1,s),t.blendMode==n.blendModes.NORMAL?i.blendFunc(i.ONE,i.ONE_MINUS_SRC_ALPHA):i.blendFunc(i.ONE,i.ONE_MINUS_SRC_COLOR),t.dirty?(t.dirty=!1,i.bindBuffer(i.ARRAY_BUFFER,t._vertexBuffer),i.bufferData(i.ARRAY_BUFFER,t.verticies,i.STATIC_DRAW),i.vertexAttribPointer(r.vertexPositionAttribute,2,i.FLOAT,!1,0,0),i.bindBuffer(i.ARRAY_BUFFER,t._uvBuffer),i.bufferData(i.ARRAY_BUFFER,t.uvs,i.STATIC_DRAW),i.vertexAttribPointer(r.textureCoordAttribute,2,i.FLOAT,!1,0,0),i.activeTexture(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,t.texture.baseTexture._glTexture),i.bindBuffer(i.ARRAY_BUFFER,t._colorBuffer),i.bufferData(i.ARRAY_BUFFER,t.colors,i.STATIC_DRAW),i.vertexAttribPointer(r.colorAttribute,1,i.FLOAT,!1,0,0),i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,t._indexBuffer),i.bufferData(i.ELEMENT_ARRAY_BUFFER,t.indices,i.STATIC_DRAW)):(i.bindBuffer(i.ARRAY_BUFFER,t._vertexBuffer),i.bufferSubData(i.ARRAY_BUFFER,0,t.verticies),i.vertexAttribPointer(r.vertexPositionAttribute,2,i.FLOAT,!1,0,0),i.bindBuffer(i.ARRAY_BUFFER,t._uvBuffer),i.vertexAttribPointer(r.textureCoordAttribute,2,i.FLOAT,!1,0,0),i.activeTexture(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,t.texture.baseTexture._glTexture),i.bindBuffer(i.ARRAY_BUFFER,t._colorBuffer),i.vertexAttribPointer(r.colorAttribute,1,i.FLOAT,!1,0,0),i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,t._indexBuffer)),i.drawElements(i.TRIANGLE_STRIP,t.indices.length,i.UNSIGNED_SHORT,0),i.uniformMatrix4fv(r.mvMatrixUniform,!1,e)},n.WebGLRenderGroup.prototype.renderTilingSprite=function(t,e){var i=this.gl;n.shaderProgram;var r=t.tilePosition,s=t.tileScale,a=r.x/t.texture.baseTexture.width,o=r.y/t.texture.baseTexture.height,h=t.width/t.texture.baseTexture.width/s.x,l=t.height/t.texture.baseTexture.height/s.y;t.uvs[0]=0-a,t.uvs[1]=0-o,t.uvs[2]=1*h-a,t.uvs[3]=0-o,t.uvs[4]=1*h-a,t.uvs[5]=1*l-o,t.uvs[6]=0-a,t.uvs[7]=1*l-o,i.bindBuffer(i.ARRAY_BUFFER,t._uvBuffer),i.bufferSubData(i.ARRAY_BUFFER,0,t.uvs),this.renderStrip(t,e)},n.WebGLRenderer.prototype.initStrip=function(t){var e=this.gl;this.shaderProgram,t._vertexBuffer=e.createBuffer(),t._indexBuffer=e.createBuffer(),t._uvBuffer=e.createBuffer(),t._colorBuffer=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,t._vertexBuffer),e.bufferData(e.ARRAY_BUFFER,t.verticies,e.DYNAMIC_DRAW),e.bindBuffer(e.ARRAY_BUFFER,t._uvBuffer),e.bufferData(e.ARRAY_BUFFER,t.uvs,e.STATIC_DRAW),e.bindBuffer(e.ARRAY_BUFFER,t._colorBuffer),e.bufferData(e.ARRAY_BUFFER,t.colors,e.STATIC_DRAW),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t._indexBuffer),e.bufferData(e.ELEMENT_ARRAY_BUFFER,t.indices,e.STATIC_DRAW)},n.CanvasRenderer=function(t,e,i,r){this.transparent=r,this.width=t||800,this.height=e||600,this.refresh=!0,this.view=i||document.createElement("canvas"),this.view.width=this.width,this.view.height=this.height,this.count=0,this.context=this.view.getContext("2d")},n.CanvasRenderer.constructor=n.CanvasRenderer,n.CanvasRenderer.prototype.render=function(t){n.texturesToUpdate=[],n.texturesToDestroy=[],t.updateTransform(),this.view.style.backgroundColor==t.backgroundColorString||this.transparent||(this.view.style.backgroundColor=t.backgroundColorString),this.context.setTransform(1,0,0,1,0,0),this.context.clearRect(0,0,this.width,this.height),this.renderDisplayObject(t),t.interactive&&(t._interactiveEventsAdded||(t._interactiveEventsAdded=!0,t.interactionManager.setTarget(this))),n.Texture.frameUpdates.length>0&&(n.Texture.frameUpdates=[])},n.CanvasRenderer.prototype.resize=function(t,e){this.width=t,this.height=e,this.view.width=t,this.view.height=e},n.CanvasRenderer.prototype.renderDisplayObject=function(t){var e=t.worldTransform,i=this.context;if(t.visible){if(t instanceof n.Sprite){var r=t.texture.frame;r&&(i.globalAlpha=t.worldAlpha,i.setTransform(e[0],e[3],e[1],e[4],e[2],e[5]),i.drawImage(t.texture.baseTexture.source,r.x,r.y,r.width,r.height,t.anchor.x*-r.width,t.anchor.y*-r.height,r.width,r.height))}else t instanceof n.Strip?(i.setTransform(e[0],e[3],e[1],e[4],e[2],e[5]),this.renderStrip(t)):t instanceof n.TilingSprite?(i.setTransform(e[0],e[3],e[1],e[4],e[2],e[5]),this.renderTilingSprite(t)):t instanceof n.CustomRenderable&&t.renderCanvas(this);if(t.children)for(var s=0;t.children.length>s;s++)this.renderDisplayObject(t.children[s]);this.context.setTransform(1,0,0,1,0,0)}},n.CanvasRenderer.prototype.renderStripFlat=function(t){var e=this.context,i=t.verticies;t.uvs;var r=i.length/2;this.count++,e.beginPath();for(var n=1;r-2>n;n++){var s=2*n,a=i[s],o=i[s+2],h=i[s+4],l=i[s+1],u=i[s+3],c=i[s+5];e.moveTo(a,l),e.lineTo(o,u),e.lineTo(h,c)}e.fillStyle="#FF0000",e.fill(),e.closePath()},n.CanvasRenderer.prototype.renderTilingSprite=function(t){var e=this.context;t.__tilePattern||(t.__tilePattern=e.createPattern(t.texture.baseTexture.source,"repeat")),e.beginPath();var i=t.tilePosition,r=t.tileScale;e.scale(r.x,r.y),e.translate(i.x,i.y),e.fillStyle=t.__tilePattern,e.fillRect(-i.x,-i.y,t.width/r.x,t.height/r.y),e.scale(1/r.x,1/r.y),e.translate(-i.x,-i.y),e.closePath()},n.CanvasRenderer.prototype.renderStrip=function(t){var e=this.context,i=t.verticies,r=t.uvs,n=i.length/2;this.count++;for(var s=1;n-2>s;s++){var a=2*s,o=i[a],h=i[a+2],l=i[a+4],u=i[a+1],c=i[a+3],d=i[a+5],p=r[a]*t.texture.width,f=r[a+2]*t.texture.width,m=r[a+4]*t.texture.width,v=r[a+1]*t.texture.height,g=r[a+3]*t.texture.height,x=r[a+5]*t.texture.height;e.save(),e.beginPath(),e.moveTo(o,u),e.lineTo(h,c),e.lineTo(l,d),e.closePath(),e.clip();var b=p*g+v*m+f*x-g*m-v*f-p*x,T=o*g+v*l+h*x-g*l-v*h-o*x,y=p*h+o*m+f*l-h*m-o*f-p*l,w=p*g*l+v*h*m+o*f*x-o*g*m-v*f*l-p*h*x,_=u*g+v*d+c*x-g*d-v*c-u*x,R=p*c+u*m+f*d-c*m-u*f-p*d,A=p*g*d+v*c*m+u*f*x-u*g*m-v*f*d-p*c*x;e.transform(T/b,_/b,y/b,R/b,w/b,A/b),e.drawImage(t.texture.baseTexture.source,0,0),e.restore()}},n.Strip=function(t,e,i){n.DisplayObjectContainer.call(this),this.texture=t,this.blendMode=n.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(r){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=e,this.height=i,t.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},n.Strip.constructor=n.Strip,n.Strip.prototype=Object.create(n.DisplayObjectContainer.prototype),n.Strip.prototype.setTexture=function(t){this.texture=t,this.width=t.frame.width,this.height=t.frame.height,this.updateFrame=!0},n.Strip.prototype.onTextureUpdate=function(){this.updateFrame=!0},n.Rope=function(t,e){n.Strip.call(this,t),this.points=e;try{this.verticies=new Float32Array(4*e.length),this.uvs=new Float32Array(4*e.length),this.colors=new Float32Array(2*e.length),this.indices=new Uint16Array(2*e.length)}catch(i){this.verticies=verticies,this.uvs=uvs,this.colors=colors,this.indices=indices}this.refresh()},n.Rope.constructor=n.Rope,n.Rope.prototype=Object.create(n.Strip.prototype),n.Rope.prototype.refresh=function(){var t=this.points;if(!(1>t.length)){var e=this.uvs,i=this.indices,r=this.colors,n=t[0],s=t[0];this.count-=.2,e[0]=0,e[1]=1,e[2]=0,e[3]=1,r[0]=1,r[1]=1,i[0]=0,i[1]=1;for(var a=t.length,o=1;a>o;o++){var s=t[o],h=4*o,l=o/(a-1);o%2?(e[h]=l,e[h+1]=0,e[h+2]=l,e[h+3]=1):(e[h]=l,e[h+1]=0,e[h+2]=l,e[h+3]=1),h=2*o,r[h]=1,r[h+1]=1,h=2*o,i[h]=h,i[h+1]=h+1,n=s}}},n.Rope.prototype.updateTransform=function(){var t=this.points;if(!(1>t.length)){var e,i=this.verticies,r=t[0],s={x:0,y:0},a=t[0];this.count-=.2,i[0]=a.x+s.x,i[1]=a.y+s.y,i[2]=a.x-s.x,i[3]=a.y-s.y;for(var o=t.length,h=1;o>h;h++){var a=t[h],l=4*h;e=t.length-1>h?t[h+1]:a,s.y=-(e.x-r.x),s.x=e.y-r.y;var u=10*(1-h/(o-1));u>1&&(u=1);var c=Math.sqrt(s.x*s.x+s.y*s.y),d=this.texture.height/2;s.x/=c,s.y/=c,s.x*=d,s.y*=d,i[l]=a.x+s.x,i[l+1]=a.y+s.y,i[l+2]=a.x-s.x,i[l+3]=a.y-s.y,r=a}n.DisplayObjectContainer.prototype.updateTransform.call(this)}},n.Rope.prototype.setTexture=function(t){this.texture=t,this.updateFrame=!0},n.TilingSprite=function(t,e,i){n.DisplayObjectContainer.call(this),this.texture=t,this.width=e,this.height=i,this.renderable=!0,this.tileScale=new n.Point(1,1),this.tilePosition=new n.Point(0,0),this.blendMode=n.blendModes.NORMAL},n.TilingSprite.constructor=n.TilingSprite,n.TilingSprite.prototype=Object.create(n.DisplayObjectContainer.prototype),n.TilingSprite.prototype.setTexture=function(t){this.texture=t,this.updateFrame=!0},n.TilingSprite.prototype.onTextureUpdate=function(){this.updateFrame=!0},n.Spine=function(t){if(n.DisplayObjectContainer.call(this),this.spineData=n.AnimCache[t],!this.spineData)throw Error("Spine data must be preloaded using PIXI.SpineLoader or PIXI.AssetLoader: "+t);this.count=0,this.sprites=[],this.skeleton=new u.Skeleton(this.spineData),this.skeleton.updateWorldTransform(),this.stateData=new u.AnimationStateData(this.spineData),this.state=new u.AnimationState(this.stateData);for(var e=0;this.skeleton.drawOrder.length>e;e++){var i=this.skeleton.drawOrder[e].data.attachmentName;n.TextureCache[i]||(i+=".png");var r=new n.Sprite(n.Texture.fromFrame(i));r.anchor.x=r.anchor.y=.5,this.addChild(r),this.sprites.push(r)}},n.Spine.constructor=n.Spine,n.Spine.prototype=Object.create(n.DisplayObjectContainer.prototype),n.Spine.prototype.updateTransform=function(){this.state.update(1/60),this.state.apply(this.skeleton),this.skeleton.updateWorldTransform();for(var t=0;this.skeleton.drawOrder.length>t;t++){var e=this.skeleton.drawOrder[t],i=e.bone.worldX+e.attachment.x*e.bone.m00+e.attachment.y*e.bone.m01+.5*e.attachment.width,r=e.bone.worldY+e.attachment.x*e.bone.m10+e.attachment.y*e.bone.m11+.5*e.attachment.height;if(e.cacheName!=e.attachment.name){var s=e.attachment.name;n.TextureCache[s]||(s+=".png"),this.sprites[t].setTexture(n.TextureCache[s]),e.cacheName=e.attachment.name}i+=-(e.attachment.width*(e.bone.worldScaleX+e.attachment.scaleX-1)>>1),r+=-(e.attachment.height*(e.bone.worldScaleY+e.attachment.scaleY-1)>>1),this.sprites[t].position.x=i,this.sprites[t].position.y=r,this.sprites[t].rotation=-(e.bone.worldRotation+e.attachment.rotation)*(Math.PI/180)}n.DisplayObjectContainer.prototype.updateTransform.call(this)};var u={};u.BoneData=function(t,e){this.name=t,this.parent=e},u.BoneData.prototype={length:0,x:0,y:0,rotation:0,scaleX:1,scaleY:1},u.SlotData=function(t,e){this.name=t,this.boneData=e},u.SlotData.prototype={r:1,g:1,b:1,a:1,attachmentName:null},u.Bone=function(t,e){this.data=t,this.parent=e,this.setToSetupPose()},u.Bone.yDown=!1,u.Bone.prototype={x:0,y:0,rotation:0,scaleX:1,scaleY:1,m00:0,m01:0,worldX:0,m10:0,m11:0,worldY:0,worldRotation:0,worldScaleX:1,worldScaleY:1,updateWorldTransform:function(t,e){var i=this.parent;null!=i?(this.worldX=this.x*i.m00+this.y*i.m01+i.worldX,this.worldY=this.x*i.m10+this.y*i.m11+i.worldY,this.worldScaleX=i.worldScaleX*this.scaleX,this.worldScaleY=i.worldScaleY*this.scaleY,this.worldRotation=i.worldRotation+this.rotation):(this.worldX=this.x,this.worldY=this.y,this.worldScaleX=this.scaleX,this.worldScaleY=this.scaleY,this.worldRotation=this.rotation);var r=this.worldRotation*Math.PI/180,n=Math.cos(r),s=Math.sin(r);this.m00=n*this.worldScaleX,this.m10=s*this.worldScaleX,this.m01=-s*this.worldScaleY,this.m11=n*this.worldScaleY,t&&(this.m00=-this.m00,this.m01=-this.m01),e&&(this.m10=-this.m10,this.m11=-this.m11),u.Bone.yDown&&(this.m10=-this.m10,this.m11=-this.m11)},setToSetupPose:function(){var t=this.data;this.x=t.x,this.y=t.y,this.rotation=t.rotation,this.scaleX=t.scaleX,this.scaleY=t.scaleY}},u.Slot=function(t,e,i){this.data=t,this.skeleton=e,this.bone=i,this.setToSetupPose()},u.Slot.prototype={r:1,g:1,b:1,a:1,_attachmentTime:0,attachment:null,setAttachment:function(t){this.attachment=t,this._attachmentTime=this.skeleton.time},setAttachmentTime:function(t){this._attachmentTime=this.skeleton.time-t},getAttachmentTime:function(){return this.skeleton.time-this._attachmentTime},setToSetupPose:function(){var t=this.data;this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a;for(var e=this.skeleton.data.slots,i=0,r=e.length;r>i;i++)if(e[i]==t){this.setAttachment(t.attachmentName?this.skeleton.getAttachmentBySlotIndex(i,t.attachmentName):null);break}}},u.Skin=function(t){this.name=t,this.attachments={}},u.Skin.prototype={addAttachment:function(t,e,i){this.attachments[t+":"+e]=i},getAttachment:function(t,e){return this.attachments[t+":"+e]},_attachAll:function(t,e){for(var i in e.attachments){var r=i.indexOf(":"),n=parseInt(i.substring(0,r)),s=i.substring(r+1),a=t.slots[n];if(a.attachment&&a.attachment.name==s){var o=this.getAttachment(n,s);o&&a.setAttachment(o)}}}},u.Animation=function(t,e,i){this.name=t,this.timelines=e,this.duration=i},u.Animation.prototype={apply:function(t,e,i){i&&0!=this.duration&&(e%=this.duration);for(var r=this.timelines,n=0,s=r.length;s>n;n++)r[n].apply(t,e,1)},mix:function(t,e,i,r){i&&0!=this.duration&&(e%=this.duration);for(var n=this.timelines,s=0,a=n.length;a>s;s++)n[s].apply(t,e,r)}},u.binarySearch=function(t,e,i){var r=0,n=Math.floor(t.length/i)-2;if(0==n)return i;for(var s=n>>>1;;){if(e>=t[(s+1)*i]?r=s+1:n=s,r==n)return(r+1)*i;s=r+n>>>1}},u.linearSearch=function(t,e,i){for(var r=0,n=t.length-i;n>=r;r+=i)if(t[r]>e)return r;return-1},u.Curves=function(t){this.curves=[],this.curves.length=6*(t-1)},u.Curves.prototype={setLinear:function(t){this.curves[6*t]=0},setStepped:function(t){this.curves[6*t]=-1},setCurve:function(t,e,i,r,n){var s=.1,a=s*s,o=a*s,h=3*s,l=3*a,u=6*a,c=6*o,d=2*-e+r,p=2*-i+n,f=3*(e-r)+1,m=3*(i-n)+1,v=6*t,g=this.curves;g[v]=e*h+d*l+f*o,g[v+1]=i*h+p*l+m*o,g[v+2]=d*u+f*c,g[v+3]=p*u+m*c,g[v+4]=f*c,g[v+5]=m*c},getCurvePercent:function(t,e){e=0>e?0:e>1?1:e;var i=6*t,r=this.curves,n=r[i];if(!n)return e;if(-1==n)return 0;for(var s=r[i+1],a=r[i+2],o=r[i+3],h=r[i+4],l=r[i+5],u=n,c=s,d=8;;){if(u>=e){var p=u-n,f=c-s;return f+(c-f)*(e-p)/(u-p)}if(0==d)break;d--,n+=a,s+=o,a+=h,o+=l,u+=n,c+=s}return c+(1-c)*(e-u)/(1-u)}},u.RotateTimeline=function(t){this.curves=new u.Curves(t),this.frames=[],this.frames.length=2*t},u.RotateTimeline.prototype={boneIndex:0,getFrameCount:function(){return this.frames.length/2},setFrame:function(t,e,i){t*=2,this.frames[t]=e,this.frames[t+1]=i},apply:function(t,e,i){var r=this.frames;if(!(r[0]>e)){var n=t.bones[this.boneIndex];if(e>=r[r.length-2]){for(var s=n.data.rotation+r[r.length-1]-n.rotation;s>180;)s-=360;for(;-180>s;)s+=360;return n.rotation+=s*i,void 0}var a=u.binarySearch(r,e,2),o=r[a-1],h=r[a],l=1-(e-h)/(r[a-2]-h);l=this.curves.getCurvePercent(a/2-1,l);for(var s=r[a+1]-o;s>180;)s-=360;for(;-180>s;)s+=360;for(s=n.data.rotation+(o+s*l)-n.rotation;s>180;)s-=360;for(;-180>s;)s+=360;n.rotation+=s*i}}},u.TranslateTimeline=function(t){this.curves=new u.Curves(t),this.frames=[],this.frames.length=3*t},u.TranslateTimeline.prototype={boneIndex:0,getFrameCount:function(){return this.frames.length/3},setFrame:function(t,e,i,r){t*=3,this.frames[t]=e,this.frames[t+1]=i,this.frames[t+2]=r},apply:function(t,e,i){var r=this.frames;if(!(r[0]>e)){var n=t.bones[this.boneIndex];if(e>=r[r.length-3])return n.x+=(n.data.x+r[r.length-2]-n.x)*i,n.y+=(n.data.y+r[r.length-1]-n.y)*i,void 0;var s=u.binarySearch(r,e,3),a=r[s-2],o=r[s-1],h=r[s],l=1-(e-h)/(r[s+-3]-h);l=this.curves.getCurvePercent(s/3-1,l),n.x+=(n.data.x+a+(r[s+1]-a)*l-n.x)*i,n.y+=(n.data.y+o+(r[s+2]-o)*l-n.y)*i}}},u.ScaleTimeline=function(t){this.curves=new u.Curves(t),this.frames=[],this.frames.length=3*t},u.ScaleTimeline.prototype={boneIndex:0,getFrameCount:function(){return this.frames.length/3},setFrame:function(t,e,i,r){t*=3,this.frames[t]=e,this.frames[t+1]=i,this.frames[t+2]=r},apply:function(t,e,i){var r=this.frames;if(!(r[0]>e)){var n=t.bones[this.boneIndex];if(e>=r[r.length-3])return n.scaleX+=(n.data.scaleX-1+r[r.length-2]-n.scaleX)*i,n.scaleY+=(n.data.scaleY-1+r[r.length-1]-n.scaleY)*i,void 0;var s=u.binarySearch(r,e,3),a=r[s-2],o=r[s-1],h=r[s],l=1-(e-h)/(r[s+-3]-h);l=this.curves.getCurvePercent(s/3-1,l),n.scaleX+=(n.data.scaleX-1+a+(r[s+1]-a)*l-n.scaleX)*i,n.scaleY+=(n.data.scaleY-1+o+(r[s+2]-o)*l-n.scaleY)*i}}},u.ColorTimeline=function(t){this.curves=new u.Curves(t),this.frames=[],this.frames.length=5*t},u.ColorTimeline.prototype={slotIndex:0,getFrameCount:function(){return this.frames.length/2},setFrame:function(t,e){t*=5,this.frames[t]=e,this.frames[t+1]=r,this.frames[t+2]=g,this.frames[t+3]=b,this.frames[t+4]=a},apply:function(t,e,i){var r=this.frames;if(!(r[0]>e)){var n=t.slots[this.slotIndex];if(e>=r[r.length-5]){var s=r.length-1;return n.r=r[s-3],n.g=r[s-2],n.b=r[s-1],n.a=r[s],void 0}var a=u.binarySearch(r,e,5),o=r[a-4],h=r[a-3],l=r[a-2],c=r[a-1],d=r[a],p=1-(e-d)/(r[a-5]-d);p=this.curves.getCurvePercent(a/5-1,p);var f=o+(r[a+1]-o)*p,m=h+(r[a+2]-h)*p,v=l+(r[a+3]-l)*p,g=c+(r[a+4]-c)*p;1>i?(n.r+=(f-n.r)*i,n.g+=(m-n.g)*i,n.b+=(v-n.b)*i,n.a+=(g-n.a)*i):(n.r=f,n.g=m,n.b=v,n.a=g)}}},u.AttachmentTimeline=function(t){this.curves=new u.Curves(t),this.frames=[],this.frames.length=t,this.attachmentNames=[],this.attachmentNames.length=t},u.AttachmentTimeline.prototype={slotIndex:0,getFrameCount:function(){return this.frames.length/2},setFrame:function(t,e,i){this.frames[t]=e,this.attachmentNames[t]=i},apply:function(t,e){var i=this.frames;if(!(i[0]>e)){var r;r=e>=i[i.length-1]?i.length-1:u.binarySearch(i,e,1)-1;var n=this.attachmentNames[r];t.slots[this.slotIndex].setAttachment(n?t.getAttachmentBySlotIndex(this.slotIndex,n):null)}}},u.SkeletonData=function(){this.bones=[],this.slots=[],this.skins=[],this.animations=[]},u.SkeletonData.prototype={defaultSkin:null,findBone:function(t){for(var e=this.bones,i=0,r=e.length;r>i;i++)if(e[i].name==t)return e[i];return null},findBoneIndex:function(t){for(var e=this.bones,i=0,r=e.length;r>i;i++)if(e[i].name==t)return i;return-1},findSlot:function(t){for(var e=this.slots,i=0,r=e.length;r>i;i++)if(e[i].name==t)return slot[i];return null},findSlotIndex:function(t){for(var e=this.slots,i=0,r=e.length;r>i;i++)if(e[i].name==t)return i;return-1},findSkin:function(t){for(var e=this.skins,i=0,r=e.length;r>i;i++)if(e[i].name==t)return e[i];return null},findAnimation:function(t){for(var e=this.animations,i=0,r=e.length;r>i;i++)if(e[i].name==t)return e[i];return null}},u.Skeleton=function(t){this.data=t,this.bones=[];for(var e=0,i=t.bones.length;i>e;e++){var r=t.bones[e],n=r.parent?this.bones[t.bones.indexOf(r.parent)]:null;this.bones.push(new u.Bone(r,n))}this.slots=[],this.drawOrder=[];for(var e=0,i=t.slots.length;i>e;e++){var s=t.slots[e],a=this.bones[t.bones.indexOf(s.boneData)],o=new u.Slot(s,this,a);this.slots.push(o),this.drawOrder.push(o)}},u.Skeleton.prototype={x:0,y:0,skin:null,r:1,g:1,b:1,a:1,time:0,flipX:!1,flipY:!1,updateWorldTransform:function(){for(var t=this.flipX,e=this.flipY,i=this.bones,r=0,n=i.length;n>r;r++)i[r].updateWorldTransform(t,e)},setToSetupPose:function(){this.setBonesToSetupPose(),this.setSlotsToSetupPose()},setBonesToSetupPose:function(){for(var t=this.bones,e=0,i=t.length;i>e;e++)t[e].setToSetupPose()},setSlotsToSetupPose:function(){for(var t=this.slots,e=0,i=t.length;i>e;e++)t[e].setToSetupPose(e)},getRootBone:function(){return 0==this.bones.length?null:this.bones[0]},findBone:function(t){for(var e=this.bones,i=0,r=e.length;r>i;i++)if(e[i].data.name==t)return e[i];return null},findBoneIndex:function(t){for(var e=this.bones,i=0,r=e.length;r>i;i++)if(e[i].data.name==t)return i;return-1},findSlot:function(t){for(var e=this.slots,i=0,r=e.length;r>i;i++)if(e[i].data.name==t)return e[i];return null},findSlotIndex:function(t){for(var e=this.slots,i=0,r=e.length;r>i;i++)if(e[i].data.name==t)return i;return-1},setSkinByName:function(t){var e=this.data.findSkin(t);if(!e)throw"Skin not found: "+t;this.setSkin(e)},setSkin:function(t){this.skin&&t&&t._attachAll(this,this.skin),this.skin=t},getAttachmentBySlotName:function(t,e){return this.getAttachmentBySlotIndex(this.data.findSlotIndex(t),e)},getAttachmentBySlotIndex:function(t,e){if(this.skin){var i=this.skin.getAttachment(t,e);if(i)return i}return this.data.defaultSkin?this.data.defaultSkin.getAttachment(t,e):null},setAttachment:function(t,e){for(var i=this.slots,r=0,n=i.size;n>r;r++){var s=i[r];if(s.data.name==t){var a=null;if(e&&(a=this.getAttachment(r,e),null==a))throw"Attachment not found: "+e+", for slot: "+t;return s.setAttachment(a),void 0}}throw"Slot not found: "+t},update:function(t){time+=t}},u.AttachmentType={region:0},u.RegionAttachment=function(){this.offset=[],this.offset.length=8,this.uvs=[],this.uvs.length=8},u.RegionAttachment.prototype={x:0,y:0,rotation:0,scaleX:1,scaleY:1,width:0,height:0,rendererObject:null,regionOffsetX:0,regionOffsetY:0,regionWidth:0,regionHeight:0,regionOriginalWidth:0,regionOriginalHeight:0,setUVs:function(t,e,i,r,n){var s=this.uvs;n?(s[2]=t,s[3]=r,s[4]=t,s[5]=e,s[6]=i,s[7]=e,s[0]=i,s[1]=r):(s[0]=t,s[1]=r,s[2]=t,s[3]=e,s[4]=i,s[5]=e,s[6]=i,s[7]=r)},updateOffset:function(){var t=this.width/this.regionOriginalWidth*this.scaleX,e=this.height/this.regionOriginalHeight*this.scaleY,i=-this.width/2*this.scaleX+this.regionOffsetX*t,r=-this.height/2*this.scaleY+this.regionOffsetY*e,n=i+this.regionWidth*t,s=r+this.regionHeight*e,a=this.rotation*Math.PI/180,o=Math.cos(a),h=Math.sin(a),l=i*o+this.x,u=i*h,c=r*o+this.y,d=r*h,p=n*o+this.x,f=n*h,m=s*o+this.y,v=s*h,g=this.offset;g[0]=l-d,g[1]=c+u,g[2]=l-v,g[3]=m+u,g[4]=p-v,g[5]=m+f,g[6]=p-d,g[7]=c+f -},computeVertices:function(t,e,i,r){t+=i.worldX,e+=i.worldY;var n=i.m00,s=i.m01,a=i.m10,o=i.m11,h=this.offset;r[0]=h[0]*n+h[1]*s+t,r[1]=h[0]*a+h[1]*o+e,r[2]=h[2]*n+h[3]*s+t,r[3]=h[2]*a+h[3]*o+e,r[4]=h[4]*n+h[5]*s+t,r[5]=h[4]*a+h[5]*o+e,r[6]=h[6]*n+h[7]*s+t,r[7]=h[6]*a+h[7]*o+e}},u.AnimationStateData=function(t){this.skeletonData=t,this.animationToMixTime={}},u.AnimationStateData.prototype={setMixByName:function(t,e,i){var r=this.skeletonData.findAnimation(t);if(!r)throw"Animation not found: "+t;var n=this.skeletonData.findAnimation(e);if(!n)throw"Animation not found: "+e;this.setMix(r,n,i)},setMix:function(t,e,i){this.animationToMixTime[t.name+":"+e.name]=i},getMix:function(t,e){var i=this.animationToMixTime[t.name+":"+e.name];return i?i:0}},u.AnimationState=function(t){this.data=t,this.queue=[]},u.AnimationState.prototype={current:null,previous:null,currentTime:0,previousTime:0,currentLoop:!1,previousLoop:!1,mixTime:0,mixDuration:0,update:function(t){if(this.currentTime+=t,this.previousTime+=t,this.mixTime+=t,this.queue.length>0){var e=this.queue[0];this.currentTime>=e.delay&&(this._setAnimation(e.animation,e.loop),this.queue.shift())}},apply:function(t){if(this.current)if(this.previous){this.previous.apply(t,this.previousTime,this.previousLoop);var e=this.mixTime/this.mixDuration;e>=1&&(e=1,this.previous=null),this.current.mix(t,this.currentTime,this.currentLoop,e)}else this.current.apply(t,this.currentTime,this.currentLoop)},clearAnimation:function(){this.previous=null,this.current=null,this.queue.length=0},_setAnimation:function(t,e){this.previous=null,t&&this.current&&(this.mixDuration=this.data.getMix(this.current,t),this.mixDuration>0&&(this.mixTime=0,this.previous=this.current,this.previousTime=this.currentTime,this.previousLoop=this.currentLoop)),this.current=t,this.currentLoop=e,this.currentTime=0},setAnimationByName:function(t,e){var i=this.data.skeletonData.findAnimation(t);if(!i)throw"Animation not found: "+t;this.setAnimation(i,e)},setAnimation:function(t,e){this.queue.length=0,this._setAnimation(t,e)},addAnimationByName:function(t,e,i){var r=this.data.skeletonData.findAnimation(t);if(!r)throw"Animation not found: "+t;this.addAnimation(r,e,i)},addAnimation:function(t,e,i){var r={};if(r.animation=t,r.loop=e,!i||0>=i){var n=0==this.queue.length?this.current:this.queue[this.queue.length-1].animation;i=null!=n?n.duration-this.data.getMix(n,t)+(i||0):0}r.delay=i,this.queue.push(r)},isComplete:function(){return!this.current||this.currentTime>=this.current.duration}},u.SkeletonJson=function(t){this.attachmentLoader=t},u.SkeletonJson.prototype={scale:1,readSkeletonData:function(t){for(var e=new u.SkeletonData,i=t.bones,r=0,n=i.length;n>r;r++){var s=i[r],a=null;if(s.parent&&(a=e.findBone(s.parent),!a))throw"Parent bone not found: "+s.parent;var o=new u.BoneData(s.name,a);o.length=(s.length||0)*this.scale,o.x=(s.x||0)*this.scale,o.y=(s.y||0)*this.scale,o.rotation=s.rotation||0,o.scaleX=s.scaleX||1,o.scaleY=s.scaleY||1,e.bones.push(o)}for(var h=t.slots,r=0,n=h.length;n>r;r++){var l=h[r],o=e.findBone(l.bone);if(!o)throw"Slot bone not found: "+l.bone;var c=new u.SlotData(l.name,o),d=l.color;d&&(c.r=u.SkeletonJson.toColor(d,0),c.g=u.SkeletonJson.toColor(d,1),c.b=u.SkeletonJson.toColor(d,2),c.a=u.SkeletonJson.toColor(d,3)),c.attachmentName=l.attachment,e.slots.push(c)}var p=t.skins;for(var f in p)if(p.hasOwnProperty(f)){var m=p[f],v=new u.Skin(f);for(var g in m)if(m.hasOwnProperty(g)){var x=e.findSlotIndex(g),b=m[g];for(var T in b)if(b.hasOwnProperty(T)){var y=this.readAttachment(v,T,b[T]);null!=y&&v.addAttachment(x,T,y)}}e.skins.push(v),"default"==v.name&&(e.defaultSkin=v)}var w=t.animations;for(var _ in w)w.hasOwnProperty(_)&&this.readAnimation(_,w[_],e);return e},readAttachment:function(t,e,i){e=i.name||e;var r=u.AttachmentType[i.type||"region"],n=new u.RegionAttachment;return n.name=e,r==u.AttachmentType.region&&(n.x=(i.x||0)*this.scale,n.y=(i.y||0)*this.scale,n.scaleX=i.scaleX||1,n.scaleY=i.scaleY||1,n.rotation=i.rotation||0,n.width=(i.width||32)*this.scale,n.height=(i.height||32)*this.scale,n.updateOffset()),n},readAnimation:function(t,e,i){var r=[],n=0,s=e.bones;for(var a in s)if(s.hasOwnProperty(a)){var o=i.findBoneIndex(a);if(-1==o)throw"Bone not found: "+a;var h=s[a];for(var l in h)if(h.hasOwnProperty(l)){var c=h[l];if("rotate"==l){var d=new u.RotateTimeline(c.length);d.boneIndex=o;for(var p=0,f=0,m=c.length;m>f;f++){var v=c[f];d.setFrame(p,v.time,v.angle),u.SkeletonJson.readCurve(d,p,v),p++}r.push(d),n=Math.max(n,d.frames[2*d.getFrameCount()-2])}else{if("translate"!=l&&"scale"!=l)throw"Invalid timeline type for a bone: "+l+" ("+a+")";var d,g=1;"scale"==l?d=new u.ScaleTimeline(c.length):(d=new u.TranslateTimeline(c.length),g=this.scale),d.boneIndex=o;for(var p=0,f=0,m=c.length;m>f;f++){var v=c[f],x=(v.x||0)*g,b=(v.y||0)*g;d.setFrame(p,v.time,x,b),u.SkeletonJson.readCurve(d,p,v),p++}r.push(d),n=Math.max(n,d.frames[3*d.getFrameCount()-3])}}}var T=e.slots;for(var y in T)if(T.hasOwnProperty(y)){var w=T[y],_=i.findSlotIndex(y);for(var l in w)if(w.hasOwnProperty(l)){var c=w[l];if("color"==l){var d=new u.ColorTimeline(c.length);d.slotIndex=_;for(var p=0,f=0,m=c.length;m>f;f++){var v=c[f],R=v.color,A=u.SkeletonJson.toColor(R,0),S=u.SkeletonJson.toColor(R,1),L=u.SkeletonJson.toColor(R,2),C=u.SkeletonJson.toColor(R,3);d.setFrame(p,v.time,A,S,L,C),u.SkeletonJson.readCurve(d,p,v),p++}r.push(d),n=Math.max(n,d.frames[5*d.getFrameCount()-5])}else{if("attachment"!=l)throw"Invalid timeline type for a slot: "+l+" ("+y+")";var d=new u.AttachmentTimeline(c.length);d.slotIndex=_;for(var p=0,f=0,m=c.length;m>f;f++){var v=c[f];d.setFrame(p++,v.time,v.name)}r.push(d),n=Math.max(n,d.frames[Math.floor(d.getFrameCount())-1])}}}i.animations.push(new u.Animation(t,r,n))}},u.SkeletonJson.readCurve=function(t,e,i){var r=i.curve;r&&("stepped"==r?t.curves.setStepped(e):r instanceof Array&&t.curves.setCurve(e,r[0],r[1],r[2],r[3]))},u.SkeletonJson.toColor=function(t,e){if(8!=t.length)throw"Color hexidecimal length must be 8, recieved: "+t;return parseInt(t.substring(2*e,2),16)/255},u.Atlas=function(t,e){this.textureLoader=e,this.pages=[],this.regions=[];var i=new u.AtlasReader(t),r=[];r.length=4;for(var n=null;;){var s=i.readLine();if(null==s)break;if(s=i.trim(s),0==s.length)n=null;else if(n){var a=new u.AtlasRegion;a.name=s,a.page=n,a.rotate="true"==i.readValue(),i.readTuple(r);var o=parseInt(r[0]),h=parseInt(r[1]);i.readTuple(r);var l=parseInt(r[0]),c=parseInt(r[1]);a.u=o/n.width,a.v=h/n.height,a.rotate?(a.u2=(o+c)/n.width,a.v2=(h+l)/n.height):(a.u2=(o+l)/n.width,a.v2=(h+c)/n.height),a.x=o,a.y=h,a.width=Math.abs(l),a.height=Math.abs(c),4==i.readTuple(r)&&(a.splits=[parseInt(r[0]),parseInt(r[1]),parseInt(r[2]),parseInt(r[3])],4==i.readTuple(r)&&(a.pads=[parseInt(r[0]),parseInt(r[1]),parseInt(r[2]),parseInt(r[3])],i.readTuple(r))),a.originalWidth=parseInt(r[0]),a.originalHeight=parseInt(r[1]),i.readTuple(r),a.offsetX=parseInt(r[0]),a.offsetY=parseInt(r[1]),a.index=parseInt(i.readValue()),this.regions.push(a)}else{n=new u.AtlasPage,n.name=s,n.format=u.Atlas.Format[i.readValue()],i.readTuple(r),n.minFilter=u.Atlas.TextureFilter[r[0]],n.magFilter=u.Atlas.TextureFilter[r[1]];var d=i.readValue();n.uWrap=u.Atlas.TextureWrap.clampToEdge,n.vWrap=u.Atlas.TextureWrap.clampToEdge,"x"==d?n.uWrap=u.Atlas.TextureWrap.repeat:"y"==d?n.vWrap=u.Atlas.TextureWrap.repeat:"xy"==d&&(n.uWrap=n.vWrap=u.Atlas.TextureWrap.repeat),e.load(n,s),this.pages.push(n)}}},u.Atlas.prototype={findRegion:function(t){for(var e=this.regions,i=0,r=e.length;r>i;i++)if(e[i].name==t)return e[i];return null},dispose:function(){for(var t=this.pages,e=0,i=t.length;i>e;e++)this.textureLoader.unload(t[e].rendererObject)},updateUVs:function(t){for(var e=this.regions,i=0,r=e.length;r>i;i++){var n=e[i];n.page==t&&(n.u=n.x/t.width,n.v=n.y/t.height,n.rotate?(n.u2=(n.x+n.height)/t.width,n.v2=(n.y+n.width)/t.height):(n.u2=(n.x+n.width)/t.width,n.v2=(n.y+n.height)/t.height))}}},u.Atlas.Format={alpha:0,intensity:1,luminanceAlpha:2,rgb565:3,rgba4444:4,rgb888:5,rgba8888:6},u.Atlas.TextureFilter={nearest:0,linear:1,mipMap:2,mipMapNearestNearest:3,mipMapLinearNearest:4,mipMapNearestLinear:5,mipMapLinearLinear:6},u.Atlas.TextureWrap={mirroredRepeat:0,clampToEdge:1,repeat:2},u.AtlasPage=function(){},u.AtlasPage.prototype={name:null,format:null,minFilter:null,magFilter:null,uWrap:null,vWrap:null,rendererObject:null,width:0,height:0},u.AtlasRegion=function(){},u.AtlasRegion.prototype={page:null,name:null,x:0,y:0,width:0,height:0,u:0,v:0,u2:0,v2:0,offsetX:0,offsetY:0,originalWidth:0,originalHeight:0,index:0,rotate:!1,splits:null,pads:null},u.AtlasReader=function(t){this.lines=t.split(/\r\n|\r|\n/)},u.AtlasReader.prototype={index:0,trim:function(t){return t.replace(/^\s+|\s+$/g,"")},readLine:function(){return this.index>=this.lines.length?null:this.lines[this.index++]},readValue:function(){var t=this.readLine(),e=t.indexOf(":");if(-1==e)throw"Invalid line: "+t;return this.trim(t.substring(e+1))},readTuple:function(t){var e=this.readLine(),i=e.indexOf(":");if(-1==i)throw"Invalid line: "+e;for(var r=0,n=i+1;3>r;r++){var s=e.indexOf(",",n);if(-1==s){if(0==r)throw"Invalid line: "+e;break}t[r]=this.trim(e.substr(n,s-n)),n=s+1}return t[r]=this.trim(e.substring(n)),r+1}},u.AtlasAttachmentLoader=function(t){this.atlas=t},u.AtlasAttachmentLoader.prototype={newAttachment:function(t,e,i){switch(e){case u.AttachmentType.region:var r=this.atlas.findRegion(i);if(!r)throw"Region not found in atlas: "+i+" ("+e+")";var n=new u.RegionAttachment(i);return n.rendererObject=r,n.setUVs(r.u,r.v,r.u2,r.v2,r.rotate),n.regionOffsetX=r.offsetX,n.regionOffsetY=r.offsetY,n.regionWidth=r.width,n.regionHeight=r.height,n.regionOriginalWidth=r.originalWidth,n.regionOriginalHeight=r.originalHeight,n}throw"Unknown attachment type: "+e}},n.AnimCache={},u.Bone.yDown=!0,n.CustomRenderable=function(){n.DisplayObject.call(this)},n.CustomRenderable.constructor=n.CustomRenderable,n.CustomRenderable.prototype=Object.create(n.DisplayObject.prototype),n.CustomRenderable.prototype.renderCanvas=function(){},n.CustomRenderable.prototype.initWebGL=function(){},n.CustomRenderable.prototype.renderWebGL=function(){},n.BaseTextureCache={},n.texturesToUpdate=[],n.texturesToDestroy=[],n.BaseTexture=function(t){if(n.EventTarget.call(this),this.width=100,this.height=100,this.source=t,t){if(this.source instanceof Image)if(this.source.complete)this.hasLoaded=!0,this.width=this.source.width,this.height=this.source.height,n.texturesToUpdate.push(this);else{var e=this;this.source.onload=function(){e.hasLoaded=!0,e.width=e.source.width,e.height=e.source.height,n.texturesToUpdate.push(e),e.dispatchEvent({type:"loaded",content:e})}}else this.hasLoaded=!0,this.width=this.source.width,this.height=this.source.height,n.texturesToUpdate.push(this);this._powerOf2=!1}},n.BaseTexture.constructor=n.BaseTexture,n.BaseTexture.prototype.destroy=function(){this.source instanceof Image&&(this.source.src=null),this.source=null,n.texturesToDestroy.push(this)},n.BaseTexture.fromImage=function(t,e){var i=n.BaseTextureCache[t];if(!i){var r=new Image;e&&(r.crossOrigin=""),r.src=t,i=new n.BaseTexture(r),n.BaseTextureCache[t]=i}return i},n.TextureCache={},n.FrameCache={},n.Texture=function(t,e){if(n.EventTarget.call(this),e||(this.noFrame=!0,e=new n.Rectangle(0,0,1,1)),this.trim=new n.Point,t instanceof n.Texture&&(t=t.baseTexture),this.baseTexture=t,this.frame=e,this.scope=this,t.hasLoaded)this.noFrame&&(e=new n.Rectangle(0,0,t.width,t.height)),this.setFrame(e);else{var i=this;t.addEventListener("loaded",function(){i.onBaseTextureLoaded()})}},n.Texture.constructor=n.Texture,n.Texture.prototype.onBaseTextureLoaded=function(){var t=this.baseTexture;t.removeEventListener("loaded",this.onLoaded),this.noFrame&&(this.frame=new n.Rectangle(0,0,t.width,t.height)),this.noFrame=!1,this.width=this.frame.width,this.height=this.frame.height,this.scope.dispatchEvent({type:"update",content:this})},n.Texture.prototype.destroy=function(t){t&&this.baseTexture.destroy()},n.Texture.prototype.setFrame=function(t){if(this.frame=t,this.width=t.width,this.height=t.height,t.x+t.width>this.baseTexture.width||t.y+t.height>this.baseTexture.height)throw Error("Texture Error: frame does not fit inside the base Texture dimensions "+this);this.updateFrame=!0,n.Texture.frameUpdates.push(this)},n.Texture.fromImage=function(t,e){var i=n.TextureCache[t];return i||(i=new n.Texture(n.BaseTexture.fromImage(t,e)),n.TextureCache[t]=i),i},n.Texture.fromFrame=function(t){var e=n.TextureCache[t];if(!e)throw Error("The frameId '"+t+"' does not exist in the texture cache "+this);return e},n.Texture.fromCanvas=function(t){var e=new n.BaseTexture(t);return new n.Texture(e)},n.Texture.addTextureToCache=function(t,e){n.TextureCache[e]=t},n.Texture.removeTextureFromCache=function(t){var e=n.TextureCache[t];return n.TextureCache[t]=null,e},n.Texture.frameUpdates=[],n.RenderTexture=function(t,e){n.EventTarget.call(this),this.width=t||100,this.height=e||100,this.indetityMatrix=n.mat3.create(),this.frame=new n.Rectangle(0,0,this.width,this.height),n.gl?this.initWebGL():this.initCanvas()},n.RenderTexture.constructor=n.RenderTexture,n.RenderTexture.prototype=Object.create(n.Texture.prototype),n.RenderTexture.prototype.initWebGL=function(){var t=n.gl;this.glFramebuffer=t.createFramebuffer(),t.bindFramebuffer(t.FRAMEBUFFER,this.glFramebuffer),this.glFramebuffer.width=this.width,this.glFramebuffer.height=this.height,this.baseTexture=new n.BaseTexture,this.baseTexture.width=this.width,this.baseTexture.height=this.height,this.baseTexture._glTexture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.baseTexture._glTexture),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,this.width,this.height,0,t.RGBA,t.UNSIGNED_BYTE,null),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),this.baseTexture.isRender=!0,t.bindFramebuffer(t.FRAMEBUFFER,this.glFramebuffer),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,this.baseTexture._glTexture,0),this.projectionMatrix=n.mat4.create(),this.projectionMatrix[5]=2/this.height,this.projectionMatrix[13]=-1,this.projectionMatrix[0]=2/this.width,this.projectionMatrix[12]=-1,this.render=this.renderWebGL},n.RenderTexture.prototype.initCanvas=function(){this.renderer=new n.CanvasRenderer(this.width,this.height,null,0),this.baseTexture=new n.BaseTexture(this.renderer.view),this.frame=new n.Rectangle(0,0,this.width,this.height),this.render=this.renderCanvas},n.RenderTexture.prototype.renderWebGL=function(t,e){var i=n.gl;i.colorMask(!0,!0,!0,!0),i.viewport(0,0,this.width,this.height),i.bindFramebuffer(i.FRAMEBUFFER,this.glFramebuffer),e&&(i.clearColor(0,0,0,0),i.clear(i.COLOR_BUFFER_BIT));var r=t.children;t.worldTransform=n.mat3.create();for(var s=0,a=r.length;a>s;s++)r[s].updateTransform();var o=t.__renderGroup;o?t==o.root?o.render(this.projectionMatrix):o.renderSpecific(t,this.projectionMatrix):(this.renderGroup||(this.renderGroup=new n.WebGLRenderGroup(i)),this.renderGroup.setRenderable(t),this.renderGroup.render(this.projectionMatrix))},n.RenderTexture.prototype.renderCanvas=function(t,e){var i=t.children;t.worldTransform=n.mat3.create();for(var r=0,s=i.length;s>r;r++)i[r].updateTransform();e&&this.renderer.context.clearRect(0,0,this.width,this.height),this.renderer.renderDisplayObject(t),n.texturesToUpdate.push(this.baseTexture)},n.AssetLoader=function(t){n.EventTarget.call(this),this.assetURLs=t,this.crossorigin=!1,this.loadersByType={jpg:n.ImageLoader,jpeg:n.ImageLoader,png:n.ImageLoader,gif:n.ImageLoader,json:n.JsonLoader,anim:n.SpineLoader,xml:n.BitmapFontLoader,fnt:n.BitmapFontLoader}},n.AssetLoader.constructor=n.AssetLoader,n.AssetLoader.prototype.load=function(){var t=this;this.loadCount=this.assetURLs.length;for(var e=0;this.assetURLs.length>e;e++){var i=this.assetURLs[e],r=i.split(".").pop().toLowerCase(),n=this.loadersByType[r];if(!n)throw Error(r+" is an unsupported file type");var s=new n(i,this.crossorigin);s.addEventListener("loaded",function(){t.onAssetLoaded()}),s.load()}},n.AssetLoader.prototype.onAssetLoaded=function(){this.loadCount--,this.dispatchEvent({type:"onProgress",content:this}),this.onProgress&&this.onProgress(),0==this.loadCount&&(this.dispatchEvent({type:"onComplete",content:this}),this.onComplete&&this.onComplete())},n.JsonLoader=function(t,e){n.EventTarget.call(this),this.url=t,this.baseUrl=t.replace(/[^\/]*$/,""),this.crossorigin=e,this.loaded=!1},n.JsonLoader.constructor=n.JsonLoader,n.JsonLoader.prototype.load=function(){this.ajaxRequest=new l;var t=this;this.ajaxRequest.onreadystatechange=function(){t.onJSONLoaded()},this.ajaxRequest.open("GET",this.url,!0),this.ajaxRequest.overrideMimeType&&this.ajaxRequest.overrideMimeType("application/json"),this.ajaxRequest.send(null)},n.JsonLoader.prototype.onJSONLoaded=function(){if(4==this.ajaxRequest.readyState)if(200==this.ajaxRequest.status||-1==window.location.href.indexOf("http"))if(this.json=JSON.parse(this.ajaxRequest.responseText),this.json.frames){var t=this,e=this.baseUrl+this.json.meta.image,i=new n.ImageLoader(e,this.crossorigin),r=this.json.frames;this.texture=i.texture.baseTexture,i.addEventListener("loaded",function(){t.onLoaded()});for(var s in r){var a=r[s].frame;a&&(n.TextureCache[s]=new n.Texture(this.texture,{x:a.x,y:a.y,width:a.w,height:a.h}),r[s].trimmed&&(n.TextureCache[s].realSize=r[s].spriteSourceSize,n.TextureCache[s].trim.x=0))}i.load()}else if(this.json.bones){var o=new u.SkeletonJson,h=o.readSkeletonData(this.json);n.AnimCache[this.url]=h,this.onLoaded()}else this.onLoaded();else this.onError()},n.JsonLoader.prototype.onLoaded=function(){this.loaded=!0,this.dispatchEvent({type:"loaded",content:this})},n.JsonLoader.prototype.onError=function(){this.dispatchEvent({type:"error",content:this})},n.SpriteSheetLoader=function(t,e){n.EventTarget.call(this),this.url=t,this.baseUrl=t.replace(/[^\/]*$/,""),this.texture=null,this.frames={},this.crossorigin=e},n.SpriteSheetLoader.constructor=n.SpriteSheetLoader,n.SpriteSheetLoader.prototype.load=function(){var t=this,e=new n.JsonLoader(this.url,this.crossorigin);e.addEventListener("loaded",function(e){t.json=e.content.json,t.onJSONLoaded()}),e.load()},n.SpriteSheetLoader.prototype.onJSONLoaded=function(){var t=this,e=this.baseUrl+this.json.meta.image,i=new n.ImageLoader(e,this.crossorigin),r=this.json.frames;this.texture=i.texture.baseTexture,i.addEventListener("loaded",function(){t.onLoaded()});for(var s in r){var a=r[s].frame;a&&(n.TextureCache[s]=new n.Texture(this.texture,{x:a.x,y:a.y,width:a.w,height:a.h}),r[s].trimmed&&(n.TextureCache[s].realSize=r[s].spriteSourceSize,n.TextureCache[s].trim.x=0))}i.load()},n.SpriteSheetLoader.prototype.onLoaded=function(){this.dispatchEvent({type:"loaded",content:this})},n.ImageLoader=function(t,e){n.EventTarget.call(this),this.texture=n.Texture.fromImage(t,e)},n.ImageLoader.constructor=n.ImageLoader,n.ImageLoader.prototype.load=function(){if(this.texture.baseTexture.hasLoaded)this.onLoaded();else{var t=this;this.texture.baseTexture.addEventListener("loaded",function(){t.onLoaded()})}},n.ImageLoader.prototype.onLoaded=function(){this.dispatchEvent({type:"loaded",content:this})},n.BitmapFontLoader=function(t,e){n.EventTarget.call(this),this.url=t,this.baseUrl=t.replace(/[^\/]*$/,""),this.texture=null,this.crossorigin=e},n.BitmapFontLoader.constructor=n.BitmapFontLoader,n.BitmapFontLoader.prototype.load=function(){this.ajaxRequest=new XMLHttpRequest;var t=this;this.ajaxRequest.onreadystatechange=function(){t.onXMLLoaded()},this.ajaxRequest.open("GET",this.url,!0),this.ajaxRequest.overrideMimeType&&this.ajaxRequest.overrideMimeType("application/xml"),this.ajaxRequest.send(null)},n.BitmapFontLoader.prototype.onXMLLoaded=function(){if(4==this.ajaxRequest.readyState&&(200==this.ajaxRequest.status||-1==window.location.href.indexOf("http"))){var t=this.baseUrl+this.ajaxRequest.responseXML.getElementsByTagName("page")[0].attributes.getNamedItem("file").nodeValue,e=new n.ImageLoader(t,this.crossorigin);this.texture=e.texture.baseTexture;var i={},r=this.ajaxRequest.responseXML.getElementsByTagName("info")[0],s=this.ajaxRequest.responseXML.getElementsByTagName("common")[0];i.font=r.attributes.getNamedItem("face").nodeValue,i.size=parseInt(r.attributes.getNamedItem("size").nodeValue,10),i.lineHeight=parseInt(s.attributes.getNamedItem("lineHeight").nodeValue,10),i.chars={};for(var a=this.ajaxRequest.responseXML.getElementsByTagName("char"),o=0;a.length>o;o++){var h=parseInt(a[o].attributes.getNamedItem("id").nodeValue,10),l={x:parseInt(a[o].attributes.getNamedItem("x").nodeValue,10),y:parseInt(a[o].attributes.getNamedItem("y").nodeValue,10),width:parseInt(a[o].attributes.getNamedItem("width").nodeValue,10),height:parseInt(a[o].attributes.getNamedItem("height").nodeValue,10)};n.TextureCache[h]=new n.Texture(this.texture,l),i.chars[h]={xOffset:parseInt(a[o].attributes.getNamedItem("xoffset").nodeValue,10),yOffset:parseInt(a[o].attributes.getNamedItem("yoffset").nodeValue,10),xAdvance:parseInt(a[o].attributes.getNamedItem("xadvance").nodeValue,10),kerning:{},texture:new n.Texture(this.texture,l)}}var u=this.ajaxRequest.responseXML.getElementsByTagName("kerning");for(o=0;u.length>o;o++){var c=parseInt(u[o].attributes.getNamedItem("first").nodeValue,10),d=parseInt(u[o].attributes.getNamedItem("second").nodeValue,10),p=parseInt(u[o].attributes.getNamedItem("amount").nodeValue,10);i.chars[d].kerning[c]=p}n.BitmapText.fonts[i.font]=i;var f=this;e.addEventListener("loaded",function(){f.onLoaded()}),e.load()}},n.BitmapFontLoader.prototype.onLoaded=function(){this.dispatchEvent({type:"loaded",content:this})},n.SpineLoader=function(t,e){n.EventTarget.call(this),this.url=t,this.crossorigin=e,this.loaded=!1},n.SpineLoader.constructor=n.SpineLoader,n.SpineLoader.prototype.load=function(){new n.JsonLoader(this.url,this.crossorigin),jsonLoader.addEventListener("loaded",function(t){scope.json=t.content.json,scope.onJSONLoaded()}),jsonLoader.load()},n.SpineLoader.prototype.load=function(){var t=this,e=new n.JsonLoader(this.url,this.crossorigin);e.addEventListener("loaded",function(e){t.json=e.content.json,t.onJSONLoaded()}),e.load()},n.SpineLoader.prototype.onJSONLoaded=function(){var t=new u.SkeletonJson,e=t.readSkeletonData(this.json);n.AnimCache[this.url]=e,this.onLoaded()},n.SpineLoader.prototype.onLoaded=function(){this.loaded=!0,this.dispatchEvent({type:"loaded",content:this})},"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=n),exports.PIXI=n):i.PIXI=n}).call(this); \ No newline at end of file +(function(){function t(){return o.Matrix="undefined"!=typeof Float32Array?Float32Array:Array,o.Matrix}function e(t){return[(255&t>>16)/255,(255&t>>8)/255,(255&t)/255]}function e(t){return[(255&t>>16)/255,(255&t>>8)/255,(255&t)/255]}function i(t,e){return new o.Point(-(t.y-e.y),t.x-e.x)}function n(t,e,i,r){var n,s,a,h,l,u,c;s=e.y-t.y,h=t.x-e.x,u=e.x*t.y-t.x*e.y,a=r.y-i.y,l=i.x-r.x,c=r.x*i.y-i.x*r.y;var d=s*l-a*h;return 0==d&&(console.log("!"),d+=1),n=new o.Point,n.x=(h*c-l*u)/d,n.y=(a*u-s*c)/d,n}var s=this,o=o||{};o.Point=function(t,e){this.x=t||0,this.y=e||0},o.Point.prototype.clone=function(){return new o.Point(this.x,this.y)},o.Point.constructor=o.Point,o.Rectangle=function(t,e,i,r){this.x=t||0,this.y=e||0,this.width=i||0,this.height=r||0},o.Rectangle.prototype.clone=function(){return new o.Rectangle(this.x,this.y,this.width,this.height)},o.Rectangle.constructor=o.Rectangle,o.Polygon=function(t){this.points=t},o.Polygon.clone=function(){for(var t=[],e=0;this.points.length>e;e++)t.push(this.points[e].clone());return new o.Polygon(t)},o.Polygon.constructor=o.Polygon,t(),o.mat3={},o.mat3.create=function(){var t=new o.Matrix(9);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},o.mat4={},o.mat4.create=function(){var t=new o.Matrix(16);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},o.mat3.multiply=function(t,e,i){i||(i=t);var r=t[0],n=t[1],s=t[2],a=t[3],o=t[4],h=t[5],l=t[6],u=t[7],c=t[8],d=e[0],p=e[1],f=e[2],v=e[3],m=e[4],g=e[5],x=e[6],b=e[7],y=e[8];return i[0]=d*r+p*a+f*l,i[1]=d*n+p*o+f*u,i[2]=d*s+p*h+f*c,i[3]=v*r+m*a+g*l,i[4]=v*n+m*o+g*u,i[5]=v*s+m*h+g*c,i[6]=x*r+b*a+y*l,i[7]=x*n+b*o+y*u,i[8]=x*s+b*h+y*c,i},o.mat3.toMat4=function(t,e){return e||(e=o.mat4.create()),e[15]=1,e[14]=0,e[13]=0,e[12]=0,e[11]=0,e[10]=t[8],e[9]=t[7],e[8]=t[6],e[7]=0,e[6]=t[5],e[5]=t[4],e[4]=t[3],e[3]=0,e[2]=t[2],e[1]=t[1],e[0]=t[0],e},o.mat4.create=function(){var t=new o.Matrix(16);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},o.mat4.transpose=function(t,e){if(!e||t===e){var i=t[1],r=t[2],n=t[3],s=t[6],a=t[7],o=t[11];return t[1]=t[4],t[2]=t[8],t[3]=t[12],t[4]=i,t[6]=t[9],t[7]=t[13],t[8]=r,t[9]=s,t[11]=t[14],t[12]=n,t[13]=a,t[14]=o,t}return e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15],e},o.mat4.multiply=function(t,e,i){i||(i=t);var r=t[0],n=t[1],s=t[2],a=t[3],o=t[4],h=t[5],l=t[6],u=t[7],c=t[8],d=t[9],p=t[10],f=t[11],v=t[12],m=t[13],g=t[14],x=t[15],b=e[0],y=e[1],T=e[2],w=e[3];return i[0]=b*r+y*o+T*c+w*v,i[1]=b*n+y*h+T*d+w*m,i[2]=b*s+y*l+T*p+w*g,i[3]=b*a+y*u+T*f+w*x,b=e[4],y=e[5],T=e[6],w=e[7],i[4]=b*r+y*o+T*c+w*v,i[5]=b*n+y*h+T*d+w*m,i[6]=b*s+y*l+T*p+w*g,i[7]=b*a+y*u+T*f+w*x,b=e[8],y=e[9],T=e[10],w=e[11],i[8]=b*r+y*o+T*c+w*v,i[9]=b*n+y*h+T*d+w*m,i[10]=b*s+y*l+T*p+w*g,i[11]=b*a+y*u+T*f+w*x,b=e[12],y=e[13],T=e[14],w=e[15],i[12]=b*r+y*o+T*c+w*v,i[13]=b*n+y*h+T*d+w*m,i[14]=b*s+y*l+T*p+w*g,i[15]=b*a+y*u+T*f+w*x,i},o.DisplayObject=function(){this.position=new o.Point,this.scale=new o.Point(1,1),this.pivot=new o.Point(0,0),this.rotation=0,this.alpha=1,this.visible=!0,this.worldVisible=!1,this.parent=null,this.stage=null,this.hitArea=null,this.worldAlpha=1,this.color=[],this.worldTransform=o.mat3.create(),this.localTransform=o.mat3.create(),this.dynamic=!0,this._sr=0,this._cr=1,this.childIndex=0,this.renderable=!1,this.interactive=!1,this.buttonMode=!1},o.DisplayObject.constructor=o.DisplayObject,o.DisplayObject.prototype.setInteractive=function(t){this.interactive=t,this.stage&&(this.stage.dirty=!0)},o.DisplayObject.prototype.updateTransform=function(){this.rotation!=this.rotationCache&&(this.rotationCache=this.rotation,this._sr=Math.sin(this.rotation),this._cr=Math.cos(this.rotation));var t=this.localTransform,e=this.parent.worldTransform,i=this.worldTransform;t[0]=this._cr*this.scale.x,t[1]=-this._sr*this.scale.y,t[3]=this._sr*this.scale.x,t[4]=this._cr*this.scale.y;var r=this.pivot.x,n=this.pivot.y;t[2]=this.position.x-t[0]*r-n*t[1],t[5]=this.position.y-t[4]*n-r*t[3];var s=t[0],a=t[1],o=t[2],h=t[3],l=t[4],u=t[5],c=e[0],d=e[1],p=e[2],f=e[3],v=e[4],m=e[5];i[0]=c*s+d*h,i[1]=c*a+d*l,i[2]=c*o+d*u+p,i[3]=f*s+v*h,i[4]=f*a+v*l,i[5]=f*o+v*u+m,this.worldAlpha=this.alpha*this.parent.worldAlpha},o.DisplayObjectContainer=function(){o.DisplayObject.call(this),this.children=[],this.renderable=!1},o.DisplayObjectContainer.constructor=o.DisplayObjectContainer,o.DisplayObjectContainer.prototype=Object.create(o.DisplayObject.prototype),o.DisplayObjectContainer.prototype.addChild=function(t){void 0!=t.parent&&t.parent.removeChild(t),t.parent=this,t.childIndex=this.children.length,this.children.push(t),this.stage&&this.stage.__addChild(t),this.__renderGroup&&(t.__renderGroup&&t.__renderGroup.removeDisplayObjectAndChildren(t),this.__renderGroup.addDisplayObjectAndChildren(t))},o.DisplayObjectContainer.prototype.addChildAt=function(t,e){if(!(e>=0&&this.children.length>=e))throw Error(t+" The index "+e+" supplied is out of bounds "+this.children.length);void 0!=t.parent&&t.parent.removeChild(t),e==this.children.length?this.children.push(t):this.children.splice(e,0,t),t.parent=this,t.childIndex=e;for(var i=this.children.length,r=e;i>r;r++)this.children[r].childIndex=r;this.stage&&this.stage.__addChild(t),this.__renderGroup&&(t.__renderGroup&&t.__renderGroup.removeDisplayObjectAndChildren(t),this.__renderGroup.addDisplayObjectAndChildren(t))},o.DisplayObjectContainer.prototype.swapChildren=function(t,e){var i=this.children.indexOf(t),r=this.children.indexOf(e);if(-1===i||-1===r)throw Error(t+" Both the supplied DisplayObjects must be a child of the caller "+this);this.stage&&(this.stage.__removeChild(t),this.stage.__removeChild(e),this.stage.__addChild(t),this.stage.__addChild(e)),t.childIndex=r,e.childIndex=i,this.children[i]=e,this.children[r]=t},o.DisplayObjectContainer.prototype.getChildAt=function(t){if(t>=0&&this.children.length>t)return this.children[t];throw Error(child+" Both the supplied DisplayObjects must be a child of the caller "+this)},o.DisplayObjectContainer.prototype.removeChild=function(t){var e=this.children.indexOf(t);if(-1===e)throw Error(t+" The supplied DisplayObject must be a child of the caller "+this);this.stage&&this.stage.__removeChild(t),t.__renderGroup&&t.__renderGroup.removeDisplayObjectAndChildren(t),t.parent=void 0,this.children.splice(e,1);for(var i=e,r=this.children.length;r>i;i++)this.children[i].childIndex-=1},o.DisplayObjectContainer.prototype.updateTransform=function(){if(this.visible){o.DisplayObject.prototype.updateTransform.call(this);for(var t=0,e=this.children.length;e>t;t++)this.children[t].updateTransform()}},o.blendModes={},o.blendModes.NORMAL=0,o.blendModes.SCREEN=1,o.Sprite=function(t){o.DisplayObjectContainer.call(this),this.anchor=new o.Point,this.texture=t,this.blendMode=o.blendModes.NORMAL,this._width=0,this._height=0,t.baseTexture.hasLoaded?this.updateFrame=!0:(this.onTextureUpdateBind=this.onTextureUpdate.bind(this),this.texture.addEventListener("update",this.onTextureUpdateBind)),this.renderable=!0},o.Sprite.constructor=o.Sprite,o.Sprite.prototype=Object.create(o.DisplayObjectContainer.prototype),Object.defineProperty(o.Sprite.prototype,"width",{get:function(){return this.scale.x*this.texture.frame.width},set:function(t){this.scale.x=t/this.texture.frame.width,this._width=t}}),Object.defineProperty(o.Sprite.prototype,"height",{get:function(){return this.scale.y*this.texture.frame.height},set:function(t){this.scale.y=t/this.texture.frame.height,this._height=t}}),o.Sprite.prototype.setTexture=function(t){this.texture.baseTexture!=t.baseTexture&&(this.textureChange=!0),this.texture=t,this.updateFrame=!0},o.Sprite.prototype.onTextureUpdate=function(){this._width&&(this.scale.x=this._width/this.texture.frame.width),this._height&&(this.scale.y=this._height/this.texture.frame.height),this.updateFrame=!0},o.Sprite.fromFrame=function(t){var e=o.TextureCache[t];if(!e)throw Error("The frameId '"+t+"' does not exist in the texture cache"+this);return new o.Sprite(e)},o.Sprite.fromImage=function(t){var e=o.Texture.fromImage(t);return new o.Sprite(e)},o.MovieClip=function(t){o.Sprite.call(this,t[0]),this.textures=t,this.currentFrame=0,this.animationSpeed=1,this.loop=!0,this.onComplete=null,this.playing},o.MovieClip.constructor=o.MovieClip,o.MovieClip.prototype=Object.create(o.Sprite.prototype),o.MovieClip.prototype.stop=function(){this.playing=!1},o.MovieClip.prototype.play=function(){this.playing=!0},o.MovieClip.prototype.gotoAndStop=function(t){this.playing=!1,this.currentFrame=t;var e=0|this.currentFrame+.5;this.setTexture(this.textures[e%this.textures.length])},o.MovieClip.prototype.gotoAndPlay=function(t){this.currentFrame=t,this.playing=!0},o.MovieClip.prototype.updateTransform=function(){if(o.Sprite.prototype.updateTransform.call(this),this.playing){this.currentFrame+=this.animationSpeed;var t=0|this.currentFrame+.5;this.loop||this.textures.length>t?this.setTexture(this.textures[t%this.textures.length]):t>=this.textures.length&&(this.gotoAndStop(this.textures.length-1),this.onComplete&&this.onComplete())}},o.Text=function(t,e){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"),o.Sprite.call(this,o.Texture.fromCanvas(this.canvas)),this.setText(t),this.setStyle(e),this.updateText(),this.dirty=!1},o.Text.constructor=o.Text,o.Text.prototype=Object.create(o.Sprite.prototype),o.Text.prototype.setStyle=function(t){t=t||{},t.font=t.font||"bold 20pt Arial",t.fill=t.fill||"black",t.align=t.align||"left",t.stroke=t.stroke||"black",t.strokeThickness=t.strokeThickness||0,t.wordWrap=t.wordWrap||!1,t.wordWrapWidth=t.wordWrapWidth||100,this.style=t,this.dirty=!0},o.Sprite.prototype.setText=function(t){this.text=""+t||" ",this.dirty=!0},o.Text.prototype.updateText=function(){this.context.font=this.style.font;var t=this.text;this.style.wordWrap&&(t=this.wordWrap(this.text));for(var e=t.split(/(?:\r\n|\r|\n)/),i=[],r=0,n=0;e.length>n;n++){var s=this.context.measureText(e[n]).width;i[n]=s,r=Math.max(r,s)}this.canvas.width=r+this.style.strokeThickness;var a=this.determineFontHeight("font: "+this.style.font+";")+this.style.strokeThickness;for(this.canvas.height=a*e.length,this.context.fillStyle=this.style.fill,this.context.font=this.style.font,this.context.strokeStyle=this.style.stroke,this.context.lineWidth=this.style.strokeThickness,this.context.textBaseline="top",n=0;e.length>n;n++){var h=new o.Point(this.style.strokeThickness/2,this.style.strokeThickness/2+n*a);"right"==this.style.align?h.x+=r-i[n]:"center"==this.style.align&&(h.x+=(r-i[n])/2),this.style.stroke&&this.style.strokeThickness&&this.context.strokeText(e[n],h.x,h.y),this.style.fill&&this.context.fillText(e[n],h.x,h.y)}this.updateTexture()},o.Text.prototype.updateTexture=function(){this.texture.baseTexture.width=this.canvas.width,this.texture.baseTexture.height=this.canvas.height,this.texture.frame.width=this.canvas.width,this.texture.frame.height=this.canvas.height,this._width=this.canvas.width,this._height=this.canvas.height,o.texturesToUpdate.push(this.texture.baseTexture)},o.Text.prototype.updateTransform=function(){this.dirty&&(this.updateText(),this.dirty=!1),o.Sprite.prototype.updateTransform.call(this)},o.Text.prototype.determineFontHeight=function(t){var e=o.Text.heightCache[t];if(!e){var i=document.getElementsByTagName("body")[0],r=document.createElement("div"),n=document.createTextNode("M");r.appendChild(n),r.setAttribute("style",t+";position:absolute;top:0;left:0"),i.appendChild(r),e=r.offsetHeight,o.Text.heightCache[t]=e,i.removeChild(r)}return e},o.Text.prototype.wordWrap=function(t){for(var e=function(t,e,i,r,n){var s=Math.floor((r-i)/2)+i;return s==i?1:n>=t.measureText(e.substring(0,s)).width?t.measureText(e.substring(0,s+1)).width>n?s:arguments.callee(t,e,s,r,n):arguments.callee(t,e,i,s,n)},i=function(t,i,r){if(r>=t.measureText(i).width||1>i.length)return i;var n=e(t,i,0,i.length,r);return i.substring(0,n)+"\n"+arguments.callee(t,i.substring(n),r)},r="",n=t.split("\n"),s=0;n.length>s;s++)r+=i(this.context,n[s],this.style.wordWrapWidth)+"\n";return r},o.Text.prototype.destroy=function(t){t&&this.texture.destroy()},o.Text.heightCache={},o.BitmapText=function(t,e){o.DisplayObjectContainer.call(this),this.setText(t),this.setStyle(e),this.updateText(),this.dirty=!1},o.BitmapText.constructor=o.BitmapText,o.BitmapText.prototype=Object.create(o.DisplayObjectContainer.prototype),o.BitmapText.prototype.setText=function(t){this.text=t||" ",this.dirty=!0},o.BitmapText.prototype.setStyle=function(t){t=t||{},t.align=t.align||"left",this.style=t;var e=t.font.split(" ");this.fontName=e[e.length-1],this.fontSize=e.length>=2?parseInt(e[e.length-2],10):o.BitmapText.fonts[this.fontName].size,this.dirty=!0},o.BitmapText.prototype.updateText=function(){for(var t=o.BitmapText.fonts[this.fontName],e=new o.Point,i=null,r=[],n=0,s=[],a=0,h=this.fontSize/t.size,l=0;this.text.length>l;l++){var u=this.text.charCodeAt(l);if(/(?:\r\n|\r|\n)/.test(this.text.charAt(l)))s.push(e.x),n=Math.max(n,e.x),a++,e.x=0,e.y+=t.lineHeight,i=null;else{var c=t.chars[u];c&&(i&&c[i]&&(e.x+=c.kerning[i]),r.push({texture:c.texture,line:a,charCode:u,position:new o.Point(e.x+c.xOffset,e.y+c.yOffset)}),e.x+=c.xAdvance,i=u)}}s.push(e.x),n=Math.max(n,e.x);var d=[];for(l=0;a>=l;l++){var p=0;"right"==this.style.align?p=n-s[l]:"center"==this.style.align&&(p=(n-s[l])/2),d.push(p)}for(l=0;r.length>l;l++){var f=new o.Sprite(r[l].texture);f.position.x=(r[l].position.x+d[r[l].line])*h,f.position.y=r[l].position.y*h,f.scale.x=f.scale.y=h,this.addChild(f)}this.width=e.x*h,this.height=(e.y+t.lineHeight)*h},o.BitmapText.prototype.updateTransform=function(){if(this.dirty){for(;this.children.length>0;)this.removeChild(this.getChildAt(0));this.updateText(),this.dirty=!1}o.DisplayObjectContainer.prototype.updateTransform.call(this)},o.BitmapText.fonts={},o.InteractionManager=function(t){this.stage=t,this.tempPoint=new o.Point,this.mouseoverEnabled=!0,this.mouse=new o.InteractionData,this.touchs={},this.pool=[],this.interactiveItems=[],this.last=0},o.InteractionManager.constructor=o.InteractionManager,o.InteractionManager.prototype.collectInteractiveSprite=function(t,e){for(var i=t.children,r=i.length,n=r-1;n>=0;n--){var s=i[n];s.visible&&(s.interactive?(e.interactiveChildren=!0,this.interactiveItems.push(s),s.children.length>0&&this.collectInteractiveSprite(s,s)):(s.__iParent=null,s.children.length>0&&this.collectInteractiveSprite(s,e)))}},o.InteractionManager.prototype.setTarget=function(t){window.navigator.msPointerEnabled&&(t.view.style["-ms-content-zooming"]="none",t.view.style["-ms-touch-action"]="none"),this.target=t,t.view.addEventListener("mousemove",this.onMouseMove.bind(this),!0),t.view.addEventListener("mousedown",this.onMouseDown.bind(this),!0),document.body.addEventListener("mouseup",this.onMouseUp.bind(this),!0),t.view.addEventListener("mouseout",this.onMouseUp.bind(this),!0),t.view.addEventListener("touchstart",this.onTouchStart.bind(this),!0),t.view.addEventListener("touchend",this.onTouchEnd.bind(this),!0),t.view.addEventListener("touchmove",this.onTouchMove.bind(this),!0)},o.InteractionManager.prototype.update=function(){if(this.target){var t=Date.now(),e=t-this.last;if(e=30*e/1e3,!(1>e)){if(this.last=t,this.dirty){this.dirty=!1;for(var i=this.interactiveItems.length,r=0;i>r;r++)this.interactiveItems[r].interactiveChildren=!1;this.interactiveItems=[],this.stage.interactive&&this.interactiveItems.push(this.stage),this.collectInteractiveSprite(this.stage,this.stage)}var n=this.interactiveItems.length;this.target.view.style.cursor="default";for(var r=0;n>r;r++){var s=this.interactiveItems[r];s.visible&&(s.mouseover||s.mouseout||s.buttonMode)&&(s.__hit=this.hitTest(s,this.mouse),s.__hit?(s.buttonMode&&(this.target.view.style.cursor="pointer"),s.__isOver||(s.mouseover&&s.mouseover(this.mouse),s.__isOver=!0)):s.__isOver&&(s.mouseout&&s.mouseout(this.mouse),s.__isOver=!1))}}}},o.InteractionManager.prototype.onMouseMove=function(t){var e=this.target.view.getBoundingClientRect();this.mouse.global.x=(t.clientX-e.left)*(this.target.width/e.width),this.mouse.global.y=(t.clientY-e.top)*(this.target.height/e.height);var i=this.interactiveItems.length;this.mouse.global;for(var r=0;i>r;r++){var n=this.interactiveItems[r];n.mousemove&&n.mousemove(this.mouse)}},o.InteractionManager.prototype.onMouseDown=function(t){t.preventDefault();var e=this.interactiveItems.length;this.mouse.global,this.stage;for(var i=0;e>i;i++){var r=this.interactiveItems[i];if((r.mousedown||r.click)&&(r.__mouseIsDown=!0,r.__hit=this.hitTest(r,this.mouse),r.__hit&&(r.mousedown&&r.mousedown(this.mouse),r.__isDown=!0,!r.interactiveChildren)))break}},o.InteractionManager.prototype.onMouseUp=function(){this.mouse.global;for(var t=this.interactiveItems.length,e=!1,i=0;t>i;i++){var r=this.interactiveItems[i];(r.mouseup||r.mouseupoutside||r.click)&&(r.__hit=this.hitTest(r,this.mouse),r.__hit&&!e?(r.mouseup&&r.mouseup(this.mouse),r.__isDown&&r.click&&r.click(this.mouse),r.interactiveChildren||(e=!0)):r.__isDown&&r.mouseupoutside&&r.mouseupoutside(this.mouse),r.__isDown=!1)}},o.InteractionManager.prototype.hitTest=function(t,e){var i=e.global;if(!t.visible)return!1;var r=t instanceof o.Sprite,n=t.worldTransform,s=n[0],a=n[1],h=n[2],l=n[3],u=n[4],c=n[5],d=1/(s*u+a*-l),p=u*d*i.x+-a*d*i.y+(c*a-h*u)*d,f=s*d*i.y+-l*d*i.x+(-c*s+h*l)*d;if(t.hitArea){var v=t.hitArea;if(t.hitArea instanceof o.Polygon){for(var m=!1,g=0,x=t.hitArea.points.length-1;t.hitArea.points.length>g;x=g++){var b=t.hitArea.points[g].x,y=t.hitArea.points[g].y,T=t.hitArea.points[x].x,w=t.hitArea.points[x].y,_=y>f!=w>f&&(T-b)*(f-y)/(w-y)+b>p;_&&(m=!m)}if(m)return r&&(e.target=t),!0}else{var A=v.x;if(p>A&&A+v.width>p){var R=v.y;if(f>R&&R+v.height>f)return r&&(e.target=t),!0}}}else if(r){var R,S=t.texture.frame.width,L=t.texture.frame.height,A=-S*t.anchor.x;if(p>A&&A+S>p&&(R=-L*t.anchor.y,f>R&&R+L>f))return e.target=t,!0}for(var C=t.children.length,g=0;C>g;g++){var E=t.children[g],B=this.hitTest(E,e);if(B)return!0}return!1},o.InteractionManager.prototype.onTouchMove=function(t){for(var e=this.target.view.getBoundingClientRect(),i=t.changedTouches,r=0;i.length>r;r++){var n=i[r],s=this.touchs[n.identifier];s.global.x=(n.clientX-e.left)*(this.target.width/e.width),s.global.y=(n.clientY-e.top)*(this.target.height/e.height)}for(var a=this.interactiveItems.length,r=0;a>r;r++){var o=this.interactiveItems[r];o.touchmove&&o.touchmove(s)}},o.InteractionManager.prototype.onTouchStart=function(t){t.preventDefault();for(var e=this.target.view.getBoundingClientRect(),i=t.changedTouches,r=0;i.length>r;r++){var n=i[r],s=this.pool.pop();s||(s=new o.InteractionData),this.touchs[n.identifier]=s,s.global.x=(n.clientX-e.left)*(this.target.width/e.width),s.global.y=(n.clientY-e.top)*(this.target.height/e.height);for(var a=this.interactiveItems.length,h=0;a>h;h++){var l=this.interactiveItems[h];if((l.touchstart||l.tap)&&(l.__hit=this.hitTest(l,s),l.__hit&&(l.touchstart&&l.touchstart(s),l.__isDown=!0,l.__touchData=s,!l.interactiveChildren)))break}}},o.InteractionManager.prototype.onTouchEnd=function(t){for(var e=this.target.view.getBoundingClientRect(),i=t.changedTouches,r=0;i.length>r;r++){var n=i[r],s=this.touchs[n.identifier],a=!1;s.global.x=(n.clientX-e.left)*(this.target.width/e.width),s.global.y=(n.clientY-e.top)*(this.target.height/e.height);for(var o=this.interactiveItems.length,h=0;o>h;h++){var l=this.interactiveItems[h],u=l.__touchData;l.__hit=this.hitTest(l,s),u==s&&((l.touchend||l.tap)&&(l.__hit&&!a?(l.touchend&&l.touchend(s),l.__isDown&&l.tap&&l.tap(s),l.interactiveChildren||(a=!0)):l.__isDown&&l.touchendoutside&&l.touchendoutside(s),l.__isDown=!1),l.__touchData=null)}this.pool.push(s),this.touchs[n.identifier]=null}},o.InteractionData=function(){this.global=new o.Point,this.local=new o.Point,this.target},o.InteractionData.prototype.getLocalPosition=function(t){var e=t.worldTransform,i=this.global,r=e[0],n=e[1],s=e[2],a=e[3],h=e[4],l=e[5],u=1/(r*h+n*-a);return new o.Point(h*u*i.x+-n*u*i.y+(l*n-s*h)*u,r*u*i.y+-a*u*i.x+(-l*r+s*a)*u)},o.InteractionData.constructor=o.InteractionData,o.Stage=function(t,e){o.DisplayObjectContainer.call(this),this.worldTransform=o.mat3.create(),this.__childrenAdded=[],this.__childrenRemoved=[],this.childIndex=0,this.stage=this,this.stage.hitArea=new o.Rectangle(0,0,1e5,1e5),this.interactive=!!e,this.interactionManager=new o.InteractionManager(this),this.setBackgroundColor(t),this.worldVisible=!0,this.stage.dirty=!0},o.Stage.constructor=o.Stage,o.Stage.prototype=Object.create(o.DisplayObjectContainer.prototype),o.Stage.prototype.updateTransform=function(){this.worldAlpha=1;for(var t=0,e=this.children.length;e>t;t++)this.children[t].updateTransform();this.dirty&&(this.dirty=!1,this.interactionManager.dirty=!0),this.interactive&&this.interactionManager.update()},o.Stage.prototype.setBackgroundColor=function(t){this.backgroundColor=t||0,this.backgroundColorSplit=e(this.backgroundColor);var i=this.backgroundColor.toString(16);i="000000".substr(0,6-i.length)+i,this.backgroundColorString="#"+i},o.Stage.prototype.getMousePosition=function(){return this.interactionManager.mouse.global},o.Stage.prototype.__addChild=function(t){if(t.interactive&&(this.dirty=!0),t.stage=this,t.children)for(var e=0;t.children.length>e;e++)this.__addChild(t.children[e])},o.Stage.prototype.__removeChild=function(t){if(t.interactive&&(this.dirty=!0),t.stage=void 0,t.children)for(var e=0,i=t.children.length;i>e;e++)this.__removeChild(t.children[e])};for(var h=0,l=["ms","moz","webkit","o"],u=0;l.length>u&&!window.requestAnimationFrame;++u)window.requestAnimationFrame=window[l[u]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[l[u]+"CancelAnimationFrame"]||window[l[u]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(t){var e=(new Date).getTime(),i=Math.max(0,16-(e-h)),r=window.setTimeout(function(){t(e+i)},i);return h=e+i,r}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)}),window.requestAnimFrame=window.requestAnimationFrame,"function"!=typeof Function.prototype.bind&&(Function.prototype.bind=function(){var t=Array.prototype.slice;return function(e){function i(){var s=n.concat(t.call(arguments));r.apply(this instanceof i?this:e,s)}var r=this,n=t.call(arguments,1);if("function"!=typeof r)throw new TypeError;return i.prototype=function s(t){return t&&(s.prototype=t),this instanceof s?void 0:new s}(r.prototype),i}}());var c=o.AjaxRequest=function(){var t=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(!window.ActiveXObject)return window.XMLHttpRequest?new XMLHttpRequest:!1;for(var e=0;t.length>e;e++)try{return new ActiveXObject(t[e])}catch(i){}};o.EventTarget=function(){var t={};this.addEventListener=this.on=function(e,i){void 0===t[e]&&(t[e]=[]),-1===t[e].indexOf(i)&&t[e].push(i)},this.dispatchEvent=this.emit=function(e){for(var i in t[e.type])t[e.type][i](e)},this.removeEventListener=this.off=function(e,i){var r=t[e].indexOf(i);-1!==r&&t[e].splice(r,1)}},o.autoDetectRenderer=function(t,e,i,r){t||(t=800),e||(e=600);var n=function(){try{return!!window.WebGLRenderingContext&&!!document.createElement("canvas").getContext("experimental-webgl")}catch(t){return!1}}();return n?new o.WebGLRenderer(t,e,i,r):new o.CanvasRenderer(t,e,i,r)},o.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;","}"],o.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;","}"],o.CompileVertexShader=function(t,e){return o._CompileShader(t,e,t.VERTEX_SHADER)},o.CompileFragmentShader=function(t,e){return o._CompileShader(t,e,t.FRAGMENT_SHADER)},o._CompileShader=function(t,e,i){var r=e.join("\n"),n=t.createShader(i);return t.shaderSource(n,r),t.compileShader(n),t.getShaderParameter(n,t.COMPILE_STATUS)?n:(alert(t.getShaderInfoLog(n)),null)},o.activateDefaultShader=function(){var t=o.gl,e=o.shaderProgram;t.useProgram(e),t.enableVertexAttribArray(e.vertexPositionAttribute),t.enableVertexAttribArray(e.textureCoordAttribute),t.enableVertexAttribArray(e.colorAttribute)},o.activatePrimitiveShader=function(){var t=o.gl;t.disableVertexAttribArray(o.shaderProgram.textureCoordAttribute),t.disableVertexAttribArray(o.shaderProgram.colorAttribute);var e=o.shaderProgram2;t.useProgram(e),t.enableVertexAttribArray(e.vertexPositionAttribute),t.enableVertexAttribArray(o.shaderProgram2.colorAttribute)},o.WebGLGraphics=function(){},o.WebGLGraphics.constructor=o.WebGLGraphics,o.WebGLGraphics.renderGraphics=function(t){o.activatePrimitiveShader();var e=o.gl;t._webGL||(t._webGL={points:[],lastPosition:new o.Point,lastIndex:0,buffer:e.createBuffer()}),t.dirty&&(t.dirty=!1,t.clearDirty&&(t.clearDirty=!1,t._webGL.lastIndex=0,t._webGL.points=[]),o.WebGLGraphics.initGraphics(t)),e.uniformMatrix4fv(o.shaderProgram2.mvMatrixUniform,!1,o.projectionMatrix),e.bindBuffer(e.ARRAY_BUFFER,t._webGL.buffer),e.vertexAttribPointer(o.shaderProgram2.vertexPositionAttribute,2,e.FLOAT,!1,24,0),e.vertexAttribPointer(o.shaderProgram2.colorAttribute,4,e.FLOAT,!1,24,8),e.drawArrays(e.TRIANGLE_STRIP,0,t._webGL.glPoints.length/6),o.activateDefaultShader()},o.WebGLGraphics.initGraphics=function(t){for(var e=t._webGL.lastIndex;t.graphicsData.length>e;e++){var i=t.graphicsData[e];i.type==o.Graphics.POLY?i.lineWidth>0&&o.WebGLGraphics.buildLine(i,t._webGL):i.type==o.Graphics.RECT?o.WebGLGraphics.buildRectangle(i,t._webGL):i.type==o.Graphics.CIRC&&o.WebGLGraphics.buildCircle(i,t._webGL)}t._webGL.lastIndex=t.graphicsData.length,t._webGL.glPoints=new Float32Array(t._webGL.points);var r=o.gl;r.bindBuffer(r.ARRAY_BUFFER,t._webGL.buffer),r.bufferData(r.ARRAY_BUFFER,t._webGL.glPoints,r.STATIC_DRAW)},o.WebGLGraphics.buildRectangle=function(t,i){var r=t.points,n=r[0],s=r[1],a=r[2],h=r[3];if(t.fill){var l=e(t.fillColor),u=t.fillAlpha,c=l[0]*u,d=l[1]*u,p=l[2]*u,f=i.points;f.push(i.lastPosition.x,i.lastPosition.y,1,1,1,1),f.push(n,s,1,1,1,1),f.push(n,s),f.push(c,d,p,u),f.push(n+a,s),f.push(c,d,p,u),f.push(n,s+h),f.push(c,d,p,u),f.push(n+a,s+h),f.push(c,d,p,u),i.lastPosition.x=n+a,i.lastPosition.y=s+h}t.lineWidth&&(t.points=[n,s,n+a,s,n+a,s+h,n,s+h,n,s],o.WebGLGraphics.buildLine(t,i))},o.WebGLGraphics.buildCircle=function(t,i){var r=t.points,n=r[0],s=r[1],a=r[2],h=40,l=2*Math.PI/h;if(t.fill){var u=e(t.fillColor),c=t.fillAlpha,d=u[0]*c,p=u[1]*c,f=u[2]*c,v=i.points;v.push(i.lastPosition.x,i.lastPosition.y,1,1,1,1),v.push(n,s,1,1,1,1);for(var m=0;h+1>m;m++)v.push(n,s),v.push(d,p,f,c),v.push(n+Math.sin(l*m)*a,s+Math.cos(l*m)*a),v.push(d,p,f,c);v.push(n,s),v.push(1,0,0,1),i.lastPosition.x=n,i.lastPosition.y=s}if(t.lineWidth){t.points=[];for(var m=0;h+1>m;m++)t.points.push(n+Math.sin(l*m)*a,s+Math.cos(l*m)*a);o.WebGLGraphics.buildLine(t,i)}},o.WebGLGraphics.buildLine=function(t,r){var s=t.points;if(0!=s.length){var a=new o.Point(s[0],s[1]),h=new o.Point(s[s.length-2],s[s.length-1]);if(a.x==h.x&&a.y==h.y){s.pop(),s.pop(),h=new o.Point(s[s.length-2],s[s.length-1]);var l=h.x+.5*(a.x-h.x),u=h.y+.5*(a.y-h.y);s.unshift(l,u),s.push(l,u)}var c=r.points,d=s.length/2,p=t.lineWidth/2,f=e(t.lineColor),v=t.lineAlpha,m=f[0]*v,g=f[1]*v,x=f[2]*v,b=new o.Point(s[0],s[1]),y=new o.Point(s[2],s[3]),T=i(b,y),w=Math.sqrt(T.x*T.x+T.y*T.y);T.x/=w,T.y/=w,T.x*=p,T.y*=p,c.push(r.lastPosition.x,r.lastPosition.y,1,1,1,1),c.push(s[0]-T.x,s[1]-T.y,1,1,1,1),c.push(s[0]-T.x,s[1]-T.y),c.push(m,g,x,v),c.push(s[0]+T.x,s[1]+T.y),c.push(m,g,x,v);for(var _=1;d-1>_;_++){var b=new o.Point(s[2*(_-1)],s[2*(_-1)+1]),y=new o.Point(s[2*_],s[2*_+1]),A=new o.Point(s[2*(_+1)],s[2*(_+1)+1]),T=i(b,y),w=Math.sqrt(T.x*T.x+T.y*T.y);T.x/=w,T.y/=w,T.x*=p,T.y*=p;var R=i(y,A),S=Math.sqrt(R.x*R.x+R.y*R.y);R.x/=S,R.y/=S,R.x*=p,R.y*=p;var L=new o.Point(-T.x+y.x,-T.y+y.y),C=new o.Point(-T.x+b.x,-T.y+b.y),E=new o.Point(-R.x+y.x,-R.y+y.y),B=new o.Point(-R.x+A.x,-R.y+A.y),F=n(L,C,E,B),G=(F.x-y.x)*(F.x-y.x)+(F.y-y.y)+(F.y-y.y);if(G>19600){var P=new o.Point(T.x-R.x,T.y-R.y),I=Math.sqrt(P.x*P.x+P.y*P.y);P.x/=I,P.y/=I,P.x*=p,P.y*=p,c.push(y.x-P.x,y.y-P.y),c.push(m,g,x,v),c.push(y.x+P.x,y.y+P.y),c.push(m,g,x,v),c.push(y.x-P.x,y.y-P.y),c.push(m,g,x,v)}else c.push(F.x,F.y),c.push(m,g,x,v),c.push(y.x-(F.x-y.x),y.y-(F.y-y.y)),c.push(m,g,x,v)}var b=new o.Point(s[2*(d-2)],s[2*(d-2)+1]),y=new o.Point(s[2*(d-1)],s[2*(d-1)+1]),T=i(b,y),w=Math.sqrt(T.x*T.x+T.y*T.y);T.x/=w,T.y/=w,T.x*=p,T.y*=p,c.push(y.x-T.x,y.y-T.y),c.push(m,g,x,v),c.push(y.x+T.x,y.y+T.y),c.push(m,g,x,v),r.lastPosition.x=y.x+T.x,r.lastPosition.y=y.y+T.y}},o.primitiveShaderFragmentSrc=["precision mediump float;","varying vec4 vColor;","void main(void) {","gl_FragColor = vColor;","}"],o.primitiveShaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec4 aColor;","uniform mat4 uMVMatrix;","varying vec4 vColor;","void main(void) {","gl_Position = uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vColor = aColor;","}"],o.WebGLGraphics.initShaders=function(){var t=o.gl,e=o.CompileFragmentShader(t,o.primitiveShaderFragmentSrc),i=o.CompileVertexShader(t,o.primitiveShaderVertexSrc);o.shaderProgram2=t.createProgram();var r=o.shaderProgram2;t.attachShader(r,i),t.attachShader(r,e),t.linkProgram(r),t.getProgramParameter(r,t.LINK_STATUS)||alert("Could not initialise shaders"),t.useProgram(r),r.vertexPositionAttribute=t.getAttribLocation(r,"aVertexPosition"),r.colorAttribute=t.getAttribLocation(r,"aColor"),r.mvMatrixUniform=t.getUniformLocation(r,"uMVMatrix")},o._defaultFrame=new o.Rectangle(0,0,1,1),o.gl,o.WebGLRenderer=function(t,e,i,r){this.transparent=!!r,this.width=t||800,this.height=e||600,this.view=i||document.createElement("canvas"),this.view.width=this.width,this.view.height=this.height;var n=this;this.view.addEventListener("webglcontextlost",function(t){n.handleContextLost(t)},!1),this.view.addEventListener("webglcontextrestored",function(t){n.handleContextRestored(t)},!1),this.batchs=[];try{o.gl=this.gl=this.view.getContext("experimental-webgl",{alpha:this.transparent,antialias:!1,premultipliedAlpha:!1})}catch(s){throw Error(" This browser does not support webGL. Try using the canvas renderer"+this)}o.WebGLGraphics.initShaders(),this.initShaders();var a=this.gl;o.WebGLRenderer.gl=a,this.batch=new o.WebGLBatch(a),a.disable(a.DEPTH_TEST),a.disable(a.CULL_FACE),a.enable(a.BLEND),a.colorMask(!0,!0,!0,this.transparent),this.projectionMatrix=o.mat4.create(),this.resize(this.width,this.height),this.contextLost=!1,this.stageRenderGroup=new o.WebGLRenderGroup(this.gl)},o.WebGLRenderer.constructor=o.WebGLRenderer,o.WebGLRenderer.getBatch=function(){return 0==o._batchs.length?new o.WebGLBatch(o.WebGLRenderer.gl):o._batchs.pop()},o.WebGLRenderer.returnBatch=function(t){t.clean(),o._batchs.push(t)},o.WebGLRenderer.prototype.initShaders=function(){var t=this.gl,e=o.CompileFragmentShader(t,o.shaderFragmentSrc),i=o.CompileVertexShader(t,o.shaderVertexSrc);o.shaderProgram=t.createProgram();var r=o.shaderProgram;t.attachShader(r,i),t.attachShader(r,e),t.linkProgram(r),t.getProgramParameter(r,t.LINK_STATUS)||alert("Could not initialise shaders"),t.useProgram(r),r.vertexPositionAttribute=t.getAttribLocation(r,"aVertexPosition"),r.textureCoordAttribute=t.getAttribLocation(r,"aTextureCoord"),r.colorAttribute=t.getAttribLocation(r,"aColor"),r.mvMatrixUniform=t.getUniformLocation(r,"uMVMatrix"),r.samplerUniform=t.getUniformLocation(r,"uSampler"),o.activateDefaultShader()},o.WebGLRenderer.prototype.render=function(t){if(!this.contextLost){this.__stage!==t&&(this.__stage=t,this.stageRenderGroup.setRenderable(t)),o.WebGLRenderer.updateTextures(),t.updateTransform(); +var e=this.gl;if(e.colorMask(!0,!0,!0,this.transparent),e.viewport(0,0,this.width,this.height),e.bindFramebuffer(e.FRAMEBUFFER,null),e.clearColor(t.backgroundColorSplit[0],t.backgroundColorSplit[1],t.backgroundColorSplit[2],!this.transparent),e.clear(e.COLOR_BUFFER_BIT),o.projectionMatrix=this.projectionMatrix,this.stageRenderGroup.backgroundColor=t.backgroundColorSplit,this.stageRenderGroup.render(this.projectionMatrix),t.interactive&&(t._interactiveEventsAdded||(t._interactiveEventsAdded=!0,t.interactionManager.setTarget(this))),o.Texture.frameUpdates.length>0){for(var i=0;o.Texture.frameUpdates.length>i;i++)o.Texture.frameUpdates[i].updateFrame=!1;o.Texture.frameUpdates=[]}}},o.WebGLRenderer.updateTextures=function(){for(var t=0;o.texturesToUpdate.length>t;t++)this.updateTexture(o.texturesToUpdate[t]);for(var t=0;o.texturesToDestroy.length>t;t++)this.destroyTexture(o.texturesToDestroy[t]);o.texturesToUpdate=[],o.texturesToDestroy=[]},o.WebGLRenderer.updateTexture=function(t){var e=o.gl;t._glTexture||(t._glTexture=e.createTexture()),t.hasLoaded&&(e.bindTexture(e.TEXTURE_2D,t._glTexture),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,t.source),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),t._powerOf2?(e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.REPEAT)):(e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE)),e.bindTexture(e.TEXTURE_2D,null))},o.WebGLRenderer.prototype.destroyTexture=function(t){var e=this.gl;t._glTexture&&(t._glTexture=e.createTexture(),e.deleteTexture(e.TEXTURE_2D,t._glTexture))},o.WebGLRenderer.prototype.resize=function(t,e){this.width=t,this.height=e,this.view.width=t,this.view.height=e,this.gl.viewport(0,0,this.width,this.height);var i=this.projectionMatrix;i[0]=2/this.width,i[5]=-2/this.height,i[12]=-1,i[13]=1},o.WebGLRenderer.prototype.handleContextLost=function(t){t.preventDefault(),this.contextLost=!0},o.WebGLRenderer.prototype.handleContextRestored=function(){this.gl=this.view.getContext("experimental-webgl",{alpha:!0}),this.initShaders();for(var t=0;o.TextureCache.length>t;t++)this.updateTexture(o.TextureCache[t]);for(var t=0;this.batchs.length>t;t++)this.batchs[t].restoreLostContext(this.gl),this.batchs[t].dirty=!0;o._restoreBatchs(this.gl),this.contextLost=!1},o._batchs=[],o._getBatch=function(t){return 0==o._batchs.length?new o.WebGLBatch(t):o._batchs.pop()},o._returnBatch=function(t){t.clean(),o._batchs.push(t)},o._restoreBatchs=function(t){for(var e=0;o._batchs.length>e;e++)o._batchs[e].restoreLostContext(t)},o.WebGLBatch=function(t){this.gl=t,this.size=0,this.vertexBuffer=t.createBuffer(),this.indexBuffer=t.createBuffer(),this.uvBuffer=t.createBuffer(),this.colorBuffer=t.createBuffer(),this.blendMode=o.blendModes.NORMAL,this.dynamicSize=1},o.WebGLBatch.constructor=o.WebGLBatch,o.WebGLBatch.prototype.clean=function(){this.verticies=[],this.uvs=[],this.indices=[],this.colors=[],this.dynamicSize=1,this.texture=null,this.last=null,this.size=0,this.head,this.tail},o.WebGLBatch.prototype.restoreLostContext=function(t){this.gl=t,this.vertexBuffer=t.createBuffer(),this.indexBuffer=t.createBuffer(),this.uvBuffer=t.createBuffer(),this.colorBuffer=t.createBuffer()},o.WebGLBatch.prototype.init=function(t){t.batch=this,this.dirty=!0,this.blendMode=t.blendMode,this.texture=t.texture.baseTexture,this.head=t,this.tail=t,this.size=1,this.growBatch()},o.WebGLBatch.prototype.insertBefore=function(t,e){this.size++,t.batch=this,this.dirty=!0;var i=e.__prev;e.__prev=t,t.__next=e,i?(t.__prev=i,i.__next=t):this.head=t},o.WebGLBatch.prototype.insertAfter=function(t,e){this.size++,t.batch=this,this.dirty=!0;var i=e.__next;e.__next=t,t.__prev=e,i?(t.__next=i,i.__prev=t):this.tail=t},o.WebGLBatch.prototype.remove=function(t){return this.size--,0==this.size?(t.batch=null,t.__prev=null,t.__next=null,void 0):(t.__prev?t.__prev.__next=t.__next:(this.head=t.__next,this.head.__prev=null),t.__next?t.__next.__prev=t.__prev:(this.tail=t.__prev,this.tail.__next=null),t.batch=null,t.__next=null,t.__prev=null,this.dirty=!0,void 0)},o.WebGLBatch.prototype.split=function(t){this.dirty=!0;var e=new o.WebGLBatch(this.gl);e.init(t),e.texture=this.texture,e.tail=this.tail,this.tail=t.__prev,this.tail.__next=null,t.__prev=null;for(var i=0;t;)i++,t.batch=e,t=t.__next;return e.size=i,this.size-=i,e},o.WebGLBatch.prototype.merge=function(t){this.dirty=!0,this.tail.__next=t.head,t.head.__prev=this.tail,this.size+=t.size,this.tail=t.tail;for(var e=t.head;e;)e.batch=this,e=e.__next},o.WebGLBatch.prototype.growBatch=function(){var t=this.gl;this.dynamicSize=1==this.size?1:1.5*this.size,this.verticies=new Float32Array(8*this.dynamicSize),t.bindBuffer(t.ARRAY_BUFFER,this.vertexBuffer),t.bufferData(t.ARRAY_BUFFER,this.verticies,t.DYNAMIC_DRAW),this.uvs=new Float32Array(8*this.dynamicSize),t.bindBuffer(t.ARRAY_BUFFER,this.uvBuffer),t.bufferData(t.ARRAY_BUFFER,this.uvs,t.DYNAMIC_DRAW),this.dirtyUVS=!0,this.colors=new Float32Array(4*this.dynamicSize),t.bindBuffer(t.ARRAY_BUFFER,this.colorBuffer),t.bufferData(t.ARRAY_BUFFER,this.colors,t.DYNAMIC_DRAW),this.dirtyColors=!0,this.indices=new Uint16Array(6*this.dynamicSize);for(var e=this.indices.length/6,i=0;e>i;i++){var r=6*i,n=4*i;this.indices[r+0]=n+0,this.indices[r+1]=n+1,this.indices[r+2]=n+2,this.indices[r+3]=n+0,this.indices[r+4]=n+2,this.indices[r+5]=n+3}t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indexBuffer),t.bufferData(t.ELEMENT_ARRAY_BUFFER,this.indices,t.STATIC_DRAW)},o.WebGLBatch.prototype.refresh=function(){this.gl,this.dynamicSizer;r++)i=this.batchs[r],i instanceof o.WebGLBatch?this.batchs[r].render():i instanceof o.TilingSprite?i.visible&&this.renderTilingSprite(i,t):i instanceof o.Strip?i.visible&&this.renderStrip(i,t):i instanceof o.Graphics&&i.visible&&o.WebGLGraphics.renderGraphics(i)},o.WebGLRenderGroup.prototype.renderSpecific=function(t,e){o.WebGLRenderer.updateTextures();var i=this.gl;this.checkVisibility(t,t.visible),i.uniformMatrix4fv(o.shaderProgram.mvMatrixUniform,!1,e);var r,n,s,a,h=t.renderable?t:this.getNextRenderable(t),l=h.batch;if(h instanceof o.Sprite){l=h.batch;var u=l.head;if(u==h)r=0;else for(r=1;u.__next!=h;)r++,u=u.__next}else l=h;for(var c,d=t,p=t;p.children.length>0;)p=p.children[p.children.length-1],p.renderable&&(d=p);if(d instanceof o.Sprite){c=d.batch;var u=c.head;if(u==d)s=0;else for(s=1;u.__next!=d;)s++,u=u.__next}else c=d;if(l==c)return l instanceof o.WebGLBatch?l.render(r,s+1):l instanceof o.TilingSprite?l.visible&&this.renderTilingSprite(l,e):l instanceof o.Strip?l.visible&&this.renderStrip(l,e):l instanceof o.CustomRenderable?l.visible&&l.renderWebGL(this,e):renderable instanceof o.Graphics&&renderable.visible&&o.WebGLGraphics.renderGraphics(renderable),void 0;n=this.batchs.indexOf(l),a=this.batchs.indexOf(c),l instanceof o.WebGLBatch?l.render(r):l instanceof o.TilingSprite?l.visible&&this.renderTilingSprite(l,e):l instanceof o.Strip?l.visible&&this.renderStrip(l,e):l instanceof o.CustomRenderable?l.visible&&l.renderWebGL(this,e):renderable instanceof o.Graphics&&renderable.visible&&o.WebGLGraphics.renderGraphics(renderable);for(var f=n+1;a>f;f++)renderable=this.batchs[f],renderable instanceof o.WebGLBatch?this.batchs[f].render():renderable instanceof o.TilingSprite?renderable.visible&&this.renderTilingSprite(renderable,e):renderable instanceof o.Strip?renderable.visible&&this.renderStrip(renderable,e):renderable instanceof o.CustomRenderable?renderable.visible&&renderable.renderWebGL(this,e):renderable instanceof o.Graphics&&renderable.visible&&o.WebGLGraphics.renderGraphics(renderable);c instanceof o.WebGLBatch?c.render(0,s+1):c instanceof o.TilingSprite?c.visible&&this.renderTilingSprite(c):c instanceof o.Strip?c.visible&&this.renderStrip(c):c instanceof o.CustomRenderable?c.visible&&c.renderWebGL(this,e):renderable instanceof o.Graphics&&renderable.visible&&o.WebGLGraphics.renderGraphics(renderable)},o.WebGLRenderGroup.prototype.checkVisibility=function(t,e){for(var i=t.children,r=0;i.length>r;r++){var n=i[r];n.worldVisible=n.visible&&e,n.textureChange&&(n.textureChange=!1,n.worldVisible&&(this.removeDisplayObject(n),this.addDisplayObject(n))),n.children.length>0&&this.checkVisibility(n,n.worldVisible)}},o.WebGLRenderGroup.prototype.updateTexture=function(t){if(1==t.batch.length)return t.batch.texture=t.texture.baseTexture,void 0;if(t.batch.texture!=t.texture.baseTexture)if(t.batch.head==t){var e=t.batch,i=this.batchs.indexOf(e),r=this.batchs[i-1];if(e.remove(t),r)if(r.texture==t.texture.baseTexture&&r.blendMode==t.blendMode)r.insertAfter(t,r.tail);else{var n=o.WebGLRenderer.getBatch();n.init(t),this.batchs.splice(i-1,0,n)}else{var n=o.WebGLRenderer.getBatch();n.init(t),this.batchs.splice(0,0,n)}}else if(t.batch.tail==t){var e=t.batch,i=this.batchs.indexOf(e),s=this.batchs[i+1];if(e.remove(t),s){if(s.texture==t.texture.baseTexture&&s.blendMode==t.blendMode)return s.insertBefore(t,s.head),void 0;var n=o.WebGLRenderer.getBatch();n.init(t),this.batchs.splice(i+1,0,n)}else{var n=o.WebGLRenderer.getBatch();n.init(t),this.batchs.push(n)}}else{var e=t.batch,a=e.split(t);a.remove(t);var n=o.WebGLRenderer.getBatch(),i=this.batchs.indexOf(e);n.init(t),this.batchs.splice(i+1,0,n,a)}},o.WebGLRenderGroup.prototype.addDisplayObject=function(t){if(t.__renderGroup&&t.__renderGroup.removeDisplayObjectAndChildren(t),t.__renderGroup=this,t.renderable){var e=this.getPreviousRenderable(t),i=this.getNextRenderable(t);if(t instanceof o.Sprite){var r,n;if(e instanceof o.Sprite){if(r=e.batch,r&&r.texture==t.texture.baseTexture&&r.blendMode==t.blendMode)return r.insertAfter(t,e),void 0}else r=e;if(i)if(i instanceof o.Sprite){if(n=i.batch){if(n.texture==t.texture.baseTexture&&n.blendMode==t.blendMode)return n.insertBefore(t,i),void 0;if(n==r){var s=r.split(i),a=o.WebGLRenderer.getBatch(),h=this.batchs.indexOf(r);return a.init(t),this.batchs.splice(h+1,0,a,s),void 0}}}else n=i;var a=o.WebGLRenderer.getBatch();if(a.init(t),r){var h=this.batchs.indexOf(r);this.batchs.splice(h+1,0,a)}else this.batchs.push(a)}else t instanceof o.TilingSprite?(this.initTilingSprite(t),this.batchs.push(t)):t instanceof o.Strip?(this.initStrip(t),this.batchs.push(t)):t instanceof o.Graphics&&this.batchs.push(t);this.batchUpdate=!0}},o.WebGLRenderGroup.prototype.addDisplayObjectAndChildren=function(t){this.addDisplayObject(t);for(var e=t.children,i=0;e.length>i;i++)this.addDisplayObjectAndChildren(e[i])},o.WebGLRenderGroup.prototype.removeDisplayObject=function(t){if(t.__renderGroup=null,t.renderable){var e;if(t instanceof o.Sprite){var i=t.batch;if(!i)return;i.remove(t),0==i.size&&(e=i)}else e=t;if(e){var r=this.batchs.indexOf(e);if(-1==r)return;if(0==r||r==this.batchs.length-1)return this.batchs.splice(r,1),e instanceof o.WebGLBatch&&o.WebGLRenderer.returnBatch(e),void 0;if(this.batchs[r-1]instanceof o.WebGLBatch&&this.batchs[r+1]instanceof o.WebGLBatch&&this.batchs[r-1].texture==this.batchs[r+1].texture&&this.batchs[r-1].blendMode==this.batchs[r+1].blendMode)return this.batchs[r-1].merge(this.batchs[r+1]),e instanceof o.WebGLBatch&&o.WebGLRenderer.returnBatch(e),o.WebGLRenderer.returnBatch(this.batchs[r+1]),this.batchs.splice(r,2),void 0;this.batchs.splice(r,1),e instanceof o.WebGLBatch&&o.WebGLRenderer.returnBatch(e)}}},o.WebGLRenderGroup.prototype.removeDisplayObjectAndChildren=function(t){if(t.__renderGroup==this){this.removeDisplayObject(t);for(var e=t.children,i=0;e.length>i;i++)this.removeDisplayObjectAndChildren(e[i])}},o.WebGLRenderGroup.prototype.getNextRenderable=function(t){var e=t;do{if(0==e.children.length){if(!e.parent)return null;for(;e.childIndex==e.parent.children.length-1;)if(e=e.parent,e==this.root||!e.parent){e=null;break}e&&(e=e.parent.children[e.childIndex+1])}else e=e.children[0];if(!e)break}while(!e.renderable||!e.__renderGroup);return e},o.WebGLRenderGroup.prototype.getPreviousRenderable=function(t){var e=t;do{if(0==e.childIndex){if(e=e.parent,!e)return null}else for(e=e.parent.children[e.childIndex-1];0!=e.children.length;)e=e.children[e.children.length-1];if(e==this.root)break}while(!e.renderable||!e.__renderGroup);return e},o.WebGLRenderGroup.prototype.initTilingSprite=function(t){var e=this.gl;t.verticies=new Float32Array([0,0,t.width,0,t.width,t.height,0,t.height]),t.uvs=new Float32Array([0,0,1,0,1,1,0,1]),t.colors=new Float32Array([1,1,1,1]),t.indices=new Uint16Array([0,1,3,2]),t._vertexBuffer=e.createBuffer(),t._indexBuffer=e.createBuffer(),t._uvBuffer=e.createBuffer(),t._colorBuffer=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,t._vertexBuffer),e.bufferData(e.ARRAY_BUFFER,t.verticies,e.STATIC_DRAW),e.bindBuffer(e.ARRAY_BUFFER,t._uvBuffer),e.bufferData(e.ARRAY_BUFFER,t.uvs,e.DYNAMIC_DRAW),e.bindBuffer(e.ARRAY_BUFFER,t._colorBuffer),e.bufferData(e.ARRAY_BUFFER,t.colors,e.STATIC_DRAW),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t._indexBuffer),e.bufferData(e.ELEMENT_ARRAY_BUFFER,t.indices,e.STATIC_DRAW),t.texture.baseTexture._glTexture?(e.bindTexture(e.TEXTURE_2D,t.texture.baseTexture._glTexture),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.REPEAT),t.texture.baseTexture._powerOf2=!0):t.texture.baseTexture._powerOf2=!0},o.WebGLRenderGroup.prototype.renderStrip=function(t,e){var i=this.gl,r=o.shaderProgram,n=o.mat3.toMat4(t.worldTransform);o.mat4.transpose(n),o.mat4.multiply(e,n,n),i.uniformMatrix4fv(r.mvMatrixUniform,!1,n),t.blendMode==o.blendModes.NORMAL?i.blendFunc(i.ONE,i.ONE_MINUS_SRC_ALPHA):i.blendFunc(i.ONE,i.ONE_MINUS_SRC_COLOR),t.dirty?(t.dirty=!1,i.bindBuffer(i.ARRAY_BUFFER,t._vertexBuffer),i.bufferData(i.ARRAY_BUFFER,t.verticies,i.STATIC_DRAW),i.vertexAttribPointer(r.vertexPositionAttribute,2,i.FLOAT,!1,0,0),i.bindBuffer(i.ARRAY_BUFFER,t._uvBuffer),i.bufferData(i.ARRAY_BUFFER,t.uvs,i.STATIC_DRAW),i.vertexAttribPointer(r.textureCoordAttribute,2,i.FLOAT,!1,0,0),i.activeTexture(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,t.texture.baseTexture._glTexture),i.bindBuffer(i.ARRAY_BUFFER,t._colorBuffer),i.bufferData(i.ARRAY_BUFFER,t.colors,i.STATIC_DRAW),i.vertexAttribPointer(r.colorAttribute,1,i.FLOAT,!1,0,0),i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,t._indexBuffer),i.bufferData(i.ELEMENT_ARRAY_BUFFER,t.indices,i.STATIC_DRAW)):(i.bindBuffer(i.ARRAY_BUFFER,t._vertexBuffer),i.bufferSubData(i.ARRAY_BUFFER,0,t.verticies),i.vertexAttribPointer(r.vertexPositionAttribute,2,i.FLOAT,!1,0,0),i.bindBuffer(i.ARRAY_BUFFER,t._uvBuffer),i.vertexAttribPointer(r.textureCoordAttribute,2,i.FLOAT,!1,0,0),i.activeTexture(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,t.texture.baseTexture._glTexture),i.bindBuffer(i.ARRAY_BUFFER,t._colorBuffer),i.vertexAttribPointer(r.colorAttribute,1,i.FLOAT,!1,0,0),i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,t._indexBuffer)),i.drawElements(i.TRIANGLE_STRIP,t.indices.length,i.UNSIGNED_SHORT,0),i.uniformMatrix4fv(r.mvMatrixUniform,!1,e)},o.WebGLRenderGroup.prototype.renderTilingSprite=function(t,e){var i=this.gl;o.shaderProgram;var r=t.tilePosition,n=t.tileScale,s=r.x/t.texture.baseTexture.width,a=r.y/t.texture.baseTexture.height,h=t.width/t.texture.baseTexture.width/n.x,l=t.height/t.texture.baseTexture.height/n.y;t.uvs[0]=0-s,t.uvs[1]=0-a,t.uvs[2]=1*h-s,t.uvs[3]=0-a,t.uvs[4]=1*h-s,t.uvs[5]=1*l-a,t.uvs[6]=0-s,t.uvs[7]=1*l-a,i.bindBuffer(i.ARRAY_BUFFER,t._uvBuffer),i.bufferSubData(i.ARRAY_BUFFER,0,t.uvs),this.renderStrip(t,e)},o.WebGLRenderer.prototype.initStrip=function(t){var e=this.gl;this.shaderProgram,t._vertexBuffer=e.createBuffer(),t._indexBuffer=e.createBuffer(),t._uvBuffer=e.createBuffer(),t._colorBuffer=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,t._vertexBuffer),e.bufferData(e.ARRAY_BUFFER,t.verticies,e.DYNAMIC_DRAW),e.bindBuffer(e.ARRAY_BUFFER,t._uvBuffer),e.bufferData(e.ARRAY_BUFFER,t.uvs,e.STATIC_DRAW),e.bindBuffer(e.ARRAY_BUFFER,t._colorBuffer),e.bufferData(e.ARRAY_BUFFER,t.colors,e.STATIC_DRAW),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t._indexBuffer),e.bufferData(e.ELEMENT_ARRAY_BUFFER,t.indices,e.STATIC_DRAW)},o.CanvasRenderer=function(t,e,i,r){this.transparent=r,this.width=t||800,this.height=e||600,this.refresh=!0,this.view=i||document.createElement("canvas"),this.view.width=this.width,this.view.height=this.height,this.count=0,this.context=this.view.getContext("2d")},o.CanvasRenderer.constructor=o.CanvasRenderer,o.CanvasRenderer.prototype.render=function(t){o.texturesToUpdate=[],o.texturesToDestroy=[],t.updateTransform(),this.view.style.backgroundColor==t.backgroundColorString||this.transparent||(this.view.style.backgroundColor=t.backgroundColorString),this.context.setTransform(1,0,0,1,0,0),this.context.clearRect(0,0,this.width,this.height),this.renderDisplayObject(t),t.interactive&&(t._interactiveEventsAdded||(t._interactiveEventsAdded=!0,t.interactionManager.setTarget(this))),o.Texture.frameUpdates.length>0&&(o.Texture.frameUpdates=[])},o.CanvasRenderer.prototype.resize=function(t,e){this.width=t,this.height=e,this.view.width=t,this.view.height=e},o.CanvasRenderer.prototype.renderDisplayObject=function(t){var e=t.worldTransform,i=this.context;if(t.visible){if(t instanceof o.Sprite){var r=t.texture.frame;r&&(i.globalAlpha=t.worldAlpha,i.setTransform(e[0],e[3],e[1],e[4],e[2],e[5]),i.drawImage(t.texture.baseTexture.source,r.x,r.y,r.width,r.height,t.anchor.x*-r.width,t.anchor.y*-r.height,r.width,r.height))}else t instanceof o.Strip?(i.setTransform(e[0],e[3],e[1],e[4],e[2],e[5]),this.renderStrip(t)):t instanceof o.TilingSprite?(i.setTransform(e[0],e[3],e[1],e[4],e[2],e[5]),this.renderTilingSprite(t)):t instanceof o.CustomRenderable?t.renderCanvas(this):t instanceof o.Graphics&&o.CanvasGraphics.renderGraphics(t,i);if(t.children)for(var n=0;t.children.length>n;n++)this.renderDisplayObject(t.children[n]);this.context.setTransform(1,0,0,1,0,0)}},o.CanvasRenderer.prototype.renderStripFlat=function(t){var e=this.context,i=t.verticies;t.uvs;var r=i.length/2;this.count++,e.beginPath();for(var n=1;r-2>n;n++){var s=2*n,a=i[s],o=i[s+2],h=i[s+4],l=i[s+1],u=i[s+3],c=i[s+5];e.moveTo(a,l),e.lineTo(o,u),e.lineTo(h,c)}e.fillStyle="#FF0000",e.fill(),e.closePath()},o.CanvasRenderer.prototype.renderTilingSprite=function(t){var e=this.context;t.__tilePattern||(t.__tilePattern=e.createPattern(t.texture.baseTexture.source,"repeat")),e.beginPath();var i=t.tilePosition,r=t.tileScale;e.scale(r.x,r.y),e.translate(i.x,i.y),e.fillStyle=t.__tilePattern,e.fillRect(-i.x,-i.y,t.width/r.x,t.height/r.y),e.scale(1/r.x,1/r.y),e.translate(-i.x,-i.y),e.closePath()},o.CanvasRenderer.prototype.renderStrip=function(t){var e=this.context,i=t.verticies,r=t.uvs,n=i.length/2;this.count++;for(var s=1;n-2>s;s++){var a=2*s,o=i[a],h=i[a+2],l=i[a+4],u=i[a+1],c=i[a+3],d=i[a+5],p=r[a]*t.texture.width,f=r[a+2]*t.texture.width,v=r[a+4]*t.texture.width,m=r[a+1]*t.texture.height,g=r[a+3]*t.texture.height,x=r[a+5]*t.texture.height;e.save(),e.beginPath(),e.moveTo(o,u),e.lineTo(h,c),e.lineTo(l,d),e.closePath(),e.clip();var b=p*g+m*v+f*x-g*v-m*f-p*x,y=o*g+m*l+h*x-g*l-m*h-o*x,T=p*h+o*v+f*l-h*v-o*f-p*l,w=p*g*l+m*h*v+o*f*x-o*g*v-m*f*l-p*h*x,_=u*g+m*d+c*x-g*d-m*c-u*x,A=p*c+u*v+f*d-c*v-u*f-p*d,R=p*g*d+m*c*v+u*f*x-u*g*v-m*f*d-p*c*x;e.transform(y/b,_/b,T/b,A/b,w/b,R/b),e.drawImage(t.texture.baseTexture.source,0,0),e.restore()}},o.CanvasGraphics=function(){},o.CanvasGraphics.renderGraphics=function(t,e){for(var i=0;t.graphicsData.length>i;i++){var r=t.graphicsData[i],n=r.points;if(e.strokeStyle=color="#"+("00000"+(0|r.lineColor).toString(16)).substr(-6),e.lineWidth=r.lineWidth,e.globalAlpha=r.lineAlpha,r.type==o.Graphics.POLY){if(0>=r.lineWidth)continue;e.beginPath(),e.moveTo(n[0],n[1]);for(var s=1;n.length/2>s;s++)e.lineTo(n[2*s],n[2*s+1]);n[0]==n[n.length-2]&&n[1]==n[n.length-1]&&e.closePath(),e.stroke()}else r.type==o.Graphics.RECT?(r.fillColor&&(e.fillStyle=color="#"+("00000"+(0|r.fillColor).toString(16)).substr(-6),e.fillRect(n[0],n[1],n[2],n[3])),r.lineWidth&&e.strokeRect(n[0],n[1],n[2],n[3])):r.type==o.Graphics.CIRC&&(e.beginPath(),e.arc(n[0],n[1],n[2],0,2*Math.PI),e.closePath(),r.fill&&(e.fillStyle=color="#"+("00000"+(0|r.fillColor).toString(16)).substr(-6),e.fill()),r.lineWidth&&e.stroke())}},o.Graphics=function(){o.DisplayObjectContainer.call(this),this.renderable=!0,this.fillAlpha=1,this.lineWidth=2,this.lineColor="#FF0000",this.graphicsData=[]},o.Graphics.POLY=0,o.Graphics.RECT=1,o.Graphics.CIRC=2,o.Graphics.constructor=o.Graphics,o.Graphics.prototype=Object.create(o.DisplayObjectContainer.prototype),o.Graphics.prototype.lineStyle=function(t,e,i){this.lineWidth=t||0,this.lineColor=e||0,this.lineAlpha=void 0==i?1:i,this.currentPath={lineWidth:this.lineWidth,lineColor:this.lineColor,lineAlpha:this.lineAlpha,points:[],type:o.Graphics.POLY},this.graphicsData.push(this.currentPath)},o.Graphics.prototype.moveTo=function(t,e){this.currentPath={lineWidth:this.lineWidth,lineColor:this.lineColor,lineAlpha:this.lineAlpha,points:[],type:o.Graphics.POLY},this.currentPath.points.push(t,e),this.graphicsData.push(this.currentPath)},o.Graphics.prototype.lineTo=function(t,e){this.currentPath.points.push(t,e),this.dirty=!0},o.Graphics.prototype.beginFill=function(t,e){this.filling=!0,this.fillColor=t||0,this.fillAlpha=e||1},o.Graphics.prototype.endFill=function(){this.filling=!1,this.fillColor=null,this.fillAlpha=1},o.Graphics.prototype.updateTransform=function(){this.visible&&o.DisplayObject.prototype.updateTransform.call(this)},o.Graphics.prototype.drawRect=function(t,e,i,r){this.currentPath={lineWidth:this.lineWidth,lineColor:this.lineColor,lineAlpha:this.lineAlpha,fillColor:this.fillColor,fillAlpha:this.fillAlpha,fill:this.filling,points:[t,e,i,r],type:o.Graphics.RECT},this.graphicsData.push(this.currentPath),this.dirty=!0},o.Graphics.prototype.drawCircle=function(t,e,i){this.currentPath={lineWidth:this.lineWidth,lineColor:this.lineColor,lineAlpha:this.lineAlpha,fillColor:this.fillColor,fillAlpha:this.fillAlpha,fill:this.filling,points:[t,e,i],type:o.Graphics.CIRC},this.graphicsData.push(this.currentPath),this.dirty=!0},o.Graphics.prototype.clear=function(){this.dirty=!0,this.clearDirty=!0,this.graphicsData=[]},o.Strip=function(t,e,i){o.DisplayObjectContainer.call(this),this.texture=t,this.blendMode=o.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(r){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=e,this.height=i,t.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},o.Strip.constructor=o.Strip,o.Strip.prototype=Object.create(o.DisplayObjectContainer.prototype),o.Strip.prototype.setTexture=function(t){this.texture=t,this.width=t.frame.width,this.height=t.frame.height,this.updateFrame=!0},o.Strip.prototype.onTextureUpdate=function(){this.updateFrame=!0},o.Rope=function(t,e){o.Strip.call(this,t),this.points=e;try{this.verticies=new Float32Array(4*e.length),this.uvs=new Float32Array(4*e.length),this.colors=new Float32Array(2*e.length),this.indices=new Uint16Array(2*e.length)}catch(i){this.verticies=verticies,this.uvs=uvs,this.colors=colors,this.indices=indices}this.refresh()},o.Rope.constructor=o.Rope,o.Rope.prototype=Object.create(o.Strip.prototype),o.Rope.prototype.refresh=function(){var t=this.points;if(!(1>t.length)){var e=this.uvs,i=this.indices,r=this.colors,n=t[0],s=t[0];this.count-=.2,e[0]=0,e[1]=1,e[2]=0,e[3]=1,r[0]=1,r[1]=1,i[0]=0,i[1]=1;for(var a=t.length,o=1;a>o;o++){var s=t[o],h=4*o,l=o/(a-1);o%2?(e[h]=l,e[h+1]=0,e[h+2]=l,e[h+3]=1):(e[h]=l,e[h+1]=0,e[h+2]=l,e[h+3]=1),h=2*o,r[h]=1,r[h+1]=1,h=2*o,i[h]=h,i[h+1]=h+1,n=s}}},o.Rope.prototype.updateTransform=function(){var t=this.points;if(!(1>t.length)){var e,i=this.verticies,r=t[0],n={x:0,y:0},s=t[0];this.count-=.2,i[0]=s.x+n.x,i[1]=s.y+n.y,i[2]=s.x-n.x,i[3]=s.y-n.y;for(var a=t.length,h=1;a>h;h++){var s=t[h],l=4*h;e=t.length-1>h?t[h+1]:s,n.y=-(e.x-r.x),n.x=e.y-r.y;var u=10*(1-h/(a-1));u>1&&(u=1);var c=Math.sqrt(n.x*n.x+n.y*n.y),d=this.texture.height/2;n.x/=c,n.y/=c,n.x*=d,n.y*=d,i[l]=s.x+n.x,i[l+1]=s.y+n.y,i[l+2]=s.x-n.x,i[l+3]=s.y-n.y,r=s}o.DisplayObjectContainer.prototype.updateTransform.call(this)}},o.Rope.prototype.setTexture=function(t){this.texture=t,this.updateFrame=!0},o.TilingSprite=function(t,e,i){o.DisplayObjectContainer.call(this),this.texture=t,this.width=e,this.height=i,this.renderable=!0,this.tileScale=new o.Point(1,1),this.tilePosition=new o.Point(0,0),this.blendMode=o.blendModes.NORMAL},o.TilingSprite.constructor=o.TilingSprite,o.TilingSprite.prototype=Object.create(o.DisplayObjectContainer.prototype),o.TilingSprite.prototype.setTexture=function(t){this.texture=t,this.updateFrame=!0},o.TilingSprite.prototype.onTextureUpdate=function(){this.updateFrame=!0},o.Spine=function(t){if(o.DisplayObjectContainer.call(this),this.spineData=o.AnimCache[t],!this.spineData)throw Error("Spine data must be preloaded using PIXI.SpineLoader or PIXI.AssetLoader: "+t);this.count=0,this.sprites=[],this.skeleton=new d.Skeleton(this.spineData),this.skeleton.updateWorldTransform(),this.stateData=new d.AnimationStateData(this.spineData),this.state=new d.AnimationState(this.stateData);for(var e=0;this.skeleton.drawOrder.length>e;e++){var i=this.skeleton.drawOrder[e].data.attachmentName;o.TextureCache[i]||(i+=".png");var r=new o.Sprite(o.Texture.fromFrame(i));r.anchor.x=r.anchor.y=.5,this.addChild(r),this.sprites.push(r)}},o.Spine.constructor=o.Spine,o.Spine.prototype=Object.create(o.DisplayObjectContainer.prototype),o.Spine.prototype.updateTransform=function(){this.state.update(1/60),this.state.apply(this.skeleton),this.skeleton.updateWorldTransform();for(var t=0;this.skeleton.drawOrder.length>t;t++){var e=this.skeleton.drawOrder[t],i=e.bone.worldX+e.attachment.x*e.bone.m00+e.attachment.y*e.bone.m01+.5*e.attachment.width,r=e.bone.worldY+e.attachment.x*e.bone.m10+e.attachment.y*e.bone.m11+.5*e.attachment.height;if(e.cacheName!=e.attachment.name){var n=e.attachment.name;o.TextureCache[n]||(n+=".png"),this.sprites[t].setTexture(o.TextureCache[n]),e.cacheName=e.attachment.name}i+=-(e.attachment.width*(e.bone.worldScaleX+e.attachment.scaleX-1)>>1),r+=-(e.attachment.height*(e.bone.worldScaleY+e.attachment.scaleY-1)>>1),this.sprites[t].position.x=i,this.sprites[t].position.y=r,this.sprites[t].rotation=-(e.bone.worldRotation+e.attachment.rotation)*(Math.PI/180)}o.DisplayObjectContainer.prototype.updateTransform.call(this)};var d={};d.BoneData=function(t,e){this.name=t,this.parent=e},d.BoneData.prototype={length:0,x:0,y:0,rotation:0,scaleX:1,scaleY:1},d.SlotData=function(t,e){this.name=t,this.boneData=e},d.SlotData.prototype={r:1,g:1,b:1,a:1,attachmentName:null},d.Bone=function(t,e){this.data=t,this.parent=e,this.setToSetupPose()},d.Bone.yDown=!1,d.Bone.prototype={x:0,y:0,rotation:0,scaleX:1,scaleY:1,m00:0,m01:0,worldX:0,m10:0,m11:0,worldY:0,worldRotation:0,worldScaleX:1,worldScaleY:1,updateWorldTransform:function(t,e){var i=this.parent;null!=i?(this.worldX=this.x*i.m00+this.y*i.m01+i.worldX,this.worldY=this.x*i.m10+this.y*i.m11+i.worldY,this.worldScaleX=i.worldScaleX*this.scaleX,this.worldScaleY=i.worldScaleY*this.scaleY,this.worldRotation=i.worldRotation+this.rotation):(this.worldX=this.x,this.worldY=this.y,this.worldScaleX=this.scaleX,this.worldScaleY=this.scaleY,this.worldRotation=this.rotation);var r=this.worldRotation*Math.PI/180,n=Math.cos(r),s=Math.sin(r);this.m00=n*this.worldScaleX,this.m10=s*this.worldScaleX,this.m01=-s*this.worldScaleY,this.m11=n*this.worldScaleY,t&&(this.m00=-this.m00,this.m01=-this.m01),e&&(this.m10=-this.m10,this.m11=-this.m11),d.Bone.yDown&&(this.m10=-this.m10,this.m11=-this.m11)},setToSetupPose:function(){var t=this.data;this.x=t.x,this.y=t.y,this.rotation=t.rotation,this.scaleX=t.scaleX,this.scaleY=t.scaleY}},d.Slot=function(t,e,i){this.data=t,this.skeleton=e,this.bone=i,this.setToSetupPose()},d.Slot.prototype={r:1,g:1,b:1,a:1,_attachmentTime:0,attachment:null,setAttachment:function(t){this.attachment=t,this._attachmentTime=this.skeleton.time},setAttachmentTime:function(t){this._attachmentTime=this.skeleton.time-t},getAttachmentTime:function(){return this.skeleton.time-this._attachmentTime},setToSetupPose:function(){var t=this.data;this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a;for(var e=this.skeleton.data.slots,i=0,r=e.length;r>i;i++)if(e[i]==t){this.setAttachment(t.attachmentName?this.skeleton.getAttachmentBySlotIndex(i,t.attachmentName):null); +break}}},d.Skin=function(t){this.name=t,this.attachments={}},d.Skin.prototype={addAttachment:function(t,e,i){this.attachments[t+":"+e]=i},getAttachment:function(t,e){return this.attachments[t+":"+e]},_attachAll:function(t,e){for(var i in e.attachments){var r=i.indexOf(":"),n=parseInt(i.substring(0,r)),s=i.substring(r+1),a=t.slots[n];if(a.attachment&&a.attachment.name==s){var o=this.getAttachment(n,s);o&&a.setAttachment(o)}}}},d.Animation=function(t,e,i){this.name=t,this.timelines=e,this.duration=i},d.Animation.prototype={apply:function(t,e,i){i&&0!=this.duration&&(e%=this.duration);for(var r=this.timelines,n=0,s=r.length;s>n;n++)r[n].apply(t,e,1)},mix:function(t,e,i,r){i&&0!=this.duration&&(e%=this.duration);for(var n=this.timelines,s=0,a=n.length;a>s;s++)n[s].apply(t,e,r)}},d.binarySearch=function(t,e,i){var r=0,n=Math.floor(t.length/i)-2;if(0==n)return i;for(var s=n>>>1;;){if(e>=t[(s+1)*i]?r=s+1:n=s,r==n)return(r+1)*i;s=r+n>>>1}},d.linearSearch=function(t,e,i){for(var r=0,n=t.length-i;n>=r;r+=i)if(t[r]>e)return r;return-1},d.Curves=function(t){this.curves=[],this.curves.length=6*(t-1)},d.Curves.prototype={setLinear:function(t){this.curves[6*t]=0},setStepped:function(t){this.curves[6*t]=-1},setCurve:function(t,e,i,r,n){var s=.1,a=s*s,o=a*s,h=3*s,l=3*a,u=6*a,c=6*o,d=2*-e+r,p=2*-i+n,f=3*(e-r)+1,v=3*(i-n)+1,m=6*t,g=this.curves;g[m]=e*h+d*l+f*o,g[m+1]=i*h+p*l+v*o,g[m+2]=d*u+f*c,g[m+3]=p*u+v*c,g[m+4]=f*c,g[m+5]=v*c},getCurvePercent:function(t,e){e=0>e?0:e>1?1:e;var i=6*t,r=this.curves,n=r[i];if(!n)return e;if(-1==n)return 0;for(var s=r[i+1],a=r[i+2],o=r[i+3],h=r[i+4],l=r[i+5],u=n,c=s,d=8;;){if(u>=e){var p=u-n,f=c-s;return f+(c-f)*(e-p)/(u-p)}if(0==d)break;d--,n+=a,s+=o,a+=h,o+=l,u+=n,c+=s}return c+(1-c)*(e-u)/(1-u)}},d.RotateTimeline=function(t){this.curves=new d.Curves(t),this.frames=[],this.frames.length=2*t},d.RotateTimeline.prototype={boneIndex:0,getFrameCount:function(){return this.frames.length/2},setFrame:function(t,e,i){t*=2,this.frames[t]=e,this.frames[t+1]=i},apply:function(t,e,i){var r=this.frames;if(!(r[0]>e)){var n=t.bones[this.boneIndex];if(e>=r[r.length-2]){for(var s=n.data.rotation+r[r.length-1]-n.rotation;s>180;)s-=360;for(;-180>s;)s+=360;return n.rotation+=s*i,void 0}var a=d.binarySearch(r,e,2),o=r[a-1],h=r[a],l=1-(e-h)/(r[a-2]-h);l=this.curves.getCurvePercent(a/2-1,l);for(var s=r[a+1]-o;s>180;)s-=360;for(;-180>s;)s+=360;for(s=n.data.rotation+(o+s*l)-n.rotation;s>180;)s-=360;for(;-180>s;)s+=360;n.rotation+=s*i}}},d.TranslateTimeline=function(t){this.curves=new d.Curves(t),this.frames=[],this.frames.length=3*t},d.TranslateTimeline.prototype={boneIndex:0,getFrameCount:function(){return this.frames.length/3},setFrame:function(t,e,i,r){t*=3,this.frames[t]=e,this.frames[t+1]=i,this.frames[t+2]=r},apply:function(t,e,i){var r=this.frames;if(!(r[0]>e)){var n=t.bones[this.boneIndex];if(e>=r[r.length-3])return n.x+=(n.data.x+r[r.length-2]-n.x)*i,n.y+=(n.data.y+r[r.length-1]-n.y)*i,void 0;var s=d.binarySearch(r,e,3),a=r[s-2],o=r[s-1],h=r[s],l=1-(e-h)/(r[s+-3]-h);l=this.curves.getCurvePercent(s/3-1,l),n.x+=(n.data.x+a+(r[s+1]-a)*l-n.x)*i,n.y+=(n.data.y+o+(r[s+2]-o)*l-n.y)*i}}},d.ScaleTimeline=function(t){this.curves=new d.Curves(t),this.frames=[],this.frames.length=3*t},d.ScaleTimeline.prototype={boneIndex:0,getFrameCount:function(){return this.frames.length/3},setFrame:function(t,e,i,r){t*=3,this.frames[t]=e,this.frames[t+1]=i,this.frames[t+2]=r},apply:function(t,e,i){var r=this.frames;if(!(r[0]>e)){var n=t.bones[this.boneIndex];if(e>=r[r.length-3])return n.scaleX+=(n.data.scaleX-1+r[r.length-2]-n.scaleX)*i,n.scaleY+=(n.data.scaleY-1+r[r.length-1]-n.scaleY)*i,void 0;var s=d.binarySearch(r,e,3),a=r[s-2],o=r[s-1],h=r[s],l=1-(e-h)/(r[s+-3]-h);l=this.curves.getCurvePercent(s/3-1,l),n.scaleX+=(n.data.scaleX-1+a+(r[s+1]-a)*l-n.scaleX)*i,n.scaleY+=(n.data.scaleY-1+o+(r[s+2]-o)*l-n.scaleY)*i}}},d.ColorTimeline=function(t){this.curves=new d.Curves(t),this.frames=[],this.frames.length=5*t},d.ColorTimeline.prototype={slotIndex:0,getFrameCount:function(){return this.frames.length/2},setFrame:function(t,e){t*=5,this.frames[t]=e,this.frames[t+1]=r,this.frames[t+2]=g,this.frames[t+3]=b,this.frames[t+4]=a},apply:function(t,e,i){var r=this.frames;if(!(r[0]>e)){var n=t.slots[this.slotIndex];if(e>=r[r.length-5]){var s=r.length-1;return n.r=r[s-3],n.g=r[s-2],n.b=r[s-1],n.a=r[s],void 0}var a=d.binarySearch(r,e,5),o=r[a-4],h=r[a-3],l=r[a-2],u=r[a-1],c=r[a],p=1-(e-c)/(r[a-5]-c);p=this.curves.getCurvePercent(a/5-1,p);var f=o+(r[a+1]-o)*p,v=h+(r[a+2]-h)*p,m=l+(r[a+3]-l)*p,g=u+(r[a+4]-u)*p;1>i?(n.r+=(f-n.r)*i,n.g+=(v-n.g)*i,n.b+=(m-n.b)*i,n.a+=(g-n.a)*i):(n.r=f,n.g=v,n.b=m,n.a=g)}}},d.AttachmentTimeline=function(t){this.curves=new d.Curves(t),this.frames=[],this.frames.length=t,this.attachmentNames=[],this.attachmentNames.length=t},d.AttachmentTimeline.prototype={slotIndex:0,getFrameCount:function(){return this.frames.length/2},setFrame:function(t,e,i){this.frames[t]=e,this.attachmentNames[t]=i},apply:function(t,e){var i=this.frames;if(!(i[0]>e)){var r;r=e>=i[i.length-1]?i.length-1:d.binarySearch(i,e,1)-1;var n=this.attachmentNames[r];t.slots[this.slotIndex].setAttachment(n?t.getAttachmentBySlotIndex(this.slotIndex,n):null)}}},d.SkeletonData=function(){this.bones=[],this.slots=[],this.skins=[],this.animations=[]},d.SkeletonData.prototype={defaultSkin:null,findBone:function(t){for(var e=this.bones,i=0,r=e.length;r>i;i++)if(e[i].name==t)return e[i];return null},findBoneIndex:function(t){for(var e=this.bones,i=0,r=e.length;r>i;i++)if(e[i].name==t)return i;return-1},findSlot:function(t){for(var e=this.slots,i=0,r=e.length;r>i;i++)if(e[i].name==t)return slot[i];return null},findSlotIndex:function(t){for(var e=this.slots,i=0,r=e.length;r>i;i++)if(e[i].name==t)return i;return-1},findSkin:function(t){for(var e=this.skins,i=0,r=e.length;r>i;i++)if(e[i].name==t)return e[i];return null},findAnimation:function(t){for(var e=this.animations,i=0,r=e.length;r>i;i++)if(e[i].name==t)return e[i];return null}},d.Skeleton=function(t){this.data=t,this.bones=[];for(var e=0,i=t.bones.length;i>e;e++){var r=t.bones[e],n=r.parent?this.bones[t.bones.indexOf(r.parent)]:null;this.bones.push(new d.Bone(r,n))}this.slots=[],this.drawOrder=[];for(var e=0,i=t.slots.length;i>e;e++){var s=t.slots[e],a=this.bones[t.bones.indexOf(s.boneData)],o=new d.Slot(s,this,a);this.slots.push(o),this.drawOrder.push(o)}},d.Skeleton.prototype={x:0,y:0,skin:null,r:1,g:1,b:1,a:1,time:0,flipX:!1,flipY:!1,updateWorldTransform:function(){for(var t=this.flipX,e=this.flipY,i=this.bones,r=0,n=i.length;n>r;r++)i[r].updateWorldTransform(t,e)},setToSetupPose:function(){this.setBonesToSetupPose(),this.setSlotsToSetupPose()},setBonesToSetupPose:function(){for(var t=this.bones,e=0,i=t.length;i>e;e++)t[e].setToSetupPose()},setSlotsToSetupPose:function(){for(var t=this.slots,e=0,i=t.length;i>e;e++)t[e].setToSetupPose(e)},getRootBone:function(){return 0==this.bones.length?null:this.bones[0]},findBone:function(t){for(var e=this.bones,i=0,r=e.length;r>i;i++)if(e[i].data.name==t)return e[i];return null},findBoneIndex:function(t){for(var e=this.bones,i=0,r=e.length;r>i;i++)if(e[i].data.name==t)return i;return-1},findSlot:function(t){for(var e=this.slots,i=0,r=e.length;r>i;i++)if(e[i].data.name==t)return e[i];return null},findSlotIndex:function(t){for(var e=this.slots,i=0,r=e.length;r>i;i++)if(e[i].data.name==t)return i;return-1},setSkinByName:function(t){var e=this.data.findSkin(t);if(!e)throw"Skin not found: "+t;this.setSkin(e)},setSkin:function(t){this.skin&&t&&t._attachAll(this,this.skin),this.skin=t},getAttachmentBySlotName:function(t,e){return this.getAttachmentBySlotIndex(this.data.findSlotIndex(t),e)},getAttachmentBySlotIndex:function(t,e){if(this.skin){var i=this.skin.getAttachment(t,e);if(i)return i}return this.data.defaultSkin?this.data.defaultSkin.getAttachment(t,e):null},setAttachment:function(t,e){for(var i=this.slots,r=0,n=i.size;n>r;r++){var s=i[r];if(s.data.name==t){var a=null;if(e&&(a=this.getAttachment(r,e),null==a))throw"Attachment not found: "+e+", for slot: "+t;return s.setAttachment(a),void 0}}throw"Slot not found: "+t},update:function(t){time+=t}},d.AttachmentType={region:0},d.RegionAttachment=function(){this.offset=[],this.offset.length=8,this.uvs=[],this.uvs.length=8},d.RegionAttachment.prototype={x:0,y:0,rotation:0,scaleX:1,scaleY:1,width:0,height:0,rendererObject:null,regionOffsetX:0,regionOffsetY:0,regionWidth:0,regionHeight:0,regionOriginalWidth:0,regionOriginalHeight:0,setUVs:function(t,e,i,r,n){var s=this.uvs;n?(s[2]=t,s[3]=r,s[4]=t,s[5]=e,s[6]=i,s[7]=e,s[0]=i,s[1]=r):(s[0]=t,s[1]=r,s[2]=t,s[3]=e,s[4]=i,s[5]=e,s[6]=i,s[7]=r)},updateOffset:function(){var t=this.width/this.regionOriginalWidth*this.scaleX,e=this.height/this.regionOriginalHeight*this.scaleY,i=-this.width/2*this.scaleX+this.regionOffsetX*t,r=-this.height/2*this.scaleY+this.regionOffsetY*e,n=i+this.regionWidth*t,s=r+this.regionHeight*e,a=this.rotation*Math.PI/180,o=Math.cos(a),h=Math.sin(a),l=i*o+this.x,u=i*h,c=r*o+this.y,d=r*h,p=n*o+this.x,f=n*h,v=s*o+this.y,m=s*h,g=this.offset;g[0]=l-d,g[1]=c+u,g[2]=l-m,g[3]=v+u,g[4]=p-m,g[5]=v+f,g[6]=p-d,g[7]=c+f},computeVertices:function(t,e,i,r){t+=i.worldX,e+=i.worldY;var n=i.m00,s=i.m01,a=i.m10,o=i.m11,h=this.offset;r[0]=h[0]*n+h[1]*s+t,r[1]=h[0]*a+h[1]*o+e,r[2]=h[2]*n+h[3]*s+t,r[3]=h[2]*a+h[3]*o+e,r[4]=h[4]*n+h[5]*s+t,r[5]=h[4]*a+h[5]*o+e,r[6]=h[6]*n+h[7]*s+t,r[7]=h[6]*a+h[7]*o+e}},d.AnimationStateData=function(t){this.skeletonData=t,this.animationToMixTime={}},d.AnimationStateData.prototype={setMixByName:function(t,e,i){var r=this.skeletonData.findAnimation(t);if(!r)throw"Animation not found: "+t;var n=this.skeletonData.findAnimation(e);if(!n)throw"Animation not found: "+e;this.setMix(r,n,i)},setMix:function(t,e,i){this.animationToMixTime[t.name+":"+e.name]=i},getMix:function(t,e){var i=this.animationToMixTime[t.name+":"+e.name];return i?i:0}},d.AnimationState=function(t){this.data=t,this.queue=[]},d.AnimationState.prototype={current:null,previous:null,currentTime:0,previousTime:0,currentLoop:!1,previousLoop:!1,mixTime:0,mixDuration:0,update:function(t){if(this.currentTime+=t,this.previousTime+=t,this.mixTime+=t,this.queue.length>0){var e=this.queue[0];this.currentTime>=e.delay&&(this._setAnimation(e.animation,e.loop),this.queue.shift())}},apply:function(t){if(this.current)if(this.previous){this.previous.apply(t,this.previousTime,this.previousLoop);var e=this.mixTime/this.mixDuration;e>=1&&(e=1,this.previous=null),this.current.mix(t,this.currentTime,this.currentLoop,e)}else this.current.apply(t,this.currentTime,this.currentLoop)},clearAnimation:function(){this.previous=null,this.current=null,this.queue.length=0},_setAnimation:function(t,e){this.previous=null,t&&this.current&&(this.mixDuration=this.data.getMix(this.current,t),this.mixDuration>0&&(this.mixTime=0,this.previous=this.current,this.previousTime=this.currentTime,this.previousLoop=this.currentLoop)),this.current=t,this.currentLoop=e,this.currentTime=0},setAnimationByName:function(t,e){var i=this.data.skeletonData.findAnimation(t);if(!i)throw"Animation not found: "+t;this.setAnimation(i,e)},setAnimation:function(t,e){this.queue.length=0,this._setAnimation(t,e)},addAnimationByName:function(t,e,i){var r=this.data.skeletonData.findAnimation(t);if(!r)throw"Animation not found: "+t;this.addAnimation(r,e,i)},addAnimation:function(t,e,i){var r={};if(r.animation=t,r.loop=e,!i||0>=i){var n=0==this.queue.length?this.current:this.queue[this.queue.length-1].animation;i=null!=n?n.duration-this.data.getMix(n,t)+(i||0):0}r.delay=i,this.queue.push(r)},isComplete:function(){return!this.current||this.currentTime>=this.current.duration}},d.SkeletonJson=function(t){this.attachmentLoader=t},d.SkeletonJson.prototype={scale:1,readSkeletonData:function(t){for(var e=new d.SkeletonData,i=t.bones,r=0,n=i.length;n>r;r++){var s=i[r],a=null;if(s.parent&&(a=e.findBone(s.parent),!a))throw"Parent bone not found: "+s.parent;var o=new d.BoneData(s.name,a);o.length=(s.length||0)*this.scale,o.x=(s.x||0)*this.scale,o.y=(s.y||0)*this.scale,o.rotation=s.rotation||0,o.scaleX=s.scaleX||1,o.scaleY=s.scaleY||1,e.bones.push(o)}for(var h=t.slots,r=0,n=h.length;n>r;r++){var l=h[r],o=e.findBone(l.bone);if(!o)throw"Slot bone not found: "+l.bone;var u=new d.SlotData(l.name,o),c=l.color;c&&(u.r=d.SkeletonJson.toColor(c,0),u.g=d.SkeletonJson.toColor(c,1),u.b=d.SkeletonJson.toColor(c,2),u.a=d.SkeletonJson.toColor(c,3)),u.attachmentName=l.attachment,e.slots.push(u)}var p=t.skins;for(var f in p)if(p.hasOwnProperty(f)){var v=p[f],m=new d.Skin(f);for(var g in v)if(v.hasOwnProperty(g)){var x=e.findSlotIndex(g),b=v[g];for(var y in b)if(b.hasOwnProperty(y)){var T=this.readAttachment(m,y,b[y]);null!=T&&m.addAttachment(x,y,T)}}e.skins.push(m),"default"==m.name&&(e.defaultSkin=m)}var w=t.animations;for(var _ in w)w.hasOwnProperty(_)&&this.readAnimation(_,w[_],e);return e},readAttachment:function(t,e,i){e=i.name||e;var r=d.AttachmentType[i.type||"region"],n=new d.RegionAttachment;return n.name=e,r==d.AttachmentType.region&&(n.x=(i.x||0)*this.scale,n.y=(i.y||0)*this.scale,n.scaleX=i.scaleX||1,n.scaleY=i.scaleY||1,n.rotation=i.rotation||0,n.width=(i.width||32)*this.scale,n.height=(i.height||32)*this.scale,n.updateOffset()),n},readAnimation:function(t,e,i){var r=[],n=0,s=e.bones;for(var a in s)if(s.hasOwnProperty(a)){var o=i.findBoneIndex(a);if(-1==o)throw"Bone not found: "+a;var h=s[a];for(var l in h)if(h.hasOwnProperty(l)){var u=h[l];if("rotate"==l){var c=new d.RotateTimeline(u.length);c.boneIndex=o;for(var p=0,f=0,v=u.length;v>f;f++){var m=u[f];c.setFrame(p,m.time,m.angle),d.SkeletonJson.readCurve(c,p,m),p++}r.push(c),n=Math.max(n,c.frames[2*c.getFrameCount()-2])}else{if("translate"!=l&&"scale"!=l)throw"Invalid timeline type for a bone: "+l+" ("+a+")";var c,g=1;"scale"==l?c=new d.ScaleTimeline(u.length):(c=new d.TranslateTimeline(u.length),g=this.scale),c.boneIndex=o;for(var p=0,f=0,v=u.length;v>f;f++){var m=u[f],x=(m.x||0)*g,b=(m.y||0)*g;c.setFrame(p,m.time,x,b),d.SkeletonJson.readCurve(c,p,m),p++}r.push(c),n=Math.max(n,c.frames[3*c.getFrameCount()-3])}}}var y=e.slots;for(var T in y)if(y.hasOwnProperty(T)){var w=y[T],_=i.findSlotIndex(T);for(var l in w)if(w.hasOwnProperty(l)){var u=w[l];if("color"==l){var c=new d.ColorTimeline(u.length);c.slotIndex=_;for(var p=0,f=0,v=u.length;v>f;f++){var m=u[f],A=m.color,R=d.SkeletonJson.toColor(A,0),S=d.SkeletonJson.toColor(A,1),L=d.SkeletonJson.toColor(A,2),C=d.SkeletonJson.toColor(A,3);c.setFrame(p,m.time,R,S,L,C),d.SkeletonJson.readCurve(c,p,m),p++}r.push(c),n=Math.max(n,c.frames[5*c.getFrameCount()-5])}else{if("attachment"!=l)throw"Invalid timeline type for a slot: "+l+" ("+T+")";var c=new d.AttachmentTimeline(u.length);c.slotIndex=_;for(var p=0,f=0,v=u.length;v>f;f++){var m=u[f];c.setFrame(p++,m.time,m.name)}r.push(c),n=Math.max(n,c.frames[Math.floor(c.getFrameCount())-1])}}}i.animations.push(new d.Animation(t,r,n))}},d.SkeletonJson.readCurve=function(t,e,i){var r=i.curve;r&&("stepped"==r?t.curves.setStepped(e):r instanceof Array&&t.curves.setCurve(e,r[0],r[1],r[2],r[3]))},d.SkeletonJson.toColor=function(t,e){if(8!=t.length)throw"Color hexidecimal length must be 8, recieved: "+t;return parseInt(t.substring(2*e,2),16)/255},d.Atlas=function(t,e){this.textureLoader=e,this.pages=[],this.regions=[];var i=new d.AtlasReader(t),r=[];r.length=4;for(var n=null;;){var s=i.readLine();if(null==s)break;if(s=i.trim(s),0==s.length)n=null;else if(n){var a=new d.AtlasRegion;a.name=s,a.page=n,a.rotate="true"==i.readValue(),i.readTuple(r);var o=parseInt(r[0]),h=parseInt(r[1]);i.readTuple(r);var l=parseInt(r[0]),u=parseInt(r[1]);a.u=o/n.width,a.v=h/n.height,a.rotate?(a.u2=(o+u)/n.width,a.v2=(h+l)/n.height):(a.u2=(o+l)/n.width,a.v2=(h+u)/n.height),a.x=o,a.y=h,a.width=Math.abs(l),a.height=Math.abs(u),4==i.readTuple(r)&&(a.splits=[parseInt(r[0]),parseInt(r[1]),parseInt(r[2]),parseInt(r[3])],4==i.readTuple(r)&&(a.pads=[parseInt(r[0]),parseInt(r[1]),parseInt(r[2]),parseInt(r[3])],i.readTuple(r))),a.originalWidth=parseInt(r[0]),a.originalHeight=parseInt(r[1]),i.readTuple(r),a.offsetX=parseInt(r[0]),a.offsetY=parseInt(r[1]),a.index=parseInt(i.readValue()),this.regions.push(a)}else{n=new d.AtlasPage,n.name=s,n.format=d.Atlas.Format[i.readValue()],i.readTuple(r),n.minFilter=d.Atlas.TextureFilter[r[0]],n.magFilter=d.Atlas.TextureFilter[r[1]];var c=i.readValue();n.uWrap=d.Atlas.TextureWrap.clampToEdge,n.vWrap=d.Atlas.TextureWrap.clampToEdge,"x"==c?n.uWrap=d.Atlas.TextureWrap.repeat:"y"==c?n.vWrap=d.Atlas.TextureWrap.repeat:"xy"==c&&(n.uWrap=n.vWrap=d.Atlas.TextureWrap.repeat),e.load(n,s),this.pages.push(n)}}},d.Atlas.prototype={findRegion:function(t){for(var e=this.regions,i=0,r=e.length;r>i;i++)if(e[i].name==t)return e[i];return null},dispose:function(){for(var t=this.pages,e=0,i=t.length;i>e;e++)this.textureLoader.unload(t[e].rendererObject)},updateUVs:function(t){for(var e=this.regions,i=0,r=e.length;r>i;i++){var n=e[i];n.page==t&&(n.u=n.x/t.width,n.v=n.y/t.height,n.rotate?(n.u2=(n.x+n.height)/t.width,n.v2=(n.y+n.width)/t.height):(n.u2=(n.x+n.width)/t.width,n.v2=(n.y+n.height)/t.height))}}},d.Atlas.Format={alpha:0,intensity:1,luminanceAlpha:2,rgb565:3,rgba4444:4,rgb888:5,rgba8888:6},d.Atlas.TextureFilter={nearest:0,linear:1,mipMap:2,mipMapNearestNearest:3,mipMapLinearNearest:4,mipMapNearestLinear:5,mipMapLinearLinear:6},d.Atlas.TextureWrap={mirroredRepeat:0,clampToEdge:1,repeat:2},d.AtlasPage=function(){},d.AtlasPage.prototype={name:null,format:null,minFilter:null,magFilter:null,uWrap:null,vWrap:null,rendererObject:null,width:0,height:0},d.AtlasRegion=function(){},d.AtlasRegion.prototype={page:null,name:null,x:0,y:0,width:0,height:0,u:0,v:0,u2:0,v2:0,offsetX:0,offsetY:0,originalWidth:0,originalHeight:0,index:0,rotate:!1,splits:null,pads:null},d.AtlasReader=function(t){this.lines=t.split(/\r\n|\r|\n/)},d.AtlasReader.prototype={index:0,trim:function(t){return t.replace(/^\s+|\s+$/g,"")},readLine:function(){return this.index>=this.lines.length?null:this.lines[this.index++]},readValue:function(){var t=this.readLine(),e=t.indexOf(":");if(-1==e)throw"Invalid line: "+t;return this.trim(t.substring(e+1))},readTuple:function(t){var e=this.readLine(),i=e.indexOf(":");if(-1==i)throw"Invalid line: "+e;for(var r=0,n=i+1;3>r;r++){var s=e.indexOf(",",n);if(-1==s){if(0==r)throw"Invalid line: "+e;break}t[r]=this.trim(e.substr(n,s-n)),n=s+1}return t[r]=this.trim(e.substring(n)),r+1}},d.AtlasAttachmentLoader=function(t){this.atlas=t},d.AtlasAttachmentLoader.prototype={newAttachment:function(t,e,i){switch(e){case d.AttachmentType.region:var r=this.atlas.findRegion(i);if(!r)throw"Region not found in atlas: "+i+" ("+e+")";var n=new d.RegionAttachment(i);return n.rendererObject=r,n.setUVs(r.u,r.v,r.u2,r.v2,r.rotate),n.regionOffsetX=r.offsetX,n.regionOffsetY=r.offsetY,n.regionWidth=r.width,n.regionHeight=r.height,n.regionOriginalWidth=r.originalWidth,n.regionOriginalHeight=r.originalHeight,n}throw"Unknown attachment type: "+e}},o.AnimCache={},d.Bone.yDown=!0,o.CustomRenderable=function(){o.DisplayObject.call(this)},o.CustomRenderable.constructor=o.CustomRenderable,o.CustomRenderable.prototype=Object.create(o.DisplayObject.prototype),o.CustomRenderable.prototype.renderCanvas=function(){},o.CustomRenderable.prototype.initWebGL=function(){},o.CustomRenderable.prototype.renderWebGL=function(){},o.BaseTextureCache={},o.texturesToUpdate=[],o.texturesToDestroy=[],o.BaseTexture=function(t){if(o.EventTarget.call(this),this.width=100,this.height=100,this.source=t,t){if(this.source instanceof Image)if(this.source.complete)this.hasLoaded=!0,this.width=this.source.width,this.height=this.source.height,o.texturesToUpdate.push(this);else{var e=this;this.source.onload=function(){e.hasLoaded=!0,e.width=e.source.width,e.height=e.source.height,o.texturesToUpdate.push(e),e.dispatchEvent({type:"loaded",content:e})}}else this.hasLoaded=!0,this.width=this.source.width,this.height=this.source.height,o.texturesToUpdate.push(this);this._powerOf2=!1}},o.BaseTexture.constructor=o.BaseTexture,o.BaseTexture.prototype.destroy=function(){this.source instanceof Image&&(this.source.src=null),this.source=null,o.texturesToDestroy.push(this)},o.BaseTexture.fromImage=function(t,e){var i=o.BaseTextureCache[t];if(!i){var r=new Image;e&&(r.crossOrigin=""),r.src=t,i=new o.BaseTexture(r),o.BaseTextureCache[t]=i}return i},o.TextureCache={},o.FrameCache={},o.Texture=function(t,e){if(o.EventTarget.call(this),e||(this.noFrame=!0,e=new o.Rectangle(0,0,1,1)),this.trim=new o.Point,t instanceof o.Texture&&(t=t.baseTexture),this.baseTexture=t,this.frame=e,this.scope=this,t.hasLoaded)this.noFrame&&(e=new o.Rectangle(0,0,t.width,t.height)),this.setFrame(e);else{var i=this;t.addEventListener("loaded",function(){i.onBaseTextureLoaded()})}},o.Texture.constructor=o.Texture,o.Texture.prototype.onBaseTextureLoaded=function(){var t=this.baseTexture;t.removeEventListener("loaded",this.onLoaded),this.noFrame&&(this.frame=new o.Rectangle(0,0,t.width,t.height)),this.noFrame=!1,this.width=this.frame.width,this.height=this.frame.height,this.scope.dispatchEvent({type:"update",content:this})},o.Texture.prototype.destroy=function(t){t&&this.baseTexture.destroy()},o.Texture.prototype.setFrame=function(t){if(this.frame=t,this.width=t.width,this.height=t.height,t.x+t.width>this.baseTexture.width||t.y+t.height>this.baseTexture.height)throw Error("Texture Error: frame does not fit inside the base Texture dimensions "+this);this.updateFrame=!0,o.Texture.frameUpdates.push(this)},o.Texture.fromImage=function(t,e){var i=o.TextureCache[t];return i||(i=new o.Texture(o.BaseTexture.fromImage(t,e)),o.TextureCache[t]=i),i},o.Texture.fromFrame=function(t){var e=o.TextureCache[t];if(!e)throw Error("The frameId '"+t+"' does not exist in the texture cache "+this);return e},o.Texture.fromCanvas=function(t){var e=new o.BaseTexture(t);return new o.Texture(e)},o.Texture.addTextureToCache=function(t,e){o.TextureCache[e]=t},o.Texture.removeTextureFromCache=function(t){var e=o.TextureCache[t];return o.TextureCache[t]=null,e},o.Texture.frameUpdates=[],o.RenderTexture=function(t,e){o.EventTarget.call(this),this.width=t||100,this.height=e||100,this.indetityMatrix=o.mat3.create(),this.frame=new o.Rectangle(0,0,this.width,this.height),o.gl?this.initWebGL():this.initCanvas()},o.RenderTexture.constructor=o.RenderTexture,o.RenderTexture.prototype=Object.create(o.Texture.prototype),o.RenderTexture.prototype.initWebGL=function(){var t=o.gl;this.glFramebuffer=t.createFramebuffer(),t.bindFramebuffer(t.FRAMEBUFFER,this.glFramebuffer),this.glFramebuffer.width=this.width,this.glFramebuffer.height=this.height,this.baseTexture=new o.BaseTexture,this.baseTexture.width=this.width,this.baseTexture.height=this.height,this.baseTexture._glTexture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.baseTexture._glTexture),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,this.width,this.height,0,t.RGBA,t.UNSIGNED_BYTE,null),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),this.baseTexture.isRender=!0,t.bindFramebuffer(t.FRAMEBUFFER,this.glFramebuffer),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,this.baseTexture._glTexture,0),this.projectionMatrix=o.mat4.create(),this.projectionMatrix[5]=2/this.height,this.projectionMatrix[13]=-1,this.projectionMatrix[0]=2/this.width,this.projectionMatrix[12]=-1,this.render=this.renderWebGL},o.RenderTexture.prototype.initCanvas=function(){this.renderer=new o.CanvasRenderer(this.width,this.height,null,0),this.baseTexture=new o.BaseTexture(this.renderer.view),this.frame=new o.Rectangle(0,0,this.width,this.height),this.render=this.renderCanvas},o.RenderTexture.prototype.renderWebGL=function(t,e){var i=o.gl;i.colorMask(!0,!0,!0,!0),i.viewport(0,0,this.width,this.height),i.bindFramebuffer(i.FRAMEBUFFER,this.glFramebuffer),e&&(i.clearColor(0,0,0,0),i.clear(i.COLOR_BUFFER_BIT));var r=t.children;t.worldTransform=o.mat3.create();for(var n=0,s=r.length;s>n;n++)r[n].updateTransform();var a=t.__renderGroup;a?t==a.root?a.render(this.projectionMatrix):a.renderSpecific(t,this.projectionMatrix):(this.renderGroup||(this.renderGroup=new o.WebGLRenderGroup(i)),this.renderGroup.setRenderable(t),this.renderGroup.render(this.projectionMatrix))},o.RenderTexture.prototype.renderCanvas=function(t,e){var i=t.children;t.worldTransform=o.mat3.create();for(var r=0,n=i.length;n>r;r++)i[r].updateTransform();e&&this.renderer.context.clearRect(0,0,this.width,this.height),this.renderer.renderDisplayObject(t),o.texturesToUpdate.push(this.baseTexture)},o.AssetLoader=function(t){o.EventTarget.call(this),this.assetURLs=t,this.crossorigin=!1,this.loadersByType={jpg:o.ImageLoader,jpeg:o.ImageLoader,png:o.ImageLoader,gif:o.ImageLoader,json:o.JsonLoader,anim:o.SpineLoader,xml:o.BitmapFontLoader,fnt:o.BitmapFontLoader}},o.AssetLoader.constructor=o.AssetLoader,o.AssetLoader.prototype.load=function(){var t=this;this.loadCount=this.assetURLs.length;for(var e=0;this.assetURLs.length>e;e++){var i=this.assetURLs[e],r=i.split(".").pop().toLowerCase(),n=this.loadersByType[r];if(!n)throw Error(r+" is an unsupported file type");var s=new n(i,this.crossorigin);s.addEventListener("loaded",function(){t.onAssetLoaded()}),s.load()}},o.AssetLoader.prototype.onAssetLoaded=function(){this.loadCount--,this.dispatchEvent({type:"onProgress",content:this}),this.onProgress&&this.onProgress(),0==this.loadCount&&(this.dispatchEvent({type:"onComplete",content:this}),this.onComplete&&this.onComplete())},o.JsonLoader=function(t,e){o.EventTarget.call(this),this.url=t,this.baseUrl=t.replace(/[^\/]*$/,""),this.crossorigin=e,this.loaded=!1},o.JsonLoader.constructor=o.JsonLoader,o.JsonLoader.prototype.load=function(){this.ajaxRequest=new c;var t=this;this.ajaxRequest.onreadystatechange=function(){t.onJSONLoaded()},this.ajaxRequest.open("GET",this.url,!0),this.ajaxRequest.overrideMimeType&&this.ajaxRequest.overrideMimeType("application/json"),this.ajaxRequest.send(null)},o.JsonLoader.prototype.onJSONLoaded=function(){if(4==this.ajaxRequest.readyState)if(200==this.ajaxRequest.status||-1==window.location.href.indexOf("http"))if(this.json=JSON.parse(this.ajaxRequest.responseText),this.json.frames){var t=this,e=this.baseUrl+this.json.meta.image,i=new o.ImageLoader(e,this.crossorigin),r=this.json.frames;this.texture=i.texture.baseTexture,i.addEventListener("loaded",function(){t.onLoaded()});for(var n in r){var s=r[n].frame;s&&(o.TextureCache[n]=new o.Texture(this.texture,{x:s.x,y:s.y,width:s.w,height:s.h}),r[n].trimmed&&(o.TextureCache[n].realSize=r[n].spriteSourceSize,o.TextureCache[n].trim.x=0))}i.load()}else if(this.json.bones){var a=new d.SkeletonJson,h=a.readSkeletonData(this.json);o.AnimCache[this.url]=h,this.onLoaded()}else this.onLoaded();else this.onError()},o.JsonLoader.prototype.onLoaded=function(){this.loaded=!0,this.dispatchEvent({type:"loaded",content:this})},o.JsonLoader.prototype.onError=function(){this.dispatchEvent({type:"error",content:this})},o.SpriteSheetLoader=function(t,e){o.EventTarget.call(this),this.url=t,this.baseUrl=t.replace(/[^\/]*$/,""),this.texture=null,this.frames={},this.crossorigin=e},o.SpriteSheetLoader.constructor=o.SpriteSheetLoader,o.SpriteSheetLoader.prototype.load=function(){var t=this,e=new o.JsonLoader(this.url,this.crossorigin);e.addEventListener("loaded",function(e){t.json=e.content.json,t.onJSONLoaded()}),e.load()},o.SpriteSheetLoader.prototype.onJSONLoaded=function(){var t=this,e=this.baseUrl+this.json.meta.image,i=new o.ImageLoader(e,this.crossorigin),r=this.json.frames;this.texture=i.texture.baseTexture,i.addEventListener("loaded",function(){t.onLoaded()});for(var n in r){var s=r[n].frame;s&&(o.TextureCache[n]=new o.Texture(this.texture,{x:s.x,y:s.y,width:s.w,height:s.h}),r[n].trimmed&&(o.TextureCache[n].realSize=r[n].spriteSourceSize,o.TextureCache[n].trim.x=0))}i.load()},o.SpriteSheetLoader.prototype.onLoaded=function(){this.dispatchEvent({type:"loaded",content:this})},o.ImageLoader=function(t,e){o.EventTarget.call(this),this.texture=o.Texture.fromImage(t,e)},o.ImageLoader.constructor=o.ImageLoader,o.ImageLoader.prototype.load=function(){if(this.texture.baseTexture.hasLoaded)this.onLoaded();else{var t=this;this.texture.baseTexture.addEventListener("loaded",function(){t.onLoaded()})}},o.ImageLoader.prototype.onLoaded=function(){this.dispatchEvent({type:"loaded",content:this})},o.BitmapFontLoader=function(t,e){o.EventTarget.call(this),this.url=t,this.baseUrl=t.replace(/[^\/]*$/,""),this.texture=null,this.crossorigin=e},o.BitmapFontLoader.constructor=o.BitmapFontLoader,o.BitmapFontLoader.prototype.load=function(){this.ajaxRequest=new XMLHttpRequest;var t=this;this.ajaxRequest.onreadystatechange=function(){t.onXMLLoaded()},this.ajaxRequest.open("GET",this.url,!0),this.ajaxRequest.overrideMimeType&&this.ajaxRequest.overrideMimeType("application/xml"),this.ajaxRequest.send(null)},o.BitmapFontLoader.prototype.onXMLLoaded=function(){if(4==this.ajaxRequest.readyState&&(200==this.ajaxRequest.status||-1==window.location.href.indexOf("http"))){var t=this.baseUrl+this.ajaxRequest.responseXML.getElementsByTagName("page")[0].attributes.getNamedItem("file").nodeValue,e=new o.ImageLoader(t,this.crossorigin);this.texture=e.texture.baseTexture;var i={},r=this.ajaxRequest.responseXML.getElementsByTagName("info")[0],n=this.ajaxRequest.responseXML.getElementsByTagName("common")[0];i.font=r.attributes.getNamedItem("face").nodeValue,i.size=parseInt(r.attributes.getNamedItem("size").nodeValue,10),i.lineHeight=parseInt(n.attributes.getNamedItem("lineHeight").nodeValue,10),i.chars={};for(var s=this.ajaxRequest.responseXML.getElementsByTagName("char"),a=0;s.length>a;a++){var h=parseInt(s[a].attributes.getNamedItem("id").nodeValue,10),l={x:parseInt(s[a].attributes.getNamedItem("x").nodeValue,10),y:parseInt(s[a].attributes.getNamedItem("y").nodeValue,10),width:parseInt(s[a].attributes.getNamedItem("width").nodeValue,10),height:parseInt(s[a].attributes.getNamedItem("height").nodeValue,10)};o.TextureCache[h]=new o.Texture(this.texture,l),i.chars[h]={xOffset:parseInt(s[a].attributes.getNamedItem("xoffset").nodeValue,10),yOffset:parseInt(s[a].attributes.getNamedItem("yoffset").nodeValue,10),xAdvance:parseInt(s[a].attributes.getNamedItem("xadvance").nodeValue,10),kerning:{},texture:new o.Texture(this.texture,l)}}var u=this.ajaxRequest.responseXML.getElementsByTagName("kerning");for(a=0;u.length>a;a++){var c=parseInt(u[a].attributes.getNamedItem("first").nodeValue,10),d=parseInt(u[a].attributes.getNamedItem("second").nodeValue,10),p=parseInt(u[a].attributes.getNamedItem("amount").nodeValue,10);i.chars[d].kerning[c]=p}o.BitmapText.fonts[i.font]=i;var f=this;e.addEventListener("loaded",function(){f.onLoaded()}),e.load()}},o.BitmapFontLoader.prototype.onLoaded=function(){this.dispatchEvent({type:"loaded",content:this})},o.SpineLoader=function(t,e){o.EventTarget.call(this),this.url=t,this.crossorigin=e,this.loaded=!1},o.SpineLoader.constructor=o.SpineLoader,o.SpineLoader.prototype.load=function(){new o.JsonLoader(this.url,this.crossorigin),jsonLoader.addEventListener("loaded",function(t){scope.json=t.content.json,scope.onJSONLoaded()}),jsonLoader.load()},o.SpineLoader.prototype.load=function(){var t=this,e=new o.JsonLoader(this.url,this.crossorigin);e.addEventListener("loaded",function(e){t.json=e.content.json,t.onJSONLoaded()}),e.load()},o.SpineLoader.prototype.onJSONLoaded=function(){var t=new d.SkeletonJson,e=t.readSkeletonData(this.json);o.AnimCache[this.url]=e,this.onLoaded()},o.SpineLoader.prototype.onLoaded=function(){this.loaded=!0,this.dispatchEvent({type:"loaded",content:this})},"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=o),exports.PIXI=o):s.PIXI=o}).call(this); \ No newline at end of file diff --git a/docs/classes/BitmapText.html b/docs/classes/BitmapText.html index 5bd93e7..018c1bb 100644 --- a/docs/classes/BitmapText.html +++ b/docs/classes/BitmapText.html @@ -602,7 +602,7 @@ http://www.bmglyph.com/ for mac.

- src/pixi/DisplayObjectContainer.js:41 + src/pixi/display/DisplayObjectContainer.js:41

@@ -692,7 +692,7 @@ http://www.bmglyph.com/ for mac.

- src/pixi/DisplayObjectContainer.js:73 + src/pixi/display/DisplayObjectContainer.js:73

@@ -791,7 +791,7 @@ http://www.bmglyph.com/ for mac.

- src/pixi/DisplayObject.js:106 + src/pixi/display/DisplayObject.js:106

@@ -820,7 +820,7 @@ http://www.bmglyph.com/ for mac.

- +
@@ -875,7 +875,7 @@ http://www.bmglyph.com/ for mac.

- src/pixi/DisplayObjectContainer.js:168 + src/pixi/display/DisplayObjectContainer.js:168

@@ -959,7 +959,7 @@ http://www.bmglyph.com/ for mac.

- src/pixi/DisplayObject.js:112 + src/pixi/display/DisplayObject.js:112

@@ -988,7 +988,7 @@ http://www.bmglyph.com/ for mac.

- +
@@ -1043,7 +1043,7 @@ http://www.bmglyph.com/ for mac.

- src/pixi/DisplayObject.js:138 + src/pixi/display/DisplayObject.js:138

@@ -1072,7 +1072,7 @@ http://www.bmglyph.com/ for mac.

- +
@@ -1127,7 +1127,7 @@ http://www.bmglyph.com/ for mac.

- src/pixi/DisplayObject.js:132 + src/pixi/display/DisplayObject.js:132

@@ -1156,7 +1156,7 @@ http://www.bmglyph.com/ for mac.

- +
@@ -1211,7 +1211,7 @@ http://www.bmglyph.com/ for mac.

- src/pixi/DisplayObject.js:118 + src/pixi/display/DisplayObject.js:118

@@ -1241,7 +1241,7 @@ for this callback to be fired the mouse must have been pressed down over the dis
- +
@@ -1296,7 +1296,7 @@ for this callback to be fired the mouse must have been pressed down over the dis - src/pixi/DisplayObject.js:125 + src/pixi/display/DisplayObject.js:125

@@ -1326,7 +1326,7 @@ for this callback to be fired, The touch must have started over the displayObjec
- +
@@ -1381,7 +1381,7 @@ for this callback to be fired, The touch must have started over the displayObjec - src/pixi/DisplayObjectContainer.js:186 + src/pixi/display/DisplayObjectContainer.js:186

@@ -1465,7 +1465,7 @@ for this callback to be fired, The touch must have started over the displayObjec - src/pixi/DisplayObject.js:190 + src/pixi/display/DisplayObject.js:190

@@ -1494,7 +1494,7 @@ for this callback to be fired, The touch must have started over the displayObjec
- +
@@ -1760,7 +1760,7 @@ for this callback to be fired, The touch must have started over the displayObjec - src/pixi/DisplayObjectContainer.js:128 + src/pixi/display/DisplayObjectContainer.js:128

@@ -1859,7 +1859,7 @@ for this callback to be fired, The touch must have started over the displayObjec - src/pixi/DisplayObject.js:149 + src/pixi/display/DisplayObject.js:149

@@ -1889,7 +1889,7 @@ basically a touch version of click

- +
@@ -1944,7 +1944,7 @@ basically a touch version of click

- src/pixi/DisplayObject.js:162 + src/pixi/display/DisplayObject.js:162

@@ -1973,7 +1973,7 @@ basically a touch version of click

- +
@@ -2028,7 +2028,7 @@ basically a touch version of click

- src/pixi/DisplayObject.js:168 + src/pixi/display/DisplayObject.js:168

@@ -2058,7 +2058,7 @@ for this callback to be fired, The touch must have started over the sprite

- +
@@ -2113,7 +2113,7 @@ for this callback to be fired, The touch must have started over the sprite

- src/pixi/DisplayObject.js:156 + src/pixi/display/DisplayObject.js:156

@@ -2142,7 +2142,7 @@ for this callback to be fired, The touch must have started over the sprite

- +
@@ -2186,7 +2186,7 @@ for this callback to be fired, The touch must have started over the sprite

- src/pixi/DisplayObject.js:40 + src/pixi/display/DisplayObject.js:40

@@ -2227,7 +2227,7 @@ for this callback to be fired, The touch must have started over the sprite

- src/pixi/DisplayObject.js:95 + src/pixi/display/DisplayObject.js:95

@@ -2268,7 +2268,7 @@ for this callback to be fired, The touch must have started over the sprite

- src/pixi/DisplayObjectContainer.js:16 + src/pixi/display/DisplayObjectContainer.js:16

@@ -2309,7 +2309,7 @@ for this callback to be fired, The touch must have started over the sprite

- src/pixi/DisplayObject.js:69 + src/pixi/display/DisplayObject.js:69

@@ -2351,7 +2351,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction - src/pixi/DisplayObject.js:55 + src/pixi/display/DisplayObject.js:55

@@ -2392,7 +2392,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction - src/pixi/DisplayObject.js:26 + src/pixi/display/DisplayObject.js:26

@@ -2433,7 +2433,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction - src/pixi/DisplayObject.js:12 + src/pixi/display/DisplayObject.js:12

@@ -2474,7 +2474,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction - src/pixi/DisplayObject.js:33 + src/pixi/display/DisplayObject.js:33

@@ -2515,7 +2515,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction - src/pixi/DisplayObject.js:19 + src/pixi/display/DisplayObject.js:19

@@ -2556,7 +2556,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction - src/pixi/DisplayObject.js:62 + src/pixi/display/DisplayObject.js:62

@@ -2597,7 +2597,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction - src/pixi/DisplayObject.js:47 + src/pixi/display/DisplayObject.js:47

diff --git a/docs/classes/CanvasRenderer.html b/docs/classes/CanvasRenderer.html index ec90416..d769647 100644 --- a/docs/classes/CanvasRenderer.html +++ b/docs/classes/CanvasRenderer.html @@ -142,7 +142,7 @@ @@ -225,7 +225,7 @@ Dont forget to add the view to your DOM or you will not see anything :)

- src/pixi/renderers/CanvasRenderer.js:6 + src/pixi/renderers/canvas/CanvasRenderer.js:6

@@ -442,7 +442,7 @@ Dont forget to add the view to your DOM or you will not see anything :)

- src/pixi/renderers/CanvasRenderer.js:66 + src/pixi/renderers/canvas/CanvasRenderer.js:66

@@ -518,7 +518,7 @@ Dont forget to add the view to your DOM or you will not see anything :)

- src/pixi/renderers/CanvasRenderer.js:55 + src/pixi/renderers/canvas/CanvasRenderer.js:55

@@ -562,7 +562,7 @@ Dont forget to add the view to your DOM or you will not see anything :)

- src/pixi/renderers/CanvasRenderer.js:31 + src/pixi/renderers/canvas/CanvasRenderer.js:31

@@ -608,7 +608,7 @@ Dont forget to add the view to your DOM or you will not see anything :)

- src/pixi/renderers/CanvasRenderer.js:41 + src/pixi/renderers/canvas/CanvasRenderer.js:41

@@ -652,7 +652,7 @@ Dont forget to add the view to your DOM or you will not see anything :)

- src/pixi/renderers/CanvasRenderer.js:24 + src/pixi/renderers/canvas/CanvasRenderer.js:24

diff --git a/docs/classes/CustomRenderable.html b/docs/classes/CustomRenderable.html index 86c0ec9..1c3558a 100644 --- a/docs/classes/CustomRenderable.html +++ b/docs/classes/CustomRenderable.html @@ -458,7 +458,7 @@ - src/pixi/DisplayObject.js:106 + src/pixi/display/DisplayObject.js:106

@@ -487,7 +487,7 @@
- +
@@ -542,7 +542,7 @@ - src/pixi/DisplayObject.js:112 + src/pixi/display/DisplayObject.js:112

@@ -571,7 +571,7 @@
- +
@@ -626,7 +626,7 @@ - src/pixi/DisplayObject.js:138 + src/pixi/display/DisplayObject.js:138

@@ -655,7 +655,7 @@
- +
@@ -710,7 +710,7 @@ - src/pixi/DisplayObject.js:132 + src/pixi/display/DisplayObject.js:132

@@ -739,7 +739,7 @@
- +
@@ -794,7 +794,7 @@ - src/pixi/DisplayObject.js:118 + src/pixi/display/DisplayObject.js:118

@@ -824,7 +824,7 @@ for this callback to be fired the mouse must have been pressed down over the dis
- +
@@ -879,7 +879,7 @@ for this callback to be fired the mouse must have been pressed down over the dis - src/pixi/DisplayObject.js:125 + src/pixi/display/DisplayObject.js:125

@@ -909,7 +909,7 @@ for this callback to be fired, The touch must have started over the displayObjec
- +
@@ -964,7 +964,7 @@ for this callback to be fired, The touch must have started over the displayObjec - src/pixi/DisplayObject.js:190 + src/pixi/display/DisplayObject.js:190

@@ -993,7 +993,7 @@ for this callback to be fired, The touch must have started over the displayObjec
- +
@@ -1048,7 +1048,7 @@ for this callback to be fired, The touch must have started over the displayObjec - src/pixi/DisplayObject.js:149 + src/pixi/display/DisplayObject.js:149

@@ -1078,7 +1078,7 @@ basically a touch version of click

- +
@@ -1133,7 +1133,7 @@ basically a touch version of click

- src/pixi/DisplayObject.js:162 + src/pixi/display/DisplayObject.js:162

@@ -1162,7 +1162,7 @@ basically a touch version of click

- +
@@ -1217,7 +1217,7 @@ basically a touch version of click

- src/pixi/DisplayObject.js:168 + src/pixi/display/DisplayObject.js:168

@@ -1247,7 +1247,7 @@ for this callback to be fired, The touch must have started over the sprite

- +
@@ -1302,7 +1302,7 @@ for this callback to be fired, The touch must have started over the sprite

- src/pixi/DisplayObject.js:156 + src/pixi/display/DisplayObject.js:156

@@ -1331,7 +1331,7 @@ for this callback to be fired, The touch must have started over the sprite

- +
@@ -1375,7 +1375,7 @@ for this callback to be fired, The touch must have started over the sprite

- src/pixi/DisplayObject.js:40 + src/pixi/display/DisplayObject.js:40

@@ -1416,7 +1416,7 @@ for this callback to be fired, The touch must have started over the sprite

- src/pixi/DisplayObject.js:95 + src/pixi/display/DisplayObject.js:95

@@ -1457,7 +1457,7 @@ for this callback to be fired, The touch must have started over the sprite

- src/pixi/DisplayObject.js:69 + src/pixi/display/DisplayObject.js:69

@@ -1499,7 +1499,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction - src/pixi/DisplayObject.js:55 + src/pixi/display/DisplayObject.js:55

@@ -1540,7 +1540,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction - src/pixi/DisplayObject.js:26 + src/pixi/display/DisplayObject.js:26

@@ -1581,7 +1581,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction - src/pixi/DisplayObject.js:12 + src/pixi/display/DisplayObject.js:12

@@ -1622,7 +1622,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction - src/pixi/DisplayObject.js:33 + src/pixi/display/DisplayObject.js:33

@@ -1663,7 +1663,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction - src/pixi/DisplayObject.js:19 + src/pixi/display/DisplayObject.js:19

@@ -1704,7 +1704,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction - src/pixi/DisplayObject.js:62 + src/pixi/display/DisplayObject.js:62

@@ -1745,7 +1745,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction - src/pixi/DisplayObject.js:47 + src/pixi/display/DisplayObject.js:47

diff --git a/docs/classes/DisplayObject.html b/docs/classes/DisplayObject.html index d9531c8..e213086 100644 --- a/docs/classes/DisplayObject.html +++ b/docs/classes/DisplayObject.html @@ -142,7 +142,7 @@ @@ -196,7 +196,7 @@ - src/pixi/DisplayObject.js:5 + src/pixi/display/DisplayObject.js:5

@@ -244,15 +244,6 @@ @@ -338,7 +350,7 @@ - src/pixi/core/Polygon.js:15 + src/pixi/core/Polygon.js:28

@@ -368,6 +380,129 @@ + + + +
+

contains

+ + +
+ (
    + +
  • + + x + +
  • + +
  • + + y + +
  • + +
) +
+ + + + + + + + + + + + + + + + + + + + +
+ + + +

+ + Defined in + + + + + src/pixi/core/Polygon.js:42 + +

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

Parameters:

+ +
    + +
  • + + x + Number + + + + +
    +

    The X coord of the point to test

    +
    + + +
  • + +
  • + + y + Number + + + + +
    +

    The Y coord of the point to test

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

Returns:

+ +
+ + + if the x/y coords are within this polygon + +
+
+ + +
diff --git a/docs/classes/Rectangle.html b/docs/classes/Rectangle.html index b729b67..bbf3d67 100644 --- a/docs/classes/Rectangle.html +++ b/docs/classes/Rectangle.html @@ -53,12 +53,16 @@
  • CanvasRenderer
  • +
  • Circle
  • +
  • CustomRenderable
  • DisplayObject
  • DisplayObjectContainer
  • +
  • Ellipse
  • +
  • Graphics
  • ImageLoader
  • @@ -349,6 +353,13 @@ + + +
  • + contains + + +
  • @@ -469,6 +480,129 @@ + + + +
    +

    contains

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + src/pixi/core/Rectangle.js:54 + +

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

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      The X coord of the point to test

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      The Y coord of the point to test

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

    Returns:

    + +
    + + + if the x/y coords are within this polygon + +
    +
    + + +
    diff --git a/docs/classes/RenderTexture.html b/docs/classes/RenderTexture.html index b275efe..e274141 100644 --- a/docs/classes/RenderTexture.html +++ b/docs/classes/RenderTexture.html @@ -53,12 +53,16 @@
  • CanvasRenderer
  • +
  • Circle
  • +
  • CustomRenderable
  • DisplayObject
  • DisplayObjectContainer
  • +
  • Ellipse
  • +
  • Graphics
  • ImageLoader
  • diff --git a/docs/classes/Spine.html b/docs/classes/Spine.html index 68083c4..07fba75 100644 --- a/docs/classes/Spine.html +++ b/docs/classes/Spine.html @@ -53,12 +53,16 @@
  • CanvasRenderer
  • +
  • Circle
  • +
  • CustomRenderable
  • DisplayObject
  • DisplayObjectContainer
  • +
  • Ellipse
  • +
  • Graphics
  • ImageLoader
  • @@ -438,6 +442,20 @@ When loaded this class will dispatch a "loaded" event

    + + +
  • + interactive + + + +
  • + +
  • + mask + + +
  • @@ -542,7 +560,7 @@ When loaded this class will dispatch a "loaded" event

    - src/pixi/display/DisplayObjectContainer.js:41 + src/pixi/display/DisplayObjectContainer.js:42

    @@ -632,7 +650,7 @@ When loaded this class will dispatch a "loaded" event

    - src/pixi/display/DisplayObjectContainer.js:73 + src/pixi/display/DisplayObjectContainer.js:139

    @@ -731,7 +749,7 @@ When loaded this class will dispatch a "loaded" event

    - src/pixi/display/DisplayObject.js:106 + src/pixi/display/DisplayObject.js:109

    @@ -815,7 +833,7 @@ When loaded this class will dispatch a "loaded" event

    - src/pixi/display/DisplayObjectContainer.js:168 + src/pixi/display/DisplayObjectContainer.js:274

    @@ -899,7 +917,7 @@ When loaded this class will dispatch a "loaded" event

    - src/pixi/display/DisplayObject.js:112 + src/pixi/display/DisplayObject.js:115

    @@ -983,7 +1001,7 @@ When loaded this class will dispatch a "loaded" event

    - src/pixi/display/DisplayObject.js:138 + src/pixi/display/DisplayObject.js:141

    @@ -1067,7 +1085,7 @@ When loaded this class will dispatch a "loaded" event

    - src/pixi/display/DisplayObject.js:132 + src/pixi/display/DisplayObject.js:135

    @@ -1151,7 +1169,7 @@ When loaded this class will dispatch a "loaded" event

    - src/pixi/display/DisplayObject.js:118 + src/pixi/display/DisplayObject.js:121

    @@ -1236,7 +1254,7 @@ for this callback to be fired the mouse must have been pressed down over the dis - src/pixi/display/DisplayObject.js:125 + src/pixi/display/DisplayObject.js:128

    @@ -1321,7 +1339,7 @@ for this callback to be fired, The touch must have started over the displayObjec - src/pixi/display/DisplayObjectContainer.js:186 + src/pixi/display/DisplayObjectContainer.js:291

    @@ -1405,7 +1423,7 @@ for this callback to be fired, The touch must have started over the displayObjec - src/pixi/display/DisplayObject.js:190 + src/pixi/display/DisplayObject.js:193

    @@ -1416,7 +1434,8 @@ for this callback to be fired, The touch must have started over the displayObjec
    -

    Indicates if the sprite will have touch and mouse interactivity. It is false by default

    +

    [Deprecated] Indicates if the sprite will have touch and mouse interactivity. It is false by default +Instead of using this function you can now simply set the interactive property to true or false

    @@ -1495,7 +1514,7 @@ for this callback to be fired, The touch must have started over the displayObjec - src/pixi/display/DisplayObjectContainer.js:128 + src/pixi/display/DisplayObjectContainer.js:227

    @@ -1594,7 +1613,7 @@ for this callback to be fired, The touch must have started over the displayObjec - src/pixi/display/DisplayObject.js:149 + src/pixi/display/DisplayObject.js:152

    @@ -1679,7 +1698,7 @@ basically a touch version of click

    - src/pixi/display/DisplayObject.js:162 + src/pixi/display/DisplayObject.js:165

    @@ -1763,7 +1782,7 @@ basically a touch version of click

    - src/pixi/display/DisplayObject.js:168 + src/pixi/display/DisplayObject.js:171

    @@ -1848,7 +1867,7 @@ for this callback to be fired, The touch must have started over the sprite

    - src/pixi/display/DisplayObject.js:156 + src/pixi/display/DisplayObject.js:159

    @@ -1921,7 +1940,7 @@ for this callback to be fired, The touch must have started over the sprite

    - src/pixi/display/DisplayObject.js:40 + src/pixi/display/DisplayObject.js:43

    @@ -1962,7 +1981,7 @@ for this callback to be fired, The touch must have started over the sprite

    - src/pixi/display/DisplayObject.js:95 + src/pixi/display/DisplayObject.js:98

    @@ -2044,7 +2063,7 @@ for this callback to be fired, The touch must have started over the sprite

    - src/pixi/display/DisplayObject.js:69 + src/pixi/display/DisplayObject.js:72

    @@ -2063,6 +2082,90 @@ Setting it is a neat way of optimising the hitTest function that the interaction + + + +
    +

    interactive

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

    Inherited from + DisplayObject: + + + + src/pixi/display/DisplayObject.js:204 + +

    + + + + +
    + +
    +

    Indicates if the sprite will have touch and mouse interactivity. It is false by default

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

    mask

    + PIXI.Graphics + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + src/pixi/display/DisplayObject.js:222 + +

    + + + + +
    + +
    +

    Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it. +In PIXI a regular mask must be a PIXI.Ggraphics object. This allows for much faster masking in canvas as it utilises shape clipping. +To remove a mask, set this property to null.

    +
    + + + + + +
    @@ -2086,7 +2189,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction - src/pixi/display/DisplayObject.js:55 + src/pixi/display/DisplayObject.js:58

    @@ -2127,7 +2230,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction - src/pixi/display/DisplayObject.js:26 + src/pixi/display/DisplayObject.js:29

    @@ -2168,7 +2271,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction - src/pixi/display/DisplayObject.js:12 + src/pixi/display/DisplayObject.js:15

    @@ -2209,7 +2312,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction - src/pixi/display/DisplayObject.js:33 + src/pixi/display/DisplayObject.js:36

    @@ -2250,7 +2353,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction - src/pixi/display/DisplayObject.js:19 + src/pixi/display/DisplayObject.js:22

    @@ -2291,7 +2394,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction - src/pixi/display/DisplayObject.js:62 + src/pixi/display/DisplayObject.js:65

    @@ -2332,7 +2435,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction - src/pixi/display/DisplayObject.js:47 + src/pixi/display/DisplayObject.js:50

    diff --git a/docs/classes/Sprite.html b/docs/classes/Sprite.html index dde0def..aea92ff 100644 --- a/docs/classes/Sprite.html +++ b/docs/classes/Sprite.html @@ -53,12 +53,16 @@
  • CanvasRenderer
  • +
  • Circle
  • +
  • CustomRenderable
  • DisplayObject
  • DisplayObjectContainer
  • +
  • Ellipse
  • +
  • Graphics
  • ImageLoader
  • @@ -479,6 +483,20 @@ + + +
  • + interactive + + + +
  • + +
  • + mask + + +
  • @@ -597,7 +615,7 @@ - src/pixi/display/DisplayObjectContainer.js:41 + src/pixi/display/DisplayObjectContainer.js:42

    @@ -687,7 +705,7 @@ - src/pixi/display/DisplayObjectContainer.js:73 + src/pixi/display/DisplayObjectContainer.js:139

    @@ -786,7 +804,7 @@ - src/pixi/display/DisplayObject.js:106 + src/pixi/display/DisplayObject.js:109

    @@ -1084,7 +1102,7 @@ - src/pixi/display/DisplayObjectContainer.js:168 + src/pixi/display/DisplayObjectContainer.js:274

    @@ -1168,7 +1186,7 @@ - src/pixi/display/DisplayObject.js:112 + src/pixi/display/DisplayObject.js:115

    @@ -1252,7 +1270,7 @@ - src/pixi/display/DisplayObject.js:138 + src/pixi/display/DisplayObject.js:141

    @@ -1336,7 +1354,7 @@ - src/pixi/display/DisplayObject.js:132 + src/pixi/display/DisplayObject.js:135

    @@ -1420,7 +1438,7 @@ - src/pixi/display/DisplayObject.js:118 + src/pixi/display/DisplayObject.js:121

    @@ -1505,7 +1523,7 @@ for this callback to be fired the mouse must have been pressed down over the dis - src/pixi/display/DisplayObject.js:125 + src/pixi/display/DisplayObject.js:128

    @@ -1590,7 +1608,7 @@ for this callback to be fired, The touch must have started over the displayObjec - src/pixi/display/DisplayObjectContainer.js:186 + src/pixi/display/DisplayObjectContainer.js:291

    @@ -1674,7 +1692,7 @@ for this callback to be fired, The touch must have started over the displayObjec - src/pixi/display/DisplayObject.js:190 + src/pixi/display/DisplayObject.js:193

    @@ -1685,7 +1703,8 @@ for this callback to be fired, The touch must have started over the displayObjec
    -

    Indicates if the sprite will have touch and mouse interactivity. It is false by default

    +

    [Deprecated] Indicates if the sprite will have touch and mouse interactivity. It is false by default +Instead of using this function you can now simply set the interactive property to true or false

    @@ -1851,7 +1870,7 @@ for this callback to be fired, The touch must have started over the displayObjec - src/pixi/display/DisplayObjectContainer.js:128 + src/pixi/display/DisplayObjectContainer.js:227

    @@ -1950,7 +1969,7 @@ for this callback to be fired, The touch must have started over the displayObjec - src/pixi/display/DisplayObject.js:149 + src/pixi/display/DisplayObject.js:152

    @@ -2035,7 +2054,7 @@ basically a touch version of click

    - src/pixi/display/DisplayObject.js:162 + src/pixi/display/DisplayObject.js:165

    @@ -2119,7 +2138,7 @@ basically a touch version of click

    - src/pixi/display/DisplayObject.js:168 + src/pixi/display/DisplayObject.js:171

    @@ -2204,7 +2223,7 @@ for this callback to be fired, The touch must have started over the sprite

    - src/pixi/display/DisplayObject.js:156 + src/pixi/display/DisplayObject.js:159

    @@ -2277,7 +2296,7 @@ for this callback to be fired, The touch must have started over the sprite

    - src/pixi/display/DisplayObject.js:40 + src/pixi/display/DisplayObject.js:43

    @@ -2410,7 +2429,7 @@ currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN

    - src/pixi/display/DisplayObject.js:95 + src/pixi/display/DisplayObject.js:98

    @@ -2536,7 +2555,7 @@ currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN

    - src/pixi/display/DisplayObject.js:69 + src/pixi/display/DisplayObject.js:72

    @@ -2555,6 +2574,90 @@ Setting it is a neat way of optimising the hitTest function that the interaction + + + +
    +

    interactive

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

    Inherited from + DisplayObject: + + + + src/pixi/display/DisplayObject.js:204 + +

    + + + + +
    + +
    +

    Indicates if the sprite will have touch and mouse interactivity. It is false by default

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

    mask

    + PIXI.Graphics + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + src/pixi/display/DisplayObject.js:222 + +

    + + + + +
    + +
    +

    Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it. +In PIXI a regular mask must be a PIXI.Ggraphics object. This allows for much faster masking in canvas as it utilises shape clipping. +To remove a mask, set this property to null.

    +
    + + + + + +
    @@ -2578,7 +2681,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction - src/pixi/display/DisplayObject.js:55 + src/pixi/display/DisplayObject.js:58

    @@ -2619,7 +2722,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction - src/pixi/display/DisplayObject.js:26 + src/pixi/display/DisplayObject.js:29

    @@ -2660,7 +2763,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction - src/pixi/display/DisplayObject.js:12 + src/pixi/display/DisplayObject.js:15

    @@ -2701,7 +2804,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction - src/pixi/display/DisplayObject.js:33 + src/pixi/display/DisplayObject.js:36

    @@ -2742,7 +2845,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction - src/pixi/display/DisplayObject.js:19 + src/pixi/display/DisplayObject.js:22

    @@ -2783,7 +2886,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction - src/pixi/display/DisplayObject.js:62 + src/pixi/display/DisplayObject.js:65

    @@ -2868,7 +2971,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction - src/pixi/display/DisplayObject.js:47 + src/pixi/display/DisplayObject.js:50

    diff --git a/docs/classes/SpriteSheetLoader.html b/docs/classes/SpriteSheetLoader.html index 4888be1..f1091f0 100644 --- a/docs/classes/SpriteSheetLoader.html +++ b/docs/classes/SpriteSheetLoader.html @@ -53,12 +53,16 @@
  • CanvasRenderer
  • +
  • Circle
  • +
  • CustomRenderable
  • DisplayObject
  • DisplayObjectContainer
  • +
  • Ellipse
  • +
  • Graphics
  • ImageLoader
  • diff --git a/docs/classes/Stage.html b/docs/classes/Stage.html index a18f6e1..e145e0c 100644 --- a/docs/classes/Stage.html +++ b/docs/classes/Stage.html @@ -53,12 +53,16 @@
  • CanvasRenderer
  • +
  • Circle
  • +
  • CustomRenderable
  • DisplayObject
  • DisplayObjectContainer
  • +
  • Ellipse
  • +
  • Graphics
  • ImageLoader
  • @@ -475,6 +479,20 @@ + + +
  • + interactive + + + +
  • + +
  • + mask + + +
  • @@ -579,7 +597,7 @@ - src/pixi/display/DisplayObjectContainer.js:41 + src/pixi/display/DisplayObjectContainer.js:42

    @@ -669,7 +687,7 @@ - src/pixi/display/DisplayObjectContainer.js:73 + src/pixi/display/DisplayObjectContainer.js:139

    @@ -768,7 +786,7 @@ - src/pixi/display/DisplayObject.js:106 + src/pixi/display/DisplayObject.js:109

    @@ -852,7 +870,7 @@ - src/pixi/display/DisplayObjectContainer.js:168 + src/pixi/display/DisplayObjectContainer.js:274

    @@ -933,7 +951,7 @@ - src/pixi/display/Stage.js:76 + src/pixi/display/Stage.js:78

    @@ -1007,7 +1025,7 @@ - src/pixi/display/DisplayObject.js:112 + src/pixi/display/DisplayObject.js:115

    @@ -1091,7 +1109,7 @@ - src/pixi/display/DisplayObject.js:138 + src/pixi/display/DisplayObject.js:141

    @@ -1175,7 +1193,7 @@ - src/pixi/display/DisplayObject.js:132 + src/pixi/display/DisplayObject.js:135

    @@ -1259,7 +1277,7 @@ - src/pixi/display/DisplayObject.js:118 + src/pixi/display/DisplayObject.js:121

    @@ -1344,7 +1362,7 @@ for this callback to be fired the mouse must have been pressed down over the dis - src/pixi/display/DisplayObject.js:125 + src/pixi/display/DisplayObject.js:128

    @@ -1429,7 +1447,7 @@ for this callback to be fired, The touch must have started over the displayObjec - src/pixi/display/DisplayObjectContainer.js:186 + src/pixi/display/DisplayObjectContainer.js:291

    @@ -1516,7 +1534,7 @@ for this callback to be fired, The touch must have started over the displayObjec - src/pixi/display/Stage.js:63 + src/pixi/display/Stage.js:65

    @@ -1600,7 +1618,7 @@ for this callback to be fired, The touch must have started over the displayObjec - src/pixi/display/DisplayObject.js:190 + src/pixi/display/DisplayObject.js:193

    @@ -1611,7 +1629,8 @@ for this callback to be fired, The touch must have started over the displayObjec
    -

    Indicates if the sprite will have touch and mouse interactivity. It is false by default

    +

    [Deprecated] Indicates if the sprite will have touch and mouse interactivity. It is false by default +Instead of using this function you can now simply set the interactive property to true or false

    @@ -1690,7 +1709,7 @@ for this callback to be fired, The touch must have started over the displayObjec - src/pixi/display/DisplayObjectContainer.js:128 + src/pixi/display/DisplayObjectContainer.js:227

    @@ -1789,7 +1808,7 @@ for this callback to be fired, The touch must have started over the displayObjec - src/pixi/display/DisplayObject.js:149 + src/pixi/display/DisplayObject.js:152

    @@ -1874,7 +1893,7 @@ basically a touch version of click

    - src/pixi/display/DisplayObject.js:162 + src/pixi/display/DisplayObject.js:165

    @@ -1958,7 +1977,7 @@ basically a touch version of click

    - src/pixi/display/DisplayObject.js:168 + src/pixi/display/DisplayObject.js:171

    @@ -2043,7 +2062,7 @@ for this callback to be fired, The touch must have started over the sprite

    - src/pixi/display/DisplayObject.js:156 + src/pixi/display/DisplayObject.js:159

    @@ -2120,7 +2139,7 @@ for this callback to be fired, The touch must have started over the sprite

    - src/pixi/display/Stage.js:40 + src/pixi/display/Stage.js:42

    @@ -2170,7 +2189,7 @@ for this callback to be fired, The touch must have started over the sprite

    - src/pixi/display/DisplayObject.js:40 + src/pixi/display/DisplayObject.js:43

    @@ -2211,7 +2230,7 @@ for this callback to be fired, The touch must have started over the sprite

    - src/pixi/display/DisplayObject.js:95 + src/pixi/display/DisplayObject.js:98

    @@ -2293,7 +2312,7 @@ for this callback to be fired, The touch must have started over the sprite

    - src/pixi/display/DisplayObject.js:69 + src/pixi/display/DisplayObject.js:72

    @@ -2312,6 +2331,90 @@ Setting it is a neat way of optimising the hitTest function that the interaction + + + +
    +

    interactive

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

    Inherited from + DisplayObject: + + + + src/pixi/display/DisplayObject.js:204 + +

    + + + + +
    + +
    +

    Indicates if the sprite will have touch and mouse interactivity. It is false by default

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

    mask

    + PIXI.Graphics + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + src/pixi/display/DisplayObject.js:222 + +

    + + + + +
    + +
    +

    Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it. +In PIXI a regular mask must be a PIXI.Ggraphics object. This allows for much faster masking in canvas as it utilises shape clipping. +To remove a mask, set this property to null.

    +
    + + + + + +
    @@ -2335,7 +2438,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction - src/pixi/display/DisplayObject.js:55 + src/pixi/display/DisplayObject.js:58

    @@ -2376,7 +2479,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction - src/pixi/display/DisplayObject.js:26 + src/pixi/display/DisplayObject.js:29

    @@ -2417,7 +2520,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction - src/pixi/display/DisplayObject.js:12 + src/pixi/display/DisplayObject.js:15

    @@ -2458,7 +2561,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction - src/pixi/display/DisplayObject.js:33 + src/pixi/display/DisplayObject.js:36

    @@ -2499,7 +2602,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction - src/pixi/display/DisplayObject.js:19 + src/pixi/display/DisplayObject.js:22

    @@ -2540,7 +2643,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction - src/pixi/display/DisplayObject.js:62 + src/pixi/display/DisplayObject.js:65

    @@ -2581,7 +2684,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction - src/pixi/display/DisplayObject.js:47 + src/pixi/display/DisplayObject.js:50

    diff --git a/docs/classes/Text.html b/docs/classes/Text.html index cc2f15a..db91c58 100644 --- a/docs/classes/Text.html +++ b/docs/classes/Text.html @@ -53,12 +53,16 @@
  • CanvasRenderer
  • +
  • Circle
  • +
  • CustomRenderable
  • DisplayObject
  • DisplayObjectContainer
  • +
  • Ellipse
  • +
  • Graphics
  • ImageLoader
  • @@ -592,6 +596,20 @@ + + +
  • + interactive + + + +
  • + +
  • + mask + + +
  • @@ -710,7 +728,7 @@ - src/pixi/display/DisplayObjectContainer.js:41 + src/pixi/display/DisplayObjectContainer.js:42

    @@ -800,7 +818,7 @@ - src/pixi/display/DisplayObjectContainer.js:73 + src/pixi/display/DisplayObjectContainer.js:139

    @@ -899,7 +917,7 @@ - src/pixi/display/DisplayObject.js:106 + src/pixi/display/DisplayObject.js:109

    @@ -983,7 +1001,7 @@ - src/pixi/display/DisplayObjectContainer.js:168 + src/pixi/display/DisplayObjectContainer.js:274

    @@ -1067,7 +1085,7 @@ - src/pixi/display/DisplayObject.js:112 + src/pixi/display/DisplayObject.js:115

    @@ -1151,7 +1169,7 @@ - src/pixi/display/DisplayObject.js:138 + src/pixi/display/DisplayObject.js:141

    @@ -1235,7 +1253,7 @@ - src/pixi/display/DisplayObject.js:132 + src/pixi/display/DisplayObject.js:135

    @@ -1319,7 +1337,7 @@ - src/pixi/display/DisplayObject.js:118 + src/pixi/display/DisplayObject.js:121

    @@ -1404,7 +1422,7 @@ for this callback to be fired the mouse must have been pressed down over the dis - src/pixi/display/DisplayObject.js:125 + src/pixi/display/DisplayObject.js:128

    @@ -1489,7 +1507,7 @@ for this callback to be fired, The touch must have started over the displayObjec - src/pixi/display/DisplayObjectContainer.js:186 + src/pixi/display/DisplayObjectContainer.js:291

    @@ -1573,7 +1591,7 @@ for this callback to be fired, The touch must have started over the displayObjec - src/pixi/display/DisplayObject.js:190 + src/pixi/display/DisplayObject.js:193

    @@ -1584,7 +1602,8 @@ for this callback to be fired, The touch must have started over the displayObjec
    -

    Indicates if the sprite will have touch and mouse interactivity. It is false by default

    +

    [Deprecated] Indicates if the sprite will have touch and mouse interactivity. It is false by default +Instead of using this function you can now simply set the interactive property to true or false

    @@ -1944,7 +1963,7 @@ for this callback to be fired, The touch must have started over the displayObjec - src/pixi/display/DisplayObjectContainer.js:128 + src/pixi/display/DisplayObjectContainer.js:227

    @@ -2043,7 +2062,7 @@ for this callback to be fired, The touch must have started over the displayObjec - src/pixi/display/DisplayObject.js:149 + src/pixi/display/DisplayObject.js:152

    @@ -2128,7 +2147,7 @@ basically a touch version of click

    - src/pixi/display/DisplayObject.js:162 + src/pixi/display/DisplayObject.js:165

    @@ -2212,7 +2231,7 @@ basically a touch version of click

    - src/pixi/display/DisplayObject.js:168 + src/pixi/display/DisplayObject.js:171

    @@ -2297,7 +2316,7 @@ for this callback to be fired, The touch must have started over the sprite

    - src/pixi/display/DisplayObject.js:156 + src/pixi/display/DisplayObject.js:159

    @@ -2370,7 +2389,7 @@ for this callback to be fired, The touch must have started over the sprite

    - src/pixi/display/DisplayObject.js:40 + src/pixi/display/DisplayObject.js:43

    @@ -2497,7 +2516,7 @@ currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN

    - src/pixi/display/DisplayObject.js:95 + src/pixi/display/DisplayObject.js:98

    @@ -2620,7 +2639,7 @@ currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN

    - src/pixi/display/DisplayObject.js:69 + src/pixi/display/DisplayObject.js:72

    @@ -2639,6 +2658,90 @@ Setting it is a neat way of optimising the hitTest function that the interaction + + + +
    +

    interactive

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

    Inherited from + DisplayObject: + + + + src/pixi/display/DisplayObject.js:204 + +

    + + + + +
    + +
    +

    Indicates if the sprite will have touch and mouse interactivity. It is false by default

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

    mask

    + PIXI.Graphics + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + src/pixi/display/DisplayObject.js:222 + +

    + + + + +
    + +
    +

    Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it. +In PIXI a regular mask must be a PIXI.Ggraphics object. This allows for much faster masking in canvas as it utilises shape clipping. +To remove a mask, set this property to null.

    +
    + + + + + +
    @@ -2662,7 +2765,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction - src/pixi/display/DisplayObject.js:55 + src/pixi/display/DisplayObject.js:58

    @@ -2703,7 +2806,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction - src/pixi/display/DisplayObject.js:26 + src/pixi/display/DisplayObject.js:29

    @@ -2744,7 +2847,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction - src/pixi/display/DisplayObject.js:12 + src/pixi/display/DisplayObject.js:15

    @@ -2785,7 +2888,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction - src/pixi/display/DisplayObject.js:33 + src/pixi/display/DisplayObject.js:36

    @@ -2826,7 +2929,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction - src/pixi/display/DisplayObject.js:19 + src/pixi/display/DisplayObject.js:22

    @@ -2867,7 +2970,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction - src/pixi/display/DisplayObject.js:62 + src/pixi/display/DisplayObject.js:65

    @@ -2949,7 +3052,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction - src/pixi/display/DisplayObject.js:47 + src/pixi/display/DisplayObject.js:50

    diff --git a/docs/classes/Texture.html b/docs/classes/Texture.html index be17b99..5069fde 100644 --- a/docs/classes/Texture.html +++ b/docs/classes/Texture.html @@ -53,12 +53,16 @@
  • CanvasRenderer
  • +
  • Circle
  • +
  • CustomRenderable
  • DisplayObject
  • DisplayObjectContainer
  • +
  • Ellipse
  • +
  • Graphics
  • ImageLoader
  • diff --git a/docs/classes/TilingSprite.html b/docs/classes/TilingSprite.html index ee970f5..663486b 100644 --- a/docs/classes/TilingSprite.html +++ b/docs/classes/TilingSprite.html @@ -53,12 +53,16 @@
  • CanvasRenderer
  • +
  • Circle
  • +
  • CustomRenderable
  • DisplayObject
  • DisplayObjectContainer
  • +
  • Ellipse
  • +
  • Graphics
  • ImageLoader
  • @@ -475,6 +479,20 @@ + + +
  • + interactive + + + +
  • + +
  • + mask + + +
  • @@ -593,7 +611,7 @@ - src/pixi/display/DisplayObjectContainer.js:41 + src/pixi/display/DisplayObjectContainer.js:42

    @@ -683,7 +701,7 @@ - src/pixi/display/DisplayObjectContainer.js:73 + src/pixi/display/DisplayObjectContainer.js:139

    @@ -782,7 +800,7 @@ - src/pixi/display/DisplayObject.js:106 + src/pixi/display/DisplayObject.js:109

    @@ -866,7 +884,7 @@ - src/pixi/display/DisplayObjectContainer.js:168 + src/pixi/display/DisplayObjectContainer.js:274

    @@ -950,7 +968,7 @@ - src/pixi/display/DisplayObject.js:112 + src/pixi/display/DisplayObject.js:115

    @@ -1034,7 +1052,7 @@ - src/pixi/display/DisplayObject.js:138 + src/pixi/display/DisplayObject.js:141

    @@ -1118,7 +1136,7 @@ - src/pixi/display/DisplayObject.js:132 + src/pixi/display/DisplayObject.js:135

    @@ -1202,7 +1220,7 @@ - src/pixi/display/DisplayObject.js:118 + src/pixi/display/DisplayObject.js:121

    @@ -1287,7 +1305,7 @@ for this callback to be fired the mouse must have been pressed down over the dis - src/pixi/display/DisplayObject.js:125 + src/pixi/display/DisplayObject.js:128

    @@ -1372,7 +1390,7 @@ for this callback to be fired, The touch must have started over the displayObjec - src/pixi/display/DisplayObjectContainer.js:186 + src/pixi/display/DisplayObjectContainer.js:291

    @@ -1456,7 +1474,7 @@ for this callback to be fired, The touch must have started over the displayObjec - src/pixi/display/DisplayObject.js:190 + src/pixi/display/DisplayObject.js:193

    @@ -1467,7 +1485,8 @@ for this callback to be fired, The touch must have started over the displayObjec
    -

    Indicates if the sprite will have touch and mouse interactivity. It is false by default

    +

    [Deprecated] Indicates if the sprite will have touch and mouse interactivity. It is false by default +Instead of using this function you can now simply set the interactive property to true or false

    @@ -1546,7 +1565,7 @@ for this callback to be fired, The touch must have started over the displayObjec - src/pixi/display/DisplayObjectContainer.js:128 + src/pixi/display/DisplayObjectContainer.js:227

    @@ -1645,7 +1664,7 @@ for this callback to be fired, The touch must have started over the displayObjec - src/pixi/display/DisplayObject.js:149 + src/pixi/display/DisplayObject.js:152

    @@ -1730,7 +1749,7 @@ basically a touch version of click

    - src/pixi/display/DisplayObject.js:162 + src/pixi/display/DisplayObject.js:165

    @@ -1814,7 +1833,7 @@ basically a touch version of click

    - src/pixi/display/DisplayObject.js:168 + src/pixi/display/DisplayObject.js:171

    @@ -1899,7 +1918,7 @@ for this callback to be fired, The touch must have started over the sprite

    - src/pixi/display/DisplayObject.js:156 + src/pixi/display/DisplayObject.js:159

    @@ -1972,7 +1991,7 @@ for this callback to be fired, The touch must have started over the sprite

    - src/pixi/display/DisplayObject.js:40 + src/pixi/display/DisplayObject.js:43

    @@ -2013,7 +2032,7 @@ for this callback to be fired, The touch must have started over the sprite

    - src/pixi/display/DisplayObject.js:95 + src/pixi/display/DisplayObject.js:98

    @@ -2095,7 +2114,7 @@ for this callback to be fired, The touch must have started over the sprite

    - src/pixi/display/DisplayObject.js:69 + src/pixi/display/DisplayObject.js:72

    @@ -2114,6 +2133,90 @@ Setting it is a neat way of optimising the hitTest function that the interaction + + + +
    +

    interactive

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

    Inherited from + DisplayObject: + + + + src/pixi/display/DisplayObject.js:204 + +

    + + + + +
    + +
    +

    Indicates if the sprite will have touch and mouse interactivity. It is false by default

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

    mask

    + PIXI.Graphics + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + src/pixi/display/DisplayObject.js:222 + +

    + + + + +
    + +
    +

    Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it. +In PIXI a regular mask must be a PIXI.Ggraphics object. This allows for much faster masking in canvas as it utilises shape clipping. +To remove a mask, set this property to null.

    +
    + + + + + +
    @@ -2137,7 +2240,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction - src/pixi/display/DisplayObject.js:55 + src/pixi/display/DisplayObject.js:58

    @@ -2178,7 +2281,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction - src/pixi/display/DisplayObject.js:26 + src/pixi/display/DisplayObject.js:29

    @@ -2219,7 +2322,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction - src/pixi/display/DisplayObject.js:12 + src/pixi/display/DisplayObject.js:15

    @@ -2260,7 +2363,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction - src/pixi/display/DisplayObject.js:33 + src/pixi/display/DisplayObject.js:36

    @@ -2301,7 +2404,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction - src/pixi/display/DisplayObject.js:19 + src/pixi/display/DisplayObject.js:22

    @@ -2342,7 +2445,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction - src/pixi/display/DisplayObject.js:62 + src/pixi/display/DisplayObject.js:65

    @@ -2386,7 +2489,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction - src/pixi/extras/TilingSprite.js:29 + src/pixi/extras/TilingSprite.js:28

    @@ -2430,7 +2533,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction - src/pixi/extras/TilingSprite.js:23 + src/pixi/extras/TilingSprite.js:22

    @@ -2471,7 +2574,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction - src/pixi/display/DisplayObject.js:47 + src/pixi/display/DisplayObject.js:50

    diff --git a/docs/classes/WebGLBatch.html b/docs/classes/WebGLBatch.html index c1c627a..39646be 100644 --- a/docs/classes/WebGLBatch.html +++ b/docs/classes/WebGLBatch.html @@ -53,12 +53,16 @@
  • CanvasRenderer
  • +
  • Circle
  • +
  • CustomRenderable
  • DisplayObject
  • DisplayObjectContainer
  • +
  • Ellipse
  • +
  • Graphics
  • ImageLoader
  • diff --git a/docs/classes/WebGLRenderer.html b/docs/classes/WebGLRenderer.html index 6646299..4b5ffef 100644 --- a/docs/classes/WebGLRenderer.html +++ b/docs/classes/WebGLRenderer.html @@ -53,12 +53,16 @@
  • CanvasRenderer
  • +
  • Circle
  • +
  • CustomRenderable
  • DisplayObject
  • DisplayObjectContainer
  • +
  • Ellipse
  • +
  • Graphics
  • ImageLoader
  • @@ -415,7 +419,7 @@ Dont forget to add the view to your DOM or you will not see anything :)

    - src/pixi/renderers/webgl/WebGLRenderer.js:116 + src/pixi/renderers/webgl/WebGLRenderer.js:121

    @@ -508,7 +512,7 @@ Dont forget to add the view to your DOM or you will not see anything :)

    - src/pixi/renderers/webgl/WebGLRenderer.js:258 + src/pixi/renderers/webgl/WebGLRenderer.js:263

    diff --git a/docs/data.json b/docs/data.json index 711f8e8..fa53e3f 100644 --- a/docs/data.json +++ b/docs/data.json @@ -7,6 +7,24 @@ "logo": "http://www.goodboydigital.com/pixijs/logo_small.png" }, "files": { + "src/pixi/core/Circle.js": { + "name": "src/pixi/core/Circle.js", + "modules": {}, + "classes": { + "Circle": 1 + }, + "fors": {}, + "namespaces": {} + }, + "src/pixi/core/Ellipse.js": { + "name": "src/pixi/core/Ellipse.js", + "modules": {}, + "classes": { + "Ellipse": 1 + }, + "fors": {}, + "namespaces": {} + }, "src/pixi/core/Point.js": { "name": "src/pixi/core/Point.js", "modules": {}, @@ -118,6 +136,20 @@ "fors": {}, "namespaces": {} }, + "src/pixi/filters/FilterBlock.js": { + "name": "src/pixi/filters/FilterBlock.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "src/pixi/filters/MaskFilter.js": { + "name": "src/pixi/filters/MaskFilter.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, "src/pixi/loaders/AssetLoader.js": { "name": "src/pixi/loaders/AssetLoader.js", "modules": {}, @@ -343,6 +375,8 @@ "name": "PIXI", "submodules": {}, "classes": { + "Circle": 1, + "Ellipse": 1, "Point": 1, "Polygon": 1, "Rectangle": 1, @@ -376,10 +410,75 @@ "namespaces": {}, "tag": "module", "file": "src/pixi/InteractionManager.js", - "line": 524 + "line": 493 } }, "classes": { + "Circle": { + "name": "Circle", + "shortname": "Circle", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "src/pixi/core/Circle.js", + "line": 5, + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "The X coord of the upper-left corner of the framing rectangle of this circle", + "type": "Number" + }, + { + "name": "y", + "description": "The Y coord of the upper-left corner of the framing rectangle of this circle", + "type": "Number" + }, + { + "name": "radius", + "description": "The radius of the circle", + "type": "Number" + } + ] + }, + "Ellipse": { + "name": "Ellipse", + "shortname": "Ellipse", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "src/pixi/core/Ellipse.js", + "line": 5, + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "The X coord of the upper-left corner of the framing rectangle of this circle", + "type": "Number" + }, + { + "name": "y", + "description": "The Y coord of the upper-left corner of the framing rectangle of this circle", + "type": "Number" + }, + { + "name": "width", + "description": "The overall height of this ellipse", + "type": "Number" + }, + { + "name": "height", + "description": "The overall width of this ellipse", + "type": "Number" + } + ] + }, "Point": { "name": "Point", "shortname": "Point", @@ -421,8 +520,8 @@ "params": [ { "name": "points", - "description": "", - "type": "Array" + "description": "This cna be an array of Points or a flat array of numbers\n that will be interpreted as [x,y, x,y, ...]", + "type": "Array|Array" } ] }, @@ -1112,11 +1211,150 @@ "extension_for": [], "module": "PIXI", "file": "src/pixi/InteractionManager.js", - "line": 524, + "line": 493, "is_constructor": 1 } }, "classitems": [ + { + "file": "src/pixi/core/Circle.js", + "line": 1, + "author": "Chad Engler ", + "class": "Circle" + }, + { + "file": "src/pixi/core/Circle.js", + "line": 14, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Circle" + }, + { + "file": "src/pixi/core/Circle.js", + "line": 21, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Circle" + }, + { + "file": "src/pixi/core/Circle.js", + "line": 28, + "itemtype": "property", + "name": "radius", + "type": "Number", + "default": "0", + "class": "Circle" + }, + { + "file": "src/pixi/core/Circle.js", + "line": 36, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the polygon" + }, + "class": "Circle" + }, + { + "file": "src/pixi/core/Circle.js", + "line": 45, + "itemtype": "method", + "name": "contains", + "params": [ + { + "name": "x", + "description": "The X coord of the point to test", + "type": "Number" + }, + { + "name": "y", + "description": "The Y coord of the point to test", + "type": "Number" + } + ], + "return": { + "description": "if the x/y coords are within this polygon" + }, + "class": "Circle" + }, + { + "file": "src/pixi/core/Ellipse.js", + "line": 1, + "author": "Chad Engler ", + "class": "Ellipse" + }, + { + "file": "src/pixi/core/Ellipse.js", + "line": 15, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Ellipse" + }, + { + "file": "src/pixi/core/Ellipse.js", + "line": 22, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Ellipse" + }, + { + "file": "src/pixi/core/Ellipse.js", + "line": 29, + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "0", + "class": "Ellipse" + }, + { + "file": "src/pixi/core/Ellipse.js", + "line": 36, + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "0", + "class": "Ellipse" + }, + { + "file": "src/pixi/core/Ellipse.js", + "line": 44, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the polygon" + }, + "class": "Ellipse" + }, + { + "file": "src/pixi/core/Ellipse.js", + "line": 53, + "itemtype": "method", + "name": "contains", + "params": [ + { + "name": "x", + "description": "The X coord of the point to test", + "type": "Number" + }, + { + "name": "y", + "description": "The Y coord of the point to test", + "type": "Number" + } + ], + "return": { + "description": "if the x/y coords are within this polygon" + }, + "class": "Ellipse" + }, { "file": "src/pixi/core/Point.js", "line": 1, @@ -1159,7 +1397,7 @@ }, { "file": "src/pixi/core/Polygon.js", - "line": 15, + "line": 28, "itemtype": "method", "name": "clone", "return": { @@ -1167,6 +1405,28 @@ }, "class": "Polygon" }, + { + "file": "src/pixi/core/Polygon.js", + "line": 42, + "itemtype": "method", + "name": "contains", + "params": [ + { + "name": "x", + "description": "The X coord of the point to test", + "type": "Number" + }, + { + "name": "y", + "description": "The Y coord of the point to test", + "type": "Number" + } + ], + "return": { + "description": "if the x/y coords are within this polygon" + }, + "class": "Polygon" + }, { "file": "src/pixi/core/Rectangle.js", "line": 1, @@ -1219,6 +1479,28 @@ }, "class": "Rectangle" }, + { + "file": "src/pixi/core/Rectangle.js", + "line": 54, + "itemtype": "method", + "name": "contains", + "params": [ + { + "name": "x", + "description": "The X coord of the point to test", + "type": "Number" + }, + { + "name": "y", + "description": "The Y coord of the point to test", + "type": "Number" + } + ], + "return": { + "description": "if the x/y coords are within this polygon" + }, + "class": "Rectangle" + }, { "file": "src/pixi/display/DisplayObject.js", "line": 1, @@ -1227,7 +1509,7 @@ }, { "file": "src/pixi/display/DisplayObject.js", - "line": 12, + "line": 15, "description": "The coordinate of the object relative to the local coordinates of the parent.", "itemtype": "property", "name": "position", @@ -1236,7 +1518,7 @@ }, { "file": "src/pixi/display/DisplayObject.js", - "line": 19, + "line": 22, "description": "The scale factor of the object.", "itemtype": "property", "name": "scale", @@ -1245,7 +1527,7 @@ }, { "file": "src/pixi/display/DisplayObject.js", - "line": 26, + "line": 29, "description": "The pivot point of the displayObject that it rotates around", "itemtype": "property", "name": "pivot", @@ -1254,7 +1536,7 @@ }, { "file": "src/pixi/display/DisplayObject.js", - "line": 33, + "line": 36, "description": "The rotation of the object in radians.", "itemtype": "property", "name": "rotation", @@ -1263,7 +1545,7 @@ }, { "file": "src/pixi/display/DisplayObject.js", - "line": 40, + "line": 43, "description": "The opacity of the object.", "itemtype": "property", "name": "alpha", @@ -1272,7 +1554,7 @@ }, { "file": "src/pixi/display/DisplayObject.js", - "line": 47, + "line": 50, "description": "The visibility of the object.", "itemtype": "property", "name": "visible", @@ -1281,7 +1563,7 @@ }, { "file": "src/pixi/display/DisplayObject.js", - "line": 55, + "line": 58, "description": "[read-only] The display object container that contains this display object.", "itemtype": "property", "name": "parent", @@ -1290,7 +1572,7 @@ }, { "file": "src/pixi/display/DisplayObject.js", - "line": 62, + "line": 65, "description": "[read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.", "itemtype": "property", "name": "stage", @@ -1299,7 +1581,7 @@ }, { "file": "src/pixi/display/DisplayObject.js", - "line": 69, + "line": 72, "description": "This is the defined area that will pick up mouse / touch events. It is null by default.\nSetting it is a neat way of optimising the hitTest function that the interactionManager will use (as it will not need to hit test all the children)", "itemtype": "property", "name": "hitArea", @@ -1308,7 +1590,7 @@ }, { "file": "src/pixi/display/DisplayObject.js", - "line": 95, + "line": 98, "description": "This is used to indicate if the displayObject should display a mouse hand cursor on rollover", "itemtype": "property", "name": "buttonMode", @@ -1317,7 +1599,7 @@ }, { "file": "src/pixi/display/DisplayObject.js", - "line": 106, + "line": 109, "description": "A callback that is used when the users clicks on the displayObject with their mouse", "itemtype": "method", "name": "click", @@ -1332,7 +1614,7 @@ }, { "file": "src/pixi/display/DisplayObject.js", - "line": 112, + "line": 115, "description": "A callback that is used when the user clicks the mouse down over the sprite", "itemtype": "method", "name": "mousedown", @@ -1347,7 +1629,7 @@ }, { "file": "src/pixi/display/DisplayObject.js", - "line": 118, + "line": 121, "description": "A callback that is used when the user releases the mouse that was over the displayObject\nfor this callback to be fired the mouse must have been pressed down over the displayObject", "itemtype": "method", "name": "mouseup", @@ -1362,7 +1644,7 @@ }, { "file": "src/pixi/display/DisplayObject.js", - "line": 125, + "line": 128, "description": "A callback that is used when the user releases the mouse that was over the displayObject but is no longer over the displayObject\nfor this callback to be fired, The touch must have started over the displayObject", "itemtype": "method", "name": "mouseupoutside", @@ -1377,7 +1659,7 @@ }, { "file": "src/pixi/display/DisplayObject.js", - "line": 132, + "line": 135, "description": "A callback that is used when the users mouse rolls over the displayObject", "itemtype": "method", "name": "mouseover", @@ -1392,7 +1674,7 @@ }, { "file": "src/pixi/display/DisplayObject.js", - "line": 138, + "line": 141, "description": "A callback that is used when the users mouse leaves the displayObject", "itemtype": "method", "name": "mouseout", @@ -1407,7 +1689,7 @@ }, { "file": "src/pixi/display/DisplayObject.js", - "line": 149, + "line": 152, "description": "A callback that is used when the users taps on the sprite with their finger\nbasically a touch version of click", "itemtype": "method", "name": "tap", @@ -1422,7 +1704,7 @@ }, { "file": "src/pixi/display/DisplayObject.js", - "line": 156, + "line": 159, "description": "A callback that is used when the user touch's over the displayObject", "itemtype": "method", "name": "touchstart", @@ -1437,7 +1719,7 @@ }, { "file": "src/pixi/display/DisplayObject.js", - "line": 162, + "line": 165, "description": "A callback that is used when the user releases a touch over the displayObject", "itemtype": "method", "name": "touchend", @@ -1452,7 +1734,7 @@ }, { "file": "src/pixi/display/DisplayObject.js", - "line": 168, + "line": 171, "description": "A callback that is used when the user releases the touch that was over the displayObject\nfor this callback to be fired, The touch must have started over the sprite", "itemtype": "method", "name": "touchendoutside", @@ -1467,8 +1749,8 @@ }, { "file": "src/pixi/display/DisplayObject.js", - "line": 190, - "description": "Indicates if the sprite will have touch and mouse interactivity. It is false by default", + "line": 193, + "description": "[Deprecated] Indicates if the sprite will have touch and mouse interactivity. It is false by default\nInstead of using this function you can now simply set the interactive property to true or false", "itemtype": "method", "name": "setInteractive", "params": [ @@ -1483,6 +1765,24 @@ { "file": "src/pixi/display/DisplayObject.js", "line": 204, + "description": "Indicates if the sprite will have touch and mouse interactivity. It is false by default", + "itemtype": "property", + "name": "interactive", + "type": "Boolean", + "class": "DisplayObject" + }, + { + "file": "src/pixi/display/DisplayObject.js", + "line": 222, + "description": "Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it.\nIn PIXI a regular mask must be a PIXI.Ggraphics object. This allows for much faster masking in canvas as it utilises shape clipping.\nTo remove a mask, set this property to null.", + "itemtype": "property", + "name": "mask", + "type": "PIXI.Graphics", + "class": "DisplayObject" + }, + { + "file": "src/pixi/display/DisplayObject.js", + "line": 403, "access": "private", "tagname": "", "class": "DisplayObject" @@ -1504,7 +1804,7 @@ }, { "file": "src/pixi/display/DisplayObjectContainer.js", - "line": 41, + "line": 42, "description": "Adds a child to the container.", "itemtype": "method", "name": "addChild", @@ -1519,7 +1819,7 @@ }, { "file": "src/pixi/display/DisplayObjectContainer.js", - "line": 73, + "line": 139, "description": "Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown", "itemtype": "method", "name": "addChildAt", @@ -1539,7 +1839,7 @@ }, { "file": "src/pixi/display/DisplayObjectContainer.js", - "line": 128, + "line": 227, "description": "Swaps the depth of 2 displayObjects", "itemtype": "method", "name": "swapChildren", @@ -1559,7 +1859,7 @@ }, { "file": "src/pixi/display/DisplayObjectContainer.js", - "line": 168, + "line": 274, "description": "Returns the Child at the specified index", "itemtype": "method", "name": "getChildAt", @@ -1574,7 +1874,7 @@ }, { "file": "src/pixi/display/DisplayObjectContainer.js", - "line": 186, + "line": 291, "description": "Removes a child from the container.", "itemtype": "method", "name": "removeChild", @@ -1589,7 +1889,7 @@ }, { "file": "src/pixi/display/DisplayObjectContainer.js", - "line": 226, + "line": 358, "access": "private", "tagname": "", "class": "DisplayObjectContainer" @@ -1819,7 +2119,7 @@ }, { "file": "src/pixi/display/Stage.js", - "line": 40, + "line": 42, "itemtype": "method", "name": "updateTransform", "internal": "", @@ -1827,7 +2127,7 @@ }, { "file": "src/pixi/display/Stage.js", - "line": 63, + "line": 65, "itemtype": "method", "name": "setBackgroundColor", "params": [ @@ -1841,7 +2141,7 @@ }, { "file": "src/pixi/display/Stage.js", - "line": 76, + "line": 78, "description": "This will return the point containing global coords of the mouse.", "itemtype": "method", "name": "getMousePosition", @@ -2005,7 +2305,7 @@ }, { "file": "src/pixi/extras/TilingSprite.js", - "line": 23, + "line": 22, "description": "The scaling of the image that is being tiled", "itemtype": "property", "name": "tileScale", @@ -2014,13 +2314,25 @@ }, { "file": "src/pixi/extras/TilingSprite.js", - "line": 29, + "line": 28, "description": "The offset position of the image that is being tiled", "itemtype": "property", "name": "tilePosition", "type": "Point", "class": "TilingSprite" }, + { + "file": "src/pixi/filters/FilterBlock.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/ @Doormat23", + "class": "AssetLoader" + }, + { + "file": "src/pixi/filters/MaskFilter.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/ @Doormat23", + "class": "AssetLoader" + }, { "file": "src/pixi/loaders/AssetLoader.js", "line": 1, @@ -2473,21 +2785,21 @@ }, { "file": "src/pixi/renderers/canvas/CanvasRenderer.js", - "line": 218, + "line": 235, "access": "private", "tagname": "", "class": "CanvasRenderer" }, { "file": "src/pixi/renderers/canvas/CanvasRenderer.js", - "line": 253, + "line": 268, "access": "private", "tagname": "", "class": "CanvasRenderer" }, { "file": "src/pixi/renderers/canvas/CanvasRenderer.js", - "line": 284, + "line": 299, "access": "private", "tagname": "", "class": "CanvasRenderer" @@ -2674,35 +2986,35 @@ }, { "file": "src/pixi/renderers/webgl/WebGLRenderGroup.js", - "line": 624, + "line": 725, "access": "private", "tagname": "", "class": "WebGLBatch" }, { "file": "src/pixi/renderers/webgl/WebGLRenderGroup.js", - "line": 710, + "line": 732, "access": "private", "tagname": "", "class": "WebGLBatch" }, { "file": "src/pixi/renderers/webgl/WebGLRenderGroup.js", - "line": 765, + "line": 787, "access": "private", "tagname": "", "class": "WebGLBatch" }, { "file": "src/pixi/renderers/webgl/WebGLRenderGroup.js", - "line": 853, + "line": 875, "access": "private", "tagname": "", "class": "WebGLBatch" }, { "file": "src/pixi/renderers/webgl/WebGLRenderGroup.js", - "line": 890, + "line": 912, "access": "private", "tagname": "", "class": "WebGLBatch" @@ -2715,28 +3027,28 @@ }, { "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 85, + "line": 90, "access": "private", "tagname": "", "class": "WebGLRenderer" }, { "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 100, + "line": 105, "access": "private", "tagname": "", "class": "WebGLRenderer" }, { "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 110, + "line": 115, "access": "private", "tagname": "", "class": "WebGLRenderer" }, { "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 116, + "line": 121, "description": "Renders the stage to its webGL view", "itemtype": "method", "name": "render", @@ -2751,14 +3063,14 @@ }, { "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 199, + "line": 204, "access": "private", "tagname": "", "class": "WebGLRenderer" }, { "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 258, + "line": 263, "description": "resizes the webGL view to the specified width and height", "itemtype": "method", "name": "resize", @@ -2778,14 +3090,14 @@ }, { "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 285, + "line": 290, "access": "private", "tagname": "", "class": "WebGLRenderer" }, { "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 294, + "line": 299, "access": "private", "tagname": "", "class": "WebGLRenderer" @@ -3276,7 +3588,7 @@ }, { "file": "src/pixi/InteractionManager.js", - "line": 530, + "line": 499, "description": "This point stores the global coords of where the touch/mouse event happened", "itemtype": "property", "name": "global", @@ -3285,7 +3597,7 @@ }, { "file": "src/pixi/InteractionManager.js", - "line": 540, + "line": 509, "description": "The target Sprite that was interacted with", "itemtype": "property", "name": "target", @@ -3294,7 +3606,7 @@ }, { "file": "src/pixi/InteractionManager.js", - "line": 547, + "line": 516, "description": "When passed to an event handler, this will be the original DOM Event that was captured", "itemtype": "property", "name": "originalEvent", @@ -3303,7 +3615,7 @@ }, { "file": "src/pixi/InteractionManager.js", - "line": 555, + "line": 524, "description": "This will return the local coords of the specified displayObject for this InteractionData", "itemtype": "method", "name": "getLocalPosition", @@ -3342,7 +3654,7 @@ "warnings": [ { "message": "unknown tag: internal", - "line": " src/pixi/display/Stage.js:40" + "line": " src/pixi/display/Stage.js:42" }, { "message": "unknown tag: methos", @@ -3352,6 +3664,14 @@ "message": "unknown tag: methos", "line": " src/pixi/text/Text.js:63" }, + { + "message": "Missing item type", + "line": " src/pixi/core/Circle.js:1" + }, + { + "message": "Missing item type", + "line": " src/pixi/core/Ellipse.js:1" + }, { "message": "Missing item type", "line": " src/pixi/core/Point.js:1" @@ -3370,7 +3690,7 @@ }, { "message": "Missing item type", - "line": " src/pixi/display/DisplayObject.js:204" + "line": " src/pixi/display/DisplayObject.js:403" }, { "message": "Missing item type", @@ -3378,7 +3698,7 @@ }, { "message": "Missing item type", - "line": " src/pixi/display/DisplayObjectContainer.js:226" + "line": " src/pixi/display/DisplayObjectContainer.js:358" }, { "message": "Missing item type", @@ -3512,6 +3832,14 @@ "message": "Missing item type", "line": " src/pixi/extras/TilingSprite.js:1" }, + { + "message": "Missing item type", + "line": " src/pixi/filters/FilterBlock.js:1" + }, + { + "message": "Missing item type", + "line": " src/pixi/filters/MaskFilter.js:1" + }, { "message": "Missing item type", "line": " src/pixi/loaders/AssetLoader.js:1" @@ -3618,15 +3946,15 @@ }, { "message": "Missing item type", - "line": " src/pixi/renderers/canvas/CanvasRenderer.js:218" + "line": " src/pixi/renderers/canvas/CanvasRenderer.js:235" }, { "message": "Missing item type", - "line": " src/pixi/renderers/canvas/CanvasRenderer.js:253" + "line": " src/pixi/renderers/canvas/CanvasRenderer.js:268" }, { "message": "Missing item type", - "line": " src/pixi/renderers/canvas/CanvasRenderer.js:284" + "line": " src/pixi/renderers/canvas/CanvasRenderer.js:299" }, { "message": "Missing item type", @@ -3662,23 +3990,23 @@ }, { "message": "Missing item type", - "line": " src/pixi/renderers/webgl/WebGLRenderGroup.js:624" + "line": " src/pixi/renderers/webgl/WebGLRenderGroup.js:725" }, { "message": "Missing item type", - "line": " src/pixi/renderers/webgl/WebGLRenderGroup.js:710" + "line": " src/pixi/renderers/webgl/WebGLRenderGroup.js:732" }, { "message": "Missing item type", - "line": " src/pixi/renderers/webgl/WebGLRenderGroup.js:765" + "line": " src/pixi/renderers/webgl/WebGLRenderGroup.js:787" }, { "message": "Missing item type", - "line": " src/pixi/renderers/webgl/WebGLRenderGroup.js:853" + "line": " src/pixi/renderers/webgl/WebGLRenderGroup.js:875" }, { "message": "Missing item type", - "line": " src/pixi/renderers/webgl/WebGLRenderGroup.js:890" + "line": " src/pixi/renderers/webgl/WebGLRenderGroup.js:912" }, { "message": "Missing item type", @@ -3686,27 +4014,27 @@ }, { "message": "Missing item type", - "line": " src/pixi/renderers/webgl/WebGLRenderer.js:85" + "line": " src/pixi/renderers/webgl/WebGLRenderer.js:90" }, { "message": "Missing item type", - "line": " src/pixi/renderers/webgl/WebGLRenderer.js:100" + "line": " src/pixi/renderers/webgl/WebGLRenderer.js:105" }, { "message": "Missing item type", - "line": " src/pixi/renderers/webgl/WebGLRenderer.js:110" + "line": " src/pixi/renderers/webgl/WebGLRenderer.js:115" }, { "message": "Missing item type", - "line": " src/pixi/renderers/webgl/WebGLRenderer.js:199" + "line": " src/pixi/renderers/webgl/WebGLRenderer.js:204" }, { "message": "Missing item type", - "line": " src/pixi/renderers/webgl/WebGLRenderer.js:285" + "line": " src/pixi/renderers/webgl/WebGLRenderer.js:290" }, { "message": "Missing item type", - "line": " src/pixi/renderers/webgl/WebGLRenderer.js:294" + "line": " src/pixi/renderers/webgl/WebGLRenderer.js:299" }, { "message": "Missing item type", diff --git a/docs/files/src_pixi_InteractionManager.js.html b/docs/files/src_pixi_InteractionManager.js.html index 90a6ed5..e30e1a9 100644 --- a/docs/files/src_pixi_InteractionManager.js.html +++ b/docs/files/src_pixi_InteractionManager.js.html @@ -53,12 +53,16 @@
  • CanvasRenderer
  • +
  • Circle
  • +
  • CustomRenderable
  • DisplayObject
  • DisplayObjectContainer
  • +
  • Ellipse
  • +
  • Graphics
  • ImageLoader
  • @@ -201,7 +205,6 @@ PIXI.InteractionManager.prototype.collectInteractiveSprite = function(displayObj var children = displayObject.children; var length = children.length; - //this.interactiveItems = []; /// make an interaction tree... {item.__interactiveParent} for (var i = length-1; i >= 0; i--) { @@ -459,42 +462,12 @@ PIXI.InteractionManager.prototype.hitTest = function(item, interactionData) y = a00 * id * global.y + -a10 * id * global.x + (-a12 * a00 + a02 * a10) * id; //a sprite or display object with a hit area defined - if(item.hitArea) - { - var hitArea = item.hitArea; + if(item.hitArea && item.hitArea.contains) { + if(item.hitArea.contains(x, y)) { + if(isSprite) + interactionData.target = item; - //Polygon hit area - if(item.hitArea instanceof PIXI.Polygon) { - var inside = false; - - // use some raycasting to test hits - // https://github.com/substack/point-in-polygon/blob/master/index.js - for(var i = 0, j = item.hitArea.points.length - 1; i < item.hitArea.points.length; j = i++) { - var xi = item.hitArea.points[i].x, yi = item.hitArea.points[i].y, - xj = item.hitArea.points[j].x, yj = item.hitArea.points[j].y, - intersect = ((yi > y) != (yj > y)) && (x < (xj - xi) * (y - yi) / (yj - yi) + xi); - - if(intersect) inside = !inside; - } - - if(inside) { - if(isSprite) interactionData.target = item; - return true; - } - } - //Rectangle hit area - else { - var x1 = hitArea.x; - if(x > x1 && x < x1 + hitArea.width) - { - var y1 = hitArea.y; - - if(y > y1 && y < y1 + hitArea.height) - { - if(isSprite) interactionData.target = item; - return true; - } - } + return true; } } // a sprite with no hitarea defined diff --git a/docs/files/src_pixi_Intro.js.html b/docs/files/src_pixi_Intro.js.html index 490ac03..e5f2ae9 100644 --- a/docs/files/src_pixi_Intro.js.html +++ b/docs/files/src_pixi_Intro.js.html @@ -53,12 +53,16 @@
  • CanvasRenderer
  • +
  • Circle
  • +
  • CustomRenderable
  • DisplayObject
  • DisplayObjectContainer
  • +
  • Ellipse
  • +
  • Graphics
  • ImageLoader
  • diff --git a/docs/files/src_pixi_Outro.js.html b/docs/files/src_pixi_Outro.js.html index 766da17..1eacb07 100644 --- a/docs/files/src_pixi_Outro.js.html +++ b/docs/files/src_pixi_Outro.js.html @@ -53,12 +53,16 @@
  • CanvasRenderer
  • +
  • Circle
  • +
  • CustomRenderable
  • DisplayObject
  • DisplayObjectContainer
  • +
  • Ellipse
  • +
  • Graphics
  • ImageLoader
  • diff --git a/docs/files/src_pixi_Pixi.js.html b/docs/files/src_pixi_Pixi.js.html index bd48fdf..3ac2a71 100644 --- a/docs/files/src_pixi_Pixi.js.html +++ b/docs/files/src_pixi_Pixi.js.html @@ -53,12 +53,16 @@
  • CanvasRenderer
  • +
  • Circle
  • +
  • CustomRenderable
  • DisplayObject
  • DisplayObjectContainer
  • +
  • Ellipse
  • +
  • Graphics
  • ImageLoader
  • diff --git a/docs/files/src_pixi_core_Circle.js.html b/docs/files/src_pixi_core_Circle.js.html new file mode 100644 index 0000000..a3eb2f7 --- /dev/null +++ b/docs/files/src_pixi_core_Circle.js.html @@ -0,0 +1,235 @@ + + + + + src/pixi/core/Circle.js - Pixi.JS + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.3.0 +
    +
    +
    + + +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: src/pixi/core/Circle.js

    + +
    +
    +/**
    + * @author Chad Engler <chad@pantherdev.com>
    + */
    +
    +/**
    + * @class Circle
    + * @constructor
    + * @param x {Number} The X coord of the upper-left corner of the framing rectangle of this circle
    + * @param y {Number} The Y coord of the upper-left corner of the framing rectangle of this circle
    + * @param radius {Number} The radius of the circle
    + */
    +PIXI.Circle = function(x, y, radius)
    +{
    +    /**
    +     * @property x
    +     * @type Number
    +     * @default 0
    +     */
    +    this.x = x || 0;
    +    
    +    /**
    +     * @property y
    +     * @type Number
    +     * @default 0
    +     */
    +    this.y = y || 0;
    +
    +    /**
    +     * @property radius
    +     * @type Number
    +     * @default 0
    +     */
    +    this.radius = radius || 0;
    +}
    +
    +/**
    + * @method clone
    + * @return a copy of the polygon
    + */
    +PIXI.Circle.prototype.clone = function()
    +{
    +    return new PIXI.Circle(this.x, this.y, this.radius);
    +}
    +
    +/**
    + * @method contains
    + * @param x {Number} The X coord of the point to test
    + * @param y {Number} The Y coord of the point to test
    + * @return if the x/y coords are within this polygon
    + */
    +PIXI.Circle.prototype.contains = function(x, y)
    +{
    +    if(this.radius <= 0)
    +        return false;
    +
    +    var dx = (this.x - x),
    +        dy = (this.y - y),
    +        r2 = this.radius * this.radius;
    +
    +    dx *= dx;
    +    dy *= dy;
    +
    +    return (dx + dy <= r2);
    +}
    +
    +PIXI.Circle.constructor = PIXI.Circle;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/src_pixi_core_Ellipse.js.html b/docs/files/src_pixi_core_Ellipse.js.html new file mode 100644 index 0000000..756dc05 --- /dev/null +++ b/docs/files/src_pixi_core_Ellipse.js.html @@ -0,0 +1,249 @@ + + + + + src/pixi/core/Ellipse.js - Pixi.JS + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.3.0 +
    +
    +
    + + +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: src/pixi/core/Ellipse.js

    + +
    +
    +/**
    + * @author Chad Engler <chad@pantherdev.com>
    + */
    +
    +/**
    + * @class Ellipse
    + * @constructor
    + * @param x {Number} The X coord of the upper-left corner of the framing rectangle of this circle
    + * @param y {Number} The Y coord of the upper-left corner of the framing rectangle of this circle
    + * @param width {Number} The overall height of this ellipse
    + * @param height {Number} The overall width of this ellipse
    + */
    +PIXI.Ellipse = function(x, y, width, height)
    +{
    +    /**
    +     * @property x
    +     * @type Number
    +     * @default 0
    +     */
    +    this.x = x || 0;
    +    
    +    /**
    +     * @property y
    +     * @type Number
    +     * @default 0
    +     */
    +    this.y = y || 0;
    +    
    +    /**
    +     * @property width
    +     * @type Number
    +     * @default 0
    +     */
    +    this.width = width || 0;
    +    
    +    /**
    +     * @property height
    +     * @type Number
    +     * @default 0
    +     */
    +    this.height = height || 0;
    +}
    +
    +/**
    + * @method clone
    + * @return a copy of the polygon
    + */
    +PIXI.Ellipse.prototype.clone = function()
    +{
    +    return new PIXI.Ellipse(this.x, this.y, this.width, this.height);
    +}
    +
    +/**
    + * @method contains
    + * @param x {Number} The X coord of the point to test
    + * @param y {Number} The Y coord of the point to test
    + * @return if the x/y coords are within this polygon
    + */
    +PIXI.Ellipse.prototype.contains = function(x, y)
    +{
    +    if(this.width <= 0 || this.height <= 0)
    +        return false;
    +
    +    //normalize the coords to an ellipse with center 0,0
    +    //and a radius of 0.5
    +    var normx = ((x - this.x) / this.width) - 0.5,
    +        normy = ((y - this.y) / this.height) - 0.5;
    +
    +    normx *= normx;
    +    normy *= normy;
    +
    +    return (normx + normy < 0.25);
    +}
    +
    +PIXI.Ellipse.getBounds = function()
    +{
    +    return new PIXI.Rectangle(this.x, this.y, this.width, this.height);
    +}
    +
    +PIXI.Ellipse.constructor = PIXI.Ellipse;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/src_pixi_core_Point.js.html b/docs/files/src_pixi_core_Point.js.html index 5c45897..0d67d6c 100644 --- a/docs/files/src_pixi_core_Point.js.html +++ b/docs/files/src_pixi_core_Point.js.html @@ -53,12 +53,16 @@
  • CanvasRenderer
  • +
  • Circle
  • +
  • CustomRenderable
  • DisplayObject
  • DisplayObjectContainer
  • +
  • Ellipse
  • +
  • Graphics
  • ImageLoader
  • diff --git a/docs/files/src_pixi_core_Polygon.js.html b/docs/files/src_pixi_core_Polygon.js.html index 24ff85d..4ea7868 100644 --- a/docs/files/src_pixi_core_Polygon.js.html +++ b/docs/files/src_pixi_core_Polygon.js.html @@ -53,12 +53,16 @@
  • CanvasRenderer
  • +
  • Circle
  • +
  • CustomRenderable
  • DisplayObject
  • DisplayObjectContainer
  • +
  • Ellipse
  • +
  • Graphics
  • ImageLoader
  • @@ -149,10 +153,23 @@ /** * @class Polygon * @constructor - * @param points {Array} + * @param points {Array<Point>|Array<Number>} This cna be an array of Points or a flat array of numbers + * that will be interpreted as [x,y, x,y, ...] */ PIXI.Polygon = function(points) { + //if this is a flat array of numbers, convert it to points + if(typeof points[0] === 'number') { + var p = []; + for(var i = 0, il = points.length; i < il; i+=2) { + p.push( + new PIXI.Point(points[i], points[i + 1]) + ); + } + + points = p; + } + this.points = points; } @@ -160,7 +177,7 @@ PIXI.Polygon = function(points) * @method clone * @return a copy of the polygon */ -PIXI.Polygon.clone = function() +PIXI.Polygon.prototype.clone = function() { var points = []; for (var i=0; i<this.points.length; i++) { @@ -170,6 +187,29 @@ PIXI.Polygon.clone = function() return new PIXI.Polygon(points); } +/** + * @method contains + * @param x {Number} The X coord of the point to test + * @param y {Number} The Y coord of the point to test + * @return if the x/y coords are within this polygon + */ +PIXI.Polygon.prototype.contains = function(x, y) +{ + var inside = false; + + // use some raycasting to test hits + // https://github.com/substack/point-in-polygon/blob/master/index.js + for(var i = 0, j = this.points.length - 1; i < this.points.length; j = i++) { + var xi = this.points[i].x, yi = this.points[i].y, + xj = this.points[j].x, yj = this.points[j].y, + intersect = ((yi > y) != (yj > y)) && (x < (xj - xi) * (y - yi) / (yj - yi) + xi); + + if(intersect) inside = !inside; + } + + return inside; +} + PIXI.Polygon.constructor = PIXI.Polygon; diff --git a/docs/files/src_pixi_core_Rectangle.js.html b/docs/files/src_pixi_core_Rectangle.js.html index 731ea8b..de18763 100644 --- a/docs/files/src_pixi_core_Rectangle.js.html +++ b/docs/files/src_pixi_core_Rectangle.js.html @@ -53,12 +53,16 @@
  • CanvasRenderer
  • +
  • Circle
  • +
  • CustomRenderable
  • DisplayObject
  • DisplayObjectContainer
  • +
  • Ellipse
  • +
  • Graphics
  • ImageLoader
  • @@ -195,6 +199,31 @@ PIXI.Rectangle.prototype.clone = function() return new PIXI.Rectangle(this.x, this.y, this.width, this.height); } +/** + * @method contains + * @param x {Number} The X coord of the point to test + * @param y {Number} The Y coord of the point to test + * @return if the x/y coords are within this polygon + */ +PIXI.Rectangle.prototype.contains = function(x, y) +{ + if(this.width <= 0 || this.height <= 0) + return false; + + var x1 = this.x; + if(x > x1 && x < x1 + this.width) + { + var y1 = this.y; + + if(y > y1 && y < y1 + this.height) + { + return true; + } + } + + return false; +} + // constructor PIXI.Rectangle.constructor = PIXI.Rectangle; diff --git a/docs/files/src_pixi_display_DisplayObject.js.html b/docs/files/src_pixi_display_DisplayObject.js.html index 11d33f3..46436ba 100644 --- a/docs/files/src_pixi_display_DisplayObject.js.html +++ b/docs/files/src_pixi_display_DisplayObject.js.html @@ -53,12 +53,16 @@
  • CanvasRenderer
  • +
  • Circle
  • +
  • CustomRenderable
  • DisplayObject
  • DisplayObjectContainer
  • +
  • Ellipse
  • +
  • Graphics
  • ImageLoader
  • @@ -153,6 +157,9 @@ */ PIXI.DisplayObject = function() { + this.last = this; + this.first = this; + /** * The coordinate of the object relative to the local coordinates of the parent. * @property position @@ -234,7 +241,7 @@ PIXI.DisplayObject = function() this.renderable = false; // [readonly] best not to toggle directly! use setInteractive() - this.interactive = false; + this._interactive = false; /** * This is used to indicate if the displayObject should display a mouse hand cursor on rollover @@ -332,18 +339,214 @@ Object.defineProperty(PIXI.DisplayObject.prototype, 'visible', { });*/ /** - * Indicates if the sprite will have touch and mouse interactivity. It is false by default + * [Deprecated] Indicates if the sprite will have touch and mouse interactivity. It is false by default + * Instead of using this function you can now simply set the interactive property to true or false * @method setInteractive * @param interactive {Boolean} */ PIXI.DisplayObject.prototype.setInteractive = function(interactive) { this.interactive = interactive; - // TODO more to be done here.. - // need to sort out a re-crawl! - if(this.stage)this.stage.dirty = true; } +/** + * Indicates if the sprite will have touch and mouse interactivity. It is false by default + * @property interactive + * @type Boolean + */ +Object.defineProperty(PIXI.DisplayObject.prototype, 'interactive', { + get: function() { + return this._interactive; + }, + set: function(value) { + this._interactive = value; + + // TODO more to be done here.. + // need to sort out a re-crawl! + if(this.stage)this.stage.dirty = true; + } +}); + +/** + * Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it. + * In PIXI a regular mask must be a PIXI.Ggraphics object. This allows for much faster masking in canvas as it utilises shape clipping. + * To remove a mask, set this property to null. + * @property mask + * @type PIXI.Graphics + */ +Object.defineProperty(PIXI.DisplayObject.prototype, 'mask', { + get: function() { + return this._mask; + }, + set: function(value) { + + this._mask = value; + + if(value) + { + this.addFilter(value) + } + else + { + this.removeFilter(); + } + } +}); + +/* + * private + */ +PIXI.DisplayObject.prototype.addFilter = function(mask) +{ + if(this.filter)return; + this.filter = true; + + + // insert a filter block.. + var start = new PIXI.FilterBlock(); + var end = new PIXI.FilterBlock(); + + + start.mask = mask; + end.mask = mask; + + start.id = end.id = county + + county++; + + start.first = start.last = this; + end.first = end.last = this; + + start.open = true; + + /* + * + * insert start + * + */ + + var childFirst = start + var childLast = start + var nextObject; + var previousObject; + + previousObject = this.first._iPrev; + + if(previousObject) + { + nextObject = previousObject._iNext; + childFirst._iPrev = previousObject; + previousObject._iNext = childFirst; + } + else + { + nextObject = this; + } + + if(nextObject) + { + nextObject._iPrev = childLast; + childLast._iNext = nextObject; + } + + + // now insert the end filter block.. + + /* + * + * insert end filter + * + */ + var childFirst = end + var childLast = end + var nextObject = null; + var previousObject = null; + + previousObject = this.last; + nextObject = previousObject._iNext; + + if(nextObject) + { + nextObject._iPrev = childLast; + childLast._iNext = nextObject; + } + + childFirst._iPrev = previousObject; + previousObject._iNext = childFirst; + + var updateLast = this; + + var prevLast = this.last; + while(updateLast) + { + if(updateLast.last == prevLast) + { + updateLast.last = end; + } + updateLast = updateLast.parent; + } + + this.first = start; + + // if webGL... + if(this.__renderGroup) + { + this.__renderGroup.addFilterBlocks(start, end); + } + + mask.renderable = false; + +} + +PIXI.DisplayObject.prototype.removeFilter = function() +{ + if(!this.filter)return; + this.filter = false; + + // modify the list.. + var startBlock = this.first; + + var nextObject = startBlock._iNext; + var previousObject = startBlock._iPrev; + + if(nextObject)nextObject._iPrev = previousObject; + if(previousObject)previousObject._iNext = nextObject; + + this.first = startBlock._iNext; + + + // remove the end filter + var lastBlock = this.last; + + var nextObject = lastBlock._iNext; + var previousObject = lastBlock._iPrev; + + if(nextObject)nextObject._iPrev = previousObject; + previousObject._iNext = nextObject; + + // this is always true too! +// if(this.last == lastBlock) + //{ + var tempLast = lastBlock._iPrev; + // need to make sure the parents last is updated too + var updateLast = this; + while(updateLast.last == lastBlock) + { + updateLast.last = tempLast; + updateLast = updateLast.parent; + if(!updateLast)break; + } + + var mask = startBlock.mask + mask.renderable = true; + + // if webGL... + if(this.__renderGroup) + { + this.__renderGroup.removeFilterBlocks(startBlock, lastBlock); + } + //} +} /** * @private @@ -367,24 +570,21 @@ PIXI.DisplayObject.prototype.updateTransform = function() localTransform[3] = this._sr * this.scale.x; localTransform[4] = this._cr * this.scale.y; - ///AAARR GETTER SETTTER! - //localTransform[2] = this.position.x; - //localTransform[5] = this.position.y; + // TODO --> do we even need a local matrix??? var px = this.pivot.x; var py = this.pivot.y; - ///AAARR GETTER SETTTER! - localTransform[2] = this.position.x - localTransform[0] * px - py * localTransform[1]; - localTransform[5] = this.position.y - localTransform[4] * py - px * localTransform[3]; - // Cache the matrix values (makes for huge speed increases!) - var a00 = localTransform[0], a01 = localTransform[1], a02 = localTransform[2], - a10 = localTransform[3], a11 = localTransform[4], a12 = localTransform[5], + var a00 = localTransform[0], a01 = localTransform[1], a02 = this.position.x - localTransform[0] * px - py * localTransform[1], + a10 = localTransform[3], a11 = localTransform[4], a12 = this.position.y - localTransform[4] * py - px * localTransform[3], b00 = parentTransform[0], b01 = parentTransform[1], b02 = parentTransform[2], b10 = parentTransform[3], b11 = parentTransform[4], b12 = parentTransform[5]; + localTransform[2] = a02 + localTransform[5] = a12 + worldTransform[0] = b00 * a00 + b01 * a10; worldTransform[1] = b00 * a01 + b01 * a11; worldTransform[2] = b00 * a02 + b01 * a12 + b02; @@ -397,7 +597,6 @@ PIXI.DisplayObject.prototype.updateTransform = function() // mat3.multiply(this.localTransform, this.parent.worldTransform, this.worldTransform); this.worldAlpha = this.alpha * this.parent.worldAlpha; - } diff --git a/docs/files/src_pixi_display_DisplayObjectContainer.js.html b/docs/files/src_pixi_display_DisplayObjectContainer.js.html index 02ecf27..0875822 100644 --- a/docs/files/src_pixi_display_DisplayObjectContainer.js.html +++ b/docs/files/src_pixi_display_DisplayObjectContainer.js.html @@ -53,12 +53,16 @@
  • CanvasRenderer
  • +
  • Circle
  • +
  • CustomRenderable
  • DisplayObject
  • DisplayObjectContainer
  • +
  • Ellipse
  • +
  • Graphics
  • ImageLoader
  • @@ -164,6 +168,7 @@ PIXI.DisplayObjectContainer = function() this.children = []; //s this.renderable = false; + } // constructor @@ -189,21 +194,85 @@ Object.defineProperty(PIXI.DisplayObjectContainer.prototype, 'visible' */ PIXI.DisplayObjectContainer.prototype.addChild = function(child) { + + //this.addChildAt(child, this.children.length) + //return; + if(child.parent != undefined) { + + //// COULD BE THIS??? child.parent.removeChild(child); + // return; } child.parent = this; - child.childIndex = this.children.length; + //child.childIndex = this.children.length; this.children.push(child); + // updae the stage refference.. + if(this.stage) { - this.stage.__addChild(child); + var tmpChild = child; + do + { + if(tmpChild.interactive)this.stage.dirty = true; + tmpChild.stage = this.stage; + tmpChild = tmpChild._iNext; + } + while(tmpChild) } + // LINKED LIST // + + // modify the list.. + var childFirst = child.first + var childLast = child.last; +// console.log(childFirst) + var nextObject; + var previousObject; + + // this could be wrong if there is a filter?? + if(this.filter) + { + previousObject = this.last._iPrev; + } + else + { + previousObject = this.last; + } +// if(this.last._iNext) + + //console.log( this.last._iNext); + nextObject = previousObject._iNext; + + // always true in this case + //this.last = child.last; + // need to make sure the parents last is updated too + var updateLast = this; + var prevLast = previousObject; + + while(updateLast) + { + if(updateLast.last == prevLast) + { + updateLast.last = child.last; + } + updateLast = updateLast.parent; + } + + if(nextObject) + { + nextObject._iPrev = childLast; + childLast._iNext = nextObject; + } + + childFirst._iPrev = previousObject; + previousObject._iNext = childFirst; + +// console.log(childFirst); // need to remove any render groups.. if(this.__renderGroup) { @@ -212,6 +281,7 @@ PIXI.DisplayObjectContainer.prototype.addChild = function(child) // add them to the new render group.. this.__renderGroup.addDisplayObjectAndChildren(child); } + } /** @@ -228,30 +298,63 @@ PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index) { child.parent.removeChild(child); } - - if (index == this.children.length) - { - this.children.push(child); - } - else - { - this.children.splice(index, 0, child); - } - child.parent = this; - child.childIndex = index; - - var length = this.children.length; - for (var i=index; i < length; i++) - { - this.children[i].childIndex = i; - } if(this.stage) { - this.stage.__addChild(child); + var tmpChild = child; + do + { + if(tmpChild.interactive)this.stage.dirty = true; + tmpChild.stage = this.stage; + tmpChild = tmpChild._iNext; + } + while(tmpChild) } + // modify the list.. + var childFirst = child.first + var childLast = child.last; + var nextObject; + var previousObject; + + if(index == this.children.length) + { + previousObject = this.last; + var updateLast = this;//.parent; + var prevLast = this.last; + while(updateLast) + { + if(updateLast.last == prevLast) + { + updateLast.last = child.last; + } + updateLast = updateLast.parent; + } + } + else if(index == 0) + { + previousObject = this; + } + else + { + previousObject = this.children[index-1].last; + } + + nextObject = previousObject._iNext; + + // always true in this case + if(nextObject) + { + nextObject._iPrev = childLast; + childLast._iNext = nextObject; + } + + childFirst._iPrev = previousObject; + previousObject._iNext = childFirst; + + + this.children.splice(index, 0, child); // need to remove any render groups.. if(this.__renderGroup) { @@ -260,11 +363,11 @@ PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index) // add them to the new render group.. this.__renderGroup.addDisplayObjectAndChildren(child); } + + console.log(this.children) } else { - // error! - throw new Error(child + " The index "+ index +" supplied is out of bounds " + this.children.length); } } @@ -277,6 +380,14 @@ PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index) */ PIXI.DisplayObjectContainer.prototype.swapChildren = function(child, child2) { + /* + * this funtion needs to be recoded.. + * can be done a lot faster.. + */ + return; + + // need to fix this function :/ + /* // TODO I already know this?? var index = this.children.indexOf( child ); var index2 = this.children.indexOf( child2 ); @@ -284,6 +395,8 @@ PIXI.DisplayObjectContainer.prototype.swapChildren = function(child, child2) if ( index !== -1 && index2 !== -1 ) { // cool + + /* if(this.stage) { // this is to satisfy the webGL batching.. @@ -295,9 +408,6 @@ PIXI.DisplayObjectContainer.prototype.swapChildren = function(child, child2) this.stage.__addChild(child2); } - // swap the indexes.. - child.childIndex = index2; - child2.childIndex = index; // swap the positions.. this.children[index] = child2; this.children[index2] = child; @@ -306,7 +416,7 @@ PIXI.DisplayObjectContainer.prototype.swapChildren = function(child, child2) else { throw new Error(child + " Both the supplied DisplayObjects must be a child of the caller " + this); - } + }*/ } /** @@ -323,7 +433,6 @@ PIXI.DisplayObjectContainer.prototype.getChildAt = function(index) else { throw new Error(child + " Both the supplied DisplayObjects must be a child of the caller " + this); - } } @@ -335,30 +444,57 @@ PIXI.DisplayObjectContainer.prototype.getChildAt = function(index) PIXI.DisplayObjectContainer.prototype.removeChild = function(child) { var index = this.children.indexOf( child ); - if ( index !== -1 ) { - if(this.stage) + //console.log(">>") + // unlink // + // modify the list.. + var childFirst = child.first + var childLast = child.last; + + var nextObject = childLast._iNext; + var previousObject = childFirst._iPrev; + + if(nextObject)nextObject._iPrev = previousObject; + previousObject._iNext = nextObject; + + if(this.last == childLast) { - this.stage.__removeChild(child); + var tempLast = childFirst._iPrev; + // need to make sure the parents last is updated too + var updateLast = this; + while(updateLast.last == childLast.last) + { + updateLast.last = tempLast; + updateLast = updateLast.parent; + if(!updateLast)break; + } } + childLast._iNext = null; + childFirst._iPrev = null; + + // update the stage reference.. + if(this.stage) + { + var tmpChild = child; + do + { + if(tmpChild.interactive)this.stage.dirty = true; + tmpChild.stage = null; + tmpChild = tmpChild._iNext; + } + while(tmpChild) + } + // webGL trim if(child.__renderGroup) { child.__renderGroup.removeDisplayObjectAndChildren(child); } - // console.log(">" + child.__renderGroup) child.parent = undefined; - this.children.splice( index, 1 ); - - // update in dexs! - for(var i=index,j=this.children.length; i<j; i++) - { - this.children[i].childIndex -= 1; - } } else { diff --git a/docs/files/src_pixi_display_MovieClip.js.html b/docs/files/src_pixi_display_MovieClip.js.html index a48bbb8..87e0a59 100644 --- a/docs/files/src_pixi_display_MovieClip.js.html +++ b/docs/files/src_pixi_display_MovieClip.js.html @@ -53,12 +53,16 @@
  • CanvasRenderer
  • +
  • Circle
  • +
  • CustomRenderable
  • DisplayObject
  • DisplayObjectContainer
  • +
  • Ellipse
  • +
  • Graphics
  • ImageLoader
  • diff --git a/docs/files/src_pixi_display_Sprite.js.html b/docs/files/src_pixi_display_Sprite.js.html index 2266b51..48e9042 100644 --- a/docs/files/src_pixi_display_Sprite.js.html +++ b/docs/files/src_pixi_display_Sprite.js.html @@ -53,12 +53,16 @@
  • CanvasRenderer
  • +
  • Circle
  • +
  • CustomRenderable
  • DisplayObject
  • DisplayObjectContainer
  • +
  • Ellipse
  • +
  • Graphics
  • ImageLoader
  • diff --git a/docs/files/src_pixi_display_Stage.js.html b/docs/files/src_pixi_display_Stage.js.html index 0f8b703..6c0dc32 100644 --- a/docs/files/src_pixi_display_Stage.js.html +++ b/docs/files/src_pixi_display_Stage.js.html @@ -53,12 +53,16 @@
  • CanvasRenderer
  • +
  • Circle
  • +
  • CustomRenderable
  • DisplayObject
  • DisplayObjectContainer
  • +
  • Ellipse
  • +
  • Graphics
  • ImageLoader
  • @@ -158,21 +162,23 @@ PIXI.Stage = function(backgroundColor, interactive) { PIXI.DisplayObjectContainer.call( this ); + this.worldTransform = PIXI.mat3.create() this.__childrenAdded = []; this.__childrenRemoved = []; - this.childIndex = 0; - this.stage= this; + + //this.childIndex = 0; + this.stage = this; + this.interactive = interactive; this.stage.hitArea = new PIXI.Rectangle(0,0,100000, 100000); // interaction! - this.interactive = !!interactive; + // this.interactive = !!interactive; this.interactionManager = new PIXI.InteractionManager(this); this.setBackgroundColor(backgroundColor); this.worldVisible = true; - this.stage.dirty = true; } @@ -226,7 +232,7 @@ PIXI.Stage.prototype.getMousePosition = function() { return this.interactionManager.mouse.global; } - +/* PIXI.Stage.prototype.__addChild = function(child) { if(child.interactive)this.dirty = true; @@ -257,7 +263,7 @@ PIXI.Stage.prototype.__removeChild = function(child) this.__removeChild(child.children[i]); } } -} +}*/ diff --git a/docs/files/src_pixi_extras_CustomRenderable.js.html b/docs/files/src_pixi_extras_CustomRenderable.js.html index 80fde7f..83ef08c 100644 --- a/docs/files/src_pixi_extras_CustomRenderable.js.html +++ b/docs/files/src_pixi_extras_CustomRenderable.js.html @@ -53,12 +53,16 @@
  • CanvasRenderer
  • +
  • Circle
  • +
  • CustomRenderable
  • DisplayObject
  • DisplayObjectContainer
  • +
  • Ellipse
  • +
  • Graphics
  • ImageLoader
  • diff --git a/docs/files/src_pixi_extras_Rope.js.html b/docs/files/src_pixi_extras_Rope.js.html index 93ed7e4..37a22e4 100644 --- a/docs/files/src_pixi_extras_Rope.js.html +++ b/docs/files/src_pixi_extras_Rope.js.html @@ -53,12 +53,16 @@
  • CanvasRenderer
  • +
  • Circle
  • +
  • CustomRenderable
  • DisplayObject
  • DisplayObjectContainer
  • +
  • Ellipse
  • +
  • Graphics
  • ImageLoader
  • diff --git a/docs/files/src_pixi_extras_Spine.js.html b/docs/files/src_pixi_extras_Spine.js.html index 1838245..ba18005 100644 --- a/docs/files/src_pixi_extras_Spine.js.html +++ b/docs/files/src_pixi_extras_Spine.js.html @@ -53,12 +53,16 @@
  • CanvasRenderer
  • +
  • Circle
  • +
  • CustomRenderable
  • DisplayObject
  • DisplayObjectContainer
  • +
  • Ellipse
  • +
  • Graphics
  • ImageLoader
  • diff --git a/docs/files/src_pixi_extras_Strip.js.html b/docs/files/src_pixi_extras_Strip.js.html index 8ae02b0..1d6a08d 100644 --- a/docs/files/src_pixi_extras_Strip.js.html +++ b/docs/files/src_pixi_extras_Strip.js.html @@ -53,12 +53,16 @@
  • CanvasRenderer
  • +
  • Circle
  • +
  • CustomRenderable
  • DisplayObject
  • DisplayObjectContainer
  • +
  • Ellipse
  • +
  • Graphics
  • ImageLoader
  • diff --git a/docs/files/src_pixi_extras_TilingSprite.js.html b/docs/files/src_pixi_extras_TilingSprite.js.html index 9eca0d8..e840d1d 100644 --- a/docs/files/src_pixi_extras_TilingSprite.js.html +++ b/docs/files/src_pixi_extras_TilingSprite.js.html @@ -53,12 +53,16 @@
  • CanvasRenderer
  • +
  • Circle
  • +
  • CustomRenderable
  • DisplayObject
  • DisplayObjectContainer
  • +
  • Ellipse
  • +
  • Graphics
  • ImageLoader
  • @@ -163,7 +167,6 @@ PIXI.TilingSprite = function(texture, width, height) this.width = width; this.height = height; this.renderable = true; - /** * The scaling of the image that is being tiled * @property tileScale diff --git a/docs/files/src_pixi_filters_FilterBlock.js.html b/docs/files/src_pixi_filters_FilterBlock.js.html new file mode 100644 index 0000000..080a44f --- /dev/null +++ b/docs/files/src_pixi_filters_FilterBlock.js.html @@ -0,0 +1,181 @@ + + + + + src/pixi/filters/FilterBlock.js - Pixi.JS + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.3.0 +
    +
    +
    + + +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: src/pixi/filters/FilterBlock.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/ @Doormat23
    + */
    +
    +
    +
    +PIXI.FilterBlock = function(mask)
    +{
    +	this.graphics = mask
    +	this.visible = true;
    +	this.renderable = true;
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/src_pixi_filters_MaskFilter.js.html b/docs/files/src_pixi_filters_MaskFilter.js.html new file mode 100644 index 0000000..0df8008 --- /dev/null +++ b/docs/files/src_pixi_filters_MaskFilter.js.html @@ -0,0 +1,180 @@ + + + + + src/pixi/filters/MaskFilter.js - Pixi.JS + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.3.0 +
    +
    +
    + + +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: src/pixi/filters/MaskFilter.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/ @Doormat23
    + */
    +
    +
    +
    +PIXI.MaskFilter = function(graphics)
    +{
    +	// the graphics data that will be used for filtering
    +	this.graphics;
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/src_pixi_loaders_AssetLoader.js.html b/docs/files/src_pixi_loaders_AssetLoader.js.html index 1932a5c..a752143 100644 --- a/docs/files/src_pixi_loaders_AssetLoader.js.html +++ b/docs/files/src_pixi_loaders_AssetLoader.js.html @@ -53,12 +53,16 @@
  • CanvasRenderer
  • +
  • Circle
  • +
  • CustomRenderable
  • DisplayObject
  • DisplayObjectContainer
  • +
  • Ellipse
  • +
  • Graphics
  • ImageLoader
  • diff --git a/docs/files/src_pixi_loaders_BitmapFontLoader.js.html b/docs/files/src_pixi_loaders_BitmapFontLoader.js.html index 3e847d3..0bc6eef 100644 --- a/docs/files/src_pixi_loaders_BitmapFontLoader.js.html +++ b/docs/files/src_pixi_loaders_BitmapFontLoader.js.html @@ -53,12 +53,16 @@
  • CanvasRenderer
  • +
  • Circle
  • +
  • CustomRenderable
  • DisplayObject
  • DisplayObjectContainer
  • +
  • Ellipse
  • +
  • Graphics
  • ImageLoader
  • diff --git a/docs/files/src_pixi_loaders_ImageLoader.js.html b/docs/files/src_pixi_loaders_ImageLoader.js.html index 34cc4da..5a0c7d4 100644 --- a/docs/files/src_pixi_loaders_ImageLoader.js.html +++ b/docs/files/src_pixi_loaders_ImageLoader.js.html @@ -53,12 +53,16 @@
  • CanvasRenderer
  • +
  • Circle
  • +
  • CustomRenderable
  • DisplayObject
  • DisplayObjectContainer
  • +
  • Ellipse
  • +
  • Graphics
  • ImageLoader
  • diff --git a/docs/files/src_pixi_loaders_JsonLoader.js.html b/docs/files/src_pixi_loaders_JsonLoader.js.html index 872d9ee..8e91182 100644 --- a/docs/files/src_pixi_loaders_JsonLoader.js.html +++ b/docs/files/src_pixi_loaders_JsonLoader.js.html @@ -53,12 +53,16 @@
  • CanvasRenderer
  • +
  • Circle
  • +
  • CustomRenderable
  • DisplayObject
  • DisplayObjectContainer
  • +
  • Ellipse
  • +
  • Graphics
  • ImageLoader
  • diff --git a/docs/files/src_pixi_loaders_SpineLoader.js.html b/docs/files/src_pixi_loaders_SpineLoader.js.html index a169fcd..a5d91bf 100644 --- a/docs/files/src_pixi_loaders_SpineLoader.js.html +++ b/docs/files/src_pixi_loaders_SpineLoader.js.html @@ -53,12 +53,16 @@
  • CanvasRenderer
  • +
  • Circle
  • +
  • CustomRenderable
  • DisplayObject
  • DisplayObjectContainer
  • +
  • Ellipse
  • +
  • Graphics
  • ImageLoader
  • diff --git a/docs/files/src_pixi_loaders_SpriteSheetLoader.js.html b/docs/files/src_pixi_loaders_SpriteSheetLoader.js.html index 6d85d59..7f4f05f 100644 --- a/docs/files/src_pixi_loaders_SpriteSheetLoader.js.html +++ b/docs/files/src_pixi_loaders_SpriteSheetLoader.js.html @@ -53,12 +53,16 @@
  • CanvasRenderer
  • +
  • Circle
  • +
  • CustomRenderable
  • DisplayObject
  • DisplayObjectContainer
  • +
  • Ellipse
  • +
  • Graphics
  • ImageLoader
  • diff --git a/docs/files/src_pixi_primitives_Graphics.js.html b/docs/files/src_pixi_primitives_Graphics.js.html index 5435767..56e8996 100644 --- a/docs/files/src_pixi_primitives_Graphics.js.html +++ b/docs/files/src_pixi_primitives_Graphics.js.html @@ -53,12 +53,16 @@
  • CanvasRenderer
  • +
  • Circle
  • +
  • CustomRenderable
  • DisplayObject
  • DisplayObjectContainer
  • +
  • Ellipse
  • +
  • Graphics
  • ImageLoader
  • @@ -163,8 +167,8 @@ PIXI.Graphics = function() this.fillAlpha = 1; - this.lineWidth = 2; - this.lineColor = "#FF0000"; + this.lineWidth = 0; + this.lineColor = "black"; this.graphicsData = []; diff --git a/docs/files/src_pixi_renderers_canvas_CanvasGraphics.js.html b/docs/files/src_pixi_renderers_canvas_CanvasGraphics.js.html index 8d66dff..d09a4be 100644 --- a/docs/files/src_pixi_renderers_canvas_CanvasGraphics.js.html +++ b/docs/files/src_pixi_renderers_canvas_CanvasGraphics.js.html @@ -53,12 +53,16 @@
  • CanvasRenderer
  • +
  • Circle
  • +
  • CustomRenderable
  • DisplayObject
  • DisplayObjectContainer
  • +
  • Ellipse
  • +
  • Graphics
  • ImageLoader
  • @@ -179,7 +183,6 @@ PIXI.CanvasGraphics.renderGraphics = function(graphics, context) if(data.type == PIXI.Graphics.POLY) { - //if(data.lineWidth <= 0)continue; context.beginPath(); @@ -211,12 +214,13 @@ PIXI.CanvasGraphics.renderGraphics = function(graphics, context) } else if(data.type == PIXI.Graphics.RECT) { + // TODO - need to be Undefined! if(data.fillColor) { context.globalAlpha = data.fillAlpha * worldAlpha; context.fillStyle = color = '#' + ('00000' + ( data.fillColor | 0).toString(16)).substr(-6); - context.fillRect(points[0], points[1], points[2], points[3]); + context.rect(points[0], points[1], points[2], points[3]); } if(data.lineWidth) @@ -224,6 +228,7 @@ PIXI.CanvasGraphics.renderGraphics = function(graphics, context) context.globalAlpha = data.lineAlpha * worldAlpha; context.strokeRect(points[0], points[1], points[2], points[3]); } + } else if(data.type == PIXI.Graphics.CIRC) { @@ -288,6 +293,94 @@ PIXI.CanvasGraphics.renderGraphics = function(graphics, context) } } + }; +} + +/* + * @private + * @static + * @method renderGraphicsMask + * @param graphics {Graphics} + * @param context {Context2D} + */ +PIXI.CanvasGraphics.renderGraphicsMask = function(graphics, context) +{ + var worldAlpha = graphics.worldAlpha; + + var len = graphics.graphicsData.length; + if(len > 1) + { + len = 1; + console.log("Pixi.js warning: masks in canvas can only mask using the first path in the graphics object") + } + + for (var i=0; i < 1; i++) + { + var data = graphics.graphicsData[i]; + var points = data.points; + + if(data.type == PIXI.Graphics.POLY) + { + //if(data.lineWidth <= 0)continue; + + context.beginPath(); + context.moveTo(points[0], points[1]); + + for (var j=1; j < points.length/2; j++) + { + context.lineTo(points[j * 2], points[j * 2 + 1]); + } + + // if the first and last point are the same close the path - much neater :) + if(points[0] == points[points.length-2] && points[1] == points[points.length-1]) + { + context.closePath(); + } + + } + else if(data.type == PIXI.Graphics.RECT) + { + context.beginPath(); + context.rect(points[0], points[1], points[2], points[3]); + context.closePath(); + } + else if(data.type == PIXI.Graphics.CIRC) + { + // TODO - need to be Undefined! + context.beginPath(); + context.arc(points[0], points[1], points[2],0,2*Math.PI); + context.closePath(); + } + else if(data.type == PIXI.Graphics.ELIP) + { + + // elipse code taken from: http://stackoverflow.com/questions/2172798/how-to-draw-an-oval-in-html5-canvas + var elipseData = data.points; + + var w = elipseData[2] * 2; + var h = elipseData[3] * 2; + + var x = elipseData[0] - w/2; + var y = elipseData[1] - h/2; + + context.beginPath(); + + var kappa = .5522848, + ox = (w / 2) * kappa, // control point offset horizontal + oy = (h / 2) * kappa, // control point offset vertical + xe = x + w, // x-end + ye = y + h, // y-end + xm = x + w / 2, // x-middle + ym = y + h / 2; // y-middle + + context.moveTo(x, ym); + context.bezierCurveTo(x, ym - oy, xm - ox, y, xm, y); + context.bezierCurveTo(xm + ox, y, xe, ym - oy, xe, ym); + context.bezierCurveTo(xe, ym + oy, xm + ox, ye, xm, ye); + context.bezierCurveTo(xm - ox, ye, x, ym + oy, x, ym); + context.closePath(); + } + }; } diff --git a/docs/files/src_pixi_renderers_canvas_CanvasRenderer.js.html b/docs/files/src_pixi_renderers_canvas_CanvasRenderer.js.html index ffb101b..b4a1e3c 100644 --- a/docs/files/src_pixi_renderers_canvas_CanvasRenderer.js.html +++ b/docs/files/src_pixi_renderers_canvas_CanvasRenderer.js.html @@ -53,12 +53,16 @@
  • CanvasRenderer
  • +
  • Circle
  • +
  • CustomRenderable
  • DisplayObject
  • DisplayObjectContainer
  • +
  • Ellipse
  • +
  • Graphics
  • ImageLoader
  • @@ -271,47 +275,43 @@ PIXI.CanvasRenderer.prototype.resize = function(width, height) PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject) { - var transform = displayObject.worldTransform; + // no loger recurrsive! + var transform; var context = this.context; - //context.globalCompositeOperation = "source-over" - var blit = false; - if(!displayObject.visible)return; - - if(displayObject instanceof PIXI.Sprite) + context.globalCompositeOperation = 'source-over'; + + // one the display object hits this. we can break the loop + var testObject = displayObject.last._iNext; + displayObject = displayObject.first; + + do { - var frame = displayObject.texture.frame; + transform = displayObject.worldTransform; - if(frame) + if(!displayObject.visible) { - context.globalAlpha = displayObject.worldAlpha; + displayObject = displayObject.last._iNext; + continue; + } + + if(!displayObject.renderable) + { + displayObject = displayObject._iNext; + continue; + } + + if(displayObject instanceof PIXI.Sprite) + { + + var frame = displayObject.texture.frame; - // BLITZ!!! - /* - * if the rotation is 0 then we can blitz it - * meaning we dont need to do a transform and also we - * can round to the nearest round number for a little extra speed! - */ - /*if(displayObject.rotation == 0) + if(frame) { - 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])); + context.globalAlpha = displayObject.worldAlpha; - } - else - {*/ - // blit = false; context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5]); - + context.drawImage(displayObject.texture.baseTexture.source, frame.x, frame.y, @@ -319,46 +319,67 @@ PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject) frame.height, (displayObject.anchor.x) * -frame.width, (displayObject.anchor.y) * -frame.height, - // (displayObject.anchor.x - displayObject.texture.trim.x) * -frame.width, - // (displayObject.anchor.y - displayObject.texture.trim.y) * -frame.height, - frame.width, frame.height); - //} - } - } - else if(displayObject instanceof PIXI.Strip) - { - context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5]) - this.renderStrip(displayObject); - } - else if(displayObject instanceof PIXI.TilingSprite) - { - context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5]) - this.renderTilingSprite(displayObject); - } - else if(displayObject instanceof PIXI.CustomRenderable) - { - displayObject.renderCanvas(this); - } - else if(displayObject instanceof PIXI.Graphics) - { - context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5]) - PIXI.CanvasGraphics.renderGraphics(displayObject, context); - } - - // render! - if(displayObject.children) - { - for (var i=0; i < displayObject.children.length; i++) + } + } + else if(displayObject instanceof PIXI.Strip) { - this.renderDisplayObject(displayObject.children[i]); + context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5]) + this.renderStrip(displayObject); } + else if(displayObject instanceof PIXI.TilingSprite) + { + context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5]) + this.renderTilingSprite(displayObject); + } + else if(displayObject instanceof PIXI.CustomRenderable) + { + displayObject.renderCanvas(this); + } + else if(displayObject instanceof PIXI.Graphics) + { + context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5]) + PIXI.CanvasGraphics.renderGraphics(displayObject, context); + } + else if(displayObject instanceof PIXI.FilterBlock) + { + if(displayObject.open) + { + context.save(); + + var cacheAlpha = displayObject.mask.alpha; + var maskTransform = displayObject.mask.worldTransform; + + context.setTransform(maskTransform[0], maskTransform[3], maskTransform[1], maskTransform[4], maskTransform[2], maskTransform[5]) + + displayObject.mask.worldAlpha = 0.5; + + context.worldAlpha = 0; + + PIXI.CanvasGraphics.renderGraphicsMask(displayObject.mask, context); + // context.fillStyle = 0xFF0000; + // context.fillRect(0, 0, 200, 200); + context.clip(); + + displayObject.mask.worldAlpha = cacheAlpha; + //context.globalCompositeOperation = 'lighter'; + } + else + { + //context.globalCompositeOperation = 'source-over'; + context.restore(); + } + } + // count++ + displayObject = displayObject._iNext; + + } - - this.context.setTransform(1,0,0,1,0,0); + while(displayObject != testObject) } + /** * @private */ @@ -387,11 +408,9 @@ PIXI.CanvasRenderer.prototype.renderStripFlat = function(strip) }; -// context.globalCompositeOperation = 'lighter'; context.fillStyle = "#FF0000"; context.fill(); context.closePath(); - //context.globalCompositeOperation = 'source-over'; } /** diff --git a/docs/files/src_pixi_renderers_webgl_WebGLBatch.js.html b/docs/files/src_pixi_renderers_webgl_WebGLBatch.js.html index a696b10..3d14d09 100644 --- a/docs/files/src_pixi_renderers_webgl_WebGLBatch.js.html +++ b/docs/files/src_pixi_renderers_webgl_WebGLBatch.js.html @@ -53,12 +53,16 @@
  • CanvasRenderer
  • +
  • Circle
  • +
  • CustomRenderable
  • DisplayObject
  • DisplayObjectContainer
  • +
  • Ellipse
  • +
  • Graphics
  • ImageLoader
  • @@ -680,7 +684,6 @@ PIXI.WebGLBatch.prototype.render = function(start, end) var gl = this.gl; //TODO optimize this! - gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA); var shaderProgram = PIXI.shaderProgram; gl.useProgram(shaderProgram); @@ -723,7 +726,7 @@ PIXI.WebGLBatch.prototype.render = function(start, end) var len = end - start; // console.log(this.size) // DRAW THAT this! -// gl.drawElements(gl.TRIANGLES, len * 6, gl.UNSIGNED_SHORT, start * 2 * 6 ); + gl.drawElements(gl.TRIANGLES, len * 6, gl.UNSIGNED_SHORT, start * 2 * 6 ); } diff --git a/docs/files/src_pixi_renderers_webgl_WebGLGraphics.js.html b/docs/files/src_pixi_renderers_webgl_WebGLGraphics.js.html index e7e7777..0240783 100644 --- a/docs/files/src_pixi_renderers_webgl_WebGLGraphics.js.html +++ b/docs/files/src_pixi_renderers_webgl_WebGLGraphics.js.html @@ -53,12 +53,16 @@
  • CanvasRenderer
  • +
  • Circle
  • +
  • CustomRenderable
  • DisplayObject
  • DisplayObjectContainer
  • +
  • Ellipse
  • +
  • Graphics
  • ImageLoader
  • @@ -210,13 +214,9 @@ PIXI.WebGLGraphics.renderGraphics = function(graphics, projection) gl.vertexAttribPointer(PIXI.primitiveProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 4 * 6, 0); gl.vertexAttribPointer(PIXI.primitiveProgram.colorAttribute, 4, gl.FLOAT, false,4 * 6, 2 * 4); -// console.log(PIXI.primitiveProgram.vertexPositionAttribute); - //console.log("Color " + PIXI.primitiveProgram.colorAttribute); - // set the index buffer! gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, graphics._webGL.indexBuffer); - gl.drawElements(gl.TRIANGLE_STRIP, graphics._webGL.indices.length, gl.UNSIGNED_SHORT, 0 ); // return to default shader... diff --git a/docs/files/src_pixi_renderers_webgl_WebGLRenderGroup.js.html b/docs/files/src_pixi_renderers_webgl_WebGLRenderGroup.js.html index ca9c1d5..d73c577 100644 --- a/docs/files/src_pixi_renderers_webgl_WebGLRenderGroup.js.html +++ b/docs/files/src_pixi_renderers_webgl_WebGLRenderGroup.js.html @@ -53,12 +53,16 @@
  • CanvasRenderer
  • +
  • Circle
  • +
  • CustomRenderable
  • DisplayObject
  • DisplayObjectContainer
  • +
  • Ellipse
  • +
  • Graphics
  • ImageLoader
  • @@ -166,7 +170,6 @@ PIXI.WebGLRenderGroup = function(gl) this.toRemove = []; } - // constructor PIXI.WebGLRenderGroup.constructor = PIXI.WebGLRenderGroup; @@ -182,9 +185,7 @@ PIXI.WebGLRenderGroup.prototype.setRenderable = function(displayObject) // TODO what if its already has an object? should remove it this.root = displayObject; - //displayObject.__renderGroup = this; this.addDisplayObjectAndChildren(displayObject); - //displayObject } PIXI.WebGLRenderGroup.prototype.render = function(projection) @@ -193,11 +194,9 @@ PIXI.WebGLRenderGroup.prototype.render = function(projection) var gl = this.gl; - // set the flipped matrix.. -// gl.uniformMatrix4fv(PIXI.shaderProgram.mvMatrixUniform, false, PIXI.projectionMatrix); - gl.uniform2f(PIXI.shaderProgram.projectionVector, projection.x, projection.y); - + gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA); + // TODO remove this by replacing visible with getter setters.. this.checkVisibility(this.root, this.root.visible); @@ -222,12 +221,41 @@ PIXI.WebGLRenderGroup.prototype.render = function(projection) } else if(renderable instanceof PIXI.Graphics) { - if(renderable.visible) PIXI.WebGLGraphics.renderGraphics(renderable, projection);//, projectionMatrix); + if(renderable.visible && renderable.renderable) PIXI.WebGLGraphics.renderGraphics(renderable, projection);//, projectionMatrix); + } + else if(renderable instanceof PIXI.FilterBlock) + { + /* + * for now only masks are supported.. + */ + if(renderable.open) + { + gl.enable(gl.STENCIL_TEST); + + gl.colorMask(false, false, false, false); + gl.stencilFunc(gl.ALWAYS,1,0xff); + gl.stencilOp(gl.KEEP,gl.KEEP,gl.REPLACE); + + PIXI.WebGLGraphics.renderGraphics(renderable.mask, projection); + + gl.colorMask(true, true, true, false); + gl.stencilFunc(gl.NOTEQUAL,0,0xff); + gl.stencilOp(gl.KEEP,gl.KEEP,gl.KEEP); + } + else + { + gl.disable(gl.STENCIL_TEST); + } } } } +PIXI.WebGLRenderGroup.prototype.handleFilter = function(filter, projection) +{ + +} + PIXI.WebGLRenderGroup.prototype.renderSpecific = function(displayObject, projection) { PIXI.WebGLRenderer.updateTextures(); @@ -238,8 +266,6 @@ PIXI.WebGLRenderGroup.prototype.renderSpecific = function(displayObject, project // gl.uniformMatrix4fv(PIXI.shaderProgram.mvMatrixUniform, false, projectionMatrix); gl.uniform2f(PIXI.shaderProgram.projectionVector, projection.x, projection.y); - - //console.log("SPECIFIC"); // to do! // render part of the scene... @@ -249,8 +275,18 @@ PIXI.WebGLRenderGroup.prototype.renderSpecific = function(displayObject, project var endIndex; var endBatchIndex; - // get NEXT Renderable! - var nextRenderable = displayObject.renderable ? displayObject : this.getNextRenderable(displayObject); + /* + * 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 + */ + var nextRenderable = displayObject.last; + while(nextRenderable._iNext) + { + nextRenderable = nextRenderable._iNext; + if(nextRenderable.renderable && nextRenderable.__renderGroup)break; + } var startBatch = nextRenderable.batch; if(nextRenderable instanceof PIXI.Sprite) @@ -388,20 +424,44 @@ PIXI.WebGLRenderGroup.prototype.renderSpecial = function(renderable) } else if(renderable instanceof PIXI.Graphics) { - if(renderable.visible) PIXI.WebGLGraphics.renderGraphics(renderable);//, projectionMatrix); + if(renderable.visible && renderable.renderable) PIXI.WebGLGraphics.renderGraphics(renderable);//, projectionMatrix); + } + else if(renderable instanceof PIXI.FilterBlock) + { + /* + * for now only masks are supported.. + */ + if(renderable.open) + { + gl.enable(gl.STENCIL_TEST); + + gl.colorMask(false, false, false, false); + gl.stencilFunc(gl.ALWAYS,1,0xff); + gl.stencilOp(gl.KEEP,gl.KEEP,gl.REPLACE); + + PIXI.WebGLGraphics.renderGraphics(renderable.mask, projection); + + gl.colorMask(true, true, true, false); + gl.stencilFunc(gl.NOTEQUAL,0,0xff); + gl.stencilOp(gl.KEEP,gl.KEEP,gl.KEEP); + } + else + { + gl.disable(gl.STENCIL_TEST); + } } } PIXI.WebGLRenderGroup.prototype.checkVisibility = function(displayObject, globalVisible) { - // give the dp a refference to its renderGroup... + // give the dp a reference to its renderGroup... var children = displayObject.children; //displayObject.worldVisible = globalVisible; for (var i=0; i < children.length; i++) { var child = children[i]; - // TODO optimize... shouldt need to loop through everything all the time + // TODO optimize... should'nt need to loop through everything all the time child.worldVisible = child.visible && globalVisible; // everything should have a batch! @@ -409,12 +469,7 @@ PIXI.WebGLRenderGroup.prototype.checkVisibility = function(displayObject, global if(child.textureChange) { child.textureChange = false; - if(child.worldVisible) - { - this.removeDisplayObject(child); - this.addDisplayObject(child); - //this.updateTexture(child); - } + if(child.worldVisible)this.updateTexture(child); // update texture!! } @@ -427,123 +482,150 @@ PIXI.WebGLRenderGroup.prototype.checkVisibility = function(displayObject, global PIXI.WebGLRenderGroup.prototype.updateTexture = function(displayObject) { - // we know this exists.. - // is it in a batch.. - // check batch length - if(displayObject.batch.length == 1) + + // TODO definitely can optimse this function.. + + this.removeObject(displayObject); + + /* + * LOOK FOR THE PREVIOUS RENDERABLE + * This part looks for the closest previous sprite that can go into a batch + * It keeps going back until it finds a sprite or the stage + */ + var previousRenderable = displayObject.first; + while(previousRenderable != this.root) { - // just one! this guy! so simply swap the texture - displayObject.batch.texture = displayObject.texture.baseTexture; - return; + previousRenderable = previousRenderable._iPrev; + if(previousRenderable.renderable && previousRenderable.__renderGroup)break; } - // early out! - if(displayObject.batch.texture == displayObject.texture.baseTexture)return; + /* + * 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 + */ + var nextRenderable = displayObject.last; + while(nextRenderable._iNext) + { + nextRenderable = nextRenderable._iNext; + if(nextRenderable.renderable && nextRenderable.__renderGroup)break; + } - - if(displayObject.batch.head == displayObject) - { - //console.log("HEAD") - var currentBatch = displayObject.batch; - - var index = this.batchs.indexOf( currentBatch ); - var previousBatch = this.batchs[index-1]; - currentBatch.remove(displayObject); - - if(previousBatch) - { - if(previousBatch.texture == displayObject.texture.baseTexture && previousBatch.blendMode == displayObject.blendMode) - { - previousBatch.insertAfter(displayObject, previousBatch.tail); - } - else - { - // add it before.. - var batch = PIXI.WebGLRenderer.getBatch(); - batch.init(displayObject); - this.batchs.splice(index-1, 0, batch); - } - - } - else - { - // we are 0! - var batch = PIXI.WebGLRenderer.getBatch(); - batch.init(displayObject); - this.batchs.splice(0, 0, batch); - } - - } - else if(displayObject.batch.tail == displayObject) - { - var currentBatch = displayObject.batch; - - var index = this.batchs.indexOf( currentBatch ); - var nextBatch = this.batchs[index+1]; - currentBatch.remove(displayObject); - - if(nextBatch) - { - if(nextBatch.texture == displayObject.texture.baseTexture && nextBatch.blendMode == displayObject.blendMode) - { - nextBatch.insertBefore(displayObject, nextBatch.head); - return; - } - else - { - // add it before.. - var batch = PIXI.WebGLRenderer.getBatch(); - batch.init(displayObject); - this.batchs.splice(index+1, 0, batch); - } - - } - else - { - // we are 0! - var batch = PIXI.WebGLRenderer.getBatch(); - batch.init(displayObject); - this.batchs.push(batch); - } - } - else - { - // console.log("MIDDLE") - var currentBatch = displayObject.batch; - - // split the batch into 2 - // AH! dont split on the current display object as the texture is wrong! - var splitBatch = currentBatch.split(displayObject); - - // now remove the display object - splitBatch.remove(displayObject); - - var batch = PIXI.WebGLRenderer.getBatch(); - var index = this.batchs.indexOf( currentBatch ); - batch.init(displayObject); - this.batchs.splice(index+1, 0, batch, splitBatch); - } + this.insertObject(displayObject, previousRenderable, nextRenderable); } -PIXI.WebGLRenderGroup.prototype.addDisplayObject = function(displayObject) +PIXI.WebGLRenderGroup.prototype.addFilterBlocks = function(start, end) +{ + start.__renderGroup = this; + end.__renderGroup = this; + /* + * LOOK FOR THE PREVIOUS RENDERABLE + * This part looks for the closest previous sprite that can go into a batch + * It keeps going back until it finds a sprite or the stage + */ + var previousRenderable = start; + while(previousRenderable != this.root) + { + previousRenderable = previousRenderable._iPrev; + if(previousRenderable.renderable && previousRenderable.__renderGroup)break; + } + this.insertAfter(start, previousRenderable); + + /* + * 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 + */ + var previousRenderable2 = end; + while(previousRenderable2 != this.root) + { + previousRenderable2 = previousRenderable2._iPrev; + if(previousRenderable2.renderable && previousRenderable2.__renderGroup)break; + } + this.insertAfter(end, previousRenderable2); +} + +PIXI.WebGLRenderGroup.prototype.removeFilterBlocks = function(start, end) +{ + this.removeObject(start); + this.removeObject(end); +} + +PIXI.WebGLRenderGroup.prototype.addDisplayObjectAndChildren = function(displayObject) { - // add a child to the render group.. if(displayObject.__renderGroup)displayObject.__renderGroup.removeDisplayObjectAndChildren(displayObject); - - // DONT htink this is needed? - // displayObject.batch = null; - displayObject.__renderGroup = this; + /* + * LOOK FOR THE PREVIOUS RENDERABLE + * This part looks for the closest previous sprite that can go into a batch + * It keeps going back until it finds a sprite or the stage + */ + + var previousRenderable = displayObject.first; + while(previousRenderable != this.root) + { + previousRenderable = previousRenderable._iPrev; + if(previousRenderable.renderable && previousRenderable.__renderGroup)break; + } + + /* + * 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 + */ + var nextRenderable = displayObject.last; + while(nextRenderable._iNext) + { + nextRenderable = nextRenderable._iNext; + if(nextRenderable.renderable && nextRenderable.__renderGroup)break; + } + + // one the display object hits this. we can break the loop + + var tempObject = displayObject.first; + var testObject = displayObject.last._iNext; + do + { + tempObject.__renderGroup = this; + + if(tempObject.renderable) + { + + this.insertObject(tempObject, previousRenderable, nextRenderable); + previousRenderable = tempObject; + } + + tempObject = tempObject._iNext; + } + while(tempObject != testObject) +} - //displayObject.cacheVisible = true; - if(!displayObject.renderable)return; +PIXI.WebGLRenderGroup.prototype.removeDisplayObjectAndChildren = function(displayObject) +{ + if(displayObject.__renderGroup != this)return; + +// var displayObject = displayObject.first; + var lastObject = displayObject.last; + do + { + displayObject.__renderGroup = null; + if(displayObject.renderable)this.removeObject(displayObject); + displayObject = displayObject._iNext; + } + while(displayObject) +} + + +PIXI.WebGLRenderGroup.prototype.insertObject = function(displayObject, previousObject, nextObject) +{ // while looping below THE OBJECT MAY NOT HAVE BEEN ADDED - //displayObject.__inWebGL = true; + var previousSprite = previousObject; + var nextSprite = nextObject; - var previousSprite = this.getPreviousRenderable(displayObject); - var nextSprite = this.getNextRenderable(displayObject); - /* * so now we have the next renderable and the previous renderable * @@ -612,6 +694,7 @@ PIXI.WebGLRenderGroup.prototype.addDisplayObject = function(displayObject) else { // TODO re-word! + nextBatch = nextSprite; } } @@ -634,49 +717,88 @@ PIXI.WebGLRenderGroup.prototype.addDisplayObject = function(displayObject) { this.batchs.push(batch); } - + + return; } else if(displayObject instanceof PIXI.TilingSprite) { // add to a batch!! this.initTilingSprite(displayObject); - this.batchs.push(displayObject); + // this.batchs.push(displayObject); } else if(displayObject instanceof PIXI.Strip) { // add to a batch!! this.initStrip(displayObject); - this.batchs.push(displayObject); + // this.batchs.push(displayObject); } - else if(displayObject instanceof PIXI.Graphics) + else if(displayObject)// instanceof PIXI.Graphics) { //displayObject.initWebGL(this); // add to a batch!! //this.initStrip(displayObject); - this.batchs.push(displayObject); + //this.batchs.push(displayObject); } - // if its somthing else... then custom codes! - this.batchUpdate = true; + this.insertAfter(displayObject, previousSprite); + + // insert and SPLIT! + } -PIXI.WebGLRenderGroup.prototype.addDisplayObjectAndChildren = function(displayObject) + + +PIXI.WebGLRenderGroup.prototype.insertAfter = function(item, displayObject) { - // TODO - this can be faster - but not as important right now - - this.addDisplayObject(displayObject); - var children = displayObject.children; - - for (var i=0; i < children.length; i++) + if(displayObject instanceof PIXI.Sprite) { - this.addDisplayObjectAndChildren(children[i]); - }; + var previousBatch = displayObject.batch; + + if(previousBatch) + { + // so this object is in a batch! + + // is it not? need to split the batch + if(previousBatch.tail == displayObject) + { + // is it tail? insert in to batchs + var index = this.batchs.indexOf( previousBatch ); + this.batchs.splice(index+1, 0, item); + } + else + { + // TODO MODIFY ADD / REMOVE CHILD TO ACCOUNT FOR FILTERS (also get prev and next) // + + // THERE IS A SPLIT IN THIS BATCH! // + var splitBatch = previousBatch.split(displayObject.__next); + + // COOL! + // add it back into the array + /* + * OOPS! + * seems the new sprite is in the middle of a batch + * lets split it.. + */ + var index = this.batchs.indexOf( previousBatch ); + this.batchs.splice(index+1, 0, item, splitBatch); + } + } + else + { + this.batchs.push(item); + } + } + else + { + var index = this.batchs.indexOf( displayObject ); + this.batchs.splice(index+1, 0, item); + } } -PIXI.WebGLRenderGroup.prototype.removeDisplayObject = function(displayObject) +PIXI.WebGLRenderGroup.prototype.removeObject = function(displayObject) { // loop through children.. // display object // @@ -684,10 +806,7 @@ PIXI.WebGLRenderGroup.prototype.removeDisplayObject = function(displayObject) // add a child from the render group.. // remove it and all its children! //displayObject.cacheVisible = false;//displayObject.visible; - displayObject.__renderGroup = null; - - if(!displayObject.renderable)return; - + /* * removing is a lot quicker.. * @@ -745,111 +864,18 @@ PIXI.WebGLRenderGroup.prototype.removeDisplayObject = function(displayObject) } } - this.batchs.splice(index, 1); if(batchToRemove instanceof PIXI.WebGLBatch)PIXI.WebGLRenderer.returnBatch(batchToRemove); } } -PIXI.WebGLRenderGroup.prototype.removeDisplayObjectAndChildren = function(displayObject) -{ - // TODO - this can be faster - but not as important right now - if(displayObject.__renderGroup != this)return; - - this.removeDisplayObject(displayObject); - var children = displayObject.children; - - for (var i=0; i < children.length; i++) - { - this.removeDisplayObjectAndChildren(children[i]); - }; -} /** * @private */ -PIXI.WebGLRenderGroup.prototype.getNextRenderable = function(displayObject) -{ - /* - * LOOK FOR THE NEXT SPRITE - * This part looks for the closest next sprite that can go into a batch - * it keeps looking until it finds a sprite or gets to the end of the display - * scene graph - * - * These look a lot scarier than the actually are... - */ - - var nextSprite = displayObject; - do - { - // moving forward! - // if it has no children.. - if(nextSprite.children.length == 0) - { - //maynot have a parent - if(!nextSprite.parent)return null; - - // go along to the parent.. - while(nextSprite.childIndex == nextSprite.parent.children.length-1) - { - nextSprite = nextSprite.parent; - //console.log(">" + nextSprite); -// console.log(">-" + this.root); - if(nextSprite == this.root || !nextSprite.parent)//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.__renderGroup) - - return nextSprite; -} -PIXI.WebGLRenderGroup.prototype.getPreviousRenderable = function(displayObject) -{ - /* - * LOOK FOR THE PREVIOUS SPRITE - * This part looks for the closest previous sprite that can go into a batch - * It keeps going back until it finds a sprite or the stage - */ - var previousSprite = displayObject; - do - { - if(previousSprite.childIndex == 0) - { - previousSprite = previousSprite.parent; - if(!previousSprite)return null; - } - else - { - - previousSprite = previousSprite.parent.children[previousSprite.childIndex-1]; - // what if the bloop has children??? - while(previousSprite.children.length != 0) - { - // keep diggin till we get to the last child - previousSprite = previousSprite.children[previousSprite.children.length-1]; - } - } - - if(previousSprite == this.root)break; - } - while(!previousSprite.renderable || !previousSprite.__renderGroup); - - return previousSprite; -} /** * @private @@ -930,7 +956,7 @@ PIXI.WebGLRenderGroup.prototype.renderStrip = function(strip, projection) gl.uniform2f(PIXI.stripShaderProgram.projectionVector, projection.x, projection.y); gl.uniform1f(PIXI.stripShaderProgram.alpha, strip.worldAlpha); - +/* if(strip.blendMode == PIXI.blendModes.NORMAL) { gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA); @@ -939,7 +965,7 @@ PIXI.WebGLRenderGroup.prototype.renderStrip = function(strip, projection) { gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_COLOR); } - + */ if(!strip.dirty) diff --git a/docs/files/src_pixi_renderers_webgl_WebGLRenderer.js.html b/docs/files/src_pixi_renderers_webgl_WebGLRenderer.js.html index e301d03..eb6aae6 100644 --- a/docs/files/src_pixi_renderers_webgl_WebGLRenderer.js.html +++ b/docs/files/src_pixi_renderers_webgl_WebGLRenderer.js.html @@ -53,12 +53,16 @@
  • CanvasRenderer
  • +
  • Circle
  • +
  • CustomRenderable
  • DisplayObject
  • DisplayObjectContainer
  • +
  • Ellipse
  • +
  • Graphics
  • ImageLoader
  • @@ -192,7 +196,8 @@ PIXI.WebGLRenderer = function(width, height, view, transparent) PIXI.gl = this.gl = this.view.getContext("experimental-webgl", { alpha: this.transparent, antialias:true, // SPEED UP?? - premultipliedAlpha:false + premultipliedAlpha:false, + stencil:true }); } catch (e) @@ -212,6 +217,10 @@ PIXI.WebGLRenderer = function(width, height, view, transparent) this.batch = new PIXI.WebGLBatch(gl); gl.disable(gl.DEPTH_TEST); gl.disable(gl.CULL_FACE); + + // + + gl.enable(gl.BLEND); gl.colorMask(true, true, true, this.transparent); diff --git a/docs/files/src_pixi_renderers_webgl_WebGLShaders.js.html b/docs/files/src_pixi_renderers_webgl_WebGLShaders.js.html index 17ce023..1dff6c3 100644 --- a/docs/files/src_pixi_renderers_webgl_WebGLShaders.js.html +++ b/docs/files/src_pixi_renderers_webgl_WebGLShaders.js.html @@ -53,12 +53,16 @@
  • CanvasRenderer
  • +
  • Circle
  • +
  • CustomRenderable
  • DisplayObject
  • DisplayObjectContainer
  • +
  • Ellipse
  • +
  • Graphics
  • ImageLoader
  • @@ -242,7 +246,6 @@ PIXI.primitiveShaderVertexSrc = [ PIXI.initPrimitiveShader = function() { - return; var gl = PIXI.gl; var shaderProgram = PIXI.compileProgram(PIXI.primitiveShaderVertexSrc, PIXI.primitiveShaderFragmentSrc) @@ -325,21 +328,6 @@ PIXI._CompileShader = function(gl, shaderSrc, shaderType) return shader; } -PIXI.activateDefaultShader = function() -{ - var gl = PIXI.gl; - var shaderProgram = PIXI.shaderProgram; - - gl.useProgram(shaderProgram); - - - gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute); - gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute); - gl.enableVertexAttribArray(shaderProgram.colorAttribute); - - - -} PIXI.compileProgram = function(vertexSrc, fragmentSrc) { @@ -360,6 +348,22 @@ PIXI.compileProgram = function(vertexSrc, fragmentSrc) return shaderProgram; } + +PIXI.activateDefaultShader = function() +{ + var gl = PIXI.gl; + var shaderProgram = PIXI.shaderProgram; + + gl.useProgram(shaderProgram); + + + gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute); + gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute); + gl.enableVertexAttribArray(shaderProgram.colorAttribute); +} + + + PIXI.activatePrimitiveShader = function() { var gl = PIXI.gl; diff --git a/docs/files/src_pixi_text_BitmapText.js.html b/docs/files/src_pixi_text_BitmapText.js.html index ca39b62..5e9bbc2 100644 --- a/docs/files/src_pixi_text_BitmapText.js.html +++ b/docs/files/src_pixi_text_BitmapText.js.html @@ -53,12 +53,16 @@
  • CanvasRenderer
  • +
  • Circle
  • +
  • CustomRenderable
  • DisplayObject
  • DisplayObjectContainer
  • +
  • Ellipse
  • +
  • Graphics
  • ImageLoader
  • diff --git a/docs/files/src_pixi_text_Text.js.html b/docs/files/src_pixi_text_Text.js.html index 5503bdf..0ad9379 100644 --- a/docs/files/src_pixi_text_Text.js.html +++ b/docs/files/src_pixi_text_Text.js.html @@ -53,12 +53,16 @@
  • CanvasRenderer
  • +
  • Circle
  • +
  • CustomRenderable
  • DisplayObject
  • DisplayObjectContainer
  • +
  • Ellipse
  • +
  • Graphics
  • ImageLoader
  • diff --git a/docs/files/src_pixi_textures_BaseTexture.js.html b/docs/files/src_pixi_textures_BaseTexture.js.html index ddc2fab..98f2ff6 100644 --- a/docs/files/src_pixi_textures_BaseTexture.js.html +++ b/docs/files/src_pixi_textures_BaseTexture.js.html @@ -53,12 +53,16 @@
  • CanvasRenderer
  • +
  • Circle
  • +
  • CustomRenderable
  • DisplayObject
  • DisplayObjectContainer
  • +
  • Ellipse
  • +
  • Graphics
  • ImageLoader
  • diff --git a/docs/files/src_pixi_textures_RenderTexture.js.html b/docs/files/src_pixi_textures_RenderTexture.js.html index 2fc0808..0c25c6d 100644 --- a/docs/files/src_pixi_textures_RenderTexture.js.html +++ b/docs/files/src_pixi_textures_RenderTexture.js.html @@ -53,12 +53,16 @@
  • CanvasRenderer
  • +
  • Circle
  • +
  • CustomRenderable
  • DisplayObject
  • DisplayObjectContainer
  • +
  • Ellipse
  • +
  • Graphics
  • ImageLoader
  • diff --git a/docs/files/src_pixi_textures_Texture.js.html b/docs/files/src_pixi_textures_Texture.js.html index 6e0c5d3..ac3027a 100644 --- a/docs/files/src_pixi_textures_Texture.js.html +++ b/docs/files/src_pixi_textures_Texture.js.html @@ -53,12 +53,16 @@
  • CanvasRenderer
  • +
  • Circle
  • +
  • CustomRenderable
  • DisplayObject
  • DisplayObjectContainer
  • +
  • Ellipse
  • +
  • Graphics
  • ImageLoader
  • diff --git a/docs/files/src_pixi_utils_Detector.js.html b/docs/files/src_pixi_utils_Detector.js.html index 4b5012d..7dbe0d9 100644 --- a/docs/files/src_pixi_utils_Detector.js.html +++ b/docs/files/src_pixi_utils_Detector.js.html @@ -53,12 +53,16 @@
  • CanvasRenderer
  • +
  • Circle
  • +
  • CustomRenderable
  • DisplayObject
  • DisplayObjectContainer
  • +
  • Ellipse
  • +
  • Graphics
  • ImageLoader
  • diff --git a/docs/files/src_pixi_utils_EventTarget.js.html b/docs/files/src_pixi_utils_EventTarget.js.html index 741581d..e49f174 100644 --- a/docs/files/src_pixi_utils_EventTarget.js.html +++ b/docs/files/src_pixi_utils_EventTarget.js.html @@ -53,12 +53,16 @@
  • CanvasRenderer
  • +
  • Circle
  • +
  • CustomRenderable
  • DisplayObject
  • DisplayObjectContainer
  • +
  • Ellipse
  • +
  • Graphics
  • ImageLoader
  • diff --git a/docs/files/src_pixi_utils_Utils.js.html b/docs/files/src_pixi_utils_Utils.js.html index 25781b3..0e7d63a 100644 --- a/docs/files/src_pixi_utils_Utils.js.html +++ b/docs/files/src_pixi_utils_Utils.js.html @@ -53,12 +53,16 @@
  • CanvasRenderer
  • +
  • Circle
  • +
  • CustomRenderable
  • DisplayObject
  • DisplayObjectContainer
  • +
  • Ellipse
  • +
  • Graphics
  • ImageLoader
  • @@ -231,7 +235,32 @@ var AjaxRequest = PIXI.AjaxRequest = function() } } - +/* + * DEBUGGING ONLY + */ +PIXI.runList = function(item) +{ + console.log(">>>>>>>>>") + console.log("_") + var safe = 0; + var tmp = item.first; + console.log(tmp); + + while(tmp._iNext) + { + safe++; +// console.log(tmp.childIndex + tmp); + tmp = tmp._iNext; + console.log(tmp);//.childIndex); + // console.log(tmp); + + if(safe > 100) + { + console.log("BREAK") + break + } + } +} diff --git a/docs/index.html b/docs/index.html index 2968f75..6de3004 100644 --- a/docs/index.html +++ b/docs/index.html @@ -53,12 +53,16 @@
  • CanvasRenderer
  • +
  • Circle
  • +
  • CustomRenderable
  • DisplayObject
  • DisplayObjectContainer
  • +
  • Ellipse
  • +
  • Graphics
  • ImageLoader
  • diff --git a/docs/modules/PIXI.html b/docs/modules/PIXI.html index c7419e1..52f88e4 100644 --- a/docs/modules/PIXI.html +++ b/docs/modules/PIXI.html @@ -53,12 +53,16 @@
  • CanvasRenderer
  • +
  • Circle
  • +
  • CustomRenderable
  • DisplayObject
  • DisplayObjectContainer
  • +
  • Ellipse
  • +
  • Graphics
  • ImageLoader
  • @@ -146,7 +150,7 @@ @@ -204,6 +208,12 @@ +
  • + + Circle + +
  • +
  • CustomRenderable @@ -222,6 +232,12 @@
  • +
  • + + Ellipse + +
  • +
  • Graphics diff --git a/examples/example 1 - Basics/pixi.js b/examples/example 1 - Basics/pixi.js index 7a077d4..bb7c6c0 100644 --- a/examples/example 1 - Basics/pixi.js +++ b/examples/example 1 - Basics/pixi.js @@ -4,7 +4,7 @@ * Copyright (c) 2012, Mat Groves * http://goodboydigital.com/ * - * Compiled: 2013-07-01 + * Compiled: 2013-07-02 * * Pixi.JS is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license.php @@ -180,7 +180,7 @@ PIXI.Polygon = function(points) * @method clone * @return a copy of the polygon */ -PIXI.Polygon.clone = function() +PIXI.Polygon.prototype.clone = function() { var points = []; for (var i=0; i Date: Tue, 2 Jul 2013 10:50:27 +0100 Subject: [PATCH 36/68] Removed Some debbuging code for masks --- bin/pixi.dev.js | 4 ---- bin/pixi.js | 2 +- docs/data.json | 4 ++-- docs/files/src_pixi_display_DisplayObject.js.html | 4 ---- examples/example 1 - Basics/pixi.js | 4 ---- examples/example 10 - Text/pixi.js | 4 ---- examples/example 11 - RenderTexture/pixi.js | 4 ---- examples/example 12 - Spine/pixi.js | 4 ---- examples/example 13 - Graphics/pixi.js | 4 ---- examples/example 14 - Masking/pixi.js | 4 ---- examples/example 2 - SpriteSheet/pixi.js | 4 ---- examples/example 3 - MovieClip/pixi.js | 4 ---- examples/example 4 - Balls/pixi.js | 4 ---- examples/example 5 - Morph/pixi.js | 4 ---- examples/example 6 - Interactivity/pixi.js | 4 ---- examples/example 7 - Transparent Background/pixi.js | 4 ---- examples/example 8 - Dragging/pixi.js | 4 ---- examples/example 9 - Tiling Texture/pixi.js | 4 ---- src/pixi/display/DisplayObject.js | 4 ---- 19 files changed, 3 insertions(+), 71 deletions(-) diff --git a/bin/pixi.dev.js b/bin/pixi.dev.js index bb7c6c0..b269e8e 100644 --- a/bin/pixi.dev.js +++ b/bin/pixi.dev.js @@ -907,10 +907,6 @@ PIXI.DisplayObject.prototype.addFilter = function(mask) start.mask = mask; end.mask = mask; - start.id = end.id = county - - county++; - start.first = start.last = this; end.first = end.last = this; diff --git a/bin/pixi.js b/bin/pixi.js index 6855ebc..ba89ba6 100644 --- a/bin/pixi.js +++ b/bin/pixi.js @@ -9,7 +9,7 @@ * Pixi.JS is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license.php */ -(function(){function t(){return n.Matrix="undefined"!=typeof Float32Array?Float32Array:Array,n.Matrix}function e(t){return[(255&t>>16)/255,(255&t>>8)/255,(255&t)/255]}function e(t){return[(255&t>>16)/255,(255&t>>8)/255,(255&t)/255]}var i=this,n=n||{};n.Point=function(t,e){this.x=t||0,this.y=e||0},n.Point.prototype.clone=function(){return new n.Point(this.x,this.y)},n.Point.constructor=n.Point,n.Rectangle=function(t,e,i,r){this.x=t||0,this.y=e||0,this.width=i||0,this.height=r||0},n.Rectangle.prototype.clone=function(){return new n.Rectangle(this.x,this.y,this.width,this.height)},n.Rectangle.prototype.contains=function(t,e){if(0>=this.width||0>=this.height)return!1;var i=this.x;if(t>i&&i+this.width>t){var r=this.y;if(e>r&&r+this.height>e)return!0}return!1},n.Rectangle.constructor=n.Rectangle,n.Polygon=function(t){if("number"==typeof t[0]){for(var e=[],i=0,r=t.length;r>i;i+=2)e.push(new n.Point(t[i],t[i+1]));t=e}this.points=t},n.Polygon.prototype.clone=function(){for(var t=[],e=0;this.points.length>e;e++)t.push(this.points[e].clone());return new n.Polygon(t)},n.Polygon.prototype.contains=function(t,e){for(var i=!1,r=0,n=this.points.length-1;this.points.length>r;n=r++){var s=this.points[r].x,a=this.points[r].y,o=this.points[n].x,h=this.points[n].y,l=a>e!=h>e&&(o-s)*(e-a)/(h-a)+s>t;l&&(i=!i)}return i},n.Polygon.constructor=n.Polygon,n.Circle=function(t,e,i){this.x=t||0,this.y=e||0,this.radius=i||0},n.Circle.prototype.clone=function(){return new n.Circle(this.x,this.y,this.radius)},n.Circle.prototype.contains=function(t,e){if(0>=this.radius)return!1;var i=this.x-t,r=this.y-e,n=this.radius*this.radius;return i*=i,r*=r,n>=i+r},n.Circle.constructor=n.Circle,n.Ellipse=function(t,e,i,r){this.x=t||0,this.y=e||0,this.width=i||0,this.height=r||0},n.Ellipse.prototype.clone=function(){return new n.Ellipse(this.x,this.y,this.width,this.height)},n.Ellipse.prototype.contains=function(t,e){if(0>=this.width||0>=this.height)return!1;var i=(t-this.x)/this.width-.5,r=(e-this.y)/this.height-.5;return i*=i,r*=r,.25>i+r},n.Ellipse.getBounds=function(){return new n.Rectangle(this.x,this.y,this.width,this.height)},n.Ellipse.constructor=n.Ellipse,t(),n.mat3={},n.mat3.create=function(){var t=new n.Matrix(9);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},n.mat4={},n.mat4.create=function(){var t=new n.Matrix(16);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},n.mat3.multiply=function(t,e,i){i||(i=t);var r=t[0],n=t[1],s=t[2],a=t[3],o=t[4],h=t[5],l=t[6],u=t[7],c=t[8],d=e[0],p=e[1],f=e[2],v=e[3],g=e[4],m=e[5],x=e[6],b=e[7],y=e[8];return i[0]=d*r+p*a+f*l,i[1]=d*n+p*o+f*u,i[2]=d*s+p*h+f*c,i[3]=v*r+g*a+m*l,i[4]=v*n+g*o+m*u,i[5]=v*s+g*h+m*c,i[6]=x*r+b*a+y*l,i[7]=x*n+b*o+y*u,i[8]=x*s+b*h+y*c,i},n.mat3.clone=function(t){var e=new n.Matrix(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e},n.mat3.transpose=function(t,e){if(!e||t===e){var i=t[1],r=t[2],n=t[5];return t[1]=t[3],t[2]=t[6],t[3]=i,t[5]=t[7],t[6]=r,t[7]=n,t}return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],e},n.mat3.toMat4=function(t,e){return e||(e=n.mat4.create()),e[15]=1,e[14]=0,e[13]=0,e[12]=0,e[11]=0,e[10]=t[8],e[9]=t[7],e[8]=t[6],e[7]=0,e[6]=t[5],e[5]=t[4],e[4]=t[3],e[3]=0,e[2]=t[2],e[1]=t[1],e[0]=t[0],e},n.mat4.create=function(){var t=new n.Matrix(16);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},n.mat4.transpose=function(t,e){if(!e||t===e){var i=t[1],r=t[2],n=t[3],s=t[6],a=t[7],o=t[11];return t[1]=t[4],t[2]=t[8],t[3]=t[12],t[4]=i,t[6]=t[9],t[7]=t[13],t[8]=r,t[9]=s,t[11]=t[14],t[12]=n,t[13]=a,t[14]=o,t}return e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15],e},n.mat4.multiply=function(t,e,i){i||(i=t);var r=t[0],n=t[1],s=t[2],a=t[3],o=t[4],h=t[5],l=t[6],u=t[7],c=t[8],d=t[9],p=t[10],f=t[11],v=t[12],g=t[13],m=t[14],x=t[15],b=e[0],y=e[1],T=e[2],_=e[3];return i[0]=b*r+y*o+T*c+_*v,i[1]=b*n+y*h+T*d+_*g,i[2]=b*s+y*l+T*p+_*m,i[3]=b*a+y*u+T*f+_*x,b=e[4],y=e[5],T=e[6],_=e[7],i[4]=b*r+y*o+T*c+_*v,i[5]=b*n+y*h+T*d+_*g,i[6]=b*s+y*l+T*p+_*m,i[7]=b*a+y*u+T*f+_*x,b=e[8],y=e[9],T=e[10],_=e[11],i[8]=b*r+y*o+T*c+_*v,i[9]=b*n+y*h+T*d+_*g,i[10]=b*s+y*l+T*p+_*m,i[11]=b*a+y*u+T*f+_*x,b=e[12],y=e[13],T=e[14],_=e[15],i[12]=b*r+y*o+T*c+_*v,i[13]=b*n+y*h+T*d+_*g,i[14]=b*s+y*l+T*p+_*m,i[15]=b*a+y*u+T*f+_*x,i},n.DisplayObject=function(){this.last=this,this.first=this,this.position=new n.Point,this.scale=new n.Point(1,1),this.pivot=new n.Point(0,0),this.rotation=0,this.alpha=1,this.visible=!0,this.worldVisible=!1,this.parent=null,this.stage=null,this.hitArea=null,this.worldAlpha=1,this.color=[],this.worldTransform=n.mat3.create(),this.localTransform=n.mat3.create(),this.dynamic=!0,this._sr=0,this._cr=1,this.childIndex=0,this.renderable=!1,this._interactive=!1,this.buttonMode=!1},n.DisplayObject.constructor=n.DisplayObject,n.DisplayObject.prototype.setInteractive=function(t){this.interactive=t},Object.defineProperty(n.DisplayObject.prototype,"interactive",{get:function(){return this._interactive},set:function(t){this._interactive=t,this.stage&&(this.stage.dirty=!0)}}),Object.defineProperty(n.DisplayObject.prototype,"mask",{get:function(){return this._mask},set:function(t){this._mask=t,t?this.addFilter(t):this.removeFilter()}}),n.DisplayObject.prototype.addFilter=function(t){if(!this.filter){this.filter=!0;var e=new n.FilterBlock,i=new n.FilterBlock;e.mask=t,i.mask=t,e.id=i.id=county,county++,e.first=e.last=this,i.first=i.last=this,e.open=!0;var r,s,a=e,o=e;s=this.first._iPrev,s?(r=s._iNext,a._iPrev=s,s._iNext=a):r=this,r&&(r._iPrev=o,o._iNext=r);var a=i,o=i,r=null,s=null;s=this.last,r=s._iNext,r&&(r._iPrev=o,o._iNext=r),a._iPrev=s,s._iNext=a;for(var h=this,l=this.last;h;)h.last==l&&(h.last=i),h=h.parent;this.first=e,this.__renderGroup&&this.__renderGroup.addFilterBlocks(e,i),t.renderable=!1}},n.DisplayObject.prototype.removeFilter=function(){if(this.filter){this.filter=!1;var t=this.first,e=t._iNext,i=t._iPrev;e&&(e._iPrev=i),i&&(i._iNext=e),this.first=t._iNext;var r=this.last,e=r._iNext,i=r._iPrev;e&&(e._iPrev=i),i._iNext=e;for(var n=r._iPrev,s=this;s.last==r&&(s.last=n,s=s.parent););var a=t.mask;a.renderable=!0,this.__renderGroup&&this.__renderGroup.removeFilterBlocks(t,r)}},n.DisplayObject.prototype.updateTransform=function(){this.rotation!=this.rotationCache&&(this.rotationCache=this.rotation,this._sr=Math.sin(this.rotation),this._cr=Math.cos(this.rotation));var t=this.localTransform,e=this.parent.worldTransform,i=this.worldTransform;t[0]=this._cr*this.scale.x,t[1]=-this._sr*this.scale.y,t[3]=this._sr*this.scale.x,t[4]=this._cr*this.scale.y;var r=this.pivot.x,n=this.pivot.y,s=t[0],a=t[1],o=this.position.x-t[0]*r-n*t[1],h=t[3],l=t[4],u=this.position.y-t[4]*n-r*t[3],c=e[0],d=e[1],p=e[2],f=e[3],v=e[4],g=e[5];t[2]=o,t[5]=u,i[0]=c*s+d*h,i[1]=c*a+d*l,i[2]=c*o+d*u+p,i[3]=f*s+v*h,i[4]=f*a+v*l,i[5]=f*o+v*u+g,this.worldAlpha=this.alpha*this.parent.worldAlpha},n.DisplayObjectContainer=function(){n.DisplayObject.call(this),this.children=[],this.renderable=!1},n.DisplayObjectContainer.constructor=n.DisplayObjectContainer,n.DisplayObjectContainer.prototype=Object.create(n.DisplayObject.prototype),n.DisplayObjectContainer.prototype.addChild=function(t){if(void 0!=t.parent&&t.parent.removeChild(t),t.parent=this,this.children.push(t),this.stage){var e=t;do e.interactive&&(this.stage.dirty=!0),e.stage=this.stage,e=e._iNext;while(e)}var i,r,n=t.first,s=t.last;r=this.filter?this.last._iPrev:this.last,i=r._iNext;for(var a=this,o=r;a;)a.last==o&&(a.last=t.last),a=a.parent;i&&(i._iPrev=s,s._iNext=i),n._iPrev=r,r._iNext=n,this.__renderGroup&&(t.__renderGroup&&t.__renderGroup.removeDisplayObjectAndChildren(t),this.__renderGroup.addDisplayObjectAndChildren(t))},n.DisplayObjectContainer.prototype.addChildAt=function(t,e){if(!(e>=0&&this.children.length>=e))throw Error(t+" The index "+e+" supplied is out of bounds "+this.children.length);if(void 0!=t.parent&&t.parent.removeChild(t),t.parent=this,this.stage){var i=t;do i.interactive&&(this.stage.dirty=!0),i.stage=this.stage,i=i._iNext;while(i)}var r,n,s=t.first,a=t.last;if(e==this.children.length){n=this.last;for(var o=this,h=this.last;o;)o.last==h&&(o.last=t.last),o=o.parent}else n=0==e?this:this.children[e-1].last;r=n._iNext,r&&(r._iPrev=a,a._iNext=r),s._iPrev=n,n._iNext=s,this.children.splice(e,0,t),this.__renderGroup&&(t.__renderGroup&&t.__renderGroup.removeDisplayObjectAndChildren(t),this.__renderGroup.addDisplayObjectAndChildren(t)),console.log(this.children)},n.DisplayObjectContainer.prototype.swapChildren=function(){},n.DisplayObjectContainer.prototype.getChildAt=function(t){if(t>=0&&this.children.length>t)return this.children[t];throw Error(child+" Both the supplied DisplayObjects must be a child of the caller "+this)},n.DisplayObjectContainer.prototype.removeChild=function(t){var e=this.children.indexOf(t);if(-1===e)throw Error(t+" The supplied DisplayObject must be a child of the caller "+this);var i=t.first,r=t.last,n=r._iNext,s=i._iPrev;if(n&&(n._iPrev=s),s._iNext=n,this.last==r)for(var a=i._iPrev,o=this;o.last==r.last&&(o.last=a,o=o.parent););if(r._iNext=null,i._iPrev=null,this.stage){var h=t;do h.interactive&&(this.stage.dirty=!0),h.stage=null,h=h._iNext;while(h)}t.__renderGroup&&t.__renderGroup.removeDisplayObjectAndChildren(t),t.parent=void 0,this.children.splice(e,1)},n.DisplayObjectContainer.prototype.updateTransform=function(){if(this.visible){n.DisplayObject.prototype.updateTransform.call(this);for(var t=0,e=this.children.length;e>t;t++)this.children[t].updateTransform()}},n.blendModes={},n.blendModes.NORMAL=0,n.blendModes.SCREEN=1,n.Sprite=function(t){n.DisplayObjectContainer.call(this),this.anchor=new n.Point,this.texture=t,this.blendMode=n.blendModes.NORMAL,this._width=0,this._height=0,t.baseTexture.hasLoaded?this.updateFrame=!0:(this.onTextureUpdateBind=this.onTextureUpdate.bind(this),this.texture.addEventListener("update",this.onTextureUpdateBind)),this.renderable=!0},n.Sprite.constructor=n.Sprite,n.Sprite.prototype=Object.create(n.DisplayObjectContainer.prototype),Object.defineProperty(n.Sprite.prototype,"width",{get:function(){return this.scale.x*this.texture.frame.width},set:function(t){this.scale.x=t/this.texture.frame.width,this._width=t}}),Object.defineProperty(n.Sprite.prototype,"height",{get:function(){return this.scale.y*this.texture.frame.height},set:function(t){this.scale.y=t/this.texture.frame.height,this._height=t}}),n.Sprite.prototype.setTexture=function(t){this.texture.baseTexture!=t.baseTexture&&(this.textureChange=!0),this.texture=t,this.updateFrame=!0},n.Sprite.prototype.onTextureUpdate=function(){this._width&&(this.scale.x=this._width/this.texture.frame.width),this._height&&(this.scale.y=this._height/this.texture.frame.height),this.updateFrame=!0},n.Sprite.fromFrame=function(t){var e=n.TextureCache[t];if(!e)throw Error("The frameId '"+t+"' does not exist in the texture cache"+this);return new n.Sprite(e)},n.Sprite.fromImage=function(t){var e=n.Texture.fromImage(t);return new n.Sprite(e)},n.MovieClip=function(t){n.Sprite.call(this,t[0]),this.textures=t,this.currentFrame=0,this.animationSpeed=1,this.loop=!0,this.onComplete=null,this.playing},n.MovieClip.constructor=n.MovieClip,n.MovieClip.prototype=Object.create(n.Sprite.prototype),n.MovieClip.prototype.stop=function(){this.playing=!1},n.MovieClip.prototype.play=function(){this.playing=!0},n.MovieClip.prototype.gotoAndStop=function(t){this.playing=!1,this.currentFrame=t;var e=0|this.currentFrame+.5;this.setTexture(this.textures[e%this.textures.length])},n.MovieClip.prototype.gotoAndPlay=function(t){this.currentFrame=t,this.playing=!0},n.MovieClip.prototype.updateTransform=function(){if(n.Sprite.prototype.updateTransform.call(this),this.playing){this.currentFrame+=this.animationSpeed;var t=0|this.currentFrame+.5;this.loop||this.textures.length>t?this.setTexture(this.textures[t%this.textures.length]):t>=this.textures.length&&(this.gotoAndStop(this.textures.length-1),this.onComplete&&this.onComplete())}},n.FilterBlock=function(t){this.graphics=t,this.visible=!0,this.renderable=!0},n.Text=function(t,e){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"),n.Sprite.call(this,n.Texture.fromCanvas(this.canvas)),this.setText(t),this.setStyle(e),this.updateText(),this.dirty=!1},n.Text.constructor=n.Text,n.Text.prototype=Object.create(n.Sprite.prototype),n.Text.prototype.setStyle=function(t){t=t||{},t.font=t.font||"bold 20pt Arial",t.fill=t.fill||"black",t.align=t.align||"left",t.stroke=t.stroke||"black",t.strokeThickness=t.strokeThickness||0,t.wordWrap=t.wordWrap||!1,t.wordWrapWidth=t.wordWrapWidth||100,this.style=t,this.dirty=!0},n.Sprite.prototype.setText=function(t){this.text=""+t||" ",this.dirty=!0},n.Text.prototype.updateText=function(){this.context.font=this.style.font;var t=this.text;this.style.wordWrap&&(t=this.wordWrap(this.text));for(var e=t.split(/(?:\r\n|\r|\n)/),i=[],r=0,s=0;e.length>s;s++){var a=this.context.measureText(e[s]).width;i[s]=a,r=Math.max(r,a)}this.canvas.width=r+this.style.strokeThickness;var o=this.determineFontHeight("font: "+this.style.font+";")+this.style.strokeThickness;for(this.canvas.height=o*e.length,this.context.fillStyle=this.style.fill,this.context.font=this.style.font,this.context.strokeStyle=this.style.stroke,this.context.lineWidth=this.style.strokeThickness,this.context.textBaseline="top",s=0;e.length>s;s++){var h=new n.Point(this.style.strokeThickness/2,this.style.strokeThickness/2+s*o);"right"==this.style.align?h.x+=r-i[s]:"center"==this.style.align&&(h.x+=(r-i[s])/2),this.style.stroke&&this.style.strokeThickness&&this.context.strokeText(e[s],h.x,h.y),this.style.fill&&this.context.fillText(e[s],h.x,h.y)}this.updateTexture()},n.Text.prototype.updateTexture=function(){this.texture.baseTexture.width=this.canvas.width,this.texture.baseTexture.height=this.canvas.height,this.texture.frame.width=this.canvas.width,this.texture.frame.height=this.canvas.height,this._width=this.canvas.width,this._height=this.canvas.height,n.texturesToUpdate.push(this.texture.baseTexture)},n.Text.prototype.updateTransform=function(){this.dirty&&(this.updateText(),this.dirty=!1),n.Sprite.prototype.updateTransform.call(this)},n.Text.prototype.determineFontHeight=function(t){var e=n.Text.heightCache[t];if(!e){var i=document.getElementsByTagName("body")[0],r=document.createElement("div"),s=document.createTextNode("M");r.appendChild(s),r.setAttribute("style",t+";position:absolute;top:0;left:0"),i.appendChild(r),e=r.offsetHeight,n.Text.heightCache[t]=e,i.removeChild(r)}return e},n.Text.prototype.wordWrap=function(t){for(var e=function(t,e,i,r,n){var s=Math.floor((r-i)/2)+i;return s==i?1:n>=t.measureText(e.substring(0,s)).width?t.measureText(e.substring(0,s+1)).width>n?s:arguments.callee(t,e,s,r,n):arguments.callee(t,e,i,s,n)},i=function(t,i,r){if(r>=t.measureText(i).width||1>i.length)return i;var n=e(t,i,0,i.length,r);return i.substring(0,n)+"\n"+arguments.callee(t,i.substring(n),r)},r="",n=t.split("\n"),s=0;n.length>s;s++)r+=i(this.context,n[s],this.style.wordWrapWidth)+"\n";return r},n.Text.prototype.destroy=function(t){t&&this.texture.destroy()},n.Text.heightCache={},n.BitmapText=function(t,e){n.DisplayObjectContainer.call(this),this.setText(t),this.setStyle(e),this.updateText(),this.dirty=!1},n.BitmapText.constructor=n.BitmapText,n.BitmapText.prototype=Object.create(n.DisplayObjectContainer.prototype),n.BitmapText.prototype.setText=function(t){this.text=t||" ",this.dirty=!0},n.BitmapText.prototype.setStyle=function(t){t=t||{},t.align=t.align||"left",this.style=t;var e=t.font.split(" ");this.fontName=e[e.length-1],this.fontSize=e.length>=2?parseInt(e[e.length-2],10):n.BitmapText.fonts[this.fontName].size,this.dirty=!0},n.BitmapText.prototype.updateText=function(){for(var t=n.BitmapText.fonts[this.fontName],e=new n.Point,i=null,r=[],s=0,a=[],o=0,h=this.fontSize/t.size,l=0;this.text.length>l;l++){var u=this.text.charCodeAt(l);if(/(?:\r\n|\r|\n)/.test(this.text.charAt(l)))a.push(e.x),s=Math.max(s,e.x),o++,e.x=0,e.y+=t.lineHeight,i=null;else{var c=t.chars[u];c&&(i&&c[i]&&(e.x+=c.kerning[i]),r.push({texture:c.texture,line:o,charCode:u,position:new n.Point(e.x+c.xOffset,e.y+c.yOffset)}),e.x+=c.xAdvance,i=u)}}a.push(e.x),s=Math.max(s,e.x);var d=[];for(l=0;o>=l;l++){var p=0;"right"==this.style.align?p=s-a[l]:"center"==this.style.align&&(p=(s-a[l])/2),d.push(p)}for(l=0;r.length>l;l++){var f=new n.Sprite(r[l].texture);f.position.x=(r[l].position.x+d[r[l].line])*h,f.position.y=r[l].position.y*h,f.scale.x=f.scale.y=h,this.addChild(f)}this.width=e.x*h,this.height=(e.y+t.lineHeight)*h},n.BitmapText.prototype.updateTransform=function(){if(this.dirty){for(;this.children.length>0;)this.removeChild(this.getChildAt(0));this.updateText(),this.dirty=!1}n.DisplayObjectContainer.prototype.updateTransform.call(this)},n.BitmapText.fonts={},n.InteractionManager=function(t){this.stage=t,this.tempPoint=new n.Point,this.mouseoverEnabled=!0,this.mouse=new n.InteractionData,this.touchs={},this.pool=[],this.interactiveItems=[],this.last=0},n.InteractionManager.constructor=n.InteractionManager,n.InteractionManager.prototype.collectInteractiveSprite=function(t,e){for(var i=t.children,r=i.length,n=r-1;n>=0;n--){var s=i[n];s.visible&&(s.interactive?(e.interactiveChildren=!0,this.interactiveItems.push(s),s.children.length>0&&this.collectInteractiveSprite(s,s)):(s.__iParent=null,s.children.length>0&&this.collectInteractiveSprite(s,e)))}},n.InteractionManager.prototype.setTarget=function(t){window.navigator.msPointerEnabled&&(t.view.style["-ms-content-zooming"]="none",t.view.style["-ms-touch-action"]="none"),this.target=t,t.view.addEventListener("mousemove",this.onMouseMove.bind(this),!0),t.view.addEventListener("mousedown",this.onMouseDown.bind(this),!0),document.body.addEventListener("mouseup",this.onMouseUp.bind(this),!0),t.view.addEventListener("mouseout",this.onMouseUp.bind(this),!0),t.view.addEventListener("touchstart",this.onTouchStart.bind(this),!0),t.view.addEventListener("touchend",this.onTouchEnd.bind(this),!0),t.view.addEventListener("touchmove",this.onTouchMove.bind(this),!0)},n.InteractionManager.prototype.update=function(){if(this.target){var t=Date.now(),e=t-this.last;if(e=30*e/1e3,!(1>e)){if(this.last=t,this.dirty){this.dirty=!1;for(var i=this.interactiveItems.length,r=0;i>r;r++)this.interactiveItems[r].interactiveChildren=!1;this.interactiveItems=[],this.stage.interactive&&this.interactiveItems.push(this.stage),this.collectInteractiveSprite(this.stage,this.stage)}var n=this.interactiveItems.length;this.target.view.style.cursor="default";for(var r=0;n>r;r++){var s=this.interactiveItems[r];s.visible&&(s.mouseover||s.mouseout||s.buttonMode)&&(s.__hit=this.hitTest(s,this.mouse),s.__hit?(s.buttonMode&&(this.target.view.style.cursor="pointer"),s.__isOver||(s.mouseover&&s.mouseover(this.mouse),s.__isOver=!0)):s.__isOver&&(s.mouseout&&s.mouseout(this.mouse),s.__isOver=!1))}}}},n.InteractionManager.prototype.onMouseMove=function(t){this.mouse.originalEvent=t||window.event;var e=this.target.view.getBoundingClientRect();this.mouse.global.x=(t.clientX-e.left)*(this.target.width/e.width),this.mouse.global.y=(t.clientY-e.top)*(this.target.height/e.height);var i=this.interactiveItems.length;this.mouse.global;for(var r=0;i>r;r++){var n=this.interactiveItems[r];n.mousemove&&n.mousemove(this.mouse)}},n.InteractionManager.prototype.onMouseDown=function(t){t.preventDefault(),this.mouse.originalEvent=t||window.event;var e=this.interactiveItems.length;this.mouse.global,this.stage;for(var i=0;e>i;i++){var r=this.interactiveItems[i];if((r.mousedown||r.click)&&(r.__mouseIsDown=!0,r.__hit=this.hitTest(r,this.mouse),r.__hit&&(r.mousedown&&r.mousedown(this.mouse),r.__isDown=!0,!r.interactiveChildren)))break}},n.InteractionManager.prototype.onMouseUp=function(t){this.mouse.originalEvent=t||window.event,this.mouse.global;for(var e=this.interactiveItems.length,i=!1,r=0;e>r;r++){var n=this.interactiveItems[r];(n.mouseup||n.mouseupoutside||n.click)&&(n.__hit=this.hitTest(n,this.mouse),n.__hit&&!i?(n.mouseup&&n.mouseup(this.mouse),n.__isDown&&n.click&&n.click(this.mouse),n.interactiveChildren||(i=!0)):n.__isDown&&n.mouseupoutside&&n.mouseupoutside(this.mouse),n.__isDown=!1)}},n.InteractionManager.prototype.hitTest=function(t,e){var i=e.global;if(!t.visible)return!1;var r=t instanceof n.Sprite,s=t.worldTransform,a=s[0],o=s[1],h=s[2],l=s[3],u=s[4],c=s[5],d=1/(a*u+o*-l),p=u*d*i.x+-o*d*i.y+(c*o-h*u)*d,f=a*d*i.y+-l*d*i.x+(-c*a+h*l)*d;if(t.hitArea&&t.hitArea.contains){if(t.hitArea.contains(p,f))return r&&(e.target=t),!0}else if(r){var v,g=t.texture.frame.width,m=t.texture.frame.height,x=-g*t.anchor.x;if(p>x&&x+g>p&&(v=-m*t.anchor.y,f>v&&v+m>f))return e.target=t,!0}for(var b=t.children.length,y=0;b>y;y++){var T=t.children[y],_=this.hitTest(T,e);if(_)return!0}return!1},n.InteractionManager.prototype.onTouchMove=function(t){this.mouse.originalEvent=t||window.event;for(var e=this.target.view.getBoundingClientRect(),i=t.changedTouches,r=0;i.length>r;r++){var n=i[r],s=this.touchs[n.identifier];s.global.x=(n.clientX-e.left)*(this.target.width/e.width),s.global.y=(n.clientY-e.top)*(this.target.height/e.height)}for(var a=this.interactiveItems.length,r=0;a>r;r++){var o=this.interactiveItems[r];o.touchmove&&o.touchmove(s)}},n.InteractionManager.prototype.onTouchStart=function(t){t.preventDefault(),this.mouse.originalEvent=t||window.event;for(var e=this.target.view.getBoundingClientRect(),i=t.changedTouches,r=0;i.length>r;r++){var s=i[r],a=this.pool.pop();a||(a=new n.InteractionData),this.touchs[s.identifier]=a,a.global.x=(s.clientX-e.left)*(this.target.width/e.width),a.global.y=(s.clientY-e.top)*(this.target.height/e.height);for(var o=this.interactiveItems.length,h=0;o>h;h++){var l=this.interactiveItems[h];if((l.touchstart||l.tap)&&(l.__hit=this.hitTest(l,a),l.__hit&&(l.touchstart&&l.touchstart(a),l.__isDown=!0,l.__touchData=a,!l.interactiveChildren)))break}}},n.InteractionManager.prototype.onTouchEnd=function(t){this.mouse.originalEvent=t||window.event;for(var e=this.target.view.getBoundingClientRect(),i=t.changedTouches,r=0;i.length>r;r++){var n=i[r],s=this.touchs[n.identifier],a=!1;s.global.x=(n.clientX-e.left)*(this.target.width/e.width),s.global.y=(n.clientY-e.top)*(this.target.height/e.height);for(var o=this.interactiveItems.length,h=0;o>h;h++){var l=this.interactiveItems[h],u=l.__touchData;l.__hit=this.hitTest(l,s),u==s&&((l.touchend||l.tap)&&(l.__hit&&!a?(l.touchend&&l.touchend(s),l.__isDown&&l.tap&&l.tap(s),l.interactiveChildren||(a=!0)):l.__isDown&&l.touchendoutside&&l.touchendoutside(s),l.__isDown=!1),l.__touchData=null)}this.pool.push(s),this.touchs[n.identifier]=null}},n.InteractionData=function(){this.global=new n.Point,this.local=new n.Point,this.target,this.originalEvent},n.InteractionData.prototype.getLocalPosition=function(t){var e=t.worldTransform,i=this.global,r=e[0],s=e[1],a=e[2],o=e[3],h=e[4],l=e[5],u=1/(r*h+s*-o);return new n.Point(h*u*i.x+-s*u*i.y+(l*s-a*h)*u,r*u*i.y+-o*u*i.x+(-l*r+a*o)*u)},n.InteractionData.constructor=n.InteractionData,n.Stage=function(t,e){n.DisplayObjectContainer.call(this),this.worldTransform=n.mat3.create(),this.__childrenAdded=[],this.__childrenRemoved=[],this.stage=this,this.interactive=e,this.stage.hitArea=new n.Rectangle(0,0,1e5,1e5),this.interactionManager=new n.InteractionManager(this),this.setBackgroundColor(t),this.worldVisible=!0,this.stage.dirty=!0},n.Stage.constructor=n.Stage,n.Stage.prototype=Object.create(n.DisplayObjectContainer.prototype),n.Stage.prototype.updateTransform=function(){this.worldAlpha=1;for(var t=0,e=this.children.length;e>t;t++)this.children[t].updateTransform();this.dirty&&(this.dirty=!1,this.interactionManager.dirty=!0),this.interactive&&this.interactionManager.update()},n.Stage.prototype.setBackgroundColor=function(t){this.backgroundColor=t||0,this.backgroundColorSplit=e(this.backgroundColor);var i=this.backgroundColor.toString(16);i="000000".substr(0,6-i.length)+i,this.backgroundColorString="#"+i},n.Stage.prototype.getMousePosition=function(){return this.interactionManager.mouse.global};for(var s=0,o=["ms","moz","webkit","o"],h=0;o.length>h&&!window.requestAnimationFrame;++h)window.requestAnimationFrame=window[o[h]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[o[h]+"CancelAnimationFrame"]||window[o[h]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(t){var e=(new Date).getTime(),i=Math.max(0,16-(e-s)),r=window.setTimeout(function(){t(e+i)},i);return s=e+i,r}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)}),window.requestAnimFrame=window.requestAnimationFrame,"function"!=typeof Function.prototype.bind&&(Function.prototype.bind=function(){var t=Array.prototype.slice;return function(e){function i(){var s=n.concat(t.call(arguments));r.apply(this instanceof i?this:e,s)}var r=this,n=t.call(arguments,1);if("function"!=typeof r)throw new TypeError;return i.prototype=function s(t){return t&&(s.prototype=t),this instanceof s?void 0:new s}(r.prototype),i}}());var l=n.AjaxRequest=function(){var t=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(!window.ActiveXObject)return window.XMLHttpRequest?new XMLHttpRequest:!1;for(var e=0;t.length>e;e++)try{return new ActiveXObject(t[e])}catch(i){}};n.runList=function(t){console.log(">>>>>>>>>"),console.log("_");var e=0,i=t.first;for(console.log(i);i._iNext;)if(e++,i=i._iNext,console.log(i),e>100){console.log("BREAK");break}},n.EventTarget=function(){var t={};this.addEventListener=this.on=function(e,i){void 0===t[e]&&(t[e]=[]),-1===t[e].indexOf(i)&&t[e].push(i)},this.dispatchEvent=this.emit=function(e){for(var i in t[e.type])t[e.type][i](e)},this.removeEventListener=this.off=function(e,i){var r=t[e].indexOf(i);-1!==r&&t[e].splice(r,1)}},n.autoDetectRenderer=function(t,e,i,r){t||(t=800),e||(e=600);var s=function(){try{return!!window.WebGLRenderingContext&&!!document.createElement("canvas").getContext("experimental-webgl")}catch(t){return!1}}();return s?new n.WebGLRenderer(t,e,i,r):new n.CanvasRenderer(t,e,i,r)},n.PolyK={},n.PolyK.Triangulate=function(t){var e=!0,i=t.length>>1;if(3>i)return[];for(var r=[],s=[],a=0;i>a;a++)s.push(a);for(var a=0,o=i;o>3;){var h=s[(a+0)%o],l=s[(a+1)%o],u=s[(a+2)%o],c=t[2*h],d=t[2*h+1],p=t[2*l],f=t[2*l+1],v=t[2*u],g=t[2*u+1],m=!1;if(n.PolyK._convex(c,d,p,f,v,g,e)){m=!0;for(var x=0;o>x;x++){var b=s[x];if(b!=h&&b!=l&&b!=u&&n.PolyK._PointInTriangle(t[2*b],t[2*b+1],c,d,p,f,v,g)){m=!1;break}}}if(m)r.push(h,l,u),s.splice((a+1)%o,1),o--,a=0;else if(a++>3*o){if(!e)return console.log("PIXI Warning: shape too complex to fill"),[];var r=[];s=[];for(var a=0;i>a;a++)s.push(a);a=0,o=i,e=!1}}return r.push(s[0],s[1],s[2]),r},n.PolyK._PointInTriangle=function(t,e,i,r,n,s,a,o){var h=a-i,l=o-r,u=n-i,c=s-r,d=t-i,p=e-r,f=h*h+l*l,v=h*u+l*c,g=h*d+l*p,m=u*u+c*c,x=u*d+c*p,b=1/(f*m-v*v),y=(m*g-v*x)*b,T=(f*x-v*g)*b;return y>=0&&T>=0&&1>y+T},n.PolyK._convex=function(t,e,i,r,n,s,a){return(e-r)*(n-i)+(i-t)*(s-r)>=0==a},n.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;","}"],n.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform vec2 projectionVector;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position = vec4( aVertexPosition.x / projectionVector.x -1.0, aVertexPosition.y / -projectionVector.y + 1.0 , 0.0, 1.0);","vTextureCoord = aTextureCoord;","vColor = aColor;","}"],n.stripShaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform float alpha;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor = gl_FragColor * alpha;","}"],n.stripShaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat3 translationMatrix;","uniform vec2 projectionVector;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","vec3 v = translationMatrix * vec3(aVertexPosition, 1.0);","gl_Position = vec4( v.x / projectionVector.x -1.0, v.y / -projectionVector.y + 1.0 , 0.0, 1.0);","vTextureCoord = aTextureCoord;","vColor = aColor;","}"],n.primitiveShaderFragmentSrc=["precision mediump float;","varying vec4 vColor;","void main(void) {","gl_FragColor = vColor;","}"],n.primitiveShaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec4 aColor;","uniform mat3 translationMatrix;","uniform vec2 projectionVector;","uniform float alpha;","varying vec4 vColor;","void main(void) {","vec3 v = translationMatrix * vec3(aVertexPosition, 1.0);","gl_Position = vec4( v.x / projectionVector.x -1.0, v.y / -projectionVector.y + 1.0 , 0.0, 1.0);","vColor = aColor * alpha;","}"],n.initPrimitiveShader=function(){var t=n.gl,e=n.compileProgram(n.primitiveShaderVertexSrc,n.primitiveShaderFragmentSrc);t.useProgram(e),e.vertexPositionAttribute=t.getAttribLocation(e,"aVertexPosition"),e.colorAttribute=t.getAttribLocation(e,"aColor"),e.projectionVector=t.getUniformLocation(e,"projectionVector"),e.translationMatrix=t.getUniformLocation(e,"translationMatrix"),e.alpha=t.getUniformLocation(e,"alpha"),n.primitiveProgram=e},n.initDefaultShader=function(){var t=this.gl,e=n.compileProgram(n.shaderVertexSrc,n.shaderFragmentSrc);t.useProgram(e),e.vertexPositionAttribute=t.getAttribLocation(e,"aVertexPosition"),e.projectionVector=t.getUniformLocation(e,"projectionVector"),e.textureCoordAttribute=t.getAttribLocation(e,"aTextureCoord"),e.colorAttribute=t.getAttribLocation(e,"aColor"),e.samplerUniform=t.getUniformLocation(e,"uSampler"),n.shaderProgram=e},n.initDefaultStripShader=function(){var t=this.gl,e=n.compileProgram(n.stripShaderVertexSrc,n.stripShaderFragmentSrc);t.useProgram(e),e.vertexPositionAttribute=t.getAttribLocation(e,"aVertexPosition"),e.projectionVector=t.getUniformLocation(e,"projectionVector"),e.textureCoordAttribute=t.getAttribLocation(e,"aTextureCoord"),e.translationMatrix=t.getUniformLocation(e,"translationMatrix"),e.alpha=t.getUniformLocation(e,"alpha"),e.colorAttribute=t.getAttribLocation(e,"aColor"),e.projectionVector=t.getUniformLocation(e,"projectionVector"),e.samplerUniform=t.getUniformLocation(e,"uSampler"),n.stripShaderProgram=e},n.CompileVertexShader=function(t,e){return n._CompileShader(t,e,t.VERTEX_SHADER)},n.CompileFragmentShader=function(t,e){return n._CompileShader(t,e,t.FRAGMENT_SHADER)},n._CompileShader=function(t,e,i){var r=e.join("\n"),n=t.createShader(i);return t.shaderSource(n,r),t.compileShader(n),t.getShaderParameter(n,t.COMPILE_STATUS)?n:(alert(t.getShaderInfoLog(n)),null)},n.compileProgram=function(t,e){var i=n.gl,r=n.CompileFragmentShader(i,e),s=n.CompileVertexShader(i,t),a=i.createProgram();return i.attachShader(a,s),i.attachShader(a,r),i.linkProgram(a),i.getProgramParameter(a,i.LINK_STATUS)||alert("Could not initialise shaders"),a},n.activateDefaultShader=function(){var t=n.gl,e=n.shaderProgram;t.useProgram(e),t.enableVertexAttribArray(e.vertexPositionAttribute),t.enableVertexAttribArray(e.textureCoordAttribute),t.enableVertexAttribArray(e.colorAttribute)},n.activatePrimitiveShader=function(){var t=n.gl;t.disableVertexAttribArray(n.shaderProgram.textureCoordAttribute),t.disableVertexAttribArray(n.shaderProgram.colorAttribute),t.useProgram(n.primitiveProgram),t.enableVertexAttribArray(n.primitiveProgram.vertexPositionAttribute),t.enableVertexAttribArray(n.primitiveProgram.colorAttribute)},n.WebGLGraphics=function(){},n.WebGLGraphics.renderGraphics=function(t,e){var i=n.gl;t._webGL||(t._webGL={points:[],indices:[],lastIndex:0,buffer:i.createBuffer(),indexBuffer:i.createBuffer()}),t.dirty&&(t.dirty=!1,t.clearDirty&&(t.clearDirty=!1,t._webGL.lastIndex=0,t._webGL.points=[],t._webGL.indices=[]),n.WebGLGraphics.updateGraphics(t)),n.activatePrimitiveShader(); +(function(){function t(){return n.Matrix="undefined"!=typeof Float32Array?Float32Array:Array,n.Matrix}function e(t){return[(255&t>>16)/255,(255&t>>8)/255,(255&t)/255]}function e(t){return[(255&t>>16)/255,(255&t>>8)/255,(255&t)/255]}var i=this,n=n||{};n.Point=function(t,e){this.x=t||0,this.y=e||0},n.Point.prototype.clone=function(){return new n.Point(this.x,this.y)},n.Point.constructor=n.Point,n.Rectangle=function(t,e,i,r){this.x=t||0,this.y=e||0,this.width=i||0,this.height=r||0},n.Rectangle.prototype.clone=function(){return new n.Rectangle(this.x,this.y,this.width,this.height)},n.Rectangle.prototype.contains=function(t,e){if(0>=this.width||0>=this.height)return!1;var i=this.x;if(t>i&&i+this.width>t){var r=this.y;if(e>r&&r+this.height>e)return!0}return!1},n.Rectangle.constructor=n.Rectangle,n.Polygon=function(t){if("number"==typeof t[0]){for(var e=[],i=0,r=t.length;r>i;i+=2)e.push(new n.Point(t[i],t[i+1]));t=e}this.points=t},n.Polygon.prototype.clone=function(){for(var t=[],e=0;this.points.length>e;e++)t.push(this.points[e].clone());return new n.Polygon(t)},n.Polygon.prototype.contains=function(t,e){for(var i=!1,r=0,n=this.points.length-1;this.points.length>r;n=r++){var s=this.points[r].x,a=this.points[r].y,o=this.points[n].x,h=this.points[n].y,l=a>e!=h>e&&(o-s)*(e-a)/(h-a)+s>t;l&&(i=!i)}return i},n.Polygon.constructor=n.Polygon,n.Circle=function(t,e,i){this.x=t||0,this.y=e||0,this.radius=i||0},n.Circle.prototype.clone=function(){return new n.Circle(this.x,this.y,this.radius)},n.Circle.prototype.contains=function(t,e){if(0>=this.radius)return!1;var i=this.x-t,r=this.y-e,n=this.radius*this.radius;return i*=i,r*=r,n>=i+r},n.Circle.constructor=n.Circle,n.Ellipse=function(t,e,i,r){this.x=t||0,this.y=e||0,this.width=i||0,this.height=r||0},n.Ellipse.prototype.clone=function(){return new n.Ellipse(this.x,this.y,this.width,this.height)},n.Ellipse.prototype.contains=function(t,e){if(0>=this.width||0>=this.height)return!1;var i=(t-this.x)/this.width-.5,r=(e-this.y)/this.height-.5;return i*=i,r*=r,.25>i+r},n.Ellipse.getBounds=function(){return new n.Rectangle(this.x,this.y,this.width,this.height)},n.Ellipse.constructor=n.Ellipse,t(),n.mat3={},n.mat3.create=function(){var t=new n.Matrix(9);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},n.mat4={},n.mat4.create=function(){var t=new n.Matrix(16);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},n.mat3.multiply=function(t,e,i){i||(i=t);var r=t[0],n=t[1],s=t[2],a=t[3],o=t[4],h=t[5],l=t[6],u=t[7],c=t[8],d=e[0],p=e[1],f=e[2],v=e[3],g=e[4],m=e[5],x=e[6],b=e[7],y=e[8];return i[0]=d*r+p*a+f*l,i[1]=d*n+p*o+f*u,i[2]=d*s+p*h+f*c,i[3]=v*r+g*a+m*l,i[4]=v*n+g*o+m*u,i[5]=v*s+g*h+m*c,i[6]=x*r+b*a+y*l,i[7]=x*n+b*o+y*u,i[8]=x*s+b*h+y*c,i},n.mat3.clone=function(t){var e=new n.Matrix(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e},n.mat3.transpose=function(t,e){if(!e||t===e){var i=t[1],r=t[2],n=t[5];return t[1]=t[3],t[2]=t[6],t[3]=i,t[5]=t[7],t[6]=r,t[7]=n,t}return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],e},n.mat3.toMat4=function(t,e){return e||(e=n.mat4.create()),e[15]=1,e[14]=0,e[13]=0,e[12]=0,e[11]=0,e[10]=t[8],e[9]=t[7],e[8]=t[6],e[7]=0,e[6]=t[5],e[5]=t[4],e[4]=t[3],e[3]=0,e[2]=t[2],e[1]=t[1],e[0]=t[0],e},n.mat4.create=function(){var t=new n.Matrix(16);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},n.mat4.transpose=function(t,e){if(!e||t===e){var i=t[1],r=t[2],n=t[3],s=t[6],a=t[7],o=t[11];return t[1]=t[4],t[2]=t[8],t[3]=t[12],t[4]=i,t[6]=t[9],t[7]=t[13],t[8]=r,t[9]=s,t[11]=t[14],t[12]=n,t[13]=a,t[14]=o,t}return e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15],e},n.mat4.multiply=function(t,e,i){i||(i=t);var r=t[0],n=t[1],s=t[2],a=t[3],o=t[4],h=t[5],l=t[6],u=t[7],c=t[8],d=t[9],p=t[10],f=t[11],v=t[12],g=t[13],m=t[14],x=t[15],b=e[0],y=e[1],T=e[2],_=e[3];return i[0]=b*r+y*o+T*c+_*v,i[1]=b*n+y*h+T*d+_*g,i[2]=b*s+y*l+T*p+_*m,i[3]=b*a+y*u+T*f+_*x,b=e[4],y=e[5],T=e[6],_=e[7],i[4]=b*r+y*o+T*c+_*v,i[5]=b*n+y*h+T*d+_*g,i[6]=b*s+y*l+T*p+_*m,i[7]=b*a+y*u+T*f+_*x,b=e[8],y=e[9],T=e[10],_=e[11],i[8]=b*r+y*o+T*c+_*v,i[9]=b*n+y*h+T*d+_*g,i[10]=b*s+y*l+T*p+_*m,i[11]=b*a+y*u+T*f+_*x,b=e[12],y=e[13],T=e[14],_=e[15],i[12]=b*r+y*o+T*c+_*v,i[13]=b*n+y*h+T*d+_*g,i[14]=b*s+y*l+T*p+_*m,i[15]=b*a+y*u+T*f+_*x,i},n.DisplayObject=function(){this.last=this,this.first=this,this.position=new n.Point,this.scale=new n.Point(1,1),this.pivot=new n.Point(0,0),this.rotation=0,this.alpha=1,this.visible=!0,this.worldVisible=!1,this.parent=null,this.stage=null,this.hitArea=null,this.worldAlpha=1,this.color=[],this.worldTransform=n.mat3.create(),this.localTransform=n.mat3.create(),this.dynamic=!0,this._sr=0,this._cr=1,this.childIndex=0,this.renderable=!1,this._interactive=!1,this.buttonMode=!1},n.DisplayObject.constructor=n.DisplayObject,n.DisplayObject.prototype.setInteractive=function(t){this.interactive=t},Object.defineProperty(n.DisplayObject.prototype,"interactive",{get:function(){return this._interactive},set:function(t){this._interactive=t,this.stage&&(this.stage.dirty=!0)}}),Object.defineProperty(n.DisplayObject.prototype,"mask",{get:function(){return this._mask},set:function(t){this._mask=t,t?this.addFilter(t):this.removeFilter()}}),n.DisplayObject.prototype.addFilter=function(t){if(!this.filter){this.filter=!0;var e=new n.FilterBlock,i=new n.FilterBlock;e.mask=t,i.mask=t,e.first=e.last=this,i.first=i.last=this,e.open=!0;var r,s,a=e,o=e;s=this.first._iPrev,s?(r=s._iNext,a._iPrev=s,s._iNext=a):r=this,r&&(r._iPrev=o,o._iNext=r);var a=i,o=i,r=null,s=null;s=this.last,r=s._iNext,r&&(r._iPrev=o,o._iNext=r),a._iPrev=s,s._iNext=a;for(var h=this,l=this.last;h;)h.last==l&&(h.last=i),h=h.parent;this.first=e,this.__renderGroup&&this.__renderGroup.addFilterBlocks(e,i),t.renderable=!1}},n.DisplayObject.prototype.removeFilter=function(){if(this.filter){this.filter=!1;var t=this.first,e=t._iNext,i=t._iPrev;e&&(e._iPrev=i),i&&(i._iNext=e),this.first=t._iNext;var r=this.last,e=r._iNext,i=r._iPrev;e&&(e._iPrev=i),i._iNext=e;for(var n=r._iPrev,s=this;s.last==r&&(s.last=n,s=s.parent););var a=t.mask;a.renderable=!0,this.__renderGroup&&this.__renderGroup.removeFilterBlocks(t,r)}},n.DisplayObject.prototype.updateTransform=function(){this.rotation!=this.rotationCache&&(this.rotationCache=this.rotation,this._sr=Math.sin(this.rotation),this._cr=Math.cos(this.rotation));var t=this.localTransform,e=this.parent.worldTransform,i=this.worldTransform;t[0]=this._cr*this.scale.x,t[1]=-this._sr*this.scale.y,t[3]=this._sr*this.scale.x,t[4]=this._cr*this.scale.y;var r=this.pivot.x,n=this.pivot.y,s=t[0],a=t[1],o=this.position.x-t[0]*r-n*t[1],h=t[3],l=t[4],u=this.position.y-t[4]*n-r*t[3],c=e[0],d=e[1],p=e[2],f=e[3],v=e[4],g=e[5];t[2]=o,t[5]=u,i[0]=c*s+d*h,i[1]=c*a+d*l,i[2]=c*o+d*u+p,i[3]=f*s+v*h,i[4]=f*a+v*l,i[5]=f*o+v*u+g,this.worldAlpha=this.alpha*this.parent.worldAlpha},n.DisplayObjectContainer=function(){n.DisplayObject.call(this),this.children=[],this.renderable=!1},n.DisplayObjectContainer.constructor=n.DisplayObjectContainer,n.DisplayObjectContainer.prototype=Object.create(n.DisplayObject.prototype),n.DisplayObjectContainer.prototype.addChild=function(t){if(void 0!=t.parent&&t.parent.removeChild(t),t.parent=this,this.children.push(t),this.stage){var e=t;do e.interactive&&(this.stage.dirty=!0),e.stage=this.stage,e=e._iNext;while(e)}var i,r,n=t.first,s=t.last;r=this.filter?this.last._iPrev:this.last,i=r._iNext;for(var a=this,o=r;a;)a.last==o&&(a.last=t.last),a=a.parent;i&&(i._iPrev=s,s._iNext=i),n._iPrev=r,r._iNext=n,this.__renderGroup&&(t.__renderGroup&&t.__renderGroup.removeDisplayObjectAndChildren(t),this.__renderGroup.addDisplayObjectAndChildren(t))},n.DisplayObjectContainer.prototype.addChildAt=function(t,e){if(!(e>=0&&this.children.length>=e))throw Error(t+" The index "+e+" supplied is out of bounds "+this.children.length);if(void 0!=t.parent&&t.parent.removeChild(t),t.parent=this,this.stage){var i=t;do i.interactive&&(this.stage.dirty=!0),i.stage=this.stage,i=i._iNext;while(i)}var r,n,s=t.first,a=t.last;if(e==this.children.length){n=this.last;for(var o=this,h=this.last;o;)o.last==h&&(o.last=t.last),o=o.parent}else n=0==e?this:this.children[e-1].last;r=n._iNext,r&&(r._iPrev=a,a._iNext=r),s._iPrev=n,n._iNext=s,this.children.splice(e,0,t),this.__renderGroup&&(t.__renderGroup&&t.__renderGroup.removeDisplayObjectAndChildren(t),this.__renderGroup.addDisplayObjectAndChildren(t)),console.log(this.children)},n.DisplayObjectContainer.prototype.swapChildren=function(){},n.DisplayObjectContainer.prototype.getChildAt=function(t){if(t>=0&&this.children.length>t)return this.children[t];throw Error(child+" Both the supplied DisplayObjects must be a child of the caller "+this)},n.DisplayObjectContainer.prototype.removeChild=function(t){var e=this.children.indexOf(t);if(-1===e)throw Error(t+" The supplied DisplayObject must be a child of the caller "+this);var i=t.first,r=t.last,n=r._iNext,s=i._iPrev;if(n&&(n._iPrev=s),s._iNext=n,this.last==r)for(var a=i._iPrev,o=this;o.last==r.last&&(o.last=a,o=o.parent););if(r._iNext=null,i._iPrev=null,this.stage){var h=t;do h.interactive&&(this.stage.dirty=!0),h.stage=null,h=h._iNext;while(h)}t.__renderGroup&&t.__renderGroup.removeDisplayObjectAndChildren(t),t.parent=void 0,this.children.splice(e,1)},n.DisplayObjectContainer.prototype.updateTransform=function(){if(this.visible){n.DisplayObject.prototype.updateTransform.call(this);for(var t=0,e=this.children.length;e>t;t++)this.children[t].updateTransform()}},n.blendModes={},n.blendModes.NORMAL=0,n.blendModes.SCREEN=1,n.Sprite=function(t){n.DisplayObjectContainer.call(this),this.anchor=new n.Point,this.texture=t,this.blendMode=n.blendModes.NORMAL,this._width=0,this._height=0,t.baseTexture.hasLoaded?this.updateFrame=!0:(this.onTextureUpdateBind=this.onTextureUpdate.bind(this),this.texture.addEventListener("update",this.onTextureUpdateBind)),this.renderable=!0},n.Sprite.constructor=n.Sprite,n.Sprite.prototype=Object.create(n.DisplayObjectContainer.prototype),Object.defineProperty(n.Sprite.prototype,"width",{get:function(){return this.scale.x*this.texture.frame.width},set:function(t){this.scale.x=t/this.texture.frame.width,this._width=t}}),Object.defineProperty(n.Sprite.prototype,"height",{get:function(){return this.scale.y*this.texture.frame.height},set:function(t){this.scale.y=t/this.texture.frame.height,this._height=t}}),n.Sprite.prototype.setTexture=function(t){this.texture.baseTexture!=t.baseTexture&&(this.textureChange=!0),this.texture=t,this.updateFrame=!0},n.Sprite.prototype.onTextureUpdate=function(){this._width&&(this.scale.x=this._width/this.texture.frame.width),this._height&&(this.scale.y=this._height/this.texture.frame.height),this.updateFrame=!0},n.Sprite.fromFrame=function(t){var e=n.TextureCache[t];if(!e)throw Error("The frameId '"+t+"' does not exist in the texture cache"+this);return new n.Sprite(e)},n.Sprite.fromImage=function(t){var e=n.Texture.fromImage(t);return new n.Sprite(e)},n.MovieClip=function(t){n.Sprite.call(this,t[0]),this.textures=t,this.currentFrame=0,this.animationSpeed=1,this.loop=!0,this.onComplete=null,this.playing},n.MovieClip.constructor=n.MovieClip,n.MovieClip.prototype=Object.create(n.Sprite.prototype),n.MovieClip.prototype.stop=function(){this.playing=!1},n.MovieClip.prototype.play=function(){this.playing=!0},n.MovieClip.prototype.gotoAndStop=function(t){this.playing=!1,this.currentFrame=t;var e=0|this.currentFrame+.5;this.setTexture(this.textures[e%this.textures.length])},n.MovieClip.prototype.gotoAndPlay=function(t){this.currentFrame=t,this.playing=!0},n.MovieClip.prototype.updateTransform=function(){if(n.Sprite.prototype.updateTransform.call(this),this.playing){this.currentFrame+=this.animationSpeed;var t=0|this.currentFrame+.5;this.loop||this.textures.length>t?this.setTexture(this.textures[t%this.textures.length]):t>=this.textures.length&&(this.gotoAndStop(this.textures.length-1),this.onComplete&&this.onComplete())}},n.FilterBlock=function(t){this.graphics=t,this.visible=!0,this.renderable=!0},n.Text=function(t,e){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"),n.Sprite.call(this,n.Texture.fromCanvas(this.canvas)),this.setText(t),this.setStyle(e),this.updateText(),this.dirty=!1},n.Text.constructor=n.Text,n.Text.prototype=Object.create(n.Sprite.prototype),n.Text.prototype.setStyle=function(t){t=t||{},t.font=t.font||"bold 20pt Arial",t.fill=t.fill||"black",t.align=t.align||"left",t.stroke=t.stroke||"black",t.strokeThickness=t.strokeThickness||0,t.wordWrap=t.wordWrap||!1,t.wordWrapWidth=t.wordWrapWidth||100,this.style=t,this.dirty=!0},n.Sprite.prototype.setText=function(t){this.text=""+t||" ",this.dirty=!0},n.Text.prototype.updateText=function(){this.context.font=this.style.font;var t=this.text;this.style.wordWrap&&(t=this.wordWrap(this.text));for(var e=t.split(/(?:\r\n|\r|\n)/),i=[],r=0,s=0;e.length>s;s++){var a=this.context.measureText(e[s]).width;i[s]=a,r=Math.max(r,a)}this.canvas.width=r+this.style.strokeThickness;var o=this.determineFontHeight("font: "+this.style.font+";")+this.style.strokeThickness;for(this.canvas.height=o*e.length,this.context.fillStyle=this.style.fill,this.context.font=this.style.font,this.context.strokeStyle=this.style.stroke,this.context.lineWidth=this.style.strokeThickness,this.context.textBaseline="top",s=0;e.length>s;s++){var h=new n.Point(this.style.strokeThickness/2,this.style.strokeThickness/2+s*o);"right"==this.style.align?h.x+=r-i[s]:"center"==this.style.align&&(h.x+=(r-i[s])/2),this.style.stroke&&this.style.strokeThickness&&this.context.strokeText(e[s],h.x,h.y),this.style.fill&&this.context.fillText(e[s],h.x,h.y)}this.updateTexture()},n.Text.prototype.updateTexture=function(){this.texture.baseTexture.width=this.canvas.width,this.texture.baseTexture.height=this.canvas.height,this.texture.frame.width=this.canvas.width,this.texture.frame.height=this.canvas.height,this._width=this.canvas.width,this._height=this.canvas.height,n.texturesToUpdate.push(this.texture.baseTexture)},n.Text.prototype.updateTransform=function(){this.dirty&&(this.updateText(),this.dirty=!1),n.Sprite.prototype.updateTransform.call(this)},n.Text.prototype.determineFontHeight=function(t){var e=n.Text.heightCache[t];if(!e){var i=document.getElementsByTagName("body")[0],r=document.createElement("div"),s=document.createTextNode("M");r.appendChild(s),r.setAttribute("style",t+";position:absolute;top:0;left:0"),i.appendChild(r),e=r.offsetHeight,n.Text.heightCache[t]=e,i.removeChild(r)}return e},n.Text.prototype.wordWrap=function(t){for(var e=function(t,e,i,r,n){var s=Math.floor((r-i)/2)+i;return s==i?1:n>=t.measureText(e.substring(0,s)).width?t.measureText(e.substring(0,s+1)).width>n?s:arguments.callee(t,e,s,r,n):arguments.callee(t,e,i,s,n)},i=function(t,i,r){if(r>=t.measureText(i).width||1>i.length)return i;var n=e(t,i,0,i.length,r);return i.substring(0,n)+"\n"+arguments.callee(t,i.substring(n),r)},r="",n=t.split("\n"),s=0;n.length>s;s++)r+=i(this.context,n[s],this.style.wordWrapWidth)+"\n";return r},n.Text.prototype.destroy=function(t){t&&this.texture.destroy()},n.Text.heightCache={},n.BitmapText=function(t,e){n.DisplayObjectContainer.call(this),this.setText(t),this.setStyle(e),this.updateText(),this.dirty=!1},n.BitmapText.constructor=n.BitmapText,n.BitmapText.prototype=Object.create(n.DisplayObjectContainer.prototype),n.BitmapText.prototype.setText=function(t){this.text=t||" ",this.dirty=!0},n.BitmapText.prototype.setStyle=function(t){t=t||{},t.align=t.align||"left",this.style=t;var e=t.font.split(" ");this.fontName=e[e.length-1],this.fontSize=e.length>=2?parseInt(e[e.length-2],10):n.BitmapText.fonts[this.fontName].size,this.dirty=!0},n.BitmapText.prototype.updateText=function(){for(var t=n.BitmapText.fonts[this.fontName],e=new n.Point,i=null,r=[],s=0,a=[],o=0,h=this.fontSize/t.size,l=0;this.text.length>l;l++){var u=this.text.charCodeAt(l);if(/(?:\r\n|\r|\n)/.test(this.text.charAt(l)))a.push(e.x),s=Math.max(s,e.x),o++,e.x=0,e.y+=t.lineHeight,i=null;else{var c=t.chars[u];c&&(i&&c[i]&&(e.x+=c.kerning[i]),r.push({texture:c.texture,line:o,charCode:u,position:new n.Point(e.x+c.xOffset,e.y+c.yOffset)}),e.x+=c.xAdvance,i=u)}}a.push(e.x),s=Math.max(s,e.x);var d=[];for(l=0;o>=l;l++){var p=0;"right"==this.style.align?p=s-a[l]:"center"==this.style.align&&(p=(s-a[l])/2),d.push(p)}for(l=0;r.length>l;l++){var f=new n.Sprite(r[l].texture);f.position.x=(r[l].position.x+d[r[l].line])*h,f.position.y=r[l].position.y*h,f.scale.x=f.scale.y=h,this.addChild(f)}this.width=e.x*h,this.height=(e.y+t.lineHeight)*h},n.BitmapText.prototype.updateTransform=function(){if(this.dirty){for(;this.children.length>0;)this.removeChild(this.getChildAt(0));this.updateText(),this.dirty=!1}n.DisplayObjectContainer.prototype.updateTransform.call(this)},n.BitmapText.fonts={},n.InteractionManager=function(t){this.stage=t,this.tempPoint=new n.Point,this.mouseoverEnabled=!0,this.mouse=new n.InteractionData,this.touchs={},this.pool=[],this.interactiveItems=[],this.last=0},n.InteractionManager.constructor=n.InteractionManager,n.InteractionManager.prototype.collectInteractiveSprite=function(t,e){for(var i=t.children,r=i.length,n=r-1;n>=0;n--){var s=i[n];s.visible&&(s.interactive?(e.interactiveChildren=!0,this.interactiveItems.push(s),s.children.length>0&&this.collectInteractiveSprite(s,s)):(s.__iParent=null,s.children.length>0&&this.collectInteractiveSprite(s,e)))}},n.InteractionManager.prototype.setTarget=function(t){window.navigator.msPointerEnabled&&(t.view.style["-ms-content-zooming"]="none",t.view.style["-ms-touch-action"]="none"),this.target=t,t.view.addEventListener("mousemove",this.onMouseMove.bind(this),!0),t.view.addEventListener("mousedown",this.onMouseDown.bind(this),!0),document.body.addEventListener("mouseup",this.onMouseUp.bind(this),!0),t.view.addEventListener("mouseout",this.onMouseUp.bind(this),!0),t.view.addEventListener("touchstart",this.onTouchStart.bind(this),!0),t.view.addEventListener("touchend",this.onTouchEnd.bind(this),!0),t.view.addEventListener("touchmove",this.onTouchMove.bind(this),!0)},n.InteractionManager.prototype.update=function(){if(this.target){var t=Date.now(),e=t-this.last;if(e=30*e/1e3,!(1>e)){if(this.last=t,this.dirty){this.dirty=!1;for(var i=this.interactiveItems.length,r=0;i>r;r++)this.interactiveItems[r].interactiveChildren=!1;this.interactiveItems=[],this.stage.interactive&&this.interactiveItems.push(this.stage),this.collectInteractiveSprite(this.stage,this.stage)}var n=this.interactiveItems.length;this.target.view.style.cursor="default";for(var r=0;n>r;r++){var s=this.interactiveItems[r];s.visible&&(s.mouseover||s.mouseout||s.buttonMode)&&(s.__hit=this.hitTest(s,this.mouse),s.__hit?(s.buttonMode&&(this.target.view.style.cursor="pointer"),s.__isOver||(s.mouseover&&s.mouseover(this.mouse),s.__isOver=!0)):s.__isOver&&(s.mouseout&&s.mouseout(this.mouse),s.__isOver=!1))}}}},n.InteractionManager.prototype.onMouseMove=function(t){this.mouse.originalEvent=t||window.event;var e=this.target.view.getBoundingClientRect();this.mouse.global.x=(t.clientX-e.left)*(this.target.width/e.width),this.mouse.global.y=(t.clientY-e.top)*(this.target.height/e.height);var i=this.interactiveItems.length;this.mouse.global;for(var r=0;i>r;r++){var n=this.interactiveItems[r];n.mousemove&&n.mousemove(this.mouse)}},n.InteractionManager.prototype.onMouseDown=function(t){t.preventDefault(),this.mouse.originalEvent=t||window.event;var e=this.interactiveItems.length;this.mouse.global,this.stage;for(var i=0;e>i;i++){var r=this.interactiveItems[i];if((r.mousedown||r.click)&&(r.__mouseIsDown=!0,r.__hit=this.hitTest(r,this.mouse),r.__hit&&(r.mousedown&&r.mousedown(this.mouse),r.__isDown=!0,!r.interactiveChildren)))break}},n.InteractionManager.prototype.onMouseUp=function(t){this.mouse.originalEvent=t||window.event,this.mouse.global;for(var e=this.interactiveItems.length,i=!1,r=0;e>r;r++){var n=this.interactiveItems[r];(n.mouseup||n.mouseupoutside||n.click)&&(n.__hit=this.hitTest(n,this.mouse),n.__hit&&!i?(n.mouseup&&n.mouseup(this.mouse),n.__isDown&&n.click&&n.click(this.mouse),n.interactiveChildren||(i=!0)):n.__isDown&&n.mouseupoutside&&n.mouseupoutside(this.mouse),n.__isDown=!1)}},n.InteractionManager.prototype.hitTest=function(t,e){var i=e.global;if(!t.visible)return!1;var r=t instanceof n.Sprite,s=t.worldTransform,a=s[0],o=s[1],h=s[2],l=s[3],u=s[4],c=s[5],d=1/(a*u+o*-l),p=u*d*i.x+-o*d*i.y+(c*o-h*u)*d,f=a*d*i.y+-l*d*i.x+(-c*a+h*l)*d;if(t.hitArea&&t.hitArea.contains){if(t.hitArea.contains(p,f))return r&&(e.target=t),!0}else if(r){var v,g=t.texture.frame.width,m=t.texture.frame.height,x=-g*t.anchor.x;if(p>x&&x+g>p&&(v=-m*t.anchor.y,f>v&&v+m>f))return e.target=t,!0}for(var b=t.children.length,y=0;b>y;y++){var T=t.children[y],_=this.hitTest(T,e);if(_)return!0}return!1},n.InteractionManager.prototype.onTouchMove=function(t){this.mouse.originalEvent=t||window.event;for(var e=this.target.view.getBoundingClientRect(),i=t.changedTouches,r=0;i.length>r;r++){var n=i[r],s=this.touchs[n.identifier];s.global.x=(n.clientX-e.left)*(this.target.width/e.width),s.global.y=(n.clientY-e.top)*(this.target.height/e.height)}for(var a=this.interactiveItems.length,r=0;a>r;r++){var o=this.interactiveItems[r];o.touchmove&&o.touchmove(s)}},n.InteractionManager.prototype.onTouchStart=function(t){t.preventDefault(),this.mouse.originalEvent=t||window.event;for(var e=this.target.view.getBoundingClientRect(),i=t.changedTouches,r=0;i.length>r;r++){var s=i[r],a=this.pool.pop();a||(a=new n.InteractionData),this.touchs[s.identifier]=a,a.global.x=(s.clientX-e.left)*(this.target.width/e.width),a.global.y=(s.clientY-e.top)*(this.target.height/e.height);for(var o=this.interactiveItems.length,h=0;o>h;h++){var l=this.interactiveItems[h];if((l.touchstart||l.tap)&&(l.__hit=this.hitTest(l,a),l.__hit&&(l.touchstart&&l.touchstart(a),l.__isDown=!0,l.__touchData=a,!l.interactiveChildren)))break}}},n.InteractionManager.prototype.onTouchEnd=function(t){this.mouse.originalEvent=t||window.event;for(var e=this.target.view.getBoundingClientRect(),i=t.changedTouches,r=0;i.length>r;r++){var n=i[r],s=this.touchs[n.identifier],a=!1;s.global.x=(n.clientX-e.left)*(this.target.width/e.width),s.global.y=(n.clientY-e.top)*(this.target.height/e.height);for(var o=this.interactiveItems.length,h=0;o>h;h++){var l=this.interactiveItems[h],u=l.__touchData;l.__hit=this.hitTest(l,s),u==s&&((l.touchend||l.tap)&&(l.__hit&&!a?(l.touchend&&l.touchend(s),l.__isDown&&l.tap&&l.tap(s),l.interactiveChildren||(a=!0)):l.__isDown&&l.touchendoutside&&l.touchendoutside(s),l.__isDown=!1),l.__touchData=null)}this.pool.push(s),this.touchs[n.identifier]=null}},n.InteractionData=function(){this.global=new n.Point,this.local=new n.Point,this.target,this.originalEvent},n.InteractionData.prototype.getLocalPosition=function(t){var e=t.worldTransform,i=this.global,r=e[0],s=e[1],a=e[2],o=e[3],h=e[4],l=e[5],u=1/(r*h+s*-o);return new n.Point(h*u*i.x+-s*u*i.y+(l*s-a*h)*u,r*u*i.y+-o*u*i.x+(-l*r+a*o)*u)},n.InteractionData.constructor=n.InteractionData,n.Stage=function(t,e){n.DisplayObjectContainer.call(this),this.worldTransform=n.mat3.create(),this.__childrenAdded=[],this.__childrenRemoved=[],this.stage=this,this.interactive=e,this.stage.hitArea=new n.Rectangle(0,0,1e5,1e5),this.interactionManager=new n.InteractionManager(this),this.setBackgroundColor(t),this.worldVisible=!0,this.stage.dirty=!0},n.Stage.constructor=n.Stage,n.Stage.prototype=Object.create(n.DisplayObjectContainer.prototype),n.Stage.prototype.updateTransform=function(){this.worldAlpha=1;for(var t=0,e=this.children.length;e>t;t++)this.children[t].updateTransform();this.dirty&&(this.dirty=!1,this.interactionManager.dirty=!0),this.interactive&&this.interactionManager.update()},n.Stage.prototype.setBackgroundColor=function(t){this.backgroundColor=t||0,this.backgroundColorSplit=e(this.backgroundColor);var i=this.backgroundColor.toString(16);i="000000".substr(0,6-i.length)+i,this.backgroundColorString="#"+i},n.Stage.prototype.getMousePosition=function(){return this.interactionManager.mouse.global};for(var s=0,o=["ms","moz","webkit","o"],h=0;o.length>h&&!window.requestAnimationFrame;++h)window.requestAnimationFrame=window[o[h]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[o[h]+"CancelAnimationFrame"]||window[o[h]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(t){var e=(new Date).getTime(),i=Math.max(0,16-(e-s)),r=window.setTimeout(function(){t(e+i)},i);return s=e+i,r}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)}),window.requestAnimFrame=window.requestAnimationFrame,"function"!=typeof Function.prototype.bind&&(Function.prototype.bind=function(){var t=Array.prototype.slice;return function(e){function i(){var s=n.concat(t.call(arguments));r.apply(this instanceof i?this:e,s)}var r=this,n=t.call(arguments,1);if("function"!=typeof r)throw new TypeError;return i.prototype=function s(t){return t&&(s.prototype=t),this instanceof s?void 0:new s}(r.prototype),i}}());var l=n.AjaxRequest=function(){var t=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(!window.ActiveXObject)return window.XMLHttpRequest?new XMLHttpRequest:!1;for(var e=0;t.length>e;e++)try{return new ActiveXObject(t[e])}catch(i){}};n.runList=function(t){console.log(">>>>>>>>>"),console.log("_");var e=0,i=t.first;for(console.log(i);i._iNext;)if(e++,i=i._iNext,console.log(i),e>100){console.log("BREAK");break}},n.EventTarget=function(){var t={};this.addEventListener=this.on=function(e,i){void 0===t[e]&&(t[e]=[]),-1===t[e].indexOf(i)&&t[e].push(i)},this.dispatchEvent=this.emit=function(e){for(var i in t[e.type])t[e.type][i](e)},this.removeEventListener=this.off=function(e,i){var r=t[e].indexOf(i);-1!==r&&t[e].splice(r,1)}},n.autoDetectRenderer=function(t,e,i,r){t||(t=800),e||(e=600);var s=function(){try{return!!window.WebGLRenderingContext&&!!document.createElement("canvas").getContext("experimental-webgl")}catch(t){return!1}}();return s?new n.WebGLRenderer(t,e,i,r):new n.CanvasRenderer(t,e,i,r)},n.PolyK={},n.PolyK.Triangulate=function(t){var e=!0,i=t.length>>1;if(3>i)return[];for(var r=[],s=[],a=0;i>a;a++)s.push(a);for(var a=0,o=i;o>3;){var h=s[(a+0)%o],l=s[(a+1)%o],u=s[(a+2)%o],c=t[2*h],d=t[2*h+1],p=t[2*l],f=t[2*l+1],v=t[2*u],g=t[2*u+1],m=!1;if(n.PolyK._convex(c,d,p,f,v,g,e)){m=!0;for(var x=0;o>x;x++){var b=s[x];if(b!=h&&b!=l&&b!=u&&n.PolyK._PointInTriangle(t[2*b],t[2*b+1],c,d,p,f,v,g)){m=!1;break}}}if(m)r.push(h,l,u),s.splice((a+1)%o,1),o--,a=0;else if(a++>3*o){if(!e)return console.log("PIXI Warning: shape too complex to fill"),[];var r=[];s=[];for(var a=0;i>a;a++)s.push(a);a=0,o=i,e=!1}}return r.push(s[0],s[1],s[2]),r},n.PolyK._PointInTriangle=function(t,e,i,r,n,s,a,o){var h=a-i,l=o-r,u=n-i,c=s-r,d=t-i,p=e-r,f=h*h+l*l,v=h*u+l*c,g=h*d+l*p,m=u*u+c*c,x=u*d+c*p,b=1/(f*m-v*v),y=(m*g-v*x)*b,T=(f*x-v*g)*b;return y>=0&&T>=0&&1>y+T},n.PolyK._convex=function(t,e,i,r,n,s,a){return(e-r)*(n-i)+(i-t)*(s-r)>=0==a},n.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;","}"],n.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform vec2 projectionVector;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position = vec4( aVertexPosition.x / projectionVector.x -1.0, aVertexPosition.y / -projectionVector.y + 1.0 , 0.0, 1.0);","vTextureCoord = aTextureCoord;","vColor = aColor;","}"],n.stripShaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform float alpha;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor = gl_FragColor * alpha;","}"],n.stripShaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat3 translationMatrix;","uniform vec2 projectionVector;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","vec3 v = translationMatrix * vec3(aVertexPosition, 1.0);","gl_Position = vec4( v.x / projectionVector.x -1.0, v.y / -projectionVector.y + 1.0 , 0.0, 1.0);","vTextureCoord = aTextureCoord;","vColor = aColor;","}"],n.primitiveShaderFragmentSrc=["precision mediump float;","varying vec4 vColor;","void main(void) {","gl_FragColor = vColor;","}"],n.primitiveShaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec4 aColor;","uniform mat3 translationMatrix;","uniform vec2 projectionVector;","uniform float alpha;","varying vec4 vColor;","void main(void) {","vec3 v = translationMatrix * vec3(aVertexPosition, 1.0);","gl_Position = vec4( v.x / projectionVector.x -1.0, v.y / -projectionVector.y + 1.0 , 0.0, 1.0);","vColor = aColor * alpha;","}"],n.initPrimitiveShader=function(){var t=n.gl,e=n.compileProgram(n.primitiveShaderVertexSrc,n.primitiveShaderFragmentSrc);t.useProgram(e),e.vertexPositionAttribute=t.getAttribLocation(e,"aVertexPosition"),e.colorAttribute=t.getAttribLocation(e,"aColor"),e.projectionVector=t.getUniformLocation(e,"projectionVector"),e.translationMatrix=t.getUniformLocation(e,"translationMatrix"),e.alpha=t.getUniformLocation(e,"alpha"),n.primitiveProgram=e},n.initDefaultShader=function(){var t=this.gl,e=n.compileProgram(n.shaderVertexSrc,n.shaderFragmentSrc);t.useProgram(e),e.vertexPositionAttribute=t.getAttribLocation(e,"aVertexPosition"),e.projectionVector=t.getUniformLocation(e,"projectionVector"),e.textureCoordAttribute=t.getAttribLocation(e,"aTextureCoord"),e.colorAttribute=t.getAttribLocation(e,"aColor"),e.samplerUniform=t.getUniformLocation(e,"uSampler"),n.shaderProgram=e},n.initDefaultStripShader=function(){var t=this.gl,e=n.compileProgram(n.stripShaderVertexSrc,n.stripShaderFragmentSrc);t.useProgram(e),e.vertexPositionAttribute=t.getAttribLocation(e,"aVertexPosition"),e.projectionVector=t.getUniformLocation(e,"projectionVector"),e.textureCoordAttribute=t.getAttribLocation(e,"aTextureCoord"),e.translationMatrix=t.getUniformLocation(e,"translationMatrix"),e.alpha=t.getUniformLocation(e,"alpha"),e.colorAttribute=t.getAttribLocation(e,"aColor"),e.projectionVector=t.getUniformLocation(e,"projectionVector"),e.samplerUniform=t.getUniformLocation(e,"uSampler"),n.stripShaderProgram=e},n.CompileVertexShader=function(t,e){return n._CompileShader(t,e,t.VERTEX_SHADER)},n.CompileFragmentShader=function(t,e){return n._CompileShader(t,e,t.FRAGMENT_SHADER)},n._CompileShader=function(t,e,i){var r=e.join("\n"),n=t.createShader(i);return t.shaderSource(n,r),t.compileShader(n),t.getShaderParameter(n,t.COMPILE_STATUS)?n:(alert(t.getShaderInfoLog(n)),null)},n.compileProgram=function(t,e){var i=n.gl,r=n.CompileFragmentShader(i,e),s=n.CompileVertexShader(i,t),a=i.createProgram();return i.attachShader(a,s),i.attachShader(a,r),i.linkProgram(a),i.getProgramParameter(a,i.LINK_STATUS)||alert("Could not initialise shaders"),a},n.activateDefaultShader=function(){var t=n.gl,e=n.shaderProgram;t.useProgram(e),t.enableVertexAttribArray(e.vertexPositionAttribute),t.enableVertexAttribArray(e.textureCoordAttribute),t.enableVertexAttribArray(e.colorAttribute)},n.activatePrimitiveShader=function(){var t=n.gl;t.disableVertexAttribArray(n.shaderProgram.textureCoordAttribute),t.disableVertexAttribArray(n.shaderProgram.colorAttribute),t.useProgram(n.primitiveProgram),t.enableVertexAttribArray(n.primitiveProgram.vertexPositionAttribute),t.enableVertexAttribArray(n.primitiveProgram.colorAttribute)},n.WebGLGraphics=function(){},n.WebGLGraphics.renderGraphics=function(t,e){var i=n.gl;t._webGL||(t._webGL={points:[],indices:[],lastIndex:0,buffer:i.createBuffer(),indexBuffer:i.createBuffer()}),t.dirty&&(t.dirty=!1,t.clearDirty&&(t.clearDirty=!1,t._webGL.lastIndex=0,t._webGL.points=[],t._webGL.indices=[]),n.WebGLGraphics.updateGraphics(t)),n.activatePrimitiveShader(); var r=n.mat3.clone(t.worldTransform);n.mat3.transpose(r),i.blendFunc(i.ONE,i.ONE_MINUS_SRC_ALPHA),i.uniformMatrix3fv(n.primitiveProgram.translationMatrix,!1,r),i.uniform2f(n.primitiveProgram.projectionVector,e.x,e.y),i.uniform1f(n.primitiveProgram.alpha,t.worldAlpha),i.bindBuffer(i.ARRAY_BUFFER,t._webGL.buffer),i.vertexAttribPointer(n.shaderProgram.vertexPositionAttribute,2,i.FLOAT,!1,0,0),i.vertexAttribPointer(n.primitiveProgram.vertexPositionAttribute,2,i.FLOAT,!1,24,0),i.vertexAttribPointer(n.primitiveProgram.colorAttribute,4,i.FLOAT,!1,24,8),i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,t._webGL.indexBuffer),i.drawElements(i.TRIANGLE_STRIP,t._webGL.indices.length,i.UNSIGNED_SHORT,0),n.activateDefaultShader()},n.WebGLGraphics.updateGraphics=function(t){for(var e=t._webGL.lastIndex;t.graphicsData.length>e;e++){var i=t.graphicsData[e];i.type==n.Graphics.POLY?(i.fill&&i.points.length>3&&n.WebGLGraphics.buildPoly(i,t._webGL),i.lineWidth>0&&n.WebGLGraphics.buildLine(i,t._webGL)):i.type==n.Graphics.RECT?n.WebGLGraphics.buildRectangle(i,t._webGL):(i.type==n.Graphics.CIRC||i.type==n.Graphics.ELIP)&&n.WebGLGraphics.buildCircle(i,t._webGL)}t._webGL.lastIndex=t.graphicsData.length;var r=n.gl;t._webGL.glPoints=new Float32Array(t._webGL.points),r.bindBuffer(r.ARRAY_BUFFER,t._webGL.buffer),r.bufferData(r.ARRAY_BUFFER,t._webGL.glPoints,r.STATIC_DRAW),t._webGL.glIndicies=new Uint16Array(t._webGL.indices),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,t._webGL.indexBuffer),r.bufferData(r.ELEMENT_ARRAY_BUFFER,t._webGL.glIndicies,r.STATIC_DRAW)},n.WebGLGraphics.buildRectangle=function(t,i){var r=t.points,s=r[0],a=r[1],o=r[2],h=r[3];if(t.fill){var l=e(t.fillColor),u=t.fillAlpha,c=l[0]*u,d=l[1]*u,p=l[2]*u,f=i.points,v=i.indices,g=f.length/6;f.push(s,a),f.push(c,d,p,u),f.push(s+o,a),f.push(c,d,p,u),f.push(s,a+h),f.push(c,d,p,u),f.push(s+o,a+h),f.push(c,d,p,u),v.push(g,g,g+1,g+2,g+3,g+3)}t.lineWidth&&(t.points=[s,a,s+o,a,s+o,a+h,s,a+h,s,a],n.WebGLGraphics.buildLine(t,i))},n.WebGLGraphics.buildCircle=function(t,i){var r=t.points,s=r[0],a=r[1],o=r[2],h=r[3],l=40,u=2*Math.PI/l;if(t.fill){var c=e(t.fillColor),d=t.fillAlpha,p=c[0]*d,f=c[1]*d,v=c[2]*d,g=i.points,m=i.indices,x=g.length/6;m.push(x);for(var b=0;l+1>b;b++)g.push(s,a,p,f,v,d),g.push(s+Math.sin(u*b)*o,a+Math.cos(u*b)*h,p,f,v,d),m.push(x++,x++);m.push(x-1)}if(t.lineWidth){t.points=[];for(var b=0;l+1>b;b++)t.points.push(s+Math.sin(u*b)*o,a+Math.cos(u*b)*h);n.WebGLGraphics.buildLine(t,i)}},n.WebGLGraphics.buildLine=function(t,i){var r=t.points;if(0!=r.length){var s=new n.Point(r[0],r[1]),a=new n.Point(r[r.length-2],r[r.length-1]);if(s.x==a.x&&s.y==a.y){r.pop(),r.pop(),a=new n.Point(r[r.length-2],r[r.length-1]);var o=a.x+.5*(s.x-a.x),h=a.y+.5*(s.y-a.y);r.unshift(o,h),r.push(o,h)}var l,u,c,d,p,f,v,g,m,x,b,y,T,_,w,A,R,S,C,L,E,P=i.points,B=i.indices,F=r.length/2,G=r.length,I=P.length/6,D=t.lineWidth/2,M=e(t.lineColor),O=t.lineAlpha,W=M[0]*O,U=M[1]*O,j=M[2]*O;l=r[0],u=r[1],c=r[2],d=r[3],v=-(u-d),g=l-c,E=Math.sqrt(v*v+g*g),v/=E,g/=E,v*=D,g*=D,P.push(l-v,u-g,W,U,j,O),P.push(l+v,u+g,W,U,j,O);for(var k=1;F-1>k;k++)l=r[2*(k-1)],u=r[2*(k-1)+1],c=r[2*k],d=r[2*k+1],p=r[2*(k+1)],f=r[2*(k+1)+1],v=-(u-d),g=l-c,E=Math.sqrt(v*v+g*g),v/=E,g/=E,v*=D,g*=D,m=-(d-f),x=c-p,E=Math.sqrt(m*m+x*x),m/=E,x/=E,m*=D,x*=D,T=-g+u-(-g+d),_=-v+c-(-v+l),w=(-v+l)*(-g+d)-(-v+c)*(-g+u),A=-x+f-(-x+d),R=-m+c-(-m+p),S=(-m+p)*(-x+d)-(-m+c)*(-x+f),C=T*R-A*_,0==C&&(C+=1),px=(_*S-R*w)/C,py=(A*w-T*S)/C,L=(px-c)*(px-c)+(py-d)+(py-d),L>19600?(b=v-m,y=g-x,E=Math.sqrt(b*b+y*y),b/=E,y/=E,b*=D,y*=D,P.push(c-b,d-y),P.push(W,U,j,O),P.push(c+b,d+y),P.push(W,U,j,O),P.push(c-b,d-y),P.push(W,U,j,O),G++):(P.push(px,py),P.push(W,U,j,O),P.push(c-(px-c),d-(py-d)),P.push(W,U,j,O));l=r[2*(F-2)],u=r[2*(F-2)+1],c=r[2*(F-1)],d=r[2*(F-1)+1],v=-(u-d),g=l-c,E=Math.sqrt(v*v+g*g),v/=E,g/=E,v*=D,g*=D,P.push(c-v,d-g),P.push(W,U,j,O),P.push(c+v,d+g),P.push(W,U,j,O),B.push(I);for(var k=0;G>k;k++)B.push(I++);B.push(I-1)}},n.WebGLGraphics.buildPoly=function(t,i){var r=t.points;if(!(6>r.length)){for(var s=i.points,a=i.indices,o=r.length/2,h=e(t.fillColor),l=t.fillAlpha,u=h[0]*l,c=h[1]*l,d=h[2]*l,p=n.PolyK.Triangulate(r),f=s.length/6,v=0;p.length>v;v+=3)a.push(p[v]+f),a.push(p[v]+f),a.push(p[v+1]+f),a.push(p[v+2]+f),a.push(p[v+2]+f);for(var v=0;o>v;v++)s.push(r[2*v],r[2*v+1],u,c,d,l)}},n._defaultFrame=new n.Rectangle(0,0,1,1),n.gl,n.WebGLRenderer=function(t,e,i,r){this.transparent=!!r,this.width=t||800,this.height=e||600,this.view=i||document.createElement("canvas"),this.view.width=this.width,this.view.height=this.height;var s=this;this.view.addEventListener("webglcontextlost",function(t){s.handleContextLost(t)},!1),this.view.addEventListener("webglcontextrestored",function(t){s.handleContextRestored(t)},!1),this.batchs=[];try{n.gl=this.gl=this.view.getContext("experimental-webgl",{alpha:this.transparent,antialias:!0,premultipliedAlpha:!1,stencil:!0})}catch(a){throw Error(" This browser does not support webGL. Try using the canvas renderer"+this)}n.initPrimitiveShader(),n.initDefaultShader(),n.initDefaultStripShader(),n.activateDefaultShader();var o=this.gl;n.WebGLRenderer.gl=o,this.batch=new n.WebGLBatch(o),o.disable(o.DEPTH_TEST),o.disable(o.CULL_FACE),o.enable(o.BLEND),o.colorMask(!0,!0,!0,this.transparent),n.projection=new n.Point(400,300),this.resize(this.width,this.height),this.contextLost=!1,this.stageRenderGroup=new n.WebGLRenderGroup(this.gl)},n.WebGLRenderer.constructor=n.WebGLRenderer,n.WebGLRenderer.getBatch=function(){return 0==n._batchs.length?new n.WebGLBatch(n.WebGLRenderer.gl):n._batchs.pop()},n.WebGLRenderer.returnBatch=function(t){t.clean(),n._batchs.push(t)},n.WebGLRenderer.prototype.render=function(t){if(!this.contextLost){this.__stage!==t&&(this.__stage=t,this.stageRenderGroup.setRenderable(t)),n.WebGLRenderer.updateTextures(),t.updateTransform();var e=this.gl;if(e.colorMask(!0,!0,!0,this.transparent),e.viewport(0,0,this.width,this.height),e.bindFramebuffer(e.FRAMEBUFFER,null),e.clearColor(t.backgroundColorSplit[0],t.backgroundColorSplit[1],t.backgroundColorSplit[2],!this.transparent),e.clear(e.COLOR_BUFFER_BIT),this.stageRenderGroup.backgroundColor=t.backgroundColorSplit,this.stageRenderGroup.render(n.projection),t.interactive&&(t._interactiveEventsAdded||(t._interactiveEventsAdded=!0,t.interactionManager.setTarget(this))),n.Texture.frameUpdates.length>0){for(var i=0;n.Texture.frameUpdates.length>i;i++)n.Texture.frameUpdates[i].updateFrame=!1;n.Texture.frameUpdates=[]}}},n.WebGLRenderer.updateTextures=function(){for(var t=0;n.texturesToUpdate.length>t;t++)this.updateTexture(n.texturesToUpdate[t]);for(var t=0;n.texturesToDestroy.length>t;t++)this.destroyTexture(n.texturesToDestroy[t]);n.texturesToUpdate=[],n.texturesToDestroy=[]},n.WebGLRenderer.updateTexture=function(t){var e=n.gl;t._glTexture||(t._glTexture=e.createTexture()),t.hasLoaded&&(e.bindTexture(e.TEXTURE_2D,t._glTexture),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,t.source),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),t._powerOf2?(e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.REPEAT)):(e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE)),e.bindTexture(e.TEXTURE_2D,null))},n.WebGLRenderer.prototype.destroyTexture=function(t){var e=this.gl;t._glTexture&&(t._glTexture=e.createTexture(),e.deleteTexture(e.TEXTURE_2D,t._glTexture))},n.WebGLRenderer.prototype.resize=function(t,e){this.width=t,this.height=e,this.view.width=t,this.view.height=e,this.gl.viewport(0,0,this.width,this.height),n.projection.x=this.width/2,n.projection.y=this.height/2},n.WebGLRenderer.prototype.handleContextLost=function(t){t.preventDefault(),this.contextLost=!0},n.WebGLRenderer.prototype.handleContextRestored=function(){this.gl=this.view.getContext("experimental-webgl",{alpha:!0}),this.initShaders();for(var t in n.TextureCache){var e=n.TextureCache[t].baseTexture;e._glTexture=null,n.WebGLRenderer.updateTexture(e)}for(var i=0;this.batchs.length>i;i++)this.batchs[i].restoreLostContext(this.gl),this.batchs[i].dirty=!0;n._restoreBatchs(this.gl),this.contextLost=!1},n._batchs=[],n._getBatch=function(t){return 0==n._batchs.length?new n.WebGLBatch(t):n._batchs.pop()},n._returnBatch=function(t){t.clean(),n._batchs.push(t)},n._restoreBatchs=function(t){for(var e=0;n._batchs.length>e;e++)n._batchs[e].restoreLostContext(t)},n.WebGLBatch=function(t){this.gl=t,this.size=0,this.vertexBuffer=t.createBuffer(),this.indexBuffer=t.createBuffer(),this.uvBuffer=t.createBuffer(),this.colorBuffer=t.createBuffer(),this.blendMode=n.blendModes.NORMAL,this.dynamicSize=1},n.WebGLBatch.constructor=n.WebGLBatch,n.WebGLBatch.prototype.clean=function(){this.verticies=[],this.uvs=[],this.indices=[],this.colors=[],this.dynamicSize=1,this.texture=null,this.last=null,this.size=0,this.head,this.tail},n.WebGLBatch.prototype.restoreLostContext=function(t){this.gl=t,this.vertexBuffer=t.createBuffer(),this.indexBuffer=t.createBuffer(),this.uvBuffer=t.createBuffer(),this.colorBuffer=t.createBuffer()},n.WebGLBatch.prototype.init=function(t){t.batch=this,this.dirty=!0,this.blendMode=t.blendMode,this.texture=t.texture.baseTexture,this.head=t,this.tail=t,this.size=1,this.growBatch()},n.WebGLBatch.prototype.insertBefore=function(t,e){this.size++,t.batch=this,this.dirty=!0;var i=e.__prev;e.__prev=t,t.__next=e,i?(t.__prev=i,i.__next=t):this.head=t},n.WebGLBatch.prototype.insertAfter=function(t,e){this.size++,t.batch=this,this.dirty=!0;var i=e.__next;e.__next=t,t.__prev=e,i?(t.__next=i,i.__prev=t):this.tail=t},n.WebGLBatch.prototype.remove=function(t){return this.size--,0==this.size?(t.batch=null,t.__prev=null,t.__next=null,void 0):(t.__prev?t.__prev.__next=t.__next:(this.head=t.__next,this.head.__prev=null),t.__next?t.__next.__prev=t.__prev:(this.tail=t.__prev,this.tail.__next=null),t.batch=null,t.__next=null,t.__prev=null,this.dirty=!0,void 0)},n.WebGLBatch.prototype.split=function(t){this.dirty=!0;var e=new n.WebGLBatch(this.gl);e.init(t),e.texture=this.texture,e.tail=this.tail,this.tail=t.__prev,this.tail.__next=null,t.__prev=null;for(var i=0;t;)i++,t.batch=e,t=t.__next;return e.size=i,this.size-=i,e},n.WebGLBatch.prototype.merge=function(t){this.dirty=!0,this.tail.__next=t.head,t.head.__prev=this.tail,this.size+=t.size,this.tail=t.tail;for(var e=t.head;e;)e.batch=this,e=e.__next},n.WebGLBatch.prototype.growBatch=function(){var t=this.gl;this.dynamicSize=1==this.size?1:1.5*this.size,this.verticies=new Float32Array(8*this.dynamicSize),t.bindBuffer(t.ARRAY_BUFFER,this.vertexBuffer),t.bufferData(t.ARRAY_BUFFER,this.verticies,t.DYNAMIC_DRAW),this.uvs=new Float32Array(8*this.dynamicSize),t.bindBuffer(t.ARRAY_BUFFER,this.uvBuffer),t.bufferData(t.ARRAY_BUFFER,this.uvs,t.DYNAMIC_DRAW),this.dirtyUVS=!0,this.colors=new Float32Array(4*this.dynamicSize),t.bindBuffer(t.ARRAY_BUFFER,this.colorBuffer),t.bufferData(t.ARRAY_BUFFER,this.colors,t.DYNAMIC_DRAW),this.dirtyColors=!0,this.indices=new Uint16Array(6*this.dynamicSize);for(var e=this.indices.length/6,i=0;e>i;i++){var r=6*i,n=4*i;this.indices[r+0]=n+0,this.indices[r+1]=n+1,this.indices[r+2]=n+2,this.indices[r+3]=n+0,this.indices[r+4]=n+2,this.indices[r+5]=n+3}t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indexBuffer),t.bufferData(t.ELEMENT_ARRAY_BUFFER,this.indices,t.STATIC_DRAW)},n.WebGLBatch.prototype.refresh=function(){this.gl,this.dynamicSizer;r++)i=this.batchs[r],i instanceof n.WebGLBatch?this.batchs[r].render():i instanceof n.TilingSprite?i.visible&&this.renderTilingSprite(i,t):i instanceof n.Strip?i.visible&&this.renderStrip(i,t):i instanceof n.Graphics?i.visible&&i.renderable&&n.WebGLGraphics.renderGraphics(i,t):i instanceof n.FilterBlock&&(i.open?(e.enable(e.STENCIL_TEST),e.colorMask(!1,!1,!1,!1),e.stencilFunc(e.ALWAYS,1,255),e.stencilOp(e.KEEP,e.KEEP,e.REPLACE),n.WebGLGraphics.renderGraphics(i.mask,t),e.colorMask(!0,!0,!0,!1),e.stencilFunc(e.NOTEQUAL,0,255),e.stencilOp(e.KEEP,e.KEEP,e.KEEP)):e.disable(e.STENCIL_TEST))},n.WebGLRenderGroup.prototype.handleFilter=function(){},n.WebGLRenderGroup.prototype.renderSpecific=function(t,e){n.WebGLRenderer.updateTextures();var i=this.gl;this.checkVisibility(t,t.visible),i.uniform2f(n.shaderProgram.projectionVector,e.x,e.y);for(var r,s,a,o,h=t.last;h._iNext&&(h=h._iNext,!h.renderable||!h.__renderGroup););var l=h.batch;if(h instanceof n.Sprite){l=h.batch;var u=l.head;if(u==h)r=0;else for(r=1;u.__next!=h;)r++,u=u.__next}else l=h;for(var c,d=t,p=t;p.children.length>0;)p=p.children[p.children.length-1],p.renderable&&(d=p);if(d instanceof n.Sprite){c=d.batch;var u=c.head;if(u==d)a=0;else for(a=1;u.__next!=d;)a++,u=u.__next}else c=d;if(l==c)return l instanceof n.WebGLBatch?l.render(r,a+1):this.renderSpecial(l),void 0;s=this.batchs.indexOf(l),o=this.batchs.indexOf(c),l instanceof n.WebGLBatch?l.render(r):this.renderSpecial(l);for(var f=s+1;o>f;f++)renderable=this.batchs[f],renderable instanceof n.WebGLBatch?this.batchs[f].render():this.renderSpecial(renderable);c instanceof n.WebGLBatch?c.render(0,a+1):this.renderSpecial(c)},n.WebGLRenderGroup.prototype.renderSpecial=function(t){t instanceof n.TilingSprite?t.visible&&this.renderTilingSprite(t,projectionMatrix):t instanceof n.Strip?t.visible&&this.renderStrip(t,projectionMatrix):t instanceof n.CustomRenderable?t.visible&&t.renderWebGL(this,projectionMatrix):t instanceof n.Graphics?t.visible&&t.renderable&&n.WebGLGraphics.renderGraphics(t):t instanceof n.FilterBlock&&(t.open?(gl.enable(gl.STENCIL_TEST),gl.colorMask(!1,!1,!1,!1),gl.stencilFunc(gl.ALWAYS,1,255),gl.stencilOp(gl.KEEP,gl.KEEP,gl.REPLACE),n.WebGLGraphics.renderGraphics(t.mask,projection),gl.colorMask(!0,!0,!0,!1),gl.stencilFunc(gl.NOTEQUAL,0,255),gl.stencilOp(gl.KEEP,gl.KEEP,gl.KEEP)):gl.disable(gl.STENCIL_TEST))},n.WebGLRenderGroup.prototype.checkVisibility=function(t,e){for(var i=t.children,r=0;i.length>r;r++){var n=i[r];n.worldVisible=n.visible&&e,n.textureChange&&(n.textureChange=!1,n.worldVisible&&this.updateTexture(n)),n.children.length>0&&this.checkVisibility(n,n.worldVisible)}},n.WebGLRenderGroup.prototype.updateTexture=function(t){this.removeObject(t);for(var e=t.first;e!=this.root&&(e=e._iPrev,!e.renderable||!e.__renderGroup););for(var i=t.last;i._iNext&&(i=i._iNext,!i.renderable||!i.__renderGroup););this.insertObject(t,e,i)},n.WebGLRenderGroup.prototype.addFilterBlocks=function(t,e){t.__renderGroup=this,e.__renderGroup=this;for(var i=t;i!=this.root&&(i=i._iPrev,!i.renderable||!i.__renderGroup););this.insertAfter(t,i);for(var r=e;r!=this.root&&(r=r._iPrev,!r.renderable||!r.__renderGroup););this.insertAfter(e,r)},n.WebGLRenderGroup.prototype.removeFilterBlocks=function(t,e){this.removeObject(t),this.removeObject(e)},n.WebGLRenderGroup.prototype.addDisplayObjectAndChildren=function(t){t.__renderGroup&&t.__renderGroup.removeDisplayObjectAndChildren(t);for(var e=t.first;e!=this.root&&(e=e._iPrev,!e.renderable||!e.__renderGroup););for(var i=t.last;i._iNext&&(i=i._iNext,!i.renderable||!i.__renderGroup););var r=t.first,n=t.last._iNext;do r.__renderGroup=this,r.renderable&&(this.insertObject(r,e,i),e=r),r=r._iNext;while(r!=n)},n.WebGLRenderGroup.prototype.removeDisplayObjectAndChildren=function(t){if(t.__renderGroup==this){t.last;do t.__renderGroup=null,t.renderable&&this.removeObject(t),t=t._iNext;while(t)}},n.WebGLRenderGroup.prototype.insertObject=function(t,e,i){var r=e,s=i;if(t instanceof n.Sprite){var a,o;if(r instanceof n.Sprite){if(a=r.batch,a&&a.texture==t.texture.baseTexture&&a.blendMode==t.blendMode)return a.insertAfter(t,r),void 0}else a=r;if(s)if(s instanceof n.Sprite){if(o=s.batch){if(o.texture==t.texture.baseTexture&&o.blendMode==t.blendMode)return o.insertBefore(t,s),void 0;if(o==a){var h=a.split(s),l=n.WebGLRenderer.getBatch(),u=this.batchs.indexOf(a);return l.init(t),this.batchs.splice(u+1,0,l,h),void 0}}}else o=s;var l=n.WebGLRenderer.getBatch();if(l.init(t),a){var u=this.batchs.indexOf(a);this.batchs.splice(u+1,0,l)}else this.batchs.push(l)}else t instanceof n.TilingSprite?this.initTilingSprite(t):t instanceof n.Strip&&this.initStrip(t),this.insertAfter(t,r)},n.WebGLRenderGroup.prototype.insertAfter=function(t,e){if(e instanceof n.Sprite){var i=e.batch;if(i)if(i.tail==e){var r=this.batchs.indexOf(i);this.batchs.splice(r+1,0,t)}else{var s=i.split(e.__next),r=this.batchs.indexOf(i);this.batchs.splice(r+1,0,t,s)}else this.batchs.push(t)}else{var r=this.batchs.indexOf(e);this.batchs.splice(r+1,0,t)}},n.WebGLRenderGroup.prototype.removeObject=function(t){var e;if(t instanceof n.Sprite){var i=t.batch;if(!i)return;i.remove(t),0==i.size&&(e=i)}else e=t;if(e){var r=this.batchs.indexOf(e);if(-1==r)return;if(0==r||r==this.batchs.length-1)return this.batchs.splice(r,1),e instanceof n.WebGLBatch&&n.WebGLRenderer.returnBatch(e),void 0;if(this.batchs[r-1]instanceof n.WebGLBatch&&this.batchs[r+1]instanceof n.WebGLBatch&&this.batchs[r-1].texture==this.batchs[r+1].texture&&this.batchs[r-1].blendMode==this.batchs[r+1].blendMode)return this.batchs[r-1].merge(this.batchs[r+1]),e instanceof n.WebGLBatch&&n.WebGLRenderer.returnBatch(e),n.WebGLRenderer.returnBatch(this.batchs[r+1]),this.batchs.splice(r,2),void 0;this.batchs.splice(r,1),e instanceof n.WebGLBatch&&n.WebGLRenderer.returnBatch(e)}},n.WebGLRenderGroup.prototype.initTilingSprite=function(t){var e=this.gl;t.verticies=new Float32Array([0,0,t.width,0,t.width,t.height,0,t.height]),t.uvs=new Float32Array([0,0,1,0,1,1,0,1]),t.colors=new Float32Array([1,1,1,1]),t.indices=new Uint16Array([0,1,3,2]),t._vertexBuffer=e.createBuffer(),t._indexBuffer=e.createBuffer(),t._uvBuffer=e.createBuffer(),t._colorBuffer=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,t._vertexBuffer),e.bufferData(e.ARRAY_BUFFER,t.verticies,e.STATIC_DRAW),e.bindBuffer(e.ARRAY_BUFFER,t._uvBuffer),e.bufferData(e.ARRAY_BUFFER,t.uvs,e.DYNAMIC_DRAW),e.bindBuffer(e.ARRAY_BUFFER,t._colorBuffer),e.bufferData(e.ARRAY_BUFFER,t.colors,e.STATIC_DRAW),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t._indexBuffer),e.bufferData(e.ELEMENT_ARRAY_BUFFER,t.indices,e.STATIC_DRAW),t.texture.baseTexture._glTexture?(e.bindTexture(e.TEXTURE_2D,t.texture.baseTexture._glTexture),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.REPEAT),t.texture.baseTexture._powerOf2=!0):t.texture.baseTexture._powerOf2=!0},n.WebGLRenderGroup.prototype.renderStrip=function(t,e){var i=this.gl,r=n.shaderProgram;i.useProgram(n.stripShaderProgram);var s=n.mat3.clone(t.worldTransform);n.mat3.transpose(s),i.uniformMatrix3fv(n.stripShaderProgram.translationMatrix,!1,s),i.uniform2f(n.stripShaderProgram.projectionVector,e.x,e.y),i.uniform1f(n.stripShaderProgram.alpha,t.worldAlpha),t.dirty?(t.dirty=!1,i.bindBuffer(i.ARRAY_BUFFER,t._vertexBuffer),i.bufferData(i.ARRAY_BUFFER,t.verticies,i.STATIC_DRAW),i.vertexAttribPointer(r.vertexPositionAttribute,2,i.FLOAT,!1,0,0),i.bindBuffer(i.ARRAY_BUFFER,t._uvBuffer),i.bufferData(i.ARRAY_BUFFER,t.uvs,i.STATIC_DRAW),i.vertexAttribPointer(r.textureCoordAttribute,2,i.FLOAT,!1,0,0),i.activeTexture(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,t.texture.baseTexture._glTexture),i.bindBuffer(i.ARRAY_BUFFER,t._colorBuffer),i.bufferData(i.ARRAY_BUFFER,t.colors,i.STATIC_DRAW),i.vertexAttribPointer(r.colorAttribute,1,i.FLOAT,!1,0,0),i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,t._indexBuffer),i.bufferData(i.ELEMENT_ARRAY_BUFFER,t.indices,i.STATIC_DRAW)):(i.bindBuffer(i.ARRAY_BUFFER,t._vertexBuffer),i.bufferSubData(i.ARRAY_BUFFER,0,t.verticies),i.vertexAttribPointer(r.vertexPositionAttribute,2,i.FLOAT,!1,0,0),i.bindBuffer(i.ARRAY_BUFFER,t._uvBuffer),i.vertexAttribPointer(r.textureCoordAttribute,2,i.FLOAT,!1,0,0),i.activeTexture(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,t.texture.baseTexture._glTexture),i.bindBuffer(i.ARRAY_BUFFER,t._colorBuffer),i.vertexAttribPointer(r.colorAttribute,1,i.FLOAT,!1,0,0),i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,t._indexBuffer)),i.drawElements(i.TRIANGLE_STRIP,t.indices.length,i.UNSIGNED_SHORT,0),i.useProgram(n.shaderProgram)},n.WebGLRenderGroup.prototype.renderTilingSprite=function(t,e){var i=this.gl;n.shaderProgram;var r=t.tilePosition,s=t.tileScale,a=r.x/t.texture.baseTexture.width,o=r.y/t.texture.baseTexture.height,h=t.width/t.texture.baseTexture.width/s.x,l=t.height/t.texture.baseTexture.height/s.y;t.uvs[0]=0-a,t.uvs[1]=0-o,t.uvs[2]=1*h-a,t.uvs[3]=0-o,t.uvs[4]=1*h-a,t.uvs[5]=1*l-o,t.uvs[6]=0-a,t.uvs[7]=1*l-o,i.bindBuffer(i.ARRAY_BUFFER,t._uvBuffer),i.bufferSubData(i.ARRAY_BUFFER,0,t.uvs),this.renderStrip(t,e)},n.WebGLRenderGroup.prototype.initStrip=function(t){var e=this.gl;this.shaderProgram,t._vertexBuffer=e.createBuffer(),t._indexBuffer=e.createBuffer(),t._uvBuffer=e.createBuffer(),t._colorBuffer=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,t._vertexBuffer),e.bufferData(e.ARRAY_BUFFER,t.verticies,e.DYNAMIC_DRAW),e.bindBuffer(e.ARRAY_BUFFER,t._uvBuffer),e.bufferData(e.ARRAY_BUFFER,t.uvs,e.STATIC_DRAW),e.bindBuffer(e.ARRAY_BUFFER,t._colorBuffer),e.bufferData(e.ARRAY_BUFFER,t.colors,e.STATIC_DRAW),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t._indexBuffer),e.bufferData(e.ELEMENT_ARRAY_BUFFER,t.indices,e.STATIC_DRAW)},n.CanvasRenderer=function(t,e,i,r){this.transparent=r,this.width=t||800,this.height=e||600,this.refresh=!0,this.view=i||document.createElement("canvas"),this.view.width=this.width,this.view.height=this.height,this.count=0,this.context=this.view.getContext("2d")},n.CanvasRenderer.constructor=n.CanvasRenderer,n.CanvasRenderer.prototype.render=function(t){n.texturesToUpdate=[],n.texturesToDestroy=[],t.updateTransform(),this.view.style.backgroundColor==t.backgroundColorString||this.transparent||(this.view.style.backgroundColor=t.backgroundColorString),this.context.setTransform(1,0,0,1,0,0),this.context.clearRect(0,0,this.width,this.height),this.renderDisplayObject(t),t.interactive&&(t._interactiveEventsAdded||(t._interactiveEventsAdded=!0,t.interactionManager.setTarget(this))),n.Texture.frameUpdates.length>0&&(n.Texture.frameUpdates=[])},n.CanvasRenderer.prototype.resize=function(t,e){this.width=t,this.height=e,this.view.width=t,this.view.height=e},n.CanvasRenderer.prototype.renderDisplayObject=function(t){var e,i=this.context;i.globalCompositeOperation="source-over";var r=t.last._iNext;t=t.first;do if(e=t.worldTransform,t.visible)if(t.renderable){if(t instanceof n.Sprite){var s=t.texture.frame;s&&(i.globalAlpha=t.worldAlpha,i.setTransform(e[0],e[3],e[1],e[4],e[2],e[5]),i.drawImage(t.texture.baseTexture.source,s.x,s.y,s.width,s.height,t.anchor.x*-s.width,t.anchor.y*-s.height,s.width,s.height))}else if(t instanceof n.Strip)i.setTransform(e[0],e[3],e[1],e[4],e[2],e[5]),this.renderStrip(t);else if(t instanceof n.TilingSprite)i.setTransform(e[0],e[3],e[1],e[4],e[2],e[5]),this.renderTilingSprite(t);else if(t instanceof n.CustomRenderable)t.renderCanvas(this);else if(t instanceof n.Graphics)i.setTransform(e[0],e[3],e[1],e[4],e[2],e[5]),n.CanvasGraphics.renderGraphics(t,i);else if(t instanceof n.FilterBlock)if(t.open){i.save();var a=t.mask.alpha,o=t.mask.worldTransform;i.setTransform(o[0],o[3],o[1],o[4],o[2],o[5]),t.mask.worldAlpha=.5,i.worldAlpha=0,n.CanvasGraphics.renderGraphicsMask(t.mask,i),i.clip(),t.mask.worldAlpha=a}else i.restore();t=t._iNext}else t=t._iNext;else t=t.last._iNext;while(t!=r)},n.CanvasRenderer.prototype.renderStripFlat=function(t){var e=this.context,i=t.verticies;t.uvs;var r=i.length/2;this.count++,e.beginPath();for(var n=1;r-2>n;n++){var s=2*n,a=i[s],o=i[s+2],h=i[s+4],l=i[s+1],u=i[s+3],c=i[s+5];e.moveTo(a,l),e.lineTo(o,u),e.lineTo(h,c)}e.fillStyle="#FF0000",e.fill(),e.closePath()},n.CanvasRenderer.prototype.renderTilingSprite=function(t){var e=this.context;e.globalAlpha=t.worldAlpha,t.__tilePattern||(t.__tilePattern=e.createPattern(t.texture.baseTexture.source,"repeat")),e.beginPath();var i=t.tilePosition,r=t.tileScale;e.scale(r.x,r.y),e.translate(i.x,i.y),e.fillStyle=t.__tilePattern,e.fillRect(-i.x,-i.y,t.width/r.x,t.height/r.y),e.scale(1/r.x,1/r.y),e.translate(-i.x,-i.y),e.closePath()},n.CanvasRenderer.prototype.renderStrip=function(t){var e=this.context,i=t.verticies,r=t.uvs,n=i.length/2;this.count++;for(var s=1;n-2>s;s++){var a=2*s,o=i[a],h=i[a+2],l=i[a+4],u=i[a+1],c=i[a+3],d=i[a+5],p=r[a]*t.texture.width,f=r[a+2]*t.texture.width,v=r[a+4]*t.texture.width,g=r[a+1]*t.texture.height,m=r[a+3]*t.texture.height,x=r[a+5]*t.texture.height;e.save(),e.beginPath(),e.moveTo(o,u),e.lineTo(h,c),e.lineTo(l,d),e.closePath(),e.clip();var b=p*m+g*v+f*x-m*v-g*f-p*x,y=o*m+g*l+h*x-m*l-g*h-o*x,T=p*h+o*v+f*l-h*v-o*f-p*l,_=p*m*l+g*h*v+o*f*x-o*m*v-g*f*l-p*h*x,w=u*m+g*d+c*x-m*d-g*c-u*x,A=p*c+u*v+f*d-c*v-u*f-p*d,R=p*m*d+g*c*v+u*f*x-u*m*v-g*f*d-p*c*x;e.transform(y/b,w/b,T/b,A/b,_/b,R/b),e.drawImage(t.texture.baseTexture.source,0,0),e.restore()}},n.CanvasGraphics=function(){},n.CanvasGraphics.renderGraphics=function(t,e){for(var i=t.worldAlpha,r=0;t.graphicsData.length>r;r++){var s=t.graphicsData[r],a=s.points;if(e.strokeStyle=color="#"+("00000"+(0|s.lineColor).toString(16)).substr(-6),e.lineWidth=s.lineWidth,s.type==n.Graphics.POLY){e.beginPath(),e.moveTo(a[0],a[1]);for(var o=1;a.length/2>o;o++)e.lineTo(a[2*o],a[2*o+1]);a[0]==a[a.length-2]&&a[1]==a[a.length-1]&&e.closePath(),s.fill&&(e.globalAlpha=s.fillAlpha*i,e.fillStyle=color="#"+("00000"+(0|s.fillColor).toString(16)).substr(-6),e.fill()),s.lineWidth&&(e.globalAlpha=s.lineAlpha*i,e.stroke())}else if(s.type==n.Graphics.RECT)s.fillColor&&(e.globalAlpha=s.fillAlpha*i,e.fillStyle=color="#"+("00000"+(0|s.fillColor).toString(16)).substr(-6),e.rect(a[0],a[1],a[2],a[3])),s.lineWidth&&(e.globalAlpha=s.lineAlpha*i,e.strokeRect(a[0],a[1],a[2],a[3]));else if(s.type==n.Graphics.CIRC)e.beginPath(),e.arc(a[0],a[1],a[2],0,2*Math.PI),e.closePath(),s.fill&&(e.globalAlpha=s.fillAlpha*i,e.fillStyle=color="#"+("00000"+(0|s.fillColor).toString(16)).substr(-6),e.fill()),s.lineWidth&&(e.globalAlpha=s.lineAlpha*i,e.stroke());else if(s.type==n.Graphics.ELIP){var h=s.points,l=2*h[2],u=2*h[3],c=h[0]-l/2,d=h[1]-u/2;e.beginPath();var p=.5522848,f=l/2*p,v=u/2*p,g=c+l,m=d+u,x=c+l/2,b=d+u/2;e.moveTo(c,b),e.bezierCurveTo(c,b-v,x-f,d,x,d),e.bezierCurveTo(x+f,d,g,b-v,g,b),e.bezierCurveTo(g,b+v,x+f,m,x,m),e.bezierCurveTo(x-f,m,c,b+v,c,b),e.closePath(),s.fill&&(e.globalAlpha=s.fillAlpha*i,e.fillStyle=color="#"+("00000"+(0|s.fillColor).toString(16)).substr(-6),e.fill()),s.lineWidth&&(e.globalAlpha=s.lineAlpha*i,e.stroke())}}},n.CanvasGraphics.renderGraphicsMask=function(t,e){t.worldAlpha;var i=t.graphicsData.length;i>1&&(i=1,console.log("Pixi.js warning: masks in canvas can only mask using the first path in the graphics object"));for(var r=0;1>r;r++){var s=t.graphicsData[r],a=s.points;if(s.type==n.Graphics.POLY){e.beginPath(),e.moveTo(a[0],a[1]);for(var o=1;a.length/2>o;o++)e.lineTo(a[2*o],a[2*o+1]);a[0]==a[a.length-2]&&a[1]==a[a.length-1]&&e.closePath()}else if(s.type==n.Graphics.RECT)e.beginPath(),e.rect(a[0],a[1],a[2],a[3]),e.closePath();else if(s.type==n.Graphics.CIRC)e.beginPath(),e.arc(a[0],a[1],a[2],0,2*Math.PI),e.closePath();else if(s.type==n.Graphics.ELIP){var h=s.points,l=2*h[2],u=2*h[3],c=h[0]-l/2,d=h[1]-u/2;e.beginPath();var p=.5522848,f=l/2*p,v=u/2*p,g=c+l,m=d+u,x=c+l/2,b=d+u/2;e.moveTo(c,b),e.bezierCurveTo(c,b-v,x-f,d,x,d),e.bezierCurveTo(x+f,d,g,b-v,g,b),e.bezierCurveTo(g,b+v,x+f,m,x,m),e.bezierCurveTo(x-f,m,c,b+v,c,b),e.closePath()}}},n.Graphics=function(){n.DisplayObjectContainer.call(this),this.renderable=!0,this.fillAlpha=1,this.lineWidth=0,this.lineColor="black",this.graphicsData=[],this.currentPath={points:[]}},n.Graphics.constructor=n.Graphics,n.Graphics.prototype=Object.create(n.DisplayObjectContainer.prototype),n.Graphics.prototype.lineStyle=function(t,e,i){0==this.currentPath.points.length&&this.graphicsData.pop(),this.lineWidth=t||0,this.lineColor=e||0,this.lineAlpha=void 0==i?1:i,this.currentPath={lineWidth:this.lineWidth,lineColor:this.lineColor,lineAlpha:this.lineAlpha,fillColor:this.fillColor,fillAlpha:this.fillAlpha,fill:this.filling,points:[],type:n.Graphics.POLY},this.graphicsData.push(this.currentPath)},n.Graphics.prototype.moveTo=function(t,e){0==this.currentPath.points.length&&this.graphicsData.pop(),this.currentPath=this.currentPath={lineWidth:this.lineWidth,lineColor:this.lineColor,lineAlpha:this.lineAlpha,fillColor:this.fillColor,fillAlpha:this.fillAlpha,fill:this.filling,points:[],type:n.Graphics.POLY},this.currentPath.points.push(t,e),this.graphicsData.push(this.currentPath)},n.Graphics.prototype.lineTo=function(t,e){this.currentPath.points.push(t,e),this.dirty=!0},n.Graphics.prototype.beginFill=function(t,e){this.filling=!0,this.fillColor=t||0,this.fillAlpha=e||1},n.Graphics.prototype.endFill=function(){this.filling=!1,this.fillColor=null,this.fillAlpha=1 },n.Graphics.prototype.drawRect=function(t,e,i,r){0==this.currentPath.points.length&&this.graphicsData.pop(),this.currentPath={lineWidth:this.lineWidth,lineColor:this.lineColor,lineAlpha:this.lineAlpha,fillColor:this.fillColor,fillAlpha:this.fillAlpha,fill:this.filling,points:[t,e,i,r],type:n.Graphics.RECT},this.graphicsData.push(this.currentPath),this.dirty=!0},n.Graphics.prototype.drawCircle=function(t,e,i){0==this.currentPath.points.length&&this.graphicsData.pop(),this.currentPath={lineWidth:this.lineWidth,lineColor:this.lineColor,lineAlpha:this.lineAlpha,fillColor:this.fillColor,fillAlpha:this.fillAlpha,fill:this.filling,points:[t,e,i,i],type:n.Graphics.CIRC},this.graphicsData.push(this.currentPath),this.dirty=!0},n.Graphics.prototype.drawElipse=function(t,e,i,r){0==this.currentPath.points.length&&this.graphicsData.pop(),this.currentPath={lineWidth:this.lineWidth,lineColor:this.lineColor,lineAlpha:this.lineAlpha,fillColor:this.fillColor,fillAlpha:this.fillAlpha,fill:this.filling,points:[t,e,i,r],type:n.Graphics.ELIP},this.graphicsData.push(this.currentPath),this.dirty=!0},n.Graphics.prototype.clear=function(){this.lineWidth=0,this.filling=!1,this.dirty=!0,this.clearDirty=!0,this.graphicsData=[]},n.Graphics.POLY=0,n.Graphics.RECT=1,n.Graphics.CIRC=2,n.Graphics.ELIP=3,n.Strip=function(t,e,i){n.DisplayObjectContainer.call(this),this.texture=t,this.blendMode=n.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(r){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=e,this.height=i,t.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},n.Strip.constructor=n.Strip,n.Strip.prototype=Object.create(n.DisplayObjectContainer.prototype),n.Strip.prototype.setTexture=function(t){this.texture=t,this.width=t.frame.width,this.height=t.frame.height,this.updateFrame=!0},n.Strip.prototype.onTextureUpdate=function(){this.updateFrame=!0},n.Rope=function(t,e){n.Strip.call(this,t),this.points=e;try{this.verticies=new Float32Array(4*e.length),this.uvs=new Float32Array(4*e.length),this.colors=new Float32Array(2*e.length),this.indices=new Uint16Array(2*e.length)}catch(i){this.verticies=verticies,this.uvs=uvs,this.colors=colors,this.indices=indices}this.refresh()},n.Rope.constructor=n.Rope,n.Rope.prototype=Object.create(n.Strip.prototype),n.Rope.prototype.refresh=function(){var t=this.points;if(!(1>t.length)){var e=this.uvs,i=this.indices,r=this.colors,n=t[0],s=t[0];this.count-=.2,e[0]=0,e[1]=1,e[2]=0,e[3]=1,r[0]=1,r[1]=1,i[0]=0,i[1]=1;for(var a=t.length,o=1;a>o;o++){var s=t[o],h=4*o,l=o/(a-1);o%2?(e[h]=l,e[h+1]=0,e[h+2]=l,e[h+3]=1):(e[h]=l,e[h+1]=0,e[h+2]=l,e[h+3]=1),h=2*o,r[h]=1,r[h+1]=1,h=2*o,i[h]=h,i[h+1]=h+1,n=s}}},n.Rope.prototype.updateTransform=function(){var t=this.points;if(!(1>t.length)){var e,i=this.verticies,r=t[0],s={x:0,y:0},a=t[0];this.count-=.2,i[0]=a.x+s.x,i[1]=a.y+s.y,i[2]=a.x-s.x,i[3]=a.y-s.y;for(var o=t.length,h=1;o>h;h++){var a=t[h],l=4*h;e=t.length-1>h?t[h+1]:a,s.y=-(e.x-r.x),s.x=e.y-r.y;var u=10*(1-h/(o-1));u>1&&(u=1);var c=Math.sqrt(s.x*s.x+s.y*s.y),d=this.texture.height/2;s.x/=c,s.y/=c,s.x*=d,s.y*=d,i[l]=a.x+s.x,i[l+1]=a.y+s.y,i[l+2]=a.x-s.x,i[l+3]=a.y-s.y,r=a}n.DisplayObjectContainer.prototype.updateTransform.call(this)}},n.Rope.prototype.setTexture=function(t){this.texture=t,this.updateFrame=!0},n.TilingSprite=function(t,e,i){n.DisplayObjectContainer.call(this),this.texture=t,this.width=e,this.height=i,this.renderable=!0,this.tileScale=new n.Point(1,1),this.tilePosition=new n.Point(0,0),this.blendMode=n.blendModes.NORMAL},n.TilingSprite.constructor=n.TilingSprite,n.TilingSprite.prototype=Object.create(n.DisplayObjectContainer.prototype),n.TilingSprite.prototype.setTexture=function(t){this.texture=t,this.updateFrame=!0},n.TilingSprite.prototype.onTextureUpdate=function(){this.updateFrame=!0},n.Spine=function(t){if(n.DisplayObjectContainer.call(this),this.spineData=n.AnimCache[t],!this.spineData)throw Error("Spine data must be preloaded using PIXI.SpineLoader or PIXI.AssetLoader: "+t);this.count=0,this.sprites=[],this.skeleton=new u.Skeleton(this.spineData),this.skeleton.updateWorldTransform(),this.stateData=new u.AnimationStateData(this.spineData),this.state=new u.AnimationState(this.stateData);for(var e=0;this.skeleton.drawOrder.length>e;e++){var i=this.skeleton.drawOrder[e].data.attachmentName;n.TextureCache[i]||(i+=".png");var r=new n.Sprite(n.Texture.fromFrame(i));r.anchor.x=r.anchor.y=.5,this.addChild(r),this.sprites.push(r)}},n.Spine.constructor=n.Spine,n.Spine.prototype=Object.create(n.DisplayObjectContainer.prototype),n.Spine.prototype.updateTransform=function(){this.state.update(1/60),this.state.apply(this.skeleton),this.skeleton.updateWorldTransform();for(var t=0;this.skeleton.drawOrder.length>t;t++){var e=this.skeleton.drawOrder[t],i=e.bone.worldX+e.attachment.x*e.bone.m00+e.attachment.y*e.bone.m01+.5*e.attachment.width,r=e.bone.worldY+e.attachment.x*e.bone.m10+e.attachment.y*e.bone.m11+.5*e.attachment.height;if(e.cacheName!=e.attachment.name){var s=e.attachment.name;n.TextureCache[s]||(s+=".png"),this.sprites[t].setTexture(n.TextureCache[s]),e.cacheName=e.attachment.name}i+=-(e.attachment.width*(e.bone.worldScaleX+e.attachment.scaleX-1)>>1),r+=-(e.attachment.height*(e.bone.worldScaleY+e.attachment.scaleY-1)>>1),this.sprites[t].position.x=i,this.sprites[t].position.y=r,this.sprites[t].rotation=-(e.bone.worldRotation+e.attachment.rotation)*(Math.PI/180)}n.DisplayObjectContainer.prototype.updateTransform.call(this)};var u={};u.BoneData=function(t,e){this.name=t,this.parent=e},u.BoneData.prototype={length:0,x:0,y:0,rotation:0,scaleX:1,scaleY:1},u.SlotData=function(t,e){this.name=t,this.boneData=e},u.SlotData.prototype={r:1,g:1,b:1,a:1,attachmentName:null},u.Bone=function(t,e){this.data=t,this.parent=e,this.setToSetupPose()},u.Bone.yDown=!1,u.Bone.prototype={x:0,y:0,rotation:0,scaleX:1,scaleY:1,m00:0,m01:0,worldX:0,m10:0,m11:0,worldY:0,worldRotation:0,worldScaleX:1,worldScaleY:1,updateWorldTransform:function(t,e){var i=this.parent;null!=i?(this.worldX=this.x*i.m00+this.y*i.m01+i.worldX,this.worldY=this.x*i.m10+this.y*i.m11+i.worldY,this.worldScaleX=i.worldScaleX*this.scaleX,this.worldScaleY=i.worldScaleY*this.scaleY,this.worldRotation=i.worldRotation+this.rotation):(this.worldX=this.x,this.worldY=this.y,this.worldScaleX=this.scaleX,this.worldScaleY=this.scaleY,this.worldRotation=this.rotation);var r=this.worldRotation*Math.PI/180,n=Math.cos(r),s=Math.sin(r);this.m00=n*this.worldScaleX,this.m10=s*this.worldScaleX,this.m01=-s*this.worldScaleY,this.m11=n*this.worldScaleY,t&&(this.m00=-this.m00,this.m01=-this.m01),e&&(this.m10=-this.m10,this.m11=-this.m11),u.Bone.yDown&&(this.m10=-this.m10,this.m11=-this.m11)},setToSetupPose:function(){var t=this.data;this.x=t.x,this.y=t.y,this.rotation=t.rotation,this.scaleX=t.scaleX,this.scaleY=t.scaleY}},u.Slot=function(t,e,i){this.data=t,this.skeleton=e,this.bone=i,this.setToSetupPose()},u.Slot.prototype={r:1,g:1,b:1,a:1,_attachmentTime:0,attachment:null,setAttachment:function(t){this.attachment=t,this._attachmentTime=this.skeleton.time},setAttachmentTime:function(t){this._attachmentTime=this.skeleton.time-t},getAttachmentTime:function(){return this.skeleton.time-this._attachmentTime},setToSetupPose:function(){var t=this.data;this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a;for(var e=this.skeleton.data.slots,i=0,r=e.length;r>i;i++)if(e[i]==t){this.setAttachment(t.attachmentName?this.skeleton.getAttachmentBySlotIndex(i,t.attachmentName):null);break}}},u.Skin=function(t){this.name=t,this.attachments={}},u.Skin.prototype={addAttachment:function(t,e,i){this.attachments[t+":"+e]=i},getAttachment:function(t,e){return this.attachments[t+":"+e]},_attachAll:function(t,e){for(var i in e.attachments){var r=i.indexOf(":"),n=parseInt(i.substring(0,r)),s=i.substring(r+1),a=t.slots[n];if(a.attachment&&a.attachment.name==s){var o=this.getAttachment(n,s);o&&a.setAttachment(o)}}}},u.Animation=function(t,e,i){this.name=t,this.timelines=e,this.duration=i},u.Animation.prototype={apply:function(t,e,i){i&&0!=this.duration&&(e%=this.duration);for(var r=this.timelines,n=0,s=r.length;s>n;n++)r[n].apply(t,e,1)},mix:function(t,e,i,r){i&&0!=this.duration&&(e%=this.duration);for(var n=this.timelines,s=0,a=n.length;a>s;s++)n[s].apply(t,e,r)}},u.binarySearch=function(t,e,i){var r=0,n=Math.floor(t.length/i)-2;if(0==n)return i;for(var s=n>>>1;;){if(e>=t[(s+1)*i]?r=s+1:n=s,r==n)return(r+1)*i;s=r+n>>>1}},u.linearSearch=function(t,e,i){for(var r=0,n=t.length-i;n>=r;r+=i)if(t[r]>e)return r;return-1},u.Curves=function(t){this.curves=[],this.curves.length=6*(t-1)},u.Curves.prototype={setLinear:function(t){this.curves[6*t]=0},setStepped:function(t){this.curves[6*t]=-1},setCurve:function(t,e,i,r,n){var s=.1,a=s*s,o=a*s,h=3*s,l=3*a,u=6*a,c=6*o,d=2*-e+r,p=2*-i+n,f=3*(e-r)+1,v=3*(i-n)+1,g=6*t,m=this.curves;m[g]=e*h+d*l+f*o,m[g+1]=i*h+p*l+v*o,m[g+2]=d*u+f*c,m[g+3]=p*u+v*c,m[g+4]=f*c,m[g+5]=v*c},getCurvePercent:function(t,e){e=0>e?0:e>1?1:e;var i=6*t,r=this.curves,n=r[i];if(!n)return e;if(-1==n)return 0;for(var s=r[i+1],a=r[i+2],o=r[i+3],h=r[i+4],l=r[i+5],u=n,c=s,d=8;;){if(u>=e){var p=u-n,f=c-s;return f+(c-f)*(e-p)/(u-p)}if(0==d)break;d--,n+=a,s+=o,a+=h,o+=l,u+=n,c+=s}return c+(1-c)*(e-u)/(1-u)}},u.RotateTimeline=function(t){this.curves=new u.Curves(t),this.frames=[],this.frames.length=2*t},u.RotateTimeline.prototype={boneIndex:0,getFrameCount:function(){return this.frames.length/2},setFrame:function(t,e,i){t*=2,this.frames[t]=e,this.frames[t+1]=i},apply:function(t,e,i){var r=this.frames;if(!(r[0]>e)){var n=t.bones[this.boneIndex];if(e>=r[r.length-2]){for(var s=n.data.rotation+r[r.length-1]-n.rotation;s>180;)s-=360;for(;-180>s;)s+=360;return n.rotation+=s*i,void 0}var a=u.binarySearch(r,e,2),o=r[a-1],h=r[a],l=1-(e-h)/(r[a-2]-h);l=this.curves.getCurvePercent(a/2-1,l);for(var s=r[a+1]-o;s>180;)s-=360;for(;-180>s;)s+=360;for(s=n.data.rotation+(o+s*l)-n.rotation;s>180;)s-=360;for(;-180>s;)s+=360;n.rotation+=s*i}}},u.TranslateTimeline=function(t){this.curves=new u.Curves(t),this.frames=[],this.frames.length=3*t},u.TranslateTimeline.prototype={boneIndex:0,getFrameCount:function(){return this.frames.length/3},setFrame:function(t,e,i,r){t*=3,this.frames[t]=e,this.frames[t+1]=i,this.frames[t+2]=r},apply:function(t,e,i){var r=this.frames;if(!(r[0]>e)){var n=t.bones[this.boneIndex];if(e>=r[r.length-3])return n.x+=(n.data.x+r[r.length-2]-n.x)*i,n.y+=(n.data.y+r[r.length-1]-n.y)*i,void 0;var s=u.binarySearch(r,e,3),a=r[s-2],o=r[s-1],h=r[s],l=1-(e-h)/(r[s+-3]-h);l=this.curves.getCurvePercent(s/3-1,l),n.x+=(n.data.x+a+(r[s+1]-a)*l-n.x)*i,n.y+=(n.data.y+o+(r[s+2]-o)*l-n.y)*i}}},u.ScaleTimeline=function(t){this.curves=new u.Curves(t),this.frames=[],this.frames.length=3*t},u.ScaleTimeline.prototype={boneIndex:0,getFrameCount:function(){return this.frames.length/3},setFrame:function(t,e,i,r){t*=3,this.frames[t]=e,this.frames[t+1]=i,this.frames[t+2]=r},apply:function(t,e,i){var r=this.frames;if(!(r[0]>e)){var n=t.bones[this.boneIndex];if(e>=r[r.length-3])return n.scaleX+=(n.data.scaleX-1+r[r.length-2]-n.scaleX)*i,n.scaleY+=(n.data.scaleY-1+r[r.length-1]-n.scaleY)*i,void 0;var s=u.binarySearch(r,e,3),a=r[s-2],o=r[s-1],h=r[s],l=1-(e-h)/(r[s+-3]-h);l=this.curves.getCurvePercent(s/3-1,l),n.scaleX+=(n.data.scaleX-1+a+(r[s+1]-a)*l-n.scaleX)*i,n.scaleY+=(n.data.scaleY-1+o+(r[s+2]-o)*l-n.scaleY)*i}}},u.ColorTimeline=function(t){this.curves=new u.Curves(t),this.frames=[],this.frames.length=5*t},u.ColorTimeline.prototype={slotIndex:0,getFrameCount:function(){return this.frames.length/2},setFrame:function(t,e){t*=5,this.frames[t]=e,this.frames[t+1]=r,this.frames[t+2]=g,this.frames[t+3]=b,this.frames[t+4]=a},apply:function(t,e,i){var r=this.frames;if(!(r[0]>e)){var n=t.slots[this.slotIndex];if(e>=r[r.length-5]){var s=r.length-1;return n.r=r[s-3],n.g=r[s-2],n.b=r[s-1],n.a=r[s],void 0}var a=u.binarySearch(r,e,5),o=r[a-4],h=r[a-3],l=r[a-2],c=r[a-1],d=r[a],p=1-(e-d)/(r[a-5]-d);p=this.curves.getCurvePercent(a/5-1,p);var f=o+(r[a+1]-o)*p,v=h+(r[a+2]-h)*p,g=l+(r[a+3]-l)*p,m=c+(r[a+4]-c)*p;1>i?(n.r+=(f-n.r)*i,n.g+=(v-n.g)*i,n.b+=(g-n.b)*i,n.a+=(m-n.a)*i):(n.r=f,n.g=v,n.b=g,n.a=m)}}},u.AttachmentTimeline=function(t){this.curves=new u.Curves(t),this.frames=[],this.frames.length=t,this.attachmentNames=[],this.attachmentNames.length=t},u.AttachmentTimeline.prototype={slotIndex:0,getFrameCount:function(){return this.frames.length/2},setFrame:function(t,e,i){this.frames[t]=e,this.attachmentNames[t]=i},apply:function(t,e){var i=this.frames;if(!(i[0]>e)){var r;r=e>=i[i.length-1]?i.length-1:u.binarySearch(i,e,1)-1;var n=this.attachmentNames[r];t.slots[this.slotIndex].setAttachment(n?t.getAttachmentBySlotIndex(this.slotIndex,n):null)}}},u.SkeletonData=function(){this.bones=[],this.slots=[],this.skins=[],this.animations=[]},u.SkeletonData.prototype={defaultSkin:null,findBone:function(t){for(var e=this.bones,i=0,r=e.length;r>i;i++)if(e[i].name==t)return e[i];return null},findBoneIndex:function(t){for(var e=this.bones,i=0,r=e.length;r>i;i++)if(e[i].name==t)return i;return-1},findSlot:function(t){for(var e=this.slots,i=0,r=e.length;r>i;i++)if(e[i].name==t)return slot[i];return null},findSlotIndex:function(t){for(var e=this.slots,i=0,r=e.length;r>i;i++)if(e[i].name==t)return i;return-1},findSkin:function(t){for(var e=this.skins,i=0,r=e.length;r>i;i++)if(e[i].name==t)return e[i];return null},findAnimation:function(t){for(var e=this.animations,i=0,r=e.length;r>i;i++)if(e[i].name==t)return e[i];return null}},u.Skeleton=function(t){this.data=t,this.bones=[];for(var e=0,i=t.bones.length;i>e;e++){var r=t.bones[e],n=r.parent?this.bones[t.bones.indexOf(r.parent)]:null;this.bones.push(new u.Bone(r,n))}this.slots=[],this.drawOrder=[];for(var e=0,i=t.slots.length;i>e;e++){var s=t.slots[e],a=this.bones[t.bones.indexOf(s.boneData)],o=new u.Slot(s,this,a);this.slots.push(o),this.drawOrder.push(o)}},u.Skeleton.prototype={x:0,y:0,skin:null,r:1,g:1,b:1,a:1,time:0,flipX:!1,flipY:!1,updateWorldTransform:function(){for(var t=this.flipX,e=this.flipY,i=this.bones,r=0,n=i.length;n>r;r++)i[r].updateWorldTransform(t,e)},setToSetupPose:function(){this.setBonesToSetupPose(),this.setSlotsToSetupPose()},setBonesToSetupPose:function(){for(var t=this.bones,e=0,i=t.length;i>e;e++)t[e].setToSetupPose()},setSlotsToSetupPose:function(){for(var t=this.slots,e=0,i=t.length;i>e;e++)t[e].setToSetupPose(e)},getRootBone:function(){return 0==this.bones.length?null:this.bones[0]},findBone:function(t){for(var e=this.bones,i=0,r=e.length;r>i;i++)if(e[i].data.name==t)return e[i];return null},findBoneIndex:function(t){for(var e=this.bones,i=0,r=e.length;r>i;i++)if(e[i].data.name==t)return i;return-1},findSlot:function(t){for(var e=this.slots,i=0,r=e.length;r>i;i++)if(e[i].data.name==t)return e[i];return null},findSlotIndex:function(t){for(var e=this.slots,i=0,r=e.length;r>i;i++)if(e[i].data.name==t)return i;return-1},setSkinByName:function(t){var e=this.data.findSkin(t);if(!e)throw"Skin not found: "+t;this.setSkin(e)},setSkin:function(t){this.skin&&t&&t._attachAll(this,this.skin),this.skin=t},getAttachmentBySlotName:function(t,e){return this.getAttachmentBySlotIndex(this.data.findSlotIndex(t),e)},getAttachmentBySlotIndex:function(t,e){if(this.skin){var i=this.skin.getAttachment(t,e);if(i)return i}return this.data.defaultSkin?this.data.defaultSkin.getAttachment(t,e):null},setAttachment:function(t,e){for(var i=this.slots,r=0,n=i.size;n>r;r++){var s=i[r];if(s.data.name==t){var a=null;if(e&&(a=this.getAttachment(r,e),null==a))throw"Attachment not found: "+e+", for slot: "+t;return s.setAttachment(a),void 0}}throw"Slot not found: "+t},update:function(t){time+=t}},u.AttachmentType={region:0},u.RegionAttachment=function(){this.offset=[],this.offset.length=8,this.uvs=[],this.uvs.length=8},u.RegionAttachment.prototype={x:0,y:0,rotation:0,scaleX:1,scaleY:1,width:0,height:0,rendererObject:null,regionOffsetX:0,regionOffsetY:0,regionWidth:0,regionHeight:0,regionOriginalWidth:0,regionOriginalHeight:0,setUVs:function(t,e,i,r,n){var s=this.uvs;n?(s[2]=t,s[3]=r,s[4]=t,s[5]=e,s[6]=i,s[7]=e,s[0]=i,s[1]=r):(s[0]=t,s[1]=r,s[2]=t,s[3]=e,s[4]=i,s[5]=e,s[6]=i,s[7]=r)},updateOffset:function(){var t=this.width/this.regionOriginalWidth*this.scaleX,e=this.height/this.regionOriginalHeight*this.scaleY,i=-this.width/2*this.scaleX+this.regionOffsetX*t,r=-this.height/2*this.scaleY+this.regionOffsetY*e,n=i+this.regionWidth*t,s=r+this.regionHeight*e,a=this.rotation*Math.PI/180,o=Math.cos(a),h=Math.sin(a),l=i*o+this.x,u=i*h,c=r*o+this.y,d=r*h,p=n*o+this.x,f=n*h,v=s*o+this.y,g=s*h,m=this.offset;m[0]=l-d,m[1]=c+u,m[2]=l-g,m[3]=v+u,m[4]=p-g,m[5]=v+f,m[6]=p-d,m[7]=c+f},computeVertices:function(t,e,i,r){t+=i.worldX,e+=i.worldY;var n=i.m00,s=i.m01,a=i.m10,o=i.m11,h=this.offset;r[0]=h[0]*n+h[1]*s+t,r[1]=h[0]*a+h[1]*o+e,r[2]=h[2]*n+h[3]*s+t,r[3]=h[2]*a+h[3]*o+e,r[4]=h[4]*n+h[5]*s+t,r[5]=h[4]*a+h[5]*o+e,r[6]=h[6]*n+h[7]*s+t,r[7]=h[6]*a+h[7]*o+e}},u.AnimationStateData=function(t){this.skeletonData=t,this.animationToMixTime={}},u.AnimationStateData.prototype={setMixByName:function(t,e,i){var r=this.skeletonData.findAnimation(t);if(!r)throw"Animation not found: "+t;var n=this.skeletonData.findAnimation(e);if(!n)throw"Animation not found: "+e;this.setMix(r,n,i)},setMix:function(t,e,i){this.animationToMixTime[t.name+":"+e.name]=i},getMix:function(t,e){var i=this.animationToMixTime[t.name+":"+e.name];return i?i:0}},u.AnimationState=function(t){this.data=t,this.queue=[]},u.AnimationState.prototype={current:null,previous:null,currentTime:0,previousTime:0,currentLoop:!1,previousLoop:!1,mixTime:0,mixDuration:0,update:function(t){if(this.currentTime+=t,this.previousTime+=t,this.mixTime+=t,this.queue.length>0){var e=this.queue[0];this.currentTime>=e.delay&&(this._setAnimation(e.animation,e.loop),this.queue.shift())}},apply:function(t){if(this.current)if(this.previous){this.previous.apply(t,this.previousTime,this.previousLoop);var e=this.mixTime/this.mixDuration;e>=1&&(e=1,this.previous=null),this.current.mix(t,this.currentTime,this.currentLoop,e)}else this.current.apply(t,this.currentTime,this.currentLoop)},clearAnimation:function(){this.previous=null,this.current=null,this.queue.length=0},_setAnimation:function(t,e){this.previous=null,t&&this.current&&(this.mixDuration=this.data.getMix(this.current,t),this.mixDuration>0&&(this.mixTime=0,this.previous=this.current,this.previousTime=this.currentTime,this.previousLoop=this.currentLoop)),this.current=t,this.currentLoop=e,this.currentTime=0},setAnimationByName:function(t,e){var i=this.data.skeletonData.findAnimation(t);if(!i)throw"Animation not found: "+t;this.setAnimation(i,e)},setAnimation:function(t,e){this.queue.length=0,this._setAnimation(t,e)},addAnimationByName:function(t,e,i){var r=this.data.skeletonData.findAnimation(t);if(!r)throw"Animation not found: "+t;this.addAnimation(r,e,i)},addAnimation:function(t,e,i){var r={};if(r.animation=t,r.loop=e,!i||0>=i){var n=0==this.queue.length?this.current:this.queue[this.queue.length-1].animation;i=null!=n?n.duration-this.data.getMix(n,t)+(i||0):0}r.delay=i,this.queue.push(r)},isComplete:function(){return!this.current||this.currentTime>=this.current.duration}},u.SkeletonJson=function(t){this.attachmentLoader=t},u.SkeletonJson.prototype={scale:1,readSkeletonData:function(t){for(var e=new u.SkeletonData,i=t.bones,r=0,n=i.length;n>r;r++){var s=i[r],a=null;if(s.parent&&(a=e.findBone(s.parent),!a))throw"Parent bone not found: "+s.parent;var o=new u.BoneData(s.name,a);o.length=(s.length||0)*this.scale,o.x=(s.x||0)*this.scale,o.y=(s.y||0)*this.scale,o.rotation=s.rotation||0,o.scaleX=s.scaleX||1,o.scaleY=s.scaleY||1,e.bones.push(o)}for(var h=t.slots,r=0,n=h.length;n>r;r++){var l=h[r],o=e.findBone(l.bone);if(!o)throw"Slot bone not found: "+l.bone;var c=new u.SlotData(l.name,o),d=l.color;d&&(c.r=u.SkeletonJson.toColor(d,0),c.g=u.SkeletonJson.toColor(d,1),c.b=u.SkeletonJson.toColor(d,2),c.a=u.SkeletonJson.toColor(d,3)),c.attachmentName=l.attachment,e.slots.push(c)}var p=t.skins;for(var f in p)if(p.hasOwnProperty(f)){var v=p[f],g=new u.Skin(f);for(var m in v)if(v.hasOwnProperty(m)){var x=e.findSlotIndex(m),b=v[m];for(var y in b)if(b.hasOwnProperty(y)){var T=this.readAttachment(g,y,b[y]);null!=T&&g.addAttachment(x,y,T)}}e.skins.push(g),"default"==g.name&&(e.defaultSkin=g)}var _=t.animations;for(var w in _)_.hasOwnProperty(w)&&this.readAnimation(w,_[w],e);return e},readAttachment:function(t,e,i){e=i.name||e;var r=u.AttachmentType[i.type||"region"],n=new u.RegionAttachment;return n.name=e,r==u.AttachmentType.region&&(n.x=(i.x||0)*this.scale,n.y=(i.y||0)*this.scale,n.scaleX=i.scaleX||1,n.scaleY=i.scaleY||1,n.rotation=i.rotation||0,n.width=(i.width||32)*this.scale,n.height=(i.height||32)*this.scale,n.updateOffset()),n},readAnimation:function(t,e,i){var r=[],n=0,s=e.bones;for(var a in s)if(s.hasOwnProperty(a)){var o=i.findBoneIndex(a);if(-1==o)throw"Bone not found: "+a;var h=s[a];for(var l in h)if(h.hasOwnProperty(l)){var c=h[l];if("rotate"==l){var d=new u.RotateTimeline(c.length);d.boneIndex=o;for(var p=0,f=0,v=c.length;v>f;f++){var g=c[f];d.setFrame(p,g.time,g.angle),u.SkeletonJson.readCurve(d,p,g),p++}r.push(d),n=Math.max(n,d.frames[2*d.getFrameCount()-2])}else{if("translate"!=l&&"scale"!=l)throw"Invalid timeline type for a bone: "+l+" ("+a+")";var d,m=1;"scale"==l?d=new u.ScaleTimeline(c.length):(d=new u.TranslateTimeline(c.length),m=this.scale),d.boneIndex=o;for(var p=0,f=0,v=c.length;v>f;f++){var g=c[f],x=(g.x||0)*m,b=(g.y||0)*m;d.setFrame(p,g.time,x,b),u.SkeletonJson.readCurve(d,p,g),p++}r.push(d),n=Math.max(n,d.frames[3*d.getFrameCount()-3])}}}var y=e.slots;for(var T in y)if(y.hasOwnProperty(T)){var _=y[T],w=i.findSlotIndex(T);for(var l in _)if(_.hasOwnProperty(l)){var c=_[l];if("color"==l){var d=new u.ColorTimeline(c.length);d.slotIndex=w;for(var p=0,f=0,v=c.length;v>f;f++){var g=c[f],A=g.color,R=u.SkeletonJson.toColor(A,0),S=u.SkeletonJson.toColor(A,1),C=u.SkeletonJson.toColor(A,2),L=u.SkeletonJson.toColor(A,3);d.setFrame(p,g.time,R,S,C,L),u.SkeletonJson.readCurve(d,p,g),p++}r.push(d),n=Math.max(n,d.frames[5*d.getFrameCount()-5])}else{if("attachment"!=l)throw"Invalid timeline type for a slot: "+l+" ("+T+")";var d=new u.AttachmentTimeline(c.length);d.slotIndex=w;for(var p=0,f=0,v=c.length;v>f;f++){var g=c[f];d.setFrame(p++,g.time,g.name)}r.push(d),n=Math.max(n,d.frames[Math.floor(d.getFrameCount())-1])}}}i.animations.push(new u.Animation(t,r,n))}},u.SkeletonJson.readCurve=function(t,e,i){var r=i.curve;r&&("stepped"==r?t.curves.setStepped(e):r instanceof Array&&t.curves.setCurve(e,r[0],r[1],r[2],r[3]))},u.SkeletonJson.toColor=function(t,e){if(8!=t.length)throw"Color hexidecimal length must be 8, recieved: "+t;return parseInt(t.substring(2*e,2),16)/255},u.Atlas=function(t,e){this.textureLoader=e,this.pages=[],this.regions=[];var i=new u.AtlasReader(t),r=[];r.length=4;for(var n=null;;){var s=i.readLine();if(null==s)break;if(s=i.trim(s),0==s.length)n=null;else if(n){var a=new u.AtlasRegion;a.name=s,a.page=n,a.rotate="true"==i.readValue(),i.readTuple(r);var o=parseInt(r[0]),h=parseInt(r[1]);i.readTuple(r);var l=parseInt(r[0]),c=parseInt(r[1]);a.u=o/n.width,a.v=h/n.height,a.rotate?(a.u2=(o+c)/n.width,a.v2=(h+l)/n.height):(a.u2=(o+l)/n.width,a.v2=(h+c)/n.height),a.x=o,a.y=h,a.width=Math.abs(l),a.height=Math.abs(c),4==i.readTuple(r)&&(a.splits=[parseInt(r[0]),parseInt(r[1]),parseInt(r[2]),parseInt(r[3])],4==i.readTuple(r)&&(a.pads=[parseInt(r[0]),parseInt(r[1]),parseInt(r[2]),parseInt(r[3])],i.readTuple(r))),a.originalWidth=parseInt(r[0]),a.originalHeight=parseInt(r[1]),i.readTuple(r),a.offsetX=parseInt(r[0]),a.offsetY=parseInt(r[1]),a.index=parseInt(i.readValue()),this.regions.push(a)}else{n=new u.AtlasPage,n.name=s,n.format=u.Atlas.Format[i.readValue()],i.readTuple(r),n.minFilter=u.Atlas.TextureFilter[r[0]],n.magFilter=u.Atlas.TextureFilter[r[1]];var d=i.readValue();n.uWrap=u.Atlas.TextureWrap.clampToEdge,n.vWrap=u.Atlas.TextureWrap.clampToEdge,"x"==d?n.uWrap=u.Atlas.TextureWrap.repeat:"y"==d?n.vWrap=u.Atlas.TextureWrap.repeat:"xy"==d&&(n.uWrap=n.vWrap=u.Atlas.TextureWrap.repeat),e.load(n,s),this.pages.push(n)}}},u.Atlas.prototype={findRegion:function(t){for(var e=this.regions,i=0,r=e.length;r>i;i++)if(e[i].name==t)return e[i];return null},dispose:function(){for(var t=this.pages,e=0,i=t.length;i>e;e++)this.textureLoader.unload(t[e].rendererObject)},updateUVs:function(t){for(var e=this.regions,i=0,r=e.length;r>i;i++){var n=e[i];n.page==t&&(n.u=n.x/t.width,n.v=n.y/t.height,n.rotate?(n.u2=(n.x+n.height)/t.width,n.v2=(n.y+n.width)/t.height):(n.u2=(n.x+n.width)/t.width,n.v2=(n.y+n.height)/t.height))}}},u.Atlas.Format={alpha:0,intensity:1,luminanceAlpha:2,rgb565:3,rgba4444:4,rgb888:5,rgba8888:6},u.Atlas.TextureFilter={nearest:0,linear:1,mipMap:2,mipMapNearestNearest:3,mipMapLinearNearest:4,mipMapNearestLinear:5,mipMapLinearLinear:6},u.Atlas.TextureWrap={mirroredRepeat:0,clampToEdge:1,repeat:2},u.AtlasPage=function(){},u.AtlasPage.prototype={name:null,format:null,minFilter:null,magFilter:null,uWrap:null,vWrap:null,rendererObject:null,width:0,height:0},u.AtlasRegion=function(){},u.AtlasRegion.prototype={page:null,name:null,x:0,y:0,width:0,height:0,u:0,v:0,u2:0,v2:0,offsetX:0,offsetY:0,originalWidth:0,originalHeight:0,index:0,rotate:!1,splits:null,pads:null},u.AtlasReader=function(t){this.lines=t.split(/\r\n|\r|\n/)},u.AtlasReader.prototype={index:0,trim:function(t){return t.replace(/^\s+|\s+$/g,"")},readLine:function(){return this.index>=this.lines.length?null:this.lines[this.index++]},readValue:function(){var t=this.readLine(),e=t.indexOf(":");if(-1==e)throw"Invalid line: "+t;return this.trim(t.substring(e+1))},readTuple:function(t){var e=this.readLine(),i=e.indexOf(":");if(-1==i)throw"Invalid line: "+e;for(var r=0,n=i+1;3>r;r++){var s=e.indexOf(",",n);if(-1==s){if(0==r)throw"Invalid line: "+e;break}t[r]=this.trim(e.substr(n,s-n)),n=s+1}return t[r]=this.trim(e.substring(n)),r+1}},u.AtlasAttachmentLoader=function(t){this.atlas=t},u.AtlasAttachmentLoader.prototype={newAttachment:function(t,e,i){switch(e){case u.AttachmentType.region:var r=this.atlas.findRegion(i);if(!r)throw"Region not found in atlas: "+i+" ("+e+")";var n=new u.RegionAttachment(i);return n.rendererObject=r,n.setUVs(r.u,r.v,r.u2,r.v2,r.rotate),n.regionOffsetX=r.offsetX,n.regionOffsetY=r.offsetY,n.regionWidth=r.width,n.regionHeight=r.height,n.regionOriginalWidth=r.originalWidth,n.regionOriginalHeight=r.originalHeight,n}throw"Unknown attachment type: "+e}},n.AnimCache={},u.Bone.yDown=!0,n.CustomRenderable=function(){n.DisplayObject.call(this)},n.CustomRenderable.constructor=n.CustomRenderable,n.CustomRenderable.prototype=Object.create(n.DisplayObject.prototype),n.CustomRenderable.prototype.renderCanvas=function(){},n.CustomRenderable.prototype.initWebGL=function(){},n.CustomRenderable.prototype.renderWebGL=function(){},n.BaseTextureCache={},n.texturesToUpdate=[],n.texturesToDestroy=[],n.BaseTexture=function(t){if(n.EventTarget.call(this),this.width=100,this.height=100,this.source=t,t){if(this.source instanceof Image)if(this.source.complete)this.hasLoaded=!0,this.width=this.source.width,this.height=this.source.height,n.texturesToUpdate.push(this);else{var e=this;this.source.onload=function(){e.hasLoaded=!0,e.width=e.source.width,e.height=e.source.height,n.texturesToUpdate.push(e),e.dispatchEvent({type:"loaded",content:e})}}else this.hasLoaded=!0,this.width=this.source.width,this.height=this.source.height,n.texturesToUpdate.push(this);this._powerOf2=!1}},n.BaseTexture.constructor=n.BaseTexture,n.BaseTexture.prototype.destroy=function(){this.source instanceof Image&&(this.source.src=null),this.source=null,n.texturesToDestroy.push(this)},n.BaseTexture.fromImage=function(t,e){var i=n.BaseTextureCache[t];if(!i){var r=new Image;e&&(r.crossOrigin=""),r.src=t,i=new n.BaseTexture(r),n.BaseTextureCache[t]=i}return i},n.TextureCache={},n.FrameCache={},n.Texture=function(t,e){if(n.EventTarget.call(this),e||(this.noFrame=!0,e=new n.Rectangle(0,0,1,1)),this.trim=new n.Point,t instanceof n.Texture&&(t=t.baseTexture),this.baseTexture=t,this.frame=e,this.scope=this,t.hasLoaded)this.noFrame&&(e=new n.Rectangle(0,0,t.width,t.height)),this.setFrame(e);else{var i=this;t.addEventListener("loaded",function(){i.onBaseTextureLoaded()})}},n.Texture.constructor=n.Texture,n.Texture.prototype.onBaseTextureLoaded=function(){var t=this.baseTexture;t.removeEventListener("loaded",this.onLoaded),this.noFrame&&(this.frame=new n.Rectangle(0,0,t.width,t.height)),this.noFrame=!1,this.width=this.frame.width,this.height=this.frame.height,this.scope.dispatchEvent({type:"update",content:this})},n.Texture.prototype.destroy=function(t){t&&this.baseTexture.destroy()},n.Texture.prototype.setFrame=function(t){if(this.frame=t,this.width=t.width,this.height=t.height,t.x+t.width>this.baseTexture.width||t.y+t.height>this.baseTexture.height)throw Error("Texture Error: frame does not fit inside the base Texture dimensions "+this);this.updateFrame=!0,n.Texture.frameUpdates.push(this)},n.Texture.fromImage=function(t,e){var i=n.TextureCache[t];return i||(i=new n.Texture(n.BaseTexture.fromImage(t,e)),n.TextureCache[t]=i),i},n.Texture.fromFrame=function(t){var e=n.TextureCache[t];if(!e)throw Error("The frameId '"+t+"' does not exist in the texture cache "+this);return e},n.Texture.fromCanvas=function(t){var e=new n.BaseTexture(t);return new n.Texture(e)},n.Texture.addTextureToCache=function(t,e){n.TextureCache[e]=t},n.Texture.removeTextureFromCache=function(t){var e=n.TextureCache[t];return n.TextureCache[t]=null,e},n.Texture.frameUpdates=[],n.RenderTexture=function(t,e){n.EventTarget.call(this),this.width=t||100,this.height=e||100,this.indetityMatrix=n.mat3.create(),this.frame=new n.Rectangle(0,0,this.width,this.height),n.gl?this.initWebGL():this.initCanvas()},n.RenderTexture.constructor=n.RenderTexture,n.RenderTexture.prototype=Object.create(n.Texture.prototype),n.RenderTexture.prototype.initWebGL=function(){var t=n.gl;this.glFramebuffer=t.createFramebuffer(),t.bindFramebuffer(t.FRAMEBUFFER,this.glFramebuffer),this.glFramebuffer.width=this.width,this.glFramebuffer.height=this.height,this.baseTexture=new n.BaseTexture,this.baseTexture.width=this.width,this.baseTexture.height=this.height,this.baseTexture._glTexture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.baseTexture._glTexture),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,this.width,this.height,0,t.RGBA,t.UNSIGNED_BYTE,null),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),this.baseTexture.isRender=!0,t.bindFramebuffer(t.FRAMEBUFFER,this.glFramebuffer),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,this.baseTexture._glTexture,0),this.projection=new n.Point(this.width/2,this.height/2),this.projectionMatrix=n.mat4.create(),this.projectionMatrix[5]=2/this.height,this.projectionMatrix[13]=-1,this.projectionMatrix[0]=2/this.width,this.projectionMatrix[12]=-1,this.render=this.renderWebGL},n.RenderTexture.prototype.initCanvas=function(){this.renderer=new n.CanvasRenderer(this.width,this.height,null,0),this.baseTexture=new n.BaseTexture(this.renderer.view),this.frame=new n.Rectangle(0,0,this.width,this.height),this.render=this.renderCanvas},n.RenderTexture.prototype.renderWebGL=function(t,e){var i=n.gl;i.colorMask(!0,!0,!0,!0),i.viewport(0,0,this.width,this.height),i.bindFramebuffer(i.FRAMEBUFFER,this.glFramebuffer),e&&(i.clearColor(0,0,0,0),i.clear(i.COLOR_BUFFER_BIT));var r=t.children;t.worldTransform=n.mat3.create(),t.worldTransform[4]=-1,t.worldTransform[5]=2*this.projection.y;for(var s=0,a=r.length;a>s;s++)r[s].updateTransform(); var o=t.__renderGroup;o?t==o.root?o.render(this.projection):o.renderSpecific(t,this.projection):(this.renderGroup||(this.renderGroup=new n.WebGLRenderGroup(i)),this.renderGroup.setRenderable(t),this.renderGroup.render(this.projection))},n.RenderTexture.prototype.renderCanvas=function(t,e){var i=t.children;t.worldTransform=n.mat3.create();for(var r=0,s=i.length;s>r;r++)i[r].updateTransform();e&&this.renderer.context.clearRect(0,0,this.width,this.height),this.renderer.renderDisplayObject(t),n.texturesToUpdate.push(this.baseTexture)},n.AssetLoader=function(t){n.EventTarget.call(this),this.assetURLs=t,this.crossorigin=!1,this.loadersByType={jpg:n.ImageLoader,jpeg:n.ImageLoader,png:n.ImageLoader,gif:n.ImageLoader,json:n.JsonLoader,anim:n.SpineLoader,xml:n.BitmapFontLoader,fnt:n.BitmapFontLoader}},n.AssetLoader.constructor=n.AssetLoader,n.AssetLoader.prototype.load=function(){var t=this;this.loadCount=this.assetURLs.length;for(var e=0;this.assetURLs.length>e;e++){var i=this.assetURLs[e],r=i.split(".").pop().toLowerCase(),n=this.loadersByType[r];if(!n)throw Error(r+" is an unsupported file type");var s=new n(i,this.crossorigin);s.addEventListener("loaded",function(){t.onAssetLoaded()}),s.load()}},n.AssetLoader.prototype.onAssetLoaded=function(){this.loadCount--,this.dispatchEvent({type:"onProgress",content:this}),this.onProgress&&this.onProgress(),0==this.loadCount&&(this.dispatchEvent({type:"onComplete",content:this}),this.onComplete&&this.onComplete())},n.JsonLoader=function(t,e){n.EventTarget.call(this),this.url=t,this.baseUrl=t.replace(/[^\/]*$/,""),this.crossorigin=e,this.loaded=!1},n.JsonLoader.constructor=n.JsonLoader,n.JsonLoader.prototype.load=function(){this.ajaxRequest=new l;var t=this;this.ajaxRequest.onreadystatechange=function(){t.onJSONLoaded()},this.ajaxRequest.open("GET",this.url,!0),this.ajaxRequest.overrideMimeType&&this.ajaxRequest.overrideMimeType("application/json"),this.ajaxRequest.send(null)},n.JsonLoader.prototype.onJSONLoaded=function(){if(4==this.ajaxRequest.readyState)if(200==this.ajaxRequest.status||-1==window.location.href.indexOf("http"))if(this.json=JSON.parse(this.ajaxRequest.responseText),this.json.frames){var t=this,e=this.baseUrl+this.json.meta.image,i=new n.ImageLoader(e,this.crossorigin),r=this.json.frames;this.texture=i.texture.baseTexture,i.addEventListener("loaded",function(){t.onLoaded()});for(var s in r){var a=r[s].frame;a&&(n.TextureCache[s]=new n.Texture(this.texture,{x:a.x,y:a.y,width:a.w,height:a.h}),r[s].trimmed&&(n.TextureCache[s].realSize=r[s].spriteSourceSize,n.TextureCache[s].trim.x=0))}i.load()}else if(this.json.bones){var o=new u.SkeletonJson,h=o.readSkeletonData(this.json);n.AnimCache[this.url]=h,this.onLoaded()}else this.onLoaded();else this.onError()},n.JsonLoader.prototype.onLoaded=function(){this.loaded=!0,this.dispatchEvent({type:"loaded",content:this})},n.JsonLoader.prototype.onError=function(){this.dispatchEvent({type:"error",content:this})},n.SpriteSheetLoader=function(t,e){n.EventTarget.call(this),this.url=t,this.baseUrl=t.replace(/[^\/]*$/,""),this.texture=null,this.frames={},this.crossorigin=e},n.SpriteSheetLoader.constructor=n.SpriteSheetLoader,n.SpriteSheetLoader.prototype.load=function(){var t=this,e=new n.JsonLoader(this.url,this.crossorigin);e.addEventListener("loaded",function(e){t.json=e.content.json,t.onJSONLoaded()}),e.load()},n.SpriteSheetLoader.prototype.onJSONLoaded=function(){var t=this,e=this.baseUrl+this.json.meta.image,i=new n.ImageLoader(e,this.crossorigin),r=this.json.frames;this.texture=i.texture.baseTexture,i.addEventListener("loaded",function(){t.onLoaded()});for(var s in r){var a=r[s].frame;a&&(n.TextureCache[s]=new n.Texture(this.texture,{x:a.x,y:a.y,width:a.w,height:a.h}),r[s].trimmed&&(n.TextureCache[s].realSize=r[s].spriteSourceSize,n.TextureCache[s].trim.x=0))}i.load()},n.SpriteSheetLoader.prototype.onLoaded=function(){this.dispatchEvent({type:"loaded",content:this})},n.ImageLoader=function(t,e){n.EventTarget.call(this),this.texture=n.Texture.fromImage(t,e)},n.ImageLoader.constructor=n.ImageLoader,n.ImageLoader.prototype.load=function(){if(this.texture.baseTexture.hasLoaded)this.onLoaded();else{var t=this;this.texture.baseTexture.addEventListener("loaded",function(){t.onLoaded()})}},n.ImageLoader.prototype.onLoaded=function(){this.dispatchEvent({type:"loaded",content:this})},n.BitmapFontLoader=function(t,e){n.EventTarget.call(this),this.url=t,this.baseUrl=t.replace(/[^\/]*$/,""),this.texture=null,this.crossorigin=e},n.BitmapFontLoader.constructor=n.BitmapFontLoader,n.BitmapFontLoader.prototype.load=function(){this.ajaxRequest=new XMLHttpRequest;var t=this;this.ajaxRequest.onreadystatechange=function(){t.onXMLLoaded()},this.ajaxRequest.open("GET",this.url,!0),this.ajaxRequest.overrideMimeType&&this.ajaxRequest.overrideMimeType("application/xml"),this.ajaxRequest.send(null)},n.BitmapFontLoader.prototype.onXMLLoaded=function(){if(4==this.ajaxRequest.readyState&&(200==this.ajaxRequest.status||-1==window.location.href.indexOf("http"))){var t=this.baseUrl+this.ajaxRequest.responseXML.getElementsByTagName("page")[0].attributes.getNamedItem("file").nodeValue,e=new n.ImageLoader(t,this.crossorigin);this.texture=e.texture.baseTexture;var i={},r=this.ajaxRequest.responseXML.getElementsByTagName("info")[0],s=this.ajaxRequest.responseXML.getElementsByTagName("common")[0];i.font=r.attributes.getNamedItem("face").nodeValue,i.size=parseInt(r.attributes.getNamedItem("size").nodeValue,10),i.lineHeight=parseInt(s.attributes.getNamedItem("lineHeight").nodeValue,10),i.chars={};for(var a=this.ajaxRequest.responseXML.getElementsByTagName("char"),o=0;a.length>o;o++){var h=parseInt(a[o].attributes.getNamedItem("id").nodeValue,10),l={x:parseInt(a[o].attributes.getNamedItem("x").nodeValue,10),y:parseInt(a[o].attributes.getNamedItem("y").nodeValue,10),width:parseInt(a[o].attributes.getNamedItem("width").nodeValue,10),height:parseInt(a[o].attributes.getNamedItem("height").nodeValue,10)};n.TextureCache[h]=new n.Texture(this.texture,l),i.chars[h]={xOffset:parseInt(a[o].attributes.getNamedItem("xoffset").nodeValue,10),yOffset:parseInt(a[o].attributes.getNamedItem("yoffset").nodeValue,10),xAdvance:parseInt(a[o].attributes.getNamedItem("xadvance").nodeValue,10),kerning:{},texture:new n.Texture(this.texture,l)}}var u=this.ajaxRequest.responseXML.getElementsByTagName("kerning");for(o=0;u.length>o;o++){var c=parseInt(u[o].attributes.getNamedItem("first").nodeValue,10),d=parseInt(u[o].attributes.getNamedItem("second").nodeValue,10),p=parseInt(u[o].attributes.getNamedItem("amount").nodeValue,10);i.chars[d].kerning[c]=p}n.BitmapText.fonts[i.font]=i;var f=this;e.addEventListener("loaded",function(){f.onLoaded()}),e.load()}},n.BitmapFontLoader.prototype.onLoaded=function(){this.dispatchEvent({type:"loaded",content:this})},n.SpineLoader=function(t,e){n.EventTarget.call(this),this.url=t,this.crossorigin=e,this.loaded=!1},n.SpineLoader.constructor=n.SpineLoader,n.SpineLoader.prototype.load=function(){new n.JsonLoader(this.url,this.crossorigin),jsonLoader.addEventListener("loaded",function(t){scope.json=t.content.json,scope.onJSONLoaded()}),jsonLoader.load()},n.SpineLoader.prototype.load=function(){var t=this,e=new n.JsonLoader(this.url,this.crossorigin);e.addEventListener("loaded",function(e){t.json=e.content.json,t.onJSONLoaded()}),e.load()},n.SpineLoader.prototype.onJSONLoaded=function(){var t=new u.SkeletonJson,e=t.readSkeletonData(this.json);n.AnimCache[this.url]=e,this.onLoaded()},n.SpineLoader.prototype.onLoaded=function(){this.loaded=!0,this.dispatchEvent({type:"loaded",content:this})},"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=n),exports.PIXI=n):i.PIXI=n}).call(this); \ No newline at end of file diff --git a/docs/data.json b/docs/data.json index fa53e3f..d450277 100644 --- a/docs/data.json +++ b/docs/data.json @@ -1782,7 +1782,7 @@ }, { "file": "src/pixi/display/DisplayObject.js", - "line": 403, + "line": 399, "access": "private", "tagname": "", "class": "DisplayObject" @@ -3690,7 +3690,7 @@ }, { "message": "Missing item type", - "line": " src/pixi/display/DisplayObject.js:403" + "line": " src/pixi/display/DisplayObject.js:399" }, { "message": "Missing item type", diff --git a/docs/files/src_pixi_display_DisplayObject.js.html b/docs/files/src_pixi_display_DisplayObject.js.html index 46436ba..f4c2f15 100644 --- a/docs/files/src_pixi_display_DisplayObject.js.html +++ b/docs/files/src_pixi_display_DisplayObject.js.html @@ -410,10 +410,6 @@ PIXI.DisplayObject.prototype.addFilter = function(mask) start.mask = mask; end.mask = mask; - start.id = end.id = county - - county++; - start.first = start.last = this; end.first = end.last = this; diff --git a/examples/example 1 - Basics/pixi.js b/examples/example 1 - Basics/pixi.js index bb7c6c0..b269e8e 100644 --- a/examples/example 1 - Basics/pixi.js +++ b/examples/example 1 - Basics/pixi.js @@ -907,10 +907,6 @@ PIXI.DisplayObject.prototype.addFilter = function(mask) start.mask = mask; end.mask = mask; - start.id = end.id = county - - county++; - start.first = start.last = this; end.first = end.last = this; diff --git a/examples/example 10 - Text/pixi.js b/examples/example 10 - Text/pixi.js index bb7c6c0..b269e8e 100644 --- a/examples/example 10 - Text/pixi.js +++ b/examples/example 10 - Text/pixi.js @@ -907,10 +907,6 @@ PIXI.DisplayObject.prototype.addFilter = function(mask) start.mask = mask; end.mask = mask; - start.id = end.id = county - - county++; - start.first = start.last = this; end.first = end.last = this; diff --git a/examples/example 11 - RenderTexture/pixi.js b/examples/example 11 - RenderTexture/pixi.js index bb7c6c0..b269e8e 100644 --- a/examples/example 11 - RenderTexture/pixi.js +++ b/examples/example 11 - RenderTexture/pixi.js @@ -907,10 +907,6 @@ PIXI.DisplayObject.prototype.addFilter = function(mask) start.mask = mask; end.mask = mask; - start.id = end.id = county - - county++; - start.first = start.last = this; end.first = end.last = this; diff --git a/examples/example 12 - Spine/pixi.js b/examples/example 12 - Spine/pixi.js index bb7c6c0..b269e8e 100644 --- a/examples/example 12 - Spine/pixi.js +++ b/examples/example 12 - Spine/pixi.js @@ -907,10 +907,6 @@ PIXI.DisplayObject.prototype.addFilter = function(mask) start.mask = mask; end.mask = mask; - start.id = end.id = county - - county++; - start.first = start.last = this; end.first = end.last = this; diff --git a/examples/example 13 - Graphics/pixi.js b/examples/example 13 - Graphics/pixi.js index bb7c6c0..b269e8e 100644 --- a/examples/example 13 - Graphics/pixi.js +++ b/examples/example 13 - Graphics/pixi.js @@ -907,10 +907,6 @@ PIXI.DisplayObject.prototype.addFilter = function(mask) start.mask = mask; end.mask = mask; - start.id = end.id = county - - county++; - start.first = start.last = this; end.first = end.last = this; diff --git a/examples/example 14 - Masking/pixi.js b/examples/example 14 - Masking/pixi.js index bb7c6c0..b269e8e 100644 --- a/examples/example 14 - Masking/pixi.js +++ b/examples/example 14 - Masking/pixi.js @@ -907,10 +907,6 @@ PIXI.DisplayObject.prototype.addFilter = function(mask) start.mask = mask; end.mask = mask; - start.id = end.id = county - - county++; - start.first = start.last = this; end.first = end.last = this; diff --git a/examples/example 2 - SpriteSheet/pixi.js b/examples/example 2 - SpriteSheet/pixi.js index bb7c6c0..b269e8e 100644 --- a/examples/example 2 - SpriteSheet/pixi.js +++ b/examples/example 2 - SpriteSheet/pixi.js @@ -907,10 +907,6 @@ PIXI.DisplayObject.prototype.addFilter = function(mask) start.mask = mask; end.mask = mask; - start.id = end.id = county - - county++; - start.first = start.last = this; end.first = end.last = this; diff --git a/examples/example 3 - MovieClip/pixi.js b/examples/example 3 - MovieClip/pixi.js index bb7c6c0..b269e8e 100755 --- a/examples/example 3 - MovieClip/pixi.js +++ b/examples/example 3 - MovieClip/pixi.js @@ -907,10 +907,6 @@ PIXI.DisplayObject.prototype.addFilter = function(mask) start.mask = mask; end.mask = mask; - start.id = end.id = county - - county++; - start.first = start.last = this; end.first = end.last = this; diff --git a/examples/example 4 - Balls/pixi.js b/examples/example 4 - Balls/pixi.js index bb7c6c0..b269e8e 100644 --- a/examples/example 4 - Balls/pixi.js +++ b/examples/example 4 - Balls/pixi.js @@ -907,10 +907,6 @@ PIXI.DisplayObject.prototype.addFilter = function(mask) start.mask = mask; end.mask = mask; - start.id = end.id = county - - county++; - start.first = start.last = this; end.first = end.last = this; diff --git a/examples/example 5 - Morph/pixi.js b/examples/example 5 - Morph/pixi.js index bb7c6c0..b269e8e 100644 --- a/examples/example 5 - Morph/pixi.js +++ b/examples/example 5 - Morph/pixi.js @@ -907,10 +907,6 @@ PIXI.DisplayObject.prototype.addFilter = function(mask) start.mask = mask; end.mask = mask; - start.id = end.id = county - - county++; - start.first = start.last = this; end.first = end.last = this; diff --git a/examples/example 6 - Interactivity/pixi.js b/examples/example 6 - Interactivity/pixi.js index bb7c6c0..b269e8e 100644 --- a/examples/example 6 - Interactivity/pixi.js +++ b/examples/example 6 - Interactivity/pixi.js @@ -907,10 +907,6 @@ PIXI.DisplayObject.prototype.addFilter = function(mask) start.mask = mask; end.mask = mask; - start.id = end.id = county - - county++; - start.first = start.last = this; end.first = end.last = this; diff --git a/examples/example 7 - Transparent Background/pixi.js b/examples/example 7 - Transparent Background/pixi.js index bb7c6c0..b269e8e 100644 --- a/examples/example 7 - Transparent Background/pixi.js +++ b/examples/example 7 - Transparent Background/pixi.js @@ -907,10 +907,6 @@ PIXI.DisplayObject.prototype.addFilter = function(mask) start.mask = mask; end.mask = mask; - start.id = end.id = county - - county++; - start.first = start.last = this; end.first = end.last = this; diff --git a/examples/example 8 - Dragging/pixi.js b/examples/example 8 - Dragging/pixi.js index bb7c6c0..b269e8e 100644 --- a/examples/example 8 - Dragging/pixi.js +++ b/examples/example 8 - Dragging/pixi.js @@ -907,10 +907,6 @@ PIXI.DisplayObject.prototype.addFilter = function(mask) start.mask = mask; end.mask = mask; - start.id = end.id = county - - county++; - start.first = start.last = this; end.first = end.last = this; diff --git a/examples/example 9 - Tiling Texture/pixi.js b/examples/example 9 - Tiling Texture/pixi.js index bb7c6c0..b269e8e 100644 --- a/examples/example 9 - Tiling Texture/pixi.js +++ b/examples/example 9 - Tiling Texture/pixi.js @@ -907,10 +907,6 @@ PIXI.DisplayObject.prototype.addFilter = function(mask) start.mask = mask; end.mask = mask; - start.id = end.id = county - - county++; - start.first = start.last = this; end.first = end.last = this; diff --git a/src/pixi/display/DisplayObject.js b/src/pixi/display/DisplayObject.js index c524dd7..94ce605 100644 --- a/src/pixi/display/DisplayObject.js +++ b/src/pixi/display/DisplayObject.js @@ -262,10 +262,6 @@ PIXI.DisplayObject.prototype.addFilter = function(mask) start.mask = mask; end.mask = mask; - start.id = end.id = county - - county++; - start.first = start.last = this; end.first = end.last = this; From 7e0fc0cf005582044b7a34dd890212c3c1abf08c Mon Sep 17 00:00:00 2001 From: Mat Groves Date: Wed, 3 Jul 2013 12:17:34 +0100 Subject: [PATCH 37/68] Fixed draw Rect canvas bug --- src/pixi/renderers/canvas/CanvasGraphics.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pixi/renderers/canvas/CanvasGraphics.js b/src/pixi/renderers/canvas/CanvasGraphics.js index c076086..060f97b 100644 --- a/src/pixi/renderers/canvas/CanvasGraphics.js +++ b/src/pixi/renderers/canvas/CanvasGraphics.js @@ -72,7 +72,7 @@ PIXI.CanvasGraphics.renderGraphics = function(graphics, context) { context.globalAlpha = data.fillAlpha * worldAlpha; context.fillStyle = color = '#' + ('00000' + ( data.fillColor | 0).toString(16)).substr(-6); - context.rect(points[0], points[1], points[2], points[3]); + context.fillRect(points[0], points[1], points[2], points[3]); } if(data.lineWidth) From 89504f576fb87f7df75af8d8bb3df6a04265d4d6 Mon Sep 17 00:00:00 2001 From: Mat Groves Date: Thu, 4 Jul 2013 16:07:40 +0100 Subject: [PATCH 38/68] Bug fix to render texture --- src/pixi/renderers/webgl/WebGLRenderGroup.js | 21 ++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/pixi/renderers/webgl/WebGLRenderGroup.js b/src/pixi/renderers/webgl/WebGLRenderGroup.js index fc4eaf2..6094829 100644 --- a/src/pixi/renderers/webgl/WebGLRenderGroup.js +++ b/src/pixi/renderers/webgl/WebGLRenderGroup.js @@ -46,6 +46,7 @@ PIXI.WebGLRenderGroup.prototype.render = function(projection) var gl = this.gl; + gl.uniform2f(PIXI.shaderProgram.projectionVector, projection.x, projection.y); gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA); @@ -133,7 +134,7 @@ PIXI.WebGLRenderGroup.prototype.renderSpecific = function(displayObject, project * it keeps looking until it finds a sprite or gets to the end of the display * scene graph */ - var nextRenderable = displayObject.last; + var nextRenderable = displayObject.first; while(nextRenderable._iNext) { nextRenderable = nextRenderable._iNext; @@ -215,7 +216,7 @@ PIXI.WebGLRenderGroup.prototype.renderSpecific = function(displayObject, project } else { - this.renderSpecial(startBatch); + this.renderSpecial(startBatch, projection); } return; } @@ -231,7 +232,7 @@ PIXI.WebGLRenderGroup.prototype.renderSpecific = function(displayObject, project } else { - this.renderSpecial(startBatch); + this.renderSpecial(startBatch, projection); } // DO the middle batchs.. @@ -245,7 +246,7 @@ PIXI.WebGLRenderGroup.prototype.renderSpecific = function(displayObject, project } else { - this.renderSpecial(renderable); + this.renderSpecial(renderable, projection); } } @@ -256,27 +257,27 @@ PIXI.WebGLRenderGroup.prototype.renderSpecific = function(displayObject, project } else { - this.renderSpecial(endBatch); + this.renderSpecial(endBatch, projection); } } -PIXI.WebGLRenderGroup.prototype.renderSpecial = function(renderable) +PIXI.WebGLRenderGroup.prototype.renderSpecial = function(renderable, projection) { if(renderable instanceof PIXI.TilingSprite) { - if(renderable.visible)this.renderTilingSprite(renderable, projectionMatrix); + if(renderable.visible)this.renderTilingSprite(renderable, projection); } else if(renderable instanceof PIXI.Strip) { - if(renderable.visible)this.renderStrip(renderable, projectionMatrix); + if(renderable.visible)this.renderStrip(renderable, projection); } else if(renderable instanceof PIXI.CustomRenderable) { - if(renderable.visible) renderable.renderWebGL(this, projectionMatrix); + if(renderable.visible) renderable.renderWebGL(this, projection); } else if(renderable instanceof PIXI.Graphics) { - if(renderable.visible && renderable.renderable) PIXI.WebGLGraphics.renderGraphics(renderable);//, projectionMatrix); + if(renderable.visible && renderable.renderable) PIXI.WebGLGraphics.renderGraphics(renderable, projection); } else if(renderable instanceof PIXI.FilterBlock) { From a7b54fc47ee5348e4fc7783826c821080f90feca Mon Sep 17 00:00:00 2001 From: Mat Groves Date: Fri, 5 Jul 2013 15:14:10 +0100 Subject: [PATCH 39/68] Update README.md --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1e665f7..1993a75 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,10 @@ any breakthroughs will be posted up there too! - [Render Texture Demo]() +- [Primitives Demo]() + +- [Masking Demo]() + - [Interaction Demo]() - [photonstorm Balls Demo]() @@ -49,8 +53,6 @@ last 2 examples and allowing us to share the source code :) ### Road Map ### * Create a Typescript definition file for Pixi.js -* Implement Custom Render Item (currently being worked on by @GoodBoyDigital) -* Implement Masking * Implement Filters (currently being worked on by @GoodBoyDigital) * Implement Flash animation to pixi * Update Loader so that it support XHR2 if it is available @@ -104,6 +106,7 @@ It also copies the non-minified version to the examples. - Render Texture - Spine support - Primitive Drawing +- Masking ### Coming soon ### From 2a1e3910a4878eecc7c21bf4d79ce6c10f383bb0 Mon Sep 17 00:00:00 2001 From: Chad Engler Date: Sun, 7 Jul 2013 12:29:10 -0700 Subject: [PATCH 40/68] a shitload of doc updates --- src/pixi/InteractionManager.js | 127 ++++++++-- src/pixi/Pixi.js | 2 +- src/pixi/core/Circle.js | 10 +- src/pixi/core/Ellipse.js | 14 +- src/pixi/core/Point.js | 7 +- src/pixi/core/Polygon.js | 19 +- src/pixi/core/Rectangle.js | 19 +- src/pixi/display/DisplayObject.js | 219 +++++++++++----- src/pixi/display/DisplayObjectContainer.js | 60 ++--- src/pixi/display/MovieClip.js | 44 +++- src/pixi/display/Sprite.js | 83 +++--- src/pixi/display/Stage.js | 87 +++++-- src/pixi/extras/CustomRenderable.js | 23 +- src/pixi/extras/Spine.js | 7 +- src/pixi/extras/TilingSprite.js | 43 +++- src/pixi/loaders/AssetLoader.js | 52 ++-- src/pixi/loaders/BitmapFontLoader.js | 51 +++- src/pixi/loaders/ImageLoader.js | 18 +- src/pixi/loaders/JsonLoader.js | 58 ++++- src/pixi/loaders/SpineLoader.js | 59 +++-- src/pixi/loaders/SpriteSheetLoader.js | 55 +++- src/pixi/primitives/Graphics.js | 85 +++++-- src/pixi/renderers/canvas/CanvasGraphics.js | 11 +- src/pixi/renderers/canvas/CanvasRenderer.js | 75 +++--- src/pixi/renderers/webgl/WebGLBatch.js | 230 ++++++++--------- src/pixi/renderers/webgl/WebGLGraphics.js | 61 ++++- src/pixi/renderers/webgl/WebGLRenderGroup.js | 154 ++++++++++-- src/pixi/renderers/webgl/WebGLRenderer.js | 127 ++++++---- src/pixi/text/BitmapText.js | 26 +- src/pixi/text/Text.js | 57 +++-- src/pixi/textures/BaseTexture.js | 49 ++-- src/pixi/textures/RenderTexture.js | 85 ++++--- src/pixi/textures/Texture.js | 76 ++++-- src/pixi/utils/Detector.js | 7 +- src/pixi/utils/EventTarget.js | 12 + src/pixi/utils/Polyk.js | 252 ++++++++++--------- src/pixi/utils/Utils.js | 67 +++-- 37 files changed, 1665 insertions(+), 766 deletions(-) diff --git a/src/pixi/InteractionManager.js b/src/pixi/InteractionManager.js index 4f30464..7469af6 100644 --- a/src/pixi/InteractionManager.js +++ b/src/pixi/InteractionManager.js @@ -5,45 +5,48 @@ /** -The interaction manager deals with mouse and touch events. Any DisplayObject can be interactive -This manager also supports multitouch. -@class InteractionManager -@constructor -@param stage {Stage} -@type Stage -*/ + * The interaction manager deals with mouse and touch events. Any DisplayObject can be interactive + * This manager also supports multitouch. + * + * @class InteractionManager + * @constructor + * @param stage {Stage} The stage to handle interactions + */ PIXI.InteractionManager = function(stage) { /** * a refference to the stage + * * @property stage * @type Stage */ this.stage = stage; - // helpers - this.tempPoint = new PIXI.Point(); - //this.tempMatrix = mat3.create(); - - this.mouseoverEnabled = true; - /** - * the mouse data + * the mouse data + * * @property mouse * @type InteractionData */ this.mouse = new PIXI.InteractionData(); - + /** - * an object that stores current touches (InteractionData) by id reference + * an object that stores current touches (InteractionData) by id reference + * * @property touchs * @type Object */ this.touchs = {}; - + + // helpers + this.tempPoint = new PIXI.Point(); + //this.tempMatrix = mat3.create(); + + this.mouseoverEnabled = true; + //tiny little interactiveData pool! this.pool = []; - + this.interactiveItems = []; this.last = 0; @@ -52,6 +55,14 @@ PIXI.InteractionManager = function(stage) // constructor PIXI.InteractionManager.constructor = PIXI.InteractionManager; +/** + * Collects an interactive sprite recursively to have their interactions managed + * + * @method collectInteractiveSprite + * @param displayObject {DisplayObject} the displayObject to collect + * @param iParent {DisplayObject} + * @private + */ PIXI.InteractionManager.prototype.collectInteractiveSprite = function(displayObject, iParent) { var children = displayObject.children; @@ -88,6 +99,13 @@ PIXI.InteractionManager.prototype.collectInteractiveSprite = function(displayObj } } +/** + * Sets the target for event delegation + * + * @method setTarget + * @param target {WebGLRenderer|CanvasRenderer} the renderer to bind events to + * @private + */ PIXI.InteractionManager.prototype.setTarget = function(target) { if (window.navigator.msPointerEnabled) @@ -111,6 +129,12 @@ PIXI.InteractionManager.prototype.setTarget = function(target) target.view.addEventListener("touchmove", this.onTouchMove.bind(this), true); } +/** + * updates the state of interactive objects + * + * @method update + * @private + */ PIXI.InteractionManager.prototype.update = function() { if(!this.target)return; @@ -190,6 +214,13 @@ PIXI.InteractionManager.prototype.update = function() } } +/** + * Is called when the mouse moves accross the renderer element + * + * @method onMouseMove + * @param event {Event} The DOM event of the mouse moving + * @private + */ PIXI.InteractionManager.prototype.onMouseMove = function(event) { this.mouse.originalEvent = event || window.event; //IE uses window.event @@ -215,6 +246,13 @@ PIXI.InteractionManager.prototype.onMouseMove = function(event) } } +/** + * Is called when the mouse button is pressed down on the renderer element + * + * @method onMouseDown + * @param event {Event} The DOM event of a mouse button being pressed down + * @private + */ PIXI.InteractionManager.prototype.onMouseDown = function(event) { event.preventDefault(); @@ -254,6 +292,13 @@ PIXI.InteractionManager.prototype.onMouseDown = function(event) } } +/** + * Is called when the mouse button is released on the renderer element + * + * @method onMouseUp + * @param event {Event} The DOM event of a mouse button being released + * @private + */ PIXI.InteractionManager.prototype.onMouseUp = function(event) { this.mouse.originalEvent = event || window.event; //IE uses window.event @@ -299,6 +344,14 @@ PIXI.InteractionManager.prototype.onMouseUp = function(event) } } +/** + * Tests if the current mouse coords hit a sprite + * + * @method hitTest + * @param item {DisplayObject} The displayObject to test for a hit + * @param interactionData {InteractionData} The interactiondata object to update in the case of a hit + * @private + */ PIXI.InteractionManager.prototype.hitTest = function(item, interactionData) { var global = interactionData.global; @@ -355,8 +408,13 @@ PIXI.InteractionManager.prototype.hitTest = function(item, interactionData) return false; } - - +/** + * Is called when a touch is moved accross the renderer element + * + * @method onTouchMove + * @param event {Event} The DOM event of a touch moving accross the renderer view + * @private + */ PIXI.InteractionManager.prototype.onTouchMove = function(event) { this.mouse.originalEvent = event || window.event; //IE uses window.event @@ -381,6 +439,13 @@ PIXI.InteractionManager.prototype.onTouchMove = function(event) } } +/** + * Is called when a touch is started on the renderer element + * + * @method onTouchStart + * @param event {Event} The DOM event of a touch starting on the renderer view + * @private + */ PIXI.InteractionManager.prototype.onTouchStart = function(event) { event.preventDefault(); @@ -422,9 +487,15 @@ PIXI.InteractionManager.prototype.onTouchStart = function(event) } } } - } +/** + * Is called when a touch is ended on the renderer element + * + * @method onTouchEnd + * @param event {Event} The DOM event of a touch ending on the renderer view + * @private + */ PIXI.InteractionManager.prototype.onTouchEnd = function(event) { this.mouse.originalEvent = event || window.event; //IE uses window.event @@ -491,13 +562,16 @@ PIXI.InteractionManager.prototype.onTouchEnd = function(event) } /** -@class InteractionData -@constructor -*/ + * Holds all information related to an Interaction event + * + * @class InteractionData + * @constructor + */ PIXI.InteractionData = function() { /** * This point stores the global coords of where the touch/mouse event happened + * * @property global * @type Point */ @@ -508,6 +582,7 @@ PIXI.InteractionData = function() /** * The target Sprite that was interacted with + * * @property target * @type Sprite */ @@ -515,6 +590,7 @@ PIXI.InteractionData = function() /** * When passed to an event handler, this will be the original DOM Event that was captured + * * @property originalEvent * @type Event */ @@ -523,6 +599,7 @@ PIXI.InteractionData = function() /** * This will return the local coords of the specified displayObject for this InteractionData + * * @method getLocalPosition * @param displayObject {DisplayObject} The DisplayObject that you would like the local coords off * @return {Point} A point containing the coords of the InteractionData position relative to the DisplayObject @@ -543,5 +620,3 @@ PIXI.InteractionData.prototype.getLocalPosition = function(displayObject) // constructor PIXI.InteractionData.constructor = PIXI.InteractionData; - - diff --git a/src/pixi/Pixi.js b/src/pixi/Pixi.js index 328bf1e..bc71d47 100644 --- a/src/pixi/Pixi.js +++ b/src/pixi/Pixi.js @@ -3,6 +3,6 @@ */ /** -@module PIXI + * @module PIXI */ var PIXI = PIXI || {}; diff --git a/src/pixi/core/Circle.js b/src/pixi/core/Circle.js index 088156b..6c3433d 100644 --- a/src/pixi/core/Circle.js +++ b/src/pixi/core/Circle.js @@ -3,6 +3,8 @@ */ /** + * The Circle object can be used to specify a hit area for displayobjects + * * @class Circle * @constructor * @param x {Number} The X coord of the upper-left corner of the framing rectangle of this circle @@ -34,8 +36,10 @@ PIXI.Circle = function(x, y, radius) } /** + * Creates a clone of this Circle instance + * * @method clone - * @return a copy of the polygon + * @return {Circle} a copy of the polygon */ PIXI.Circle.prototype.clone = function() { @@ -43,10 +47,12 @@ PIXI.Circle.prototype.clone = function() } /** + * Checks if the x, and y coords passed to this function are contained within this circle + * * @method contains * @param x {Number} The X coord of the point to test * @param y {Number} The Y coord of the point to test - * @return if the x/y coords are within this polygon + * @return {Boolean} if the x/y coords are within this polygon */ PIXI.Circle.prototype.contains = function(x, y) { diff --git a/src/pixi/core/Ellipse.js b/src/pixi/core/Ellipse.js index e28b9a9..c011a63 100644 --- a/src/pixi/core/Ellipse.js +++ b/src/pixi/core/Ellipse.js @@ -3,10 +3,12 @@ */ /** + * The Ellipse object can be used to specify a hit area for displayobjects + * * @class Ellipse * @constructor - * @param x {Number} The X coord of the upper-left corner of the framing rectangle of this circle - * @param y {Number} The Y coord of the upper-left corner of the framing rectangle of this circle + * @param x {Number} The X coord of the upper-left corner of the framing rectangle of this ellipse + * @param y {Number} The Y coord of the upper-left corner of the framing rectangle of this ellipse * @param width {Number} The overall height of this ellipse * @param height {Number} The overall width of this ellipse */ @@ -42,8 +44,10 @@ PIXI.Ellipse = function(x, y, width, height) } /** + * Creates a clone of this Ellipse instance + * * @method clone - * @return a copy of the polygon + * @return {Ellipse} a copy of the polygon */ PIXI.Ellipse.prototype.clone = function() { @@ -51,10 +55,12 @@ PIXI.Ellipse.prototype.clone = function() } /** + * Checks if the x, and y coords passed to this function are contained within this ellipse + * * @method contains * @param x {Number} The X coord of the point to test * @param y {Number} The Y coord of the point to test - * @return if the x/y coords are within this polygon + * @return {Boolean} if the x/y coords are within this polygon */ PIXI.Ellipse.prototype.contains = function(x, y) { diff --git a/src/pixi/core/Point.js b/src/pixi/core/Point.js index 6fd5295..294a8f8 100644 --- a/src/pixi/core/Point.js +++ b/src/pixi/core/Point.js @@ -4,6 +4,7 @@ /** * 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 @@ -26,9 +27,11 @@ PIXI.Point = function(x, y) this.y = y || 0; } -/** +/** + * Creates a clone of this point + * * @method clone - * @return a copy of the point + * @return {Point} a copy of the point */ PIXI.Point.prototype.clone = function() { diff --git a/src/pixi/core/Polygon.js b/src/pixi/core/Polygon.js index 96edc75..5c1db06 100644 --- a/src/pixi/core/Polygon.js +++ b/src/pixi/core/Polygon.js @@ -5,11 +5,18 @@ /** * @class Polygon * @constructor - * @param points {Array|Array} This cna be an array of Points or a flat array of numbers - * that will be interpreted as [x,y, x,y, ...] + * @param points* {Array|Array|Point...|Number...} This can be an array of Points that form the polygon, + * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arugments passed can be + * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the + * arguments passed can be flat x,y values e.g. `new PIXI.Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are + * Numbers. */ PIXI.Polygon = function(points) { + //if points isn't an array, use arguments as the array + if(!(points instanceof Array)) + points = Array.prototype.slice.call(arguments); + //if this is a flat array of numbers, convert it to points if(typeof points[0] === 'number') { var p = []; @@ -26,8 +33,10 @@ PIXI.Polygon = function(points) } /** + * Creates a clone of this polygon + * * @method clone - * @return a copy of the polygon + * @return {Polygon} a copy of the polygon */ PIXI.Polygon.prototype.clone = function() { @@ -40,10 +49,12 @@ PIXI.Polygon.prototype.clone = function() } /** + * Checks if the x, and y coords passed to this function are contained within this polygon + * * @method contains * @param x {Number} The X coord of the point to test * @param y {Number} The Y coord of the point to test - * @return if the x/y coords are within this polygon + * @return {Boolean} if the x/y coords are within this polygon */ PIXI.Polygon.prototype.contains = function(x, y) { diff --git a/src/pixi/core/Rectangle.js b/src/pixi/core/Rectangle.js index 0b26270..64acf7a 100644 --- a/src/pixi/core/Rectangle.js +++ b/src/pixi/core/Rectangle.js @@ -4,12 +4,13 @@ /** * 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 + * @param x {Number} The X coord of the upper-left corner of the rectangle + * @param y {Number} The Y coord of the upper-left corner of the rectangle + * @param width {Number} The overall wisth of this rectangle + * @param height {Number} The overall height of this rectangle */ PIXI.Rectangle = function(x, y, width, height) { @@ -42,9 +43,11 @@ PIXI.Rectangle = function(x, y, width, height) this.height = height || 0; } -/** +/** + * Creates a clone of this Rectangle + * * @method clone - * @return a copy of the rectangle + * @return {Rectangle} a copy of the rectangle */ PIXI.Rectangle.prototype.clone = function() { @@ -52,10 +55,12 @@ PIXI.Rectangle.prototype.clone = function() } /** + * Checks if the x, and y coords passed to this function are contained within this Rectangle + * * @method contains * @param x {Number} The X coord of the point to test * @param y {Number} The Y coord of the point to test - * @return if the x/y coords are within this polygon + * @return {Boolean} if the x/y coords are within this Rectangle */ PIXI.Rectangle.prototype.contains = function(x, y) { diff --git a/src/pixi/display/DisplayObject.js b/src/pixi/display/DisplayObject.js index 94ce605..3b51aaf 100644 --- a/src/pixi/display/DisplayObject.js +++ b/src/pixi/display/DisplayObject.js @@ -3,7 +3,8 @@ */ /** - * this is the base class for all objects that are rendered on the screen. + * The base class for all objects that are rendered on the screen. + * * @class DisplayObject * @constructor */ @@ -11,163 +12,243 @@ PIXI.DisplayObject = function() { this.last = this; this.first = this; - + /** * The coordinate of the object relative to the local coordinates of the parent. + * * @property position * @type Point */ this.position = new PIXI.Point(); - + /** * The scale factor of the object. + * * @property scale * @type Point */ this.scale = new PIXI.Point(1,1);//{x:1, y:1}; - + /** * The pivot point of the displayObject that it rotates around + * * @property pivot * @type Point */ this.pivot = new PIXI.Point(0,0); - + /** * The rotation of the object in radians. + * * @property rotation * @type Number */ this.rotation = 0; - + /** * The opacity of the object. + * * @property alpha * @type Number */ this.alpha = 1; - + /** * The visibility of the object. + * * @property visible * @type Boolean */ this.visible = true; - this.worldVisible = false; - - /** - * [read-only] The display object container that contains this display object. - * @property parent - * @type DisplayObjectContainer - */ - this.parent = null; - - /** - * [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage. - * @property stage - * @type Stage - */ - this.stage = null; - + /** * This is the defined area that will pick up mouse / touch events. It is null by default. * Setting it is a neat way of optimising the hitTest function that the interactionManager will use (as it will not need to hit test all the children) + * * @property hitArea - * @type Rectangle + * @type Rectangle|Circle|Ellipse|Polygon */ this.hitArea = null; - - this.worldAlpha = 1; - this.color = []; - - this.worldTransform = PIXI.mat3.create()//mat3.identity(); - this.localTransform = PIXI.mat3.create()//mat3.identity(); - - this.dynamic = true; - // chach that puppy! - this._sr = 0; - this._cr = 1; - - this.childIndex = 0; - - this.renderable = false; - - // [readonly] best not to toggle directly! use setInteractive() - this._interactive = false; - + /** * This is used to indicate if the displayObject should display a mouse hand cursor on rollover + * * @property buttonMode * @type Boolean */ this.buttonMode = false; - + + /** + * Can this object be rendered + * + * @property renderable + * @type Boolean + */ + this.renderable = false; + + /** + * [read-only] The visibility of the object based on world (parent) factors. + * + * @property worldVisible + * @type Boolean + * @readOnly + */ + this.worldVisible = false; + + /** + * [read-only] The display object container that contains this display object. + * + * @property parent + * @type DisplayObjectContainer + * @readOnly + */ + this.parent = null; + + /** + * [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage. + * + * @property stage + * @type Stage + * @readOnly + */ + this.stage = null; + + /** + * [read-only] The index of this object in the parent's `children` array + * + * @property childIndex + * @type Number + * @readOnly + */ + this.childIndex = 0; + + /** + * [read-only] The multiplied alpha of the displayobject + * + * @property worldAlpha + * @type Number + * @readOnly + */ + this.worldAlpha = 1; + + /** + * [read-only] Whether or not the object is interactive, do not toggle directly! use the `interactive` property + * + * @property _interactive + * @type Boolean + * @readOnly + * @private + */ + this._interactive = false; + + /** + * [read-only] Current transform of the object based on world (parent) factors + * + * @property worldTransform + * @type Mat3 + * @readOnly + * @private + */ + this.worldTransform = PIXI.mat3.create()//mat3.identity(); + + /** + * [read-only] Current transform of the object locally + * + * @property localTransform + * @type Mat3 + * @readOnly + * @private + */ + this.localTransform = PIXI.mat3.create()//mat3.identity(); + + /** + * [NYI] Unkown + * + * @property color + * @type Array<> + * @private + */ + this.color = []; + + /** + * [NYI] Holds whether or not this object is dynamic, for rendering optimization + * + * @property dynamic + * @type Boolean + * @private + */ + this.dynamic = true; + + // chach that puppy! + this._sr = 0; + this._cr = 1; + /* * MOUSE Callbacks */ - + /** * A callback that is used when the users clicks on the displayObject with their mouse * @method click * @param interactionData {InteractionData} */ - + /** * A callback that is used when the user clicks the mouse down over the sprite * @method mousedown * @param interactionData {InteractionData} */ - + /** * A callback that is used when the user releases the mouse that was over the displayObject * for this callback to be fired the mouse must have been pressed down over the displayObject * @method mouseup * @param interactionData {InteractionData} */ - + /** * A callback that is used when the user releases the mouse that was over the displayObject but is no longer over the displayObject * for this callback to be fired, The touch must have started over the displayObject * @method mouseupoutside * @param interactionData {InteractionData} */ - + /** * A callback that is used when the users mouse rolls over the displayObject * @method mouseover * @param interactionData {InteractionData} */ - + /** * A callback that is used when the users mouse leaves the displayObject * @method mouseout * @param interactionData {InteractionData} */ - - + + /* * TOUCH Callbacks */ - + /** * A callback that is used when the users taps on the sprite with their finger * basically a touch version of click * @method tap * @param interactionData {InteractionData} */ - + /** * A callback that is used when the user touch's over the displayObject * @method touchstart * @param interactionData {InteractionData} */ - + /** * A callback that is used when the user releases a touch over the displayObject * @method touchend * @param interactionData {InteractionData} */ - + /** * A callback that is used when the user releases the touch that was over the displayObject * for this callback to be fired, The touch must have started over the sprite @@ -193,8 +274,10 @@ Object.defineProperty(PIXI.DisplayObject.prototype, 'visible', { /** * [Deprecated] Indicates if the sprite will have touch and mouse interactivity. It is false by default * Instead of using this function you can now simply set the interactive property to true or false + * * @method setInteractive * @param interactive {Boolean} + * @deprecated Simply set the `interactive` property directly */ PIXI.DisplayObject.prototype.setInteractive = function(interactive) { @@ -203,8 +286,10 @@ PIXI.DisplayObject.prototype.setInteractive = function(interactive) /** * Indicates if the sprite will have touch and mouse interactivity. It is false by default + * * @property interactive * @type Boolean + * @default false */ Object.defineProperty(PIXI.DisplayObject.prototype, 'interactive', { get: function() { @@ -223,8 +308,9 @@ Object.defineProperty(PIXI.DisplayObject.prototype, 'interactive', { * Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it. * In PIXI a regular mask must be a PIXI.Ggraphics object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. + * * @property mask - * @type PIXI.Graphics + * @type Graphics */ Object.defineProperty(PIXI.DisplayObject.prototype, 'mask', { get: function() { @@ -245,8 +331,12 @@ Object.defineProperty(PIXI.DisplayObject.prototype, 'mask', { } }); -/* - * private +/* + * Adds a filter to this displayObject + * + * @method addFilter + * @param mask {Graphics} the graphics object to use as a filter + * @private */ PIXI.DisplayObject.prototype.addFilter = function(mask) { @@ -346,6 +436,12 @@ PIXI.DisplayObject.prototype.addFilter = function(mask) } +/* + * Removes the filter to this displayObject + * + * @method removeFilter + * @private + */ PIXI.DisplayObject.prototype.removeFilter = function() { if(!this.filter)return; @@ -396,7 +492,10 @@ PIXI.DisplayObject.prototype.removeFilter = function() //} } -/** +/* + * Updates the object transform for rendering + * + * @method updateTransform * @private */ PIXI.DisplayObject.prototype.updateTransform = function() diff --git a/src/pixi/display/DisplayObjectContainer.js b/src/pixi/display/DisplayObjectContainer.js index 1a879f9..c2ac80f 100644 --- a/src/pixi/display/DisplayObjectContainer.js +++ b/src/pixi/display/DisplayObjectContainer.js @@ -4,7 +4,9 @@ /** - * 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. + * * @class DisplayObjectContainer * @extends DisplayObject * @constructor @@ -15,12 +17,12 @@ PIXI.DisplayObjectContainer = function() /** * [read-only] The of children of this container. - * @property children {Array} + * + * @property children + * @type Array + * @readOnly */ this.children = []; - //s - this.renderable = false; - } // constructor @@ -41,15 +43,12 @@ Object.defineProperty(PIXI.DisplayObjectContainer.prototype, 'visible', { /** * Adds a child to the container. + * * @method addChild - * @param DisplayObject {DisplayObject} + * @param child {DisplayObject} The DisplayObject to add to the container */ PIXI.DisplayObjectContainer.prototype.addChild = function(child) { - - //this.addChildAt(child, this.children.length) - //return; - if(child.parent != undefined) { @@ -57,9 +56,9 @@ PIXI.DisplayObjectContainer.prototype.addChild = function(child) child.parent.removeChild(child); // return; } - + child.parent = this; - //child.childIndex = this.children.length; + child.childIndex = this.children.length; this.children.push(child); @@ -82,7 +81,6 @@ PIXI.DisplayObjectContainer.prototype.addChild = function(child) // modify the list.. var childFirst = child.first var childLast = child.last; -// console.log(childFirst) var nextObject; var previousObject; @@ -95,9 +93,7 @@ PIXI.DisplayObjectContainer.prototype.addChild = function(child) { previousObject = this.last; } -// if(this.last._iNext) - - //console.log( this.last._iNext); + nextObject = previousObject._iNext; // always true in this case @@ -123,8 +119,7 @@ PIXI.DisplayObjectContainer.prototype.addChild = function(child) childFirst._iPrev = previousObject; previousObject._iNext = childFirst; - -// console.log(childFirst); + // need to remove any render groups.. if(this.__renderGroup) { @@ -138,9 +133,10 @@ 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 + * * @method addChildAt - * @param DisplayObject {DisplayObject} - * @param index {Number} + * @param child {DisplayObject} The child to add + * @param index {Number} The index to place the child in */ PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index) { @@ -204,8 +200,7 @@ PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index) childFirst._iPrev = previousObject; previousObject._iNext = childFirst; - - + this.children.splice(index, 0, child); // need to remove any render groups.. if(this.__renderGroup) @@ -225,10 +220,12 @@ PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index) } /** - * Swaps the depth of 2 displayObjects + * [NYI] Swaps the depth of 2 displayObjects + * * @method swapChildren - * @param DisplayObject {DisplayObject} - * @param DisplayObject2 {DisplayObject} + * @param child {DisplayObject} + * @param child2 {DisplayObject} + * @private */ PIXI.DisplayObjectContainer.prototype.swapChildren = function(child, child2) { @@ -273,8 +270,9 @@ PIXI.DisplayObjectContainer.prototype.swapChildren = function(child, child2) /** * Returns the Child at the specified index + * * @method getChildAt - * @param index {Number} + * @param index {Number} The index to get the child from */ PIXI.DisplayObjectContainer.prototype.getChildAt = function(index) { @@ -290,15 +288,15 @@ PIXI.DisplayObjectContainer.prototype.getChildAt = function(index) /** * Removes a child from the container. + * * @method removeChild - * @param DisplayObject {DisplayObject} + * @param child {DisplayObject} The DisplayObject to remove */ PIXI.DisplayObjectContainer.prototype.removeChild = function(child) { var index = this.children.indexOf( child ); if ( index !== -1 ) { - //console.log(">>") // unlink // // modify the list.. var childFirst = child.first @@ -354,8 +352,10 @@ PIXI.DisplayObjectContainer.prototype.removeChild = function(child) } } - -/** +/* + * Updates the container's children's transform for rendering + * + * @method updateTransform * @private */ PIXI.DisplayObjectContainer.prototype.updateTransform = function() diff --git a/src/pixi/display/MovieClip.js b/src/pixi/display/MovieClip.js index 6b0cba2..b435ffe 100644 --- a/src/pixi/display/MovieClip.js +++ b/src/pixi/display/MovieClip.js @@ -4,56 +4,68 @@ /** * A MovieClip is a simple way to display an animation depicted by a list of textures. + * * @class MovieClip * @extends Sprite * @constructor - * @param textures {Array} an array of {Texture} objects that make up the animation + * @param textures {Array} an array of {Texture} objects that make up the animation */ PIXI.MovieClip = function(textures) { - PIXI.Sprite.call( this, textures[0]); + PIXI.Sprite.call(this, textures[0]); /** * The array of textures that make up the animation + * * @property textures * @type Array */ this.textures = textures; - /** - * [read only] The index MovieClips current frame (this may not have to be a whole number) - * @property currentFrame - * @type Number - */ - this.currentFrame = 0; - /** * The speed that the MovieClip will play at. Higher is faster, lower is slower + * * @property animationSpeed * @type Number + * @default 1 */ this.animationSpeed = 1; /** * Whether or not the movie clip repeats after playing. + * * @property loop * @type Boolean + * @default true */ this.loop = true; /** * Function to call when a MovieClip finishes playing + * * @property onComplete * @type Function */ this.onComplete = null; /** - * [read only] indicates if the MovieClip is currently playing + * [read-only] The index MovieClips current frame (this may not have to be a whole number) + * + * @property currentFrame + * @type Number + * @default 0 + * @readOnly + */ + this.currentFrame = 0; + + /** + * [read-only] Indicates if the MovieClip is currently playing + * * @property playing * @type Boolean + * @readOnly */ - this.playing; + this.playing = false; } // constructor @@ -62,6 +74,7 @@ PIXI.MovieClip.prototype = Object.create( PIXI.Sprite.prototype ); /** * Stops the MovieClip + * * @method stop */ PIXI.MovieClip.prototype.stop = function() @@ -71,6 +84,7 @@ PIXI.MovieClip.prototype.stop = function() /** * Plays the MovieClip + * * @method play */ PIXI.MovieClip.prototype.play = function() @@ -80,6 +94,7 @@ PIXI.MovieClip.prototype.play = function() /** * Stops the MovieClip and goes to a specific frame + * * @method gotoAndStop * @param frameNumber {Number} frame index to stop at */ @@ -93,6 +108,7 @@ PIXI.MovieClip.prototype.gotoAndStop = function(frameNumber) /** * Goes to a specific frame and begins playing the MovieClip + * * @method gotoAndPlay * @param frameNumber {Number} frame index to start at */ @@ -102,6 +118,12 @@ PIXI.MovieClip.prototype.gotoAndPlay = function(frameNumber) this.playing = true; } +/* + * Updates the object transform for rendering + * + * @method updateTransform + * @private + */ PIXI.MovieClip.prototype.updateTransform = function() { PIXI.Sprite.prototype.updateTransform.call(this); diff --git a/src/pixi/display/Sprite.js b/src/pixi/display/Sprite.js index e4c1404..945331a 100644 --- a/src/pixi/display/Sprite.js +++ b/src/pixi/display/Sprite.js @@ -8,55 +8,64 @@ PIXI.blendModes.SCREEN = 1; /** -@class Sprite -@extends DisplayObjectContainer -@constructor -@param texture {Texture} -@type String -*/ + * The SPrite object is the base for all textured objects that are rendered to the screen + * + * @class Sprite + * @extends DisplayObjectContainer + * @constructor + * @param texture {Texture} The texture for this sprite + * @type String + */ PIXI.Sprite = function(texture) { PIXI.DisplayObjectContainer.call( this ); - - /** + + /** * The anchor sets the origin point of the texture. * The default is 0,0 this means the textures origin is the top left * Setting than anchor to 0.5,0.5 means the textures origin is centered * Setting the anchor to 1,1 would mean the textures origin points will be the bottom right + * * @property anchor * @type Point */ this.anchor = new PIXI.Point(); - + /** * The texture that the sprite is using + * * @property texture * @type Texture */ this.texture = texture; - + /** * The blend mode of sprite. * currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN + * * @property blendMode - * @type uint + * @type Number */ this.blendMode = PIXI.blendModes.NORMAL; - + /** * The width of the sprite (this is initially set by the texture) - * @property width - * @type #Number + * + * @property _width + * @type Number + * @private */ this._width = 0; - + /** * The height of the sprite (this is initially set by the texture) - * @property height - * @type #Number + * + * @property _height + * @type Number + * @private */ this._height = 0; - + if(texture.baseTexture.hasLoaded) { this.updateFrame = true; @@ -66,20 +75,20 @@ PIXI.Sprite = function(texture) this.onTextureUpdateBind = this.onTextureUpdate.bind(this); this.texture.addEventListener( 'update', this.onTextureUpdateBind ); } - + this.renderable = true; - - // thi next bit is here for the docs... - - } // constructor PIXI.Sprite.constructor = PIXI.Sprite; PIXI.Sprite.prototype = Object.create( PIXI.DisplayObjectContainer.prototype ); -// OOH! shiney new getters and setters for width and height -// The width and height now modify the scale (this is what flash does, nice and tidy!) +/** + * The width of the sprite, setting this will actually modify the scale to acheive the value set + * + * @property width + * @type Number + */ Object.defineProperty(PIXI.Sprite.prototype, 'width', { get: function() { return this.scale.x * this.texture.frame.width; @@ -90,6 +99,12 @@ Object.defineProperty(PIXI.Sprite.prototype, 'width', { } }); +/** + * The height of the sprite, setting this will actually modify the scale to acheive the value set + * + * @property height + * @type Number + */ Object.defineProperty(PIXI.Sprite.prototype, 'height', { get: function() { return this.scale.y * this.texture.frame.height; @@ -99,11 +114,13 @@ Object.defineProperty(PIXI.Sprite.prototype, 'height', { this._height = value; } }); - + /** -@method setTexture -@param texture {Texture} The PIXI texture that is displayed by the sprite -*/ + * Sets the texture of the sprite + * + * @method setTexture + * @param texture {Texture} The PIXI texture that is displayed by the sprite + */ PIXI.Sprite.prototype.setTexture = function(texture) { // stop current texture; @@ -117,6 +134,10 @@ PIXI.Sprite.prototype.setTexture = function(texture) } /** + * When the texture is updated, this event will fire to update the scale and frame + * + * @method onTextureUpdate + * @param event * @private */ PIXI.Sprite.prototype.onTextureUpdate = function(event) @@ -136,6 +157,7 @@ PIXI.Sprite.prototype.onTextureUpdate = function(event) * * Helper function that creates a sprite that will contain a texture from the TextureCache based on the 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 @@ -152,9 +174,10 @@ PIXI.Sprite.fromFrame = function(frameId) * * 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 + * @param imageId {String} The image url of the texture * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id */ PIXI.Sprite.fromImage = function(imageId) diff --git a/src/pixi/display/Stage.js b/src/pixi/display/Stage.js index 013790e..447d77a 100644 --- a/src/pixi/display/Stage.js +++ b/src/pixi/display/Stage.js @@ -3,46 +3,77 @@ */ /** -A Stage represents the root of the display tree. Everything connected to the stage is rendered -@class Stage -@extends DisplayObjectContainer -@constructor -@param backgroundColor {Number} the background color of the stage -@param interactive {Boolean} enable / disable interaction (default is false) -*/ + * A Stage represents the root of the display tree. Everything connected to the stage is rendered + * + * @class Stage + * @extends DisplayObjectContainer + * @constructor + * @param backgroundColor {Number} the background color of the stage, easiest way to pass this in is in hex format + * like: 0xFFFFFF for white + * @param interactive {Boolean} enable / disable interaction (default is false) + */ PIXI.Stage = function(backgroundColor, interactive) { - PIXI.DisplayObjectContainer.call( this ); - - this.worldTransform = PIXI.mat3.create() + + /** + * [read-only] Current transform of the object based on world (parent) factors + * + * @property worldTransform + * @type Mat3 + * @readOnly + * @private + */ + this.worldTransform = PIXI.mat3.create(); + + /** + * Whether or not the stage is interactive + * + * @property interactive + * @type Boolean + */ + this.interactive = interactive; + + /** + * The interaction manage for this stage, manages all interactive activity on the stage + * + * @property interactive + * @type InteractionManager + */ + this.interactionManager = new PIXI.InteractionManager(this); + + /** + * Whether the stage is dirty and needs to have interactions updated + * + * @property dirty + * @type Boolean + * @private + */ + this.dirty = true; + this.__childrenAdded = []; this.__childrenRemoved = []; - - //this.childIndex = 0; + + //the stage is it's own stage this.stage = this; - this.interactive = interactive; - + + //optimize hit detection a bit this.stage.hitArea = new PIXI.Rectangle(0,0,100000, 100000); - - // interaction! - // this.interactive = !!interactive; - this.interactionManager = new PIXI.InteractionManager(this); - + this.setBackgroundColor(backgroundColor); this.worldVisible = true; - this.stage.dirty = true; } // constructor PIXI.Stage.constructor = PIXI.Stage; - PIXI.Stage.prototype = Object.create( PIXI.DisplayObjectContainer.prototype ); -/** -@method updateTransform -@internal -*/ +/* + * Updates the object transform for rendering + * + * @method updateTransform + * @private + */ PIXI.Stage.prototype.updateTransform = function() { this.worldAlpha = 1; @@ -63,8 +94,11 @@ PIXI.Stage.prototype.updateTransform = function() } /** + * Sets the background color for the stage + * * @method setBackgroundColor - * @param backgroundColor {Number} + * @param backgroundColor {Number} the color of the background, easiest way to pass this in is in hex format + * like: 0xFFFFFF for white */ PIXI.Stage.prototype.setBackgroundColor = function(backgroundColor) { @@ -77,6 +111,7 @@ PIXI.Stage.prototype.setBackgroundColor = function(backgroundColor) /** * This will return the point containing global coords of the mouse. + * * @method getMousePosition * @return {Point} The point containing the coords of the global InteractionData position. */ diff --git a/src/pixi/extras/CustomRenderable.js b/src/pixi/extras/CustomRenderable.js index dda6d5c..7477195 100644 --- a/src/pixi/extras/CustomRenderable.js +++ b/src/pixi/extras/CustomRenderable.js @@ -4,7 +4,8 @@ /** - * Need to finalize this a bit more but works! Its in but will be working on this feature properly next..:) + * This object is one that will allow you to specify custom rendering functions based on render type + * * @class CustomRenderable * @extends DisplayObject * @constructor @@ -19,18 +20,34 @@ PIXI.CustomRenderable = function() PIXI.CustomRenderable.constructor = PIXI.CustomRenderable; PIXI.CustomRenderable.prototype = Object.create( PIXI.DisplayObject.prototype ); +/** + * If this object is being rendered by a CanvasRenderer it will call this callback + * + * @method renderCanvas + * @param renderer {CanvasRenderer} The renderer instance + */ PIXI.CustomRenderable.prototype.renderCanvas = function(renderer) { // override! } - +/** + * If this object is being rendered by a WebGLRenderer it will call this callback to initialize + * + * @method initWebGL + * @param renderer {WebGLRenderer} The renderer instance + */ PIXI.CustomRenderable.prototype.initWebGL = function(renderer) { // override! } - +/** + * If this object is being rendered by a WebGLRenderer it will call this callback + * + * @method renderWebGL + * @param renderer {WebGLRenderer} The renderer instance + */ PIXI.CustomRenderable.prototype.renderWebGL = function(renderGroup, projectionMatrix) { // not sure if both needed? but ya have for now! diff --git a/src/pixi/extras/Spine.js b/src/pixi/extras/Spine.js index 9b94e38..5109093 100644 --- a/src/pixi/extras/Spine.js +++ b/src/pixi/extras/Spine.js @@ -10,12 +10,13 @@ /** * A class that enables the you to import and run your spine animations in pixi. * Spine animation data needs to be loaded using the PIXI.AssetLoader or PIXI.SpineLoader before it can be used by this class - * Also due to a clash of names You will need to change the extension of the spine file from *.json to *.anim for it to load + * Also due to a clash of names, you will need to change the extension of the spine file from *.json to *.anim for it to load * See example 12 (http://www.goodboydigital.com/pixijs/examples/12/) to see a working example and check out the source + * * @class Spine - * @constructor * @extends DisplayObjectContainer - * @param {String} url the url of the spine anim file to be used + * @constructor + * @param url {String} The url of the spine anim file to be used */ PIXI.Spine = function(url) { diff --git a/src/pixi/extras/TilingSprite.js b/src/pixi/extras/TilingSprite.js index fd89100..9a49e1c 100644 --- a/src/pixi/extras/TilingSprite.js +++ b/src/pixi/extras/TilingSprite.js @@ -4,6 +4,7 @@ /** * A tiling sprite is a fast way of rendering a tiling image + * * @class TilingSprite * @extends DisplayObjectContainer * @constructor @@ -14,23 +15,48 @@ PIXI.TilingSprite = function(texture, width, height) { PIXI.DisplayObjectContainer.call( this ); - + + /** + * The texture that the sprite is using + * + * @property texture + * @type Texture + */ this.texture = texture; + + /** + * The width of the tiling sprite + * + * @property width + * @type Number + */ this.width = width; + + /** + * The height of the tiling sprite + * + * @property height + * @type Number + */ this.height = height; - this.renderable = true; + /** * The scaling of the image that is being tiled + * * @property tileScale * @type Point */ this.tileScale = new PIXI.Point(1,1); + /** * The offset position of the image that is being tiled + * * @property tilePosition * @type Point */ this.tilePosition = new PIXI.Point(0,0); + + this.renderable = true; this.blendMode = PIXI.blendModes.NORMAL } @@ -39,6 +65,12 @@ PIXI.TilingSprite = function(texture, width, height) PIXI.TilingSprite.constructor = PIXI.TilingSprite; PIXI.TilingSprite.prototype = Object.create( PIXI.DisplayObjectContainer.prototype ); +/** + * Sets the texture of the tiling sprite + * + * @method setTexture + * @param texture {Texture} The PIXI texture that is displayed by the sprite + */ PIXI.TilingSprite.prototype.setTexture = function(texture) { //TODO SET THE TEXTURES @@ -49,6 +81,13 @@ PIXI.TilingSprite.prototype.setTexture = function(texture) this.updateFrame = true; } +/** + * When the texture is updated, this event will fire to update the frame + * + * @method onTextureUpdate + * @param event + * @private + */ PIXI.TilingSprite.prototype.onTextureUpdate = function(event) { this.updateFrame = true; diff --git a/src/pixi/loaders/AssetLoader.js b/src/pixi/loaders/AssetLoader.js index 17f93a5..7936b83 100644 --- a/src/pixi/loaders/AssetLoader.js +++ b/src/pixi/loaders/AssetLoader.js @@ -3,27 +3,47 @@ */ /** - * A Class that loads a bunch of images / sprite sheet / bitmap font files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromImage() and PIXI.Sprite.fromImage() + * A Class that loads a bunch of images / sprite sheet / bitmap font files. Once the + * assets have been loaded they are added to the PIXI Texture cache and can be accessed + * easily through PIXI.Texture.fromImage() and PIXI.Sprite.fromImage() * When all items have been loaded this class will dispatch a "onLoaded" event * As each individual item is loaded this class will dispatch a "onProgress" event + * * @class AssetLoader * @constructor - * @extends EventTarget - * @param {Array} assetURLs 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. Supported bitmap font data formats include "xml" and "fnt". + * @uses EventTarget + * @param {Array} assetURLs 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. Supported bitmap font + * data formats include "xml" and "fnt". + * @param crossorigin {Boolean} Whether requests should be treated as crossorigin */ -PIXI.AssetLoader = function(assetURLs) +PIXI.AssetLoader = function(assetURLs, crossorigin) { PIXI.EventTarget.call(this); - + /** * The array of asset URLs that are going to be loaded + * * @property assetURLs - * @type Array + * @type Array */ this.assetURLs = assetURLs; - this.crossorigin = false; + /** + * Whether the requests should be treated as cross origin + * + * @property crossorigin + * @type Boolean + */ + this.crossorigin = crossorigin; + /** + * Maps file extension to loader types + * + * @property loadersByType + * @type Object + */ this.loadersByType = { "jpg": PIXI.ImageLoader, "jpeg": PIXI.ImageLoader, @@ -39,20 +59,22 @@ PIXI.AssetLoader = function(assetURLs) }; /** -Fired when an item has loaded -@event onProgress -**/ + * Fired when an item has loaded + * @event onProgress + */ /** -Fired when all the assets have loaded -@event onComplete -**/ + * Fired when all the assets have loaded + * @event onComplete + */ // constructor PIXI.AssetLoader.constructor = PIXI.AssetLoader; /** - * This will begin loading the assets sequentially + * Starts loading the assets sequentially + * + * @method load */ PIXI.AssetLoader.prototype.load = function() { @@ -81,6 +103,8 @@ PIXI.AssetLoader.prototype.load = function() /** * Invoked after each file is loaded + * + * @method onAssetLoaded * @private */ PIXI.AssetLoader.prototype.onAssetLoaded = function() diff --git a/src/pixi/loaders/BitmapFontLoader.js b/src/pixi/loaders/BitmapFontLoader.js index ee7f511..af08b83 100644 --- a/src/pixi/loaders/BitmapFontLoader.js +++ b/src/pixi/loaders/BitmapFontLoader.js @@ -7,13 +7,13 @@ * To generate the data you can use http://www.angelcode.com/products/bmfont/ * This loader will also load the image file as the data. * When loaded this class will dispatch a "loaded" event + * * @class BitmapFontLoader - * @extends EventTarget + * @uses EventTarget * @constructor - * @param {String} url the url of the sprite sheet JSON file - * @param {Boolean} crossorigin + * @param url {String} The url of the sprite sheet JSON file + * @param crossorigin {Boolean} Whether requests should be treated as crossorigin */ - PIXI.BitmapFontLoader = function(url, crossorigin) { /* @@ -22,17 +22,48 @@ PIXI.BitmapFontLoader = function(url, crossorigin) * make sure to set the format as "JSON" */ PIXI.EventTarget.call(this); + + /** + * The url of the bitmap font data + * + * @property url + * @type String + */ this.url = url; - this.baseUrl = url.replace(/[^\/]*$/, ""); - this.texture = null; + + /** + * Whether the requests should be treated as cross origin + * + * @property crossorigin + * @type Boolean + */ this.crossorigin = crossorigin; + + /** + * [read-only] The base url of the bitmap font data + * + * @property baseUrl + * @type String + * @readOnly + */ + this.baseUrl = url.replace(/[^\/]*$/, ""); + + /** + * [read-only] The texture of the bitmap font + * + * @property baseUrl + * @type String + */ + this.texture = null; }; // constructor PIXI.BitmapFontLoader.constructor = PIXI.BitmapFontLoader; /** - * This will begin loading the JSON file + * Loads the XML font data + * + * @method load */ PIXI.BitmapFontLoader.prototype.load = function() { @@ -49,7 +80,9 @@ PIXI.BitmapFontLoader.prototype.load = function() }; /** - * Invoked when XML file is loaded + * Invoked when XML file is loaded, parses the data + * + * @method onXMLLoaded * @private */ PIXI.BitmapFontLoader.prototype.onXMLLoaded = function() @@ -120,6 +153,8 @@ PIXI.BitmapFontLoader.prototype.onXMLLoaded = function() /** * Invoked when all files are loaded (xml/fnt and texture) + * + * @method onLoaded * @private */ PIXI.BitmapFontLoader.prototype.onLoaded = function() diff --git a/src/pixi/loaders/ImageLoader.js b/src/pixi/loaders/ImageLoader.js index d157c16..942b009 100644 --- a/src/pixi/loaders/ImageLoader.js +++ b/src/pixi/loaders/ImageLoader.js @@ -6,15 +6,23 @@ * The image loader class is responsible for loading images file formats ("jpeg", "jpg", "png" and "gif") * Once the image has been loaded it is stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId() * When loaded this class will dispatch a 'loaded' event + * * @class ImageLoader - * @extends EventTarget + * @uses EventTarget * @constructor - * @param {String} url The url of the image - * @param {Boolean} crossorigin + * @param url {String} The url of the image + * @param crossorigin {Boolean} Whether requests should be treated as crossorigin */ PIXI.ImageLoader = function(url, crossorigin) { PIXI.EventTarget.call(this); + + /** + * The texture being loaded + * + * @property texture + * @type Texture + */ this.texture = PIXI.Texture.fromImage(url, crossorigin); }; @@ -23,6 +31,8 @@ PIXI.ImageLoader.constructor = PIXI.ImageLoader; /** * Loads image or takes it from cache + * + * @method load */ PIXI.ImageLoader.prototype.load = function() { @@ -42,6 +52,8 @@ PIXI.ImageLoader.prototype.load = function() /** * Invoked when image file is loaded or it is already cached and ready to use + * + * @method onLoaded * @private */ PIXI.ImageLoader.prototype.onLoaded = function() diff --git a/src/pixi/loaders/JsonLoader.js b/src/pixi/loaders/JsonLoader.js index e7a57ca..1fee06b 100644 --- a/src/pixi/loaders/JsonLoader.js +++ b/src/pixi/loaders/JsonLoader.js @@ -6,18 +6,48 @@ * The json file loader is used to load in JSON data and parsing it * When loaded this class will dispatch a "loaded" event * If load failed this class will dispatch a "error" event + * * @class JsonLoader - * @extends EventTarget + * @uses EventTarget * @constructor - * @param {String} url the url of the JSON file - * @param {Boolean} crossorigin + * @param url {String} The url of the JSON file + * @param crossorigin {Boolean} Whether requests should be treated as crossorigin */ - PIXI.JsonLoader = function (url, crossorigin) { PIXI.EventTarget.call(this); + + /** + * The url of the bitmap font data + * + * @property url + * @type String + */ this.url = url; - this.baseUrl = url.replace(/[^\/]*$/, ""); + + /** + * Whether the requests should be treated as cross origin + * + * @property crossorigin + * @type Boolean + */ this.crossorigin = crossorigin; + + /** + * [read-only] The base url of the bitmap font data + * + * @property baseUrl + * @type String + * @readOnly + */ + this.baseUrl = url.replace(/[^\/]*$/, ""); + + /** + * [read-only] Whether the data has loaded yet + * + * @property loaded + * @type Boolean + * @readOnly + */ this.loaded = false; }; @@ -26,7 +56,9 @@ PIXI.JsonLoader = function (url, crossorigin) { PIXI.JsonLoader.constructor = PIXI.JsonLoader; /** - * This will begin loading the JSON file + * Loads the JSON data + * + * @method load */ PIXI.JsonLoader.prototype.load = function () { this.ajaxRequest = new AjaxRequest(); @@ -42,6 +74,8 @@ PIXI.JsonLoader.prototype.load = function () { /** * Invoke when JSON file is loaded + * + * @method onJSONLoaded * @private */ PIXI.JsonLoader.prototype.onJSONLoaded = function () { @@ -95,11 +129,9 @@ PIXI.JsonLoader.prototype.onJSONLoaded = function () { { this.onLoaded(); } - - - - - } else { + } + else + { this.onError(); } } @@ -107,6 +139,8 @@ PIXI.JsonLoader.prototype.onJSONLoaded = function () { /** * Invoke when json file loaded + * + * @method onLoaded * @private */ PIXI.JsonLoader.prototype.onLoaded = function () { @@ -119,6 +153,8 @@ PIXI.JsonLoader.prototype.onLoaded = function () { /** * Invoke when error occured + * + * @method onError * @private */ PIXI.JsonLoader.prototype.onError = function () { diff --git a/src/pixi/loaders/SpineLoader.js b/src/pixi/loaders/SpineLoader.js index d09f1cb..ce32257 100644 --- a/src/pixi/loaders/SpineLoader.js +++ b/src/pixi/loaders/SpineLoader.js @@ -14,32 +14,50 @@ * See example 12 (http://www.goodboydigital.com/pixijs/examples/12/) to see a working example and check out the source * You will need to generate a sprite sheet to accompany the spine data * When loaded this class will dispatch a "loaded" event + * * @class Spine + * @uses EventTarget * @constructor - * @extends EventTarget - * @param {String} url the url of the sprite sheet JSON file - * @param {Boolean} crossorigin + * @param url {String} The url of the JSON file + * @param crossorigin {Boolean} Whether requests should be treated as crossorigin */ PIXI.SpineLoader = function(url, crossorigin) { PIXI.EventTarget.call(this); + + /** + * The url of the bitmap font data + * + * @property url + * @type String + */ this.url = url; + + /** + * Whether the requests should be treated as cross origin + * + * @property crossorigin + * @type Boolean + */ this.crossorigin = crossorigin; + + /** + * [read-only] Whether the data has loaded yet + * + * @property loaded + * @type Boolean + * @readOnly + */ this.loaded = false; } PIXI.SpineLoader.constructor = PIXI.SpineLoader; -PIXI.SpineLoader.prototype.load = function() -{ - new PIXI.JsonLoader(this.url, this.crossorigin); - jsonLoader.addEventListener("loaded", function (event) { - scope.json = event.content.json; - scope.onJSONLoaded(); - }); - jsonLoader.load(); -}; - +/** + * Loads the JSON data + * + * @method load + */ PIXI.SpineLoader.prototype.load = function () { var scope = this; @@ -53,12 +71,12 @@ PIXI.SpineLoader.prototype.load = function () { /** * Invoke when JSON file is loaded + * + * @method onJSONLoaded * @private */ PIXI.SpineLoader.prototype.onJSONLoaded = function (event) { - var spineJsonParser = new spine.SkeletonJson(); - var skeletonData = spineJsonParser.readSkeletonData(this.json); PIXI.AnimCache[this.url] = skeletonData; @@ -66,10 +84,13 @@ PIXI.SpineLoader.prototype.onJSONLoaded = function (event) { this.onLoaded(); }; - - -PIXI.SpineLoader.prototype.onLoaded = function() -{ +/** + * Invoke when JSON file is loaded + * + * @method onLoaded + * @private + */ +PIXI.SpineLoader.prototype.onLoaded = function () { this.loaded = true; this.dispatchEvent({type: "loaded", content: this}); }; diff --git a/src/pixi/loaders/SpriteSheetLoader.js b/src/pixi/loaders/SpriteSheetLoader.js index 5b49c62..5495f57 100644 --- a/src/pixi/loaders/SpriteSheetLoader.js +++ b/src/pixi/loaders/SpriteSheetLoader.js @@ -10,11 +10,12 @@ * Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId() * This loader will also load the image file that the Spritesheet points to as well as the data. * When loaded this class will dispatch a "loaded" event + * * @class SpriteSheetLoader - * @extends EventTarget + * @uses EventTarget * @constructor - * @param {String} url the url of the sprite sheet JSON file - * @param {Boolean} crossorigin + * @param url {String} The url of the sprite sheet JSON file + * @param crossorigin {Boolean} Whether requests should be treated as crossorigin */ PIXI.SpriteSheetLoader = function (url, crossorigin) { @@ -24,11 +25,47 @@ PIXI.SpriteSheetLoader = function (url, crossorigin) { * make sure to set the format as "JSON" */ PIXI.EventTarget.call(this); + + /** + * The url of the bitmap font data + * + * @property url + * @type String + */ this.url = url; - this.baseUrl = url.replace(/[^\/]*$/, ""); - this.texture = null; - this.frames = {}; + + /** + * Whether the requests should be treated as cross origin + * + * @property crossorigin + * @type Boolean + */ this.crossorigin = crossorigin; + + /** + * [read-only] The base url of the bitmap font data + * + * @property baseUrl + * @type String + * @readOnly + */ + this.baseUrl = url.replace(/[^\/]*$/, ""); + + /** + * The texture being loaded + * + * @property texture + * @type Texture + */ + this.texture = null; + + /** + * The frames of the sprite sheet + * + * @property frames + * @type Object + */ + this.frames = {}; }; // constructor @@ -36,6 +73,8 @@ PIXI.SpriteSheetLoader.constructor = PIXI.SpriteSheetLoader; /** * This will begin loading the JSON file + * + * @method load */ PIXI.SpriteSheetLoader.prototype.load = function () { var scope = this; @@ -49,6 +88,8 @@ PIXI.SpriteSheetLoader.prototype.load = function () { /** * Invoke when JSON file is loaded + * + * @method onJSONLoaded * @private */ PIXI.SpriteSheetLoader.prototype.onJSONLoaded = function () { @@ -84,6 +125,8 @@ PIXI.SpriteSheetLoader.prototype.onJSONLoaded = function () { }; /** * Invoke when all files are loaded (json and texture) + * + * @method onLoaded * @private */ PIXI.SpriteSheetLoader.prototype.onLoaded = function () { diff --git a/src/pixi/primitives/Graphics.js b/src/pixi/primitives/Graphics.js index b4be4d6..768fede 100644 --- a/src/pixi/primitives/Graphics.js +++ b/src/pixi/primitives/Graphics.js @@ -7,6 +7,7 @@ * The Graphics class contains a set of methods that you can use to create primitive shapes and lines. * It is important to know that with the webGL renderer only simple polys can be filled at this stage * Complex polys will not be filled. Heres an example of a complex poly: http://www.goodboydigital.com/wp-content/uploads/2013/06/complexPolygon.png + * * @class Graphics * @extends DisplayObjectContainer * @constructor @@ -16,14 +17,47 @@ PIXI.Graphics = function() PIXI.DisplayObjectContainer.call( this ); this.renderable = true; - + + /** + * The alpha of the fill of this graphics object + * + * @property fillAlpha + * @type Number + */ this.fillAlpha = 1; - + + /** + * The width of any lines drawn + * + * @property lineWidth + * @type Number + */ this.lineWidth = 0; + + /** + * The color of any lines drawn + * + * @property lineColor + * @type String + */ this.lineColor = "black"; - + + /** + * Graphics data + * + * @property graphicsData + * @type Array + * @private + */ this.graphicsData = []; - + + /** + * Current path + * + * @property currentPath + * @type Object + * @private + */ this.currentPath = {points:[]}; } @@ -33,10 +67,11 @@ PIXI.Graphics.prototype = Object.create( PIXI.DisplayObjectContainer.prototype ) /** * Specifies a line style used for subsequent calls to Graphics methods such as the lineTo() method or the drawCircle() method. + * * @method lineStyle - * @param lineWidth {Number} - * @param color {Number} - * @param alpha {Number} + * @param lineWidth {Number} width of the line to draw, will update the object's stored style + * @param color {Number} color of the line to draw, will update the object's stored style + * @param alpha {Number} alpha of the line to draw, will update the object's stored style */ PIXI.Graphics.prototype.lineStyle = function(lineWidth, color, alpha) { @@ -54,9 +89,10 @@ PIXI.Graphics.prototype.lineStyle = function(lineWidth, color, alpha) /** * Moves the current drawing position to (x, y). + * * @method moveTo - * @param x {Number} - * @param y {Number} + * @param x {Number} the X coord to move to + * @param y {Number} the Y coord to move to */ PIXI.Graphics.prototype.moveTo = function(x, y) { @@ -71,10 +107,12 @@ PIXI.Graphics.prototype.moveTo = function(x, y) } /** - * Draws a line using the current line style from the current drawing position to (x, y); the current drawing position is then set to (x, y). + * Draws a line using the current line style from the current drawing position to (x, y); + * the current drawing position is then set to (x, y). + * * @method lineTo - * @param x {Number} - * @param y {Number} + * @param x {Number} the X coord to draw to + * @param y {Number} the Y coord to draw to */ PIXI.Graphics.prototype.lineTo = function(x, y) { @@ -83,7 +121,9 @@ PIXI.Graphics.prototype.lineTo = function(x, y) } /** - * Specifies a simple one-color fill that subsequent calls to other Graphics methods (such as lineTo() or drawCircle()) use when drawing. + * Specifies a simple one-color fill that subsequent calls to other Graphics methods + * (such as lineTo() or drawCircle()) use when drawing. + * * @method beginFill * @param color {uint} the color of the fill * @param alpha {Number} the alpha @@ -97,6 +137,7 @@ PIXI.Graphics.prototype.beginFill = function(color, alpha) /** * Applies a fill to the lines and shapes that were added since the last call to the beginFill() method. + * * @method endFill */ PIXI.Graphics.prototype.endFill = function() @@ -108,10 +149,11 @@ PIXI.Graphics.prototype.endFill = function() /** * @method drawRect - * @param x {Number} - * @param y {Number} - * @param width {Number} - * @param height {Number} + * + * @param x {Number} The X coord of the top-left of the rectangle + * @param y {Number} The Y coord of the top-left of the rectangle + * @param width {Number} The width of the rectangle + * @param height {Number} The height of the rectangle */ PIXI.Graphics.prototype.drawRect = function( x, y, width, height ) { @@ -127,10 +169,11 @@ PIXI.Graphics.prototype.drawRect = function( x, y, width, height ) /** * Draws a circle. + * * @method drawCircle - * @param x {Number} - * @param y {Number} - * @param radius {Number} + * @param x {Number} The X coord of the center of the circle + * @param y {Number} The Y coord of the center of the circle + * @param radius {Number} The radius of the circle */ PIXI.Graphics.prototype.drawCircle = function( x, y, radius) { @@ -146,6 +189,7 @@ PIXI.Graphics.prototype.drawCircle = function( x, y, radius) /** * Draws an elipse. + * * @method drawElipse * @param x {Number} * @param y {Number} @@ -166,6 +210,7 @@ PIXI.Graphics.prototype.drawElipse = function( x, y, width, height) /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. + * * @method clear */ PIXI.Graphics.prototype.clear = function() diff --git a/src/pixi/renderers/canvas/CanvasGraphics.js b/src/pixi/renderers/canvas/CanvasGraphics.js index 060f97b..1e5cd1b 100644 --- a/src/pixi/renderers/canvas/CanvasGraphics.js +++ b/src/pixi/renderers/canvas/CanvasGraphics.js @@ -5,7 +5,8 @@ /** * A set of functions used by the canvas renderer to draw the primitive graphics data - * @class CanvasGraphics + * + * @class CanvasGraphics */ PIXI.CanvasGraphics = function() { @@ -14,8 +15,10 @@ PIXI.CanvasGraphics = function() /* - * @private + * Renders the graphics object + * * @static + * @private * @method renderGraphics * @param graphics {Graphics} * @param context {Context2D} @@ -149,8 +152,10 @@ PIXI.CanvasGraphics.renderGraphics = function(graphics, context) } /* - * @private + * Renders a graphics mask + * * @static + * @private * @method renderGraphicsMask * @param graphics {Graphics} * @param context {Context2D} diff --git a/src/pixi/renderers/canvas/CanvasRenderer.js b/src/pixi/renderers/canvas/CanvasRenderer.js index 15044ee..4650469 100644 --- a/src/pixi/renderers/canvas/CanvasRenderer.js +++ b/src/pixi/renderers/canvas/CanvasRenderer.js @@ -6,58 +6,58 @@ /** * the CanvasRenderer 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 * @constructor - * @param width {Number} the width of the canvas view - * @default 0 - * @param height {Number} the height of the canvas view - * @default 0 + * @param width=0 {Number} the width of the canvas view + * @param height=0 {Number} the height of the canvas view * @param view {Canvas} the canvas to use as a view, optional - * @param transparent {Boolean} the transparency of the render view, default false - * @default false - * + * @param transparent=false {Boolean} the transparency of the render view, default false */ PIXI.CanvasRenderer = function(width, height, view, transparent) { this.transparent = transparent; - + /** * The width of the canvas view + * * @property width * @type Number * @default 800 */ this.width = width || 800; + /** * The height of the canvas view + * * @property height * @type Number * @default 600 */ this.height = height || 600; - - this.refresh = true; - + /** * The canvas element that the everything is drawn to + * * @property view * @type Canvas */ - this.view = view || document.createElement( 'canvas' ); - - // hack to enable some hardware acceleration! - //this.view.style["transform"] = "translatez(0)"; - - this.view.width = this.width; - this.view.height = this.height; - this.count = 0; - + this.view = view || document.createElement( 'canvas' ); + /** * The canvas context that the everything is drawn to * @property context * @type Canvas 2d Context */ this.context = this.view.getContext("2d"); + + this.refresh = true; + // hack to enable some hardware acceleration! + //this.view.style["transform"] = "translatez(0)"; + + this.view.width = this.width; + this.view.height = this.height; + this.count = 0; } // constructor @@ -65,6 +65,7 @@ PIXI.CanvasRenderer.constructor = PIXI.CanvasRenderer; /** * Renders the stage to its canvas view + * * @method render * @param stage {Stage} the Stage element to be rendered */ @@ -109,8 +110,10 @@ PIXI.CanvasRenderer.prototype.render = function(stage) /** * resizes the canvas view to the specified width and height - * @param the new width of the canvas view - * @param the new height of the canvas view + * + * @method resize + * @param width {Number} the new width of the canvas view + * @param height {Number} the new height of the canvas view */ PIXI.CanvasRenderer.prototype.resize = function(width, height) { @@ -122,9 +125,12 @@ PIXI.CanvasRenderer.prototype.resize = function(width, height) } /** + * Renders a display object + * + * @method renderDisplayObject + * @param displayObject {DisplayObject} The displayObject to render * @private */ - PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject) { // no loger recurrsive! @@ -231,8 +237,11 @@ PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject) while(displayObject != testObject) } - /** + * Renders a flat strip + * + * @method renderStripFlat + * @param strip {Strip} The Strip to render * @private */ PIXI.CanvasRenderer.prototype.renderStripFlat = function(strip) @@ -266,6 +275,10 @@ PIXI.CanvasRenderer.prototype.renderStripFlat = function(strip) } /** + * Renders a tiling sprite + * + * @method renderTilingSprite + * @param sprite {TilingSprite} The tilingsprite to render * @private */ PIXI.CanvasRenderer.prototype.renderTilingSprite = function(sprite) @@ -294,9 +307,11 @@ PIXI.CanvasRenderer.prototype.renderTilingSprite = function(sprite) context.closePath(); } - - /** + * Renders a strip + * + * @method renderStrip + * @param strip {Strip} The Strip to render * @private */ PIXI.CanvasRenderer.prototype.renderStrip = function(strip) @@ -356,11 +371,3 @@ PIXI.CanvasRenderer.prototype.renderStrip = function(strip) // context.globalCompositeOperation = 'source-over'; } - - - - - - - - diff --git a/src/pixi/renderers/webgl/WebGLBatch.js b/src/pixi/renderers/webgl/WebGLBatch.js index 19572cf..1eca2fa 100644 --- a/src/pixi/renderers/webgl/WebGLBatch.js +++ b/src/pixi/renderers/webgl/WebGLBatch.js @@ -41,10 +41,15 @@ PIXI._restoreBatchs = function(gl) /** * A WebGLBatch Enables a group of sprites to be drawn using the same settings. - * if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run. + * 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} + * @constructor + * @param gl {WebGLContext} an instance of the webGL context */ PIXI.WebGLBatch = function(gl) { @@ -60,12 +65,13 @@ PIXI.WebGLBatch = function(gl) this.dynamicSize = 1; } - // constructor PIXI.WebGLBatch.constructor = PIXI.WebGLBatch; /** * Cleans the batch so that is can be returned to an object pool and reused + * + * @method clean */ PIXI.WebGLBatch.prototype.clean = function() { @@ -78,13 +84,15 @@ PIXI.WebGLBatch.prototype.clean = function() this.texture = null; this.last = null; this.size = 0; - this.head; this.tail; } -/* - * recreates the buffers in the event of a context loss +/** + * Recreates the buffers in the event of a context loss + * + * @method restoreLostContext + * @param gl {WebGLContext} */ PIXI.WebGLBatch.prototype.restoreLostContext = function(gl) { @@ -97,8 +105,10 @@ PIXI.WebGLBatch.prototype.restoreLostContext = function(gl) /** * inits the batch's texture and blend mode based if the supplied sprite + * * @method init - * @param sprite {Sprite} the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch + * @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) { @@ -110,12 +120,13 @@ PIXI.WebGLBatch.prototype.init = function(sprite) this.head = sprite; this.tail = sprite; this.size = 1; - + this.growBatch(); } /** * inserts a sprite before the specified sprite + * * @method insertBefore * @param sprite {Sprite} the sprite to be added * @param nextSprite {nextSprite} the first sprite will be inserted before this sprite @@ -123,13 +134,13 @@ PIXI.WebGLBatch.prototype.init = function(sprite) PIXI.WebGLBatch.prototype.insertBefore = function(sprite, nextSprite) { this.size++; - + sprite.batch = this; this.dirty = true; var tempPrev = nextSprite.__prev; nextSprite.__prev = sprite; sprite.__next = nextSprite; - + if(tempPrev) { sprite.__prev = tempPrev; @@ -144,6 +155,7 @@ PIXI.WebGLBatch.prototype.insertBefore = function(sprite, nextSprite) /** * 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 @@ -151,15 +163,14 @@ PIXI.WebGLBatch.prototype.insertBefore = function(sprite, nextSprite) 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; @@ -169,18 +180,18 @@ PIXI.WebGLBatch.prototype.insertAfter = function(sprite, previousSprite) { this.tail = sprite } - } /** * removes a sprite from the batch + * * @method remove * @param sprite {Sprite} the sprite to be removed */ PIXI.WebGLBatch.prototype.remove = function(sprite) { this.size--; - + if(this.size == 0) { sprite.batch = null; @@ -188,7 +199,7 @@ PIXI.WebGLBatch.prototype.remove = function(sprite) sprite.__next = null; return; } - + if(sprite.__prev) { sprite.__prev.__next = sprite.__next; @@ -198,7 +209,7 @@ PIXI.WebGLBatch.prototype.remove = function(sprite) this.head = sprite.__next; this.head.__prev = null; } - + if(sprite.__next) { sprite.__next.__prev = sprite.__prev; @@ -208,7 +219,7 @@ PIXI.WebGLBatch.prototype.remove = function(sprite) this.tail = sprite.__prev; this.tail.__next = null } - + sprite.batch = null; sprite.__next = null; sprite.__prev = null; @@ -217,39 +228,32 @@ PIXI.WebGLBatch.prototype.remove = function(sprite) /** * Splits the batch into two with the specified sprite being the start of the new batch. + * * @method split * @param sprite {Sprite} the sprite that indicates where the batch should be split * @return {WebGLBatch} the new batch */ PIXI.WebGLBatch.prototype.split = function(sprite) { - - //console.log("Splitting batch :" + this.size) -// console.log(sprite) -// console.log("-------") this.dirty = true; - - //var val = (this.tail == this.head) - //console.log(val + " SAME?"); - var batch = new PIXI.WebGLBatch(this.gl)//PIXI._getBatch(this.gl); + + var batch = new PIXI.WebGLBatch(this.gl);//PIXI._getBatch(this.gl); batch.init(sprite); batch.texture = this.texture; batch.tail = this.tail; - //console.log("id is " +batcheee.id) - + this.tail = sprite.__prev; this.tail.__next = null; - + sprite.__prev = null; // return a splite batch! //sprite.__prev.__next = null; //sprite.__prev = null; - - + // TODO this size is wrong! // need to recalculate :/ problem with a linked list! // unless it gets calculated in the "clean"? - + // need to loop through items as there is no way to know the length on a linked list :/ var tempSize = 0; while(sprite) @@ -258,41 +262,44 @@ PIXI.WebGLBatch.prototype.split = function(sprite) sprite.batch = batch; sprite = sprite.__next; } - + batch.size = tempSize; this.size -= tempSize; - + return batch; } /** * Merges two batchs together + * * @method merge * @param batch {WebGLBatch} the batch that will be merged */ PIXI.WebGLBatch.prototype.merge = function(batch) { this.dirty = true; - + this.tail.__next = batch.head; batch.head.__prev = this.tail; - + this.size += batch.size; - + this.tail = batch.tail; - + var sprite = batch.head; while(sprite) { sprite.batch = this; sprite = sprite.__next; } - } /** - * Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added - * @methos growBatch + * 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 + * + * @method growBatch */ PIXI.WebGLBatch.prototype.growBatch = function() { @@ -307,25 +314,25 @@ PIXI.WebGLBatch.prototype.growBatch = function() } // grow verts this.verticies = new Float32Array(this.dynamicSize * 8); - + gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer); gl.bufferData(gl.ARRAY_BUFFER,this.verticies , gl.DYNAMIC_DRAW); - + this.uvs = new Float32Array( this.dynamicSize * 8 ) gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer); gl.bufferData(gl.ARRAY_BUFFER, this.uvs , gl.DYNAMIC_DRAW); - + this.dirtyUVS = true; - + this.colors = new Float32Array( this.dynamicSize * 4 ) gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer); gl.bufferData(gl.ARRAY_BUFFER, this.colors , gl.DYNAMIC_DRAW); - + this.dirtyColors = true; - + this.indices = new Uint16Array(this.dynamicSize * 6); var length = this.indices.length/6; - + for (var i=0; i < length; i++) { var index2 = i * 6; @@ -337,152 +344,152 @@ PIXI.WebGLBatch.prototype.growBatch = function() this.indices[index2 + 4] = index3 + 2; this.indices[index2 + 5] = index3 + 3; }; - + gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer); gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW); - } /** * Refresh's all the data in the batch and sync's it with the webGL buffers + * * @method refresh */ PIXI.WebGLBatch.prototype.refresh = function() { var gl = this.gl; - + if (this.dynamicSize < this.size) { this.growBatch(); } var indexRun = 0; - var worldTransform, width, height, aX, aY, w0, w1, h0, h1, index - var a, b, c, d, tx, ty - - var displayObject = this.head + var worldTransform, width, height, aX, aY, w0, w1, h0, h1, index; + var a, b, c, d, tx, ty; + + var displayObject = this.head; while(displayObject) { index = indexRun * 8; - + var texture = displayObject.texture; - + var frame = texture.frame; var tw = texture.baseTexture.width; var th = texture.baseTexture.height; - + this.uvs[index + 0] = frame.x / tw; this.uvs[index +1] = frame.y / th; - + this.uvs[index +2] = (frame.x + frame.width) / tw; this.uvs[index +3] = frame.y / th; - + this.uvs[index +4] = (frame.x + frame.width) / tw; this.uvs[index +5] = (frame.y + frame.height) / th; - + this.uvs[index +6] = frame.x / tw; this.uvs[index +7] = (frame.y + frame.height) / th; - + displayObject.updateFrame = false; - + colorIndex = indexRun * 4; this.colors[colorIndex] = this.colors[colorIndex + 1] = this.colors[colorIndex + 2] = this.colors[colorIndex + 3] = displayObject.worldAlpha; - + displayObject = displayObject.__next; - + indexRun ++; } - + this.dirtyUVS = true; this.dirtyColors = true; } /** * Updates all the relevant geometry and uploads the data to the GPU + * * @method update */ PIXI.WebGLBatch.prototype.update = function() { var gl = this.gl; var worldTransform, width, height, aX, aY, w0, w1, h0, h1, index, index2, index3 - + var a, b, c, d, tx, ty; - + var indexRun = 0; - + var displayObject = this.head; - + while(displayObject) { if(displayObject.worldVisible) { width = displayObject.texture.frame.width; height = displayObject.texture.frame.height; - + // TODO trim?? 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 || displayObject.texture.updateFrame) { this.dirtyUVS = true; - + var texture = displayObject.texture; - + var frame = texture.frame; var tw = texture.baseTexture.width; var th = texture.baseTexture.height; - + this.uvs[index + 0] = frame.x / tw; this.uvs[index +1] = frame.y / th; - + this.uvs[index +2] = (frame.x + frame.width) / tw; this.uvs[index +3] = frame.y / th; - + this.uvs[index +4] = (frame.x + frame.width) / tw; this.uvs[index +5] = (frame.y + frame.height) / th; - + this.uvs[index +6] = frame.x / tw; this.uvs[index +7] = (frame.y + frame.height) / th; - + displayObject.updateFrame = false; } - + // TODO this probably could do with some optimisation.... if(displayObject.cacheAlpha != displayObject.worldAlpha) { displayObject.cacheAlpha = displayObject.worldAlpha; - + var colorIndex = indexRun * 4; this.colors[colorIndex] = this.colors[colorIndex + 1] = this.colors[colorIndex + 2] = this.colors[colorIndex + 3] = displayObject.worldAlpha; this.dirtyColors = true; @@ -491,20 +498,20 @@ PIXI.WebGLBatch.prototype.update = function() else { index = indexRun * 8; - + this.verticies[index + 0 ] = 0; this.verticies[index + 1 ] = 0; - + this.verticies[index + 2 ] = 0; this.verticies[index + 3 ] = 0; - + this.verticies[index + 4 ] = 0; this.verticies[index + 5 ] = 0; - + this.verticies[index + 6] = 0; this.verticies[index + 7] = 0; } - + indexRun++; displayObject = displayObject.__next; } @@ -512,12 +519,11 @@ PIXI.WebGLBatch.prototype.update = function() /** * Draws the batch to the frame buffer + * * @method render */ PIXI.WebGLBatch.prototype.render = function(start, end) { - -// console.log(start + " :: " + end + " : " + this.size); start = start || 0; //end = end || this.size; if(end == undefined)end = this.size; @@ -526,20 +532,18 @@ PIXI.WebGLBatch.prototype.render = function(start, end) { this.refresh(); this.dirty = false; - } - - + if (this.size == 0)return; - + this.update(); var gl = this.gl; - + //TODO optimize this! - + var shaderProgram = PIXI.shaderProgram; gl.useProgram(shaderProgram); - + // update the verts.. gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer); // ok.. @@ -553,12 +557,12 @@ PIXI.WebGLBatch.prototype.render = function(start, end) this.dirtyUVS = false; gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.uvs); } - + gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0); - + gl.activeTexture(gl.TEXTURE0); gl.bindTexture(gl.TEXTURE_2D, this.texture._glTexture); - + // update color! gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer); @@ -567,17 +571,15 @@ PIXI.WebGLBatch.prototype.render = function(start, end) this.dirtyColors = false; gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.colors); } - + gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0); - + // dont need to upload! gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer); - - + //var startIndex = 0//1; var len = end - start; // console.log(this.size) // DRAW THAT this! gl.drawElements(gl.TRIANGLES, len * 6, gl.UNSIGNED_SHORT, start * 2 * 6 ); } - diff --git a/src/pixi/renderers/webgl/WebGLGraphics.js b/src/pixi/renderers/webgl/WebGLGraphics.js index 36c4dc4..c2831eb 100644 --- a/src/pixi/renderers/webgl/WebGLGraphics.js +++ b/src/pixi/renderers/webgl/WebGLGraphics.js @@ -2,20 +2,27 @@ * @author Mat Groves http://matgroves.com/ @Doormat23 */ - - /** * A set of functions used by the webGL renderer to draw the primitive graphics data - * @class CanvasGraphics + * + * @class CanvasGraphics */ PIXI.WebGLGraphics = function() { } +/** + * Renders the graphics object + * + * @static + * @private + * @method renderGraphics + * @param graphics {Graphics} + * @param projection {Object} + */ PIXI.WebGLGraphics.renderGraphics = function(graphics, projection) { - var gl = PIXI.gl; if(!graphics._webGL)graphics._webGL = {points:[], indices:[], lastIndex:0, @@ -75,6 +82,14 @@ PIXI.WebGLGraphics.renderGraphics = function(graphics, projection) PIXI.activateDefaultShader(); } +/** + * Updates the graphics object + * + * @static + * @private + * @method updateGraphics + * @param graphics {Graphics} + */ PIXI.WebGLGraphics.updateGraphics = function(graphics) { for (var i=graphics._webGL.lastIndex; i < graphics.graphicsData.length; i++) @@ -119,7 +134,15 @@ PIXI.WebGLGraphics.updateGraphics = function(graphics) gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, graphics._webGL.glIndicies, gl.STATIC_DRAW); } - +/** + * Builds a rectangle to draw + * + * @static + * @private + * @method buildRectangle + * @param graphics {Graphics} + * @param webGLData {Object} + */ PIXI.WebGLGraphics.buildRectangle = function(graphicsData, webGLData) { // --- // @@ -176,6 +199,15 @@ PIXI.WebGLGraphics.buildRectangle = function(graphicsData, webGLData) } +/** + * Builds a circle to draw + * + * @static + * @private + * @method buildCircle + * @param graphics {Graphics} + * @param webGLData {Object} + */ PIXI.WebGLGraphics.buildCircle = function(graphicsData, webGLData) { // --- // @@ -235,6 +267,15 @@ PIXI.WebGLGraphics.buildCircle = function(graphicsData, webGLData) } +/** + * Builds a line to draw + * + * @static + * @private + * @method buildLine + * @param graphics {Graphics} + * @param webGLData {Object} + */ PIXI.WebGLGraphics.buildLine = function(graphicsData, webGLData) { // TODO OPTIMISE! @@ -417,7 +458,15 @@ PIXI.WebGLGraphics.buildLine = function(graphicsData, webGLData) indices.push(indexStart-1); } - +/** + * Builds a polygon to draw + * + * @static + * @private + * @method buildPoly + * @param graphics {Graphics} + * @param webGLData {Object} + */ PIXI.WebGLGraphics.buildPoly = function(graphicsData, webGLData) { var points = graphicsData.points; diff --git a/src/pixi/renderers/webgl/WebGLRenderGroup.js b/src/pixi/renderers/webgl/WebGLRenderGroup.js index 6094829..a2d8e27 100644 --- a/src/pixi/renderers/webgl/WebGLRenderGroup.js +++ b/src/pixi/renderers/webgl/WebGLRenderGroup.js @@ -2,15 +2,18 @@ * @author Mat Groves http://matgroves.com/ @Doormat23 */ - - - /** * 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. + * * @class WebGLBatch - * @param an instance of the webGL context - * @return {PIXI.renderers.WebGLBatch} WebGLBatch {@link PIXI.renderers.WebGLBatch} + * @contructor + * @param gl {WebGLContext} An instance of the webGL context */ PIXI.WebGLRenderGroup = function(gl) { @@ -25,6 +28,13 @@ PIXI.WebGLRenderGroup = function(gl) // constructor PIXI.WebGLRenderGroup.constructor = PIXI.WebGLRenderGroup; +/** + * Add a display object to the webgl renderer + * + * @method setRenderable + * @param displayObject {DisplayObject} + * @private + */ PIXI.WebGLRenderGroup.prototype.setRenderable = function(displayObject) { // has this changed?? @@ -40,6 +50,12 @@ PIXI.WebGLRenderGroup.prototype.setRenderable = function(displayObject) this.addDisplayObjectAndChildren(displayObject); } +/** + * Renders the stage to its webgl view + * + * @method render + * @param projection {Object} + */ PIXI.WebGLRenderGroup.prototype.render = function(projection) { PIXI.WebGLRenderer.updateTextures(); @@ -104,11 +120,26 @@ PIXI.WebGLRenderGroup.prototype.render = function(projection) } +/** + * Renders the stage to its webgl view + * + * @method handleFilter + * @param filter {FilterBlock} + * @private + */ PIXI.WebGLRenderGroup.prototype.handleFilter = function(filter, projection) { } +/** + * Renders a specific displayObject + * + * @method renderSpecific + * @param displayObject {DisplayObject} + * @param projection {Object} + * @private + */ PIXI.WebGLRenderGroup.prototype.renderSpecific = function(displayObject, projection) { PIXI.WebGLRenderer.updateTextures(); @@ -261,6 +292,14 @@ PIXI.WebGLRenderGroup.prototype.renderSpecific = function(displayObject, project } } +/** + * Renders a specific renderable + * + * @method renderSpecial + * @param renderable {DisplayObject} + * @param projection {Object} + * @private + */ PIXI.WebGLRenderGroup.prototype.renderSpecial = function(renderable, projection) { if(renderable instanceof PIXI.TilingSprite) @@ -305,6 +344,14 @@ PIXI.WebGLRenderGroup.prototype.renderSpecial = function(renderable, projection) } } +/** + * Checks the visibility of a displayObject + * + * @method checkVisibility + * @param displayObject {DisplayObject} + * @param globalVisible {Boolean} + * @private + */ PIXI.WebGLRenderGroup.prototype.checkVisibility = function(displayObject, globalVisible) { // give the dp a reference to its renderGroup... @@ -333,6 +380,13 @@ PIXI.WebGLRenderGroup.prototype.checkVisibility = function(displayObject, global }; } +/** + * Updates a webgl texture + * + * @method updateTexture + * @param displayObject {DisplayObject} + * @private + */ PIXI.WebGLRenderGroup.prototype.updateTexture = function(displayObject) { @@ -368,6 +422,14 @@ PIXI.WebGLRenderGroup.prototype.updateTexture = function(displayObject) this.insertObject(displayObject, previousRenderable, nextRenderable); } +/** + * Adds filter blocks + * + * @method addFilterBlocks + * @param start {FilterBlock} + * @param end {FilterBlock} + * @private + */ PIXI.WebGLRenderGroup.prototype.addFilterBlocks = function(start, end) { start.__renderGroup = this; @@ -400,12 +462,27 @@ PIXI.WebGLRenderGroup.prototype.addFilterBlocks = function(start, end) this.insertAfter(end, previousRenderable2); } +/** + * Remove filter blocks + * + * @method removeFilterBlocks + * @param start {FilterBlock} + * @param end {FilterBlock} + * @private + */ PIXI.WebGLRenderGroup.prototype.removeFilterBlocks = function(start, end) { this.removeObject(start); this.removeObject(end); } +/** + * Adds a display object and children to the webgl context + * + * @method addDisplayObjectAndChildren + * @param displayObject {DisplayObject} + * @private + */ PIXI.WebGLRenderGroup.prototype.addDisplayObjectAndChildren = function(displayObject) { if(displayObject.__renderGroup)displayObject.__renderGroup.removeDisplayObjectAndChildren(displayObject); @@ -456,6 +533,13 @@ PIXI.WebGLRenderGroup.prototype.addDisplayObjectAndChildren = function(displayOb while(tempObject != testObject) } +/** + * Removes a display object and children to the webgl context + * + * @method removeDisplayObjectAndChildren + * @param displayObject {DisplayObject} + * @private + */ PIXI.WebGLRenderGroup.prototype.removeDisplayObjectAndChildren = function(displayObject) { if(displayObject.__renderGroup != this)return; @@ -471,8 +555,15 @@ PIXI.WebGLRenderGroup.prototype.removeDisplayObjectAndChildren = function(displa while(displayObject) } - - +/** + * Inserts a displayObject into the linked list + * + * @method insertObject + * @param displayObject {DisplayObject} + * @param previousObject {DisplayObject} + * @param nextObject {DisplayObject} + * @private + */ PIXI.WebGLRenderGroup.prototype.insertObject = function(displayObject, previousObject, nextObject) { // while looping below THE OBJECT MAY NOT HAVE BEEN ADDED @@ -602,8 +693,14 @@ PIXI.WebGLRenderGroup.prototype.insertObject = function(displayObject, previousO } - - +/** + * Inserts a displayObject into the linked list + * + * @method insertAfter + * @param item {DisplayObject} + * @param displayObject {DisplayObject} The object to insert + * @private + */ PIXI.WebGLRenderGroup.prototype.insertAfter = function(item, displayObject) { if(displayObject instanceof PIXI.Sprite) @@ -651,6 +748,13 @@ PIXI.WebGLRenderGroup.prototype.insertAfter = function(item, displayObject) } } +/** + * Removes a displayObject from the linked list + * + * @method removeObject + * @param displayObject {DisplayObject} The object to remove + * @private + */ PIXI.WebGLRenderGroup.prototype.removeObject = function(displayObject) { // loop through children.. @@ -722,15 +826,11 @@ PIXI.WebGLRenderGroup.prototype.removeObject = function(displayObject) } } - -/** - * @private - */ - - - - /** + * Initializes a tiling sprite + * + * @method initTilingSprite + * @param sprite {TilingSprite} The tiling sprite to initialize * @private */ PIXI.WebGLRenderGroup.prototype.initTilingSprite = function(sprite) @@ -786,6 +886,11 @@ PIXI.WebGLRenderGroup.prototype.initTilingSprite = function(sprite) } /** + * Renders a Strip + * + * @method renderStrip + * @param strip {Strip} The strip to render + * @param projection {Object} * @private */ PIXI.WebGLRenderGroup.prototype.renderStrip = function(strip, projection) @@ -872,8 +977,12 @@ PIXI.WebGLRenderGroup.prototype.renderStrip = function(strip, projection) gl.useProgram(PIXI.shaderProgram); } - /** + * Renders a TilingSprite + * + * @method renderTilingSprite + * @param sprite {TilingSprite} The tiling sprite to render + * @param projectionMatrix {Object} * @private */ PIXI.WebGLRenderGroup.prototype.renderTilingSprite = function(sprite, projectionMatrix) @@ -908,9 +1017,11 @@ PIXI.WebGLRenderGroup.prototype.renderTilingSprite = function(sprite, projection this.renderStrip(sprite, projectionMatrix); } - - /** + * Initializes a strip to be rendered + * + * @method initStrip + * @param strip {Strip} The strip to initialize * @private */ PIXI.WebGLRenderGroup.prototype.initStrip = function(strip) @@ -937,4 +1048,3 @@ PIXI.WebGLRenderGroup.prototype.initStrip = function(strip) gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer); gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, strip.indices, gl.STATIC_DRAW); } - diff --git a/src/pixi/renderers/webgl/WebGLRenderer.js b/src/pixi/renderers/webgl/WebGLRenderer.js index 42ae47d..5ea5adc 100644 --- a/src/pixi/renderers/webgl/WebGLRenderer.js +++ b/src/pixi/renderers/webgl/WebGLRenderer.js @@ -9,40 +9,39 @@ PIXI._defaultFrame = new PIXI.Rectangle(0,0,1,1); PIXI.gl; /** - * 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 :) + * * @class WebGLRenderer * @constructor - * @param width {Number} the width of the canvas view - * @default 0 - * @param height {Number} the height of the canvas view - * @default 0 + * @param width=0 {Number} the width of the canvas view + * @param height=0 {Number} the height of the canvas view * @param view {Canvas} the canvas to use as a view, optional - * @param transparent {Boolean} the transparency of the render view, default false - * @default false + * @param transparent=false {Boolean} the transparency of the render view, default false * */ PIXI.WebGLRenderer = function(width, height, view, transparent) { // do a catch.. only 1 webGL renderer.. - //console.log(transparent) this.transparent = !!transparent; - + this.width = width || 800; this.height = height || 600; - + this.view = view || document.createElement( 'canvas' ); this.view.width = this.width; this.view.height = this.height; - + // deal with losing context.. var scope = this; this.view.addEventListener('webglcontextlost', function(event) { scope.handleContextLost(event); }, false) this.view.addEventListener('webglcontextrestored', function(event) { scope.handleContextRestored(event); }, false) this.batchs = []; - + try { PIXI.gl = this.gl = this.view.getContext("experimental-webgl", { @@ -56,31 +55,28 @@ PIXI.WebGLRenderer = function(width, height, view, transparent) { throw new Error(" This browser does not support webGL. Try using the canvas renderer" + this); } - + PIXI.initPrimitiveShader(); PIXI.initDefaultShader(); PIXI.initDefaultStripShader(); - + PIXI.activateDefaultShader(); - + var gl = this.gl; PIXI.WebGLRenderer.gl = gl; - + this.batch = new PIXI.WebGLBatch(gl); gl.disable(gl.DEPTH_TEST); gl.disable(gl.CULL_FACE); - - // - - + gl.enable(gl.BLEND); gl.colorMask(true, true, true, this.transparent); - + PIXI.projection = new PIXI.Point(400, 300); - + this.resize(this.width, this.height); this.contextLost = false; - + this.stageRenderGroup = new PIXI.WebGLRenderGroup(this.gl); } @@ -88,6 +84,11 @@ PIXI.WebGLRenderer = function(width, height, view, transparent) PIXI.WebGLRenderer.constructor = PIXI.WebGLRenderer; /** + * Gets a new WebGLBatch from the pool + * + * @static + * @method getBatch + * @return {WebGLBatch} * @private */ PIXI.WebGLRenderer.getBatch = function() @@ -103,6 +104,11 @@ PIXI.WebGLRenderer.getBatch = function() } /** + * Puts a batch back into the pool + * + * @static + * @method returnBatch + * @param batch {WebGLBatch} The batch to return * @private */ PIXI.WebGLRenderer.returnBatch = function(batch) @@ -111,17 +117,11 @@ PIXI.WebGLRenderer.returnBatch = function(batch) PIXI._batchs.push(batch); } - -/** - * @private - */ - - - /** * Renders the stage to its webGL view + * * @method render - * @param stage {Stage} the PIXI.Stage element to be rendered + * @param stage {Stage} the Stage element to be rendered */ PIXI.WebGLRenderer.prototype.render = function(stage) { @@ -202,9 +202,12 @@ PIXI.WebGLRenderer.prototype.render = function(stage) } /** + * Updates the textures loaded into this webgl renderer + * + * @static + * @method updateTextures * @private */ - PIXI.WebGLRenderer.updateTextures = function() { for (var i=0; i < PIXI.texturesToUpdate.length; i++) this.updateTexture(PIXI.texturesToUpdate[i]); @@ -213,26 +216,34 @@ PIXI.WebGLRenderer.updateTextures = function() PIXI.texturesToDestroy = []; } +/** + * Updates a loaded webgl texture + * + * @static + * @method updateTexture + * @param texture {Texture} The texture to update + * @private + */ PIXI.WebGLRenderer.updateTexture = function(texture) { var gl = PIXI.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.source); gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR); gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR); - + // reguler... - + if(!texture._powerOf2) { gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); @@ -243,16 +254,22 @@ PIXI.WebGLRenderer.updateTexture = function(texture) gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.REPEAT); gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.REPEAT); } - + gl.bindTexture(gl.TEXTURE_2D, null); } - } +/** + * Destroys a loaded webgl texture + * + * @method destroyTexture + * @param texture {Texture} The texture to update + * @private + */ PIXI.WebGLRenderer.prototype.destroyTexture = function(texture) { var gl = this.gl; - + if(texture._glTexture) { texture._glTexture = gl.createTexture(); @@ -262,6 +279,7 @@ PIXI.WebGLRenderer.prototype.destroyTexture = function(texture) /** * 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 @@ -270,17 +288,17 @@ 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); - + //var projectionMatrix = this.projectionMatrix; - + PIXI.projection.x = this.width/2; PIXI.projection.y = this.height/2; - + // projectionMatrix[0] = 2/this.width; // projectionMatrix[5] = -2/this.height; // projectionMatrix[12] = -1; @@ -288,6 +306,10 @@ PIXI.WebGLRenderer.prototype.resize = function(width, height) } /** + * Handles a lost webgl context + * + * @method handleContextLost + * @param event {Event} * @private */ PIXI.WebGLRenderer.prototype.handleContextLost = function(event) @@ -297,6 +319,10 @@ PIXI.WebGLRenderer.prototype.handleContextLost = function(event) } /** + * Handles a restored webgl context + * + * @method handleContextRestored + * @param event {Event} * @private */ PIXI.WebGLRenderer.prototype.handleContextRestored = function(event) @@ -304,24 +330,23 @@ PIXI.WebGLRenderer.prototype.handleContextRestored = function(event) this.gl = this.view.getContext("experimental-webgl", { alpha: true }); - + this.initShaders(); - + for(var key in PIXI.TextureCache) { var texture = PIXI.TextureCache[key].baseTexture; texture._glTexture = null; PIXI.WebGLRenderer.updateTexture(texture); }; - + for (var i=0; i < this.batchs.length; i++) { this.batchs[i].restoreLostContext(this.gl)// this.batchs[i].dirty = true; }; - + PIXI._restoreBatchs(this.gl); - + this.contextLost = false; } - diff --git a/src/pixi/text/BitmapText.js b/src/pixi/text/BitmapText.js index 0465af7..d982d1d 100644 --- a/src/pixi/text/BitmapText.js +++ b/src/pixi/text/BitmapText.js @@ -7,13 +7,14 @@ * You can generate the fnt files using * http://www.angelcode.com/products/bmfont/ for windows or * http://www.bmglyph.com/ for mac. + * * @class BitmapText * @extends DisplayObjectContainer * @constructor - * @param {String} text The copy that you would like the text to display - * @param {Object} style The style parameters - * @param {String} style.font The size (optional) and bitmap font id (required) eq "Arial" or "20px Arial" (must have loaded previously) - * @param {String} [style.align="left"] An alignment of the multiline text ("left", "center" or "right") + * @param text {String} The copy that you would like the text to display + * @param style {Object} The style parameters + * @param style.font {String} The size (optional) and bitmap font id (required) eq "Arial" or "20px Arial" (must have loaded previously) + * @param [style.align="left"] {String} An alignment of the multiline text ("left", "center" or "right") */ PIXI.BitmapText = function(text, style) { @@ -32,8 +33,9 @@ PIXI.BitmapText.prototype = Object.create(PIXI.DisplayObjectContainer.prototype) /** * Set the copy for the text object + * * @method setText - * @param {String} text The copy that you would like the text to display + * @param text {String} The copy that you would like the text to display */ PIXI.BitmapText.prototype.setText = function(text) { @@ -43,10 +45,11 @@ PIXI.BitmapText.prototype.setText = function(text) /** * Set the style of the text + * * @method setStyle - * @param {Object} style The style parameters - * @param {String} style.font The size (optional) and bitmap font id (required) eq "Arial" or "20px Arial" (must have loaded previously) - * @param {String} [style.align="left"] An alignment of the multiline text ("left", "center" or "right") + * @param style {Object} The style parameters + * @param style.font {String} The size (optional) and bitmap font id (required) eq "Arial" or "20px Arial" (must have loaded previously) + * @param [style.align="left"] {String} An alignment of the multiline text ("left", "center" or "right") */ PIXI.BitmapText.prototype.setStyle = function(style) { @@ -63,6 +66,8 @@ PIXI.BitmapText.prototype.setStyle = function(style) /** * Renders text + * + * @method updateText * @private */ PIXI.BitmapText.prototype.updateText = function() @@ -135,6 +140,9 @@ PIXI.BitmapText.prototype.updateText = function() }; /** + * Updates the transfor of this object + * + * @method updateTransform * @private */ PIXI.BitmapText.prototype.updateTransform = function() @@ -153,4 +161,4 @@ PIXI.BitmapText.prototype.updateTransform = function() PIXI.DisplayObjectContainer.prototype.updateTransform.call(this); }; -PIXI.BitmapText.fonts = {}; \ No newline at end of file +PIXI.BitmapText.fonts = {}; diff --git a/src/pixi/text/Text.js b/src/pixi/text/Text.js index dc3dd8b..4152f58 100644 --- a/src/pixi/text/Text.js +++ b/src/pixi/text/Text.js @@ -4,18 +4,19 @@ /** * A Text Object will create a line(s) of text to split a line you can use "\n" + * * @class Text * @extends Sprite * @constructor - * @param {String} text The copy that you would like the text to display - * @param {Object} [style] The style parameters - * @param {String} [style.font] default "bold 20pt Arial" The style and size of the font - * @param {Object} [style.fill="black"] A canvas fillstyle that will be used on the text eg "red", "#00FF00" - * @param {String} [style.align="left"] An alignment of the multiline text ("left", "center" or "right") - * @param {String} [style.stroke] A canvas fillstyle that will be used on the text stroke eg "blue", "#FCFF00" - * @param {Number} [style.strokeThickness=0] A number that represents the thickness of the stroke. Default is 0 (no stroke) - * @param {Boolean} [style.wordWrap=false] Indicates if word wrap should be used - * @param {Number} [style.wordWrapWidth=100] The width at which text will wrap + * @param text {String} The copy that you would like the text to display + * @param [style] {Object} The style parameters + * @param [style.font] {String} default "bold 20pt Arial" The style and size of the font + * @param [style.fill="black"] {Object} A canvas fillstyle that will be used on the text eg "red", "#00FF00" + * @param [style.align="left"] {String} An alignment of the multiline text ("left", "center" or "right") + * @param [style.stroke] {String} A canvas fillstyle that will be used on the text stroke eg "blue", "#FCFF00" + * @param [style.strokeThickness=0] {Number} A number that represents the thickness of the stroke. Default is 0 (no stroke) + * @param [style.wordWrap=false] {Boolean} Indicates if word wrap should be used + * @param [style.wordWrapWidth=100] {Number} The width at which text will wrap */ PIXI.Text = function(text, style) { @@ -36,15 +37,16 @@ PIXI.Text.prototype = Object.create(PIXI.Sprite.prototype); /** * Set the style of the text + * * @method setStyle - * @param {Object} [style] The style parameters - * @param {String} [style.font="bold 20pt Arial"] The style and size of the font - * @param {Object} [style.fill="black"] A canvas fillstyle that will be used on the text eg "red", "#00FF00" - * @param {String} [style.align="left"] An alignment of the multiline text ("left", "center" or "right") - * @param {String} [style.stroke="black"] A canvas fillstyle that will be used on the text stroke eg "blue", "#FCFF00" - * @param {Number} [style.strokeThickness=0] A number that represents the thickness of the stroke. Default is 0 (no stroke) - * @param {Boolean} [style.wordWrap=false] Indicates if word wrap should be used - * @param {Number} [style.wordWrapWidth=100] The width at which text will wrap + * @param [style] {Object} The style parameters + * @param [style.font="bold 20pt Arial"] {String} The style and size of the font + * @param [style.fill="black"] {Object} A canvas fillstyle that will be used on the text eg "red", "#00FF00" + * @param [style.align="left"] {String} An alignment of the multiline text ("left", "center" or "right") + * @param [style.stroke="black"] {String} A canvas fillstyle that will be used on the text stroke eg "blue", "#FCFF00" + * @param [style.strokeThickness=0] {Number} A number that represents the thickness of the stroke. Default is 0 (no stroke) + * @param [style.wordWrap=false] {Boolean} Indicates if word wrap should be used + * @param [style.wordWrapWidth=100] {Number} The width at which text will wrap */ PIXI.Text.prototype.setStyle = function(style) { @@ -62,6 +64,7 @@ PIXI.Text.prototype.setStyle = function(style) /** * Set the copy for the text object. To split a line you can use "\n" + * * @methos setText * @param {String} text The copy that you would like the text to display */ @@ -73,6 +76,8 @@ PIXI.Sprite.prototype.setText = function(text) /** * Renders text + * + * @method updateText * @private */ PIXI.Text.prototype.updateText = function() @@ -142,6 +147,8 @@ PIXI.Text.prototype.updateText = function() /** * Updates texture size based on canvas size + * + * @method updateTexture * @private */ PIXI.Text.prototype.updateTexture = function() @@ -159,6 +166,9 @@ PIXI.Text.prototype.updateTexture = function() }; /** + * Updates the transfor of this object + * + * @method updateTransform * @private */ PIXI.Text.prototype.updateTransform = function() @@ -175,6 +185,10 @@ PIXI.Text.prototype.updateTransform = function() /* * http://stackoverflow.com/users/34441/ellisbben * great solution to the problem! + * + * @method determineFontHeight + * @param fontStyle {Object} + * @private */ PIXI.Text.prototype.determineFontHeight = function(fontStyle) { @@ -202,6 +216,9 @@ PIXI.Text.prototype.determineFontHeight = function(fontStyle) /** * A Text Object will apply wordwrap + * + * @method wordWrap + * @param text {String} * @private */ PIXI.Text.prototype.wordWrap = function(text) @@ -251,6 +268,12 @@ PIXI.Text.prototype.wordWrap = function(text) return result; }; +/** + * Destroys this text object + * + * @method destroy + * @param destroyTexture {Boolean} + */ PIXI.Text.prototype.destroy = function(destroyTexture) { if(destroyTexture) diff --git a/src/pixi/textures/BaseTexture.js b/src/pixi/textures/BaseTexture.js index df782cf..7051e2d 100644 --- a/src/pixi/textures/BaseTexture.js +++ b/src/pixi/textures/BaseTexture.js @@ -8,44 +8,53 @@ PIXI.texturesToDestroy = []; /** * A texture stores the information that represents an image. All textures have a base texture + * * @class BaseTexture - * @extends EventTarget + * @uses EventTarget * @constructor * @param source {String} the source object (image or canvas) */ PIXI.BaseTexture = function(source) { PIXI.EventTarget.call( this ); - - /* - * The url of the texture - * @property imageUrl - * @type String - */ - //this.imageUrl = source.src; - + /** - * [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 + * * @property width * @type Number + * @readOnly */ 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 + * * @property height * @type Number + * @readOnly */ this.height = 100; - + + /** + * [read-only] Describes if the base texture has loaded or not + * + * @property hasLoaded + * @type Boolean + * @readOnly + */ + this.hasLoaded = false; + /** * The source that is loaded to create the texture + * * @property source * @type Image */ - this.source = source//new Image(); - + this.source = source; + if(!source)return; - + if(this.source instanceof Image) { if(this.source.complete) @@ -81,13 +90,17 @@ PIXI.BaseTexture = function(source) PIXI.texturesToUpdate.push(this); } - + this._powerOf2 = false; - } PIXI.BaseTexture.constructor = PIXI.BaseTexture; +/** + * Destroys this base texture + * + * @method destroy + */ PIXI.BaseTexture.prototype.destroy = function() { if(this.source instanceof Image) @@ -99,9 +112,9 @@ PIXI.BaseTexture.prototype.destroy = function() } /** - * * Helper function that returns a base texture based on an image url * If the image is not in the base texture cache it will be created and loaded + * * @static * @method fromImage * @param imageUrl {String} The image url of the texture diff --git a/src/pixi/textures/RenderTexture.js b/src/pixi/textures/RenderTexture.js index f20f2a9..6994221 100644 --- a/src/pixi/textures/RenderTexture.js +++ b/src/pixi/textures/RenderTexture.js @@ -27,20 +27,20 @@ @class RenderTexture @extends Texture @constructor - @param width {Number} - @param height {Number} - **/ + @param width {Number} The width of the render texture + @param height {Number} The height of the render texture + */ PIXI.RenderTexture = function(width, height) { PIXI.EventTarget.call( this ); - + this.width = width || 100; this.height = height || 100; this.indetityMatrix = PIXI.mat3.create(); - + this.frame = new PIXI.Rectangle(0, 0, this.width, this.height); - + if(PIXI.gl) { this.initWebGL(); @@ -54,16 +54,22 @@ PIXI.RenderTexture = function(width, height) PIXI.RenderTexture.constructor = PIXI.RenderTexture; PIXI.RenderTexture.prototype = Object.create( PIXI.Texture.prototype ); +/** + * Initializes the webgl data for this texture + * + * @method initWebGL + * @private + */ PIXI.RenderTexture.prototype.initWebGL = function() { var gl = PIXI.gl; this.glFramebuffer = gl.createFramebuffer(); - + gl.bindFramebuffer(gl.FRAMEBUFFER, this.glFramebuffer ); this.glFramebuffer.width = this.width; this.glFramebuffer.height = this.height; - + this.baseTexture = new PIXI.BaseTexture(); this.baseTexture.width = this.width; @@ -71,27 +77,27 @@ PIXI.RenderTexture.prototype.initWebGL = function() this.baseTexture._glTexture = gl.createTexture(); gl.bindTexture(gl.TEXTURE_2D, this.baseTexture._glTexture); - + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, this.width, this.height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); - + 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); - + this.baseTexture.isRender = true; - + gl.bindFramebuffer(gl.FRAMEBUFFER, this.glFramebuffer ); gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.baseTexture._glTexture, 0); - + // create a projection matrix.. this.projection = new PIXI.Point(this.width/2 , this.height/2); - + this.projectionMatrix = PIXI.mat4.create(); - + this.projectionMatrix[5] = 2/this.height// * 0.5; this.projectionMatrix[13] = -1; - + this.projectionMatrix[0] = 2/this.width; this.projectionMatrix[12] = -1; @@ -99,53 +105,61 @@ PIXI.RenderTexture.prototype.initWebGL = function() this.render = this.renderWebGL; } +/** + * Initializes the canvas data for this texture + * + * @method initCanvas + * @private + */ PIXI.RenderTexture.prototype.initCanvas = function() { this.renderer = new PIXI.CanvasRenderer(this.width, this.height, null, 0); - + this.baseTexture = new PIXI.BaseTexture(this.renderer.view); this.frame = new PIXI.Rectangle(0, 0, this.width, this.height); - + this.render = this.renderCanvas; } /** * This function will draw the display object to the texture. - * @method render - * @param displayObject {DisplayObject} + * + * @method renderWebGL + * @param displayObject {DisplayObject} The display object to render this texture on * @param clear {Boolean} If true the texture will be cleared before the displayObject is drawn + * @private */ PIXI.RenderTexture.prototype.renderWebGL = function(displayObject, clear) { var gl = PIXI.gl; - + // enable the alpha color mask.. gl.colorMask(true, true, true, true); - + gl.viewport(0, 0, this.width, this.height); - + gl.bindFramebuffer(gl.FRAMEBUFFER, this.glFramebuffer ); - + if(clear) { gl.clearColor(0,0,0, 0); gl.clear(gl.COLOR_BUFFER_BIT); } - + // THIS WILL MESS WITH HIT TESTING! var children = displayObject.children; - + //TODO -? create a new one??? dont think so! displayObject.worldTransform = PIXI.mat3.create();//sthis.indetityMatrix; // modify to flip... displayObject.worldTransform[4] = -1; displayObject.worldTransform[5] = this.projection.y * 2; - + for(var i=0,j=children.length; i this.baseTexture.width || frame.y + frame.height > this.baseTexture.height) { throw new Error("Texture Error: frame does not fit inside the base Texture dimensions " + this); } - + this.updateFrame = true; - + PIXI.Texture.frameUpdates.push(this); //this.dispatchEvent( { type: 'update', content: this } ); } /** - * * 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 + * @param crossorigin {Boolean} Whether requests should be treated as crossorigin * @return Texture */ PIXI.Texture.fromImage = function(imageUrl, crossorigin) @@ -125,9 +148,10 @@ PIXI.Texture.fromImage = function(imageUrl, crossorigin) } /** - * * 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 + * + * @static * @method fromFrame * @param frameId {String} The frame id of the texture * @return Texture @@ -140,9 +164,9 @@ PIXI.Texture.fromFrame = function(frameId) } /** - * * Helper function that returns a texture based on a canvas element * If the canvas is not in the texture cache it will be created and loaded + * * @static * @method fromCanvas * @param canvas {Canvas} The canvas element source of the texture @@ -156,8 +180,8 @@ PIXI.Texture.fromCanvas = function(canvas) /** - * - * Adds a texture to the textureCache. + * Adds a texture to the textureCache. + * * @static * @method addTextureToCache * @param texture {Texture} @@ -169,8 +193,8 @@ PIXI.Texture.addTextureToCache = function(texture, id) } /** - * * Remove a texture from the textureCache. + * * @static * @method removeTextureFromCache * @param id {String} the id of the texture to be removed diff --git a/src/pixi/utils/Detector.js b/src/pixi/utils/Detector.js index e5722b9..6c8ffcd 100644 --- a/src/pixi/utils/Detector.js +++ b/src/pixi/utils/Detector.js @@ -4,14 +4,15 @@ /** * 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 + * * @method autoDetectRenderer * @static * @param width {Number} the width of the renderers view * @param height {Number} the height of the renderers view * @param view {Canvas} the canvas to use as a view, optional - * @param transparent {Boolean} the transparency of the render view, default false - * @default false + * @param transparent=false {Boolean} the transparency of the render view, default false */ PIXI.autoDetectRenderer = function(width, height, view, transparent) { diff --git a/src/pixi/utils/EventTarget.js b/src/pixi/utils/EventTarget.js index b0dc71f..8dc54a5 100644 --- a/src/pixi/utils/EventTarget.js +++ b/src/pixi/utils/EventTarget.js @@ -3,6 +3,18 @@ * THankS mr DOob! */ +/** + * Adds event emitter functionality to a class + * + * @class EventTarget + * @example + * function MyEmitter() { + * PIXI.EventTarget.call(this); //mixes in event target stuff + * } + * + * var em = new MyEmitter(); + * em.emit({ type: 'eventName', data: 'some data' }); + */ PIXI.EventTarget = function () { var listeners = {}; diff --git a/src/pixi/utils/Polyk.js b/src/pixi/utils/Polyk.js index d5e709a..b82eb0c 100644 --- a/src/pixi/utils/Polyk.js +++ b/src/pixi/utils/Polyk.js @@ -1,131 +1,149 @@ - - /* - PolyK library - url: http://polyk.ivank.net - Released under MIT licence. - - Copyright (c) 2012 Ivan Kuckir - - Permission is hereby granted, free of charge, to any person - obtaining a copy of this software and associated documentation - files (the "Software"), to deal in the Software without - restriction, including without limitation the rights to use, - copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the - Software is furnished to do so, subject to the following - conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - OTHER DEALINGS IN THE SOFTWARE. +/* + PolyK library + url: http://polyk.ivank.net + Released under MIT licence. - This is an amazing lib! - - slightly modified by mat groves (matgroves.com); - * */ + Copyright (c) 2012 Ivan Kuckir + + Permission is hereby granted, free of charge, to any person + obtaining a copy of this software and associated documentation + files (the "Software"), to deal in the Software without + restriction, including without limitation the rights to use, + copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following + conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + OTHER DEALINGS IN THE SOFTWARE. + + This is an amazing lib! - PIXI.PolyK = {}; + slightly modified by mat groves (matgroves.com); +*/ + +PIXI.PolyK = {}; + +/** + * Triangulates something or another + * + * @method Triangulate + * @namespace PolyK + * @constructor + */ +PIXI.PolyK.Triangulate = function(p) +{ + var sign = true; - PIXI.PolyK.Triangulate = function(p) + var n = p.length>>1; + if(n<3) return []; + var tgs = []; + var avl = []; + for(var i=0; i 3) { - var sign = true; + var i0 = avl[(i+0)%al]; + var i1 = avl[(i+1)%al]; + var i2 = avl[(i+2)%al]; - var n = p.length>>1; - if(n<3) return []; - var tgs = []; - var avl = []; - for(var i=0; i 3) + var earFound = false; + if(PIXI.PolyK._convex(ax, ay, bx, by, cx, cy, sign)) { - var i0 = avl[(i+0)%al]; - var i1 = avl[(i+1)%al]; - var i2 = avl[(i+2)%al]; - - var ax = p[2*i0], ay = p[2*i0+1]; - var bx = p[2*i1], by = p[2*i1+1]; - var cx = p[2*i2], cy = p[2*i2+1]; - - var earFound = false; - if(PIXI.PolyK._convex(ax, ay, bx, by, cx, cy, sign)) + earFound = true; + for(var j=0; j 3*al) - { - // need to flip flip reverse it! - // reset! - if(sign) - { - var tgs = []; - avl = []; - for(var i=0; i 3*al) + { + // need to flip flip reverse it! + // reset! + if(sign) + { + var tgs = []; + avl = []; + for(var i=0; i= 0) && (v >= 0) && (u + v < 1); - } +/** + * Checks if a point is within a triangle + * + * @class _PointInTriangle + * @namespace PolyK + * @private + */ +PIXI.PolyK._PointInTriangle = function(px, py, ax, ay, bx, by, cx, cy) +{ + var v0x = cx-ax; + var v0y = cy-ay; + var v1x = bx-ax; + var v1y = by-ay; + var v2x = px-ax; + var v2y = py-ay; + var dot00 = v0x*v0x+v0y*v0y; + var dot01 = v0x*v1x+v0y*v1y; + var dot02 = v0x*v2x+v0y*v2y; + var dot11 = v1x*v1x+v1y*v1y; + var dot12 = v1x*v2x+v1y*v2y; + + var invDenom = 1 / (dot00 * dot11 - dot01 * dot01); + var u = (dot11 * dot02 - dot01 * dot12) * invDenom; + var v = (dot00 * dot12 - dot01 * dot02) * invDenom; - PIXI.PolyK._convex = function(ax, ay, bx, by, cx, cy, sign) - { - return ((ay-by)*(cx-bx) + (bx-ax)*(cy-by) >= 0) == sign; - } - \ No newline at end of file + // Check if point is in triangle + return (u >= 0) && (v >= 0) && (u + v < 1); +} + +/** + * Something something something convex + * + * @class _convex + * @namespace PolyK + * @private + */ +PIXI.PolyK._convex = function(ax, ay, bx, by, cx, cy, sign) +{ + return ((ay-by)*(cx-bx) + (bx-ax)*(cy-by) >= 0) == sign; +} diff --git a/src/pixi/utils/Utils.js b/src/pixi/utils/Utils.js index 05febfe..6372c8a 100644 --- a/src/pixi/utils/Utils.js +++ b/src/pixi/utils/Utils.js @@ -5,38 +5,55 @@ // MIT license +/** + * A polyfill for requestAnimationFrame + * + * @method requestAnimationFrame + */ +/** + * A polyfill for cancelAnimationFrame + * + * @method cancelAnimationFrame + */ +var lastTime = 0; +var vendors = ['ms', 'moz', 'webkit', 'o']; +for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) { + window.requestAnimationFrame = window[vendors[x]+'RequestAnimationFrame']; + window.cancelAnimationFrame = window[vendors[x]+'CancelAnimationFrame'] + || window[vendors[x]+'CancelRequestAnimationFrame']; +} - var lastTime = 0; - var vendors = ['ms', 'moz', 'webkit', 'o']; - for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) { - window.requestAnimationFrame = window[vendors[x]+'RequestAnimationFrame']; - window.cancelAnimationFrame = window[vendors[x]+'CancelAnimationFrame'] - || window[vendors[x]+'CancelRequestAnimationFrame']; - } +if (!window.requestAnimationFrame) + window.requestAnimationFrame = function(callback, element) { + var currTime = new Date().getTime(); + var timeToCall = Math.max(0, 16 - (currTime - lastTime)); + var id = window.setTimeout(function() { callback(currTime + timeToCall); }, + timeToCall); + lastTime = currTime + timeToCall; + return id; + }; - if (!window.requestAnimationFrame) - window.requestAnimationFrame = function(callback, element) { - var currTime = new Date().getTime(); - var timeToCall = Math.max(0, 16 - (currTime - lastTime)); - var id = window.setTimeout(function() { callback(currTime + timeToCall); }, - timeToCall); - lastTime = currTime + timeToCall; - return id; - }; - - if (!window.cancelAnimationFrame) - window.cancelAnimationFrame = function(id) { - clearTimeout(id); - }; +if (!window.cancelAnimationFrame) + window.cancelAnimationFrame = function(id) { + clearTimeout(id); + }; window.requestAnimFrame = window.requestAnimationFrame; +/** + * Converts a hex color number to an [R, G, B] array + * + * @method HEXtoRGB + * @param hex {Number} + */ function HEXtoRGB(hex) { return [(hex >> 16 & 0xFF) / 255, ( hex >> 8 & 0xFF) / 255, (hex & 0xFF)/ 255]; } /** - * Provides bind in a cross browser way. + * A polyfill for Function.prototype.bind + * + * @method bind */ if (typeof Function.prototype.bind != 'function') { Function.prototype.bind = (function () { @@ -61,6 +78,12 @@ if (typeof Function.prototype.bind != 'function') { })(); } +/** + * A wrapper for ajax requests to be handled cross browser + * + * @class AjaxRequest + * @constructor + */ var AjaxRequest = PIXI.AjaxRequest = function() { var activexmodes = ["Msxml2.XMLHTTP", "Microsoft.XMLHTTP"] //activeX versions to check for in IE From 206efa6f7d5c570e0fd66573e25b178f21f02f33 Mon Sep 17 00:00:00 2001 From: Chad Engler Date: Mon, 8 Jul 2013 19:50:34 -0700 Subject: [PATCH 41/68] minor clean up based on feedback --- src/pixi/core/Ellipse.js | 4 ++-- src/pixi/extras/Spine.js | 1 - src/pixi/utils/Polyk.js | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/pixi/core/Ellipse.js b/src/pixi/core/Ellipse.js index c011a63..a0703ad 100644 --- a/src/pixi/core/Ellipse.js +++ b/src/pixi/core/Ellipse.js @@ -47,7 +47,7 @@ PIXI.Ellipse = function(x, y, width, height) * Creates a clone of this Ellipse instance * * @method clone - * @return {Ellipse} a copy of the polygon + * @return {Ellipse} a copy of the ellipse */ PIXI.Ellipse.prototype.clone = function() { @@ -60,7 +60,7 @@ PIXI.Ellipse.prototype.clone = function() * @method contains * @param x {Number} The X coord of the point to test * @param y {Number} The Y coord of the point to test - * @return {Boolean} if the x/y coords are within this polygon + * @return {Boolean} if the x/y coords are within this ellipse */ PIXI.Ellipse.prototype.contains = function(x, y) { diff --git a/src/pixi/extras/Spine.js b/src/pixi/extras/Spine.js index 5109093..0619839 100644 --- a/src/pixi/extras/Spine.js +++ b/src/pixi/extras/Spine.js @@ -10,7 +10,6 @@ /** * A class that enables the you to import and run your spine animations in pixi. * Spine animation data needs to be loaded using the PIXI.AssetLoader or PIXI.SpineLoader before it can be used by this class - * Also due to a clash of names, you will need to change the extension of the spine file from *.json to *.anim for it to load * See example 12 (http://www.goodboydigital.com/pixijs/examples/12/) to see a working example and check out the source * * @class Spine diff --git a/src/pixi/utils/Polyk.js b/src/pixi/utils/Polyk.js index b82eb0c..84d290f 100644 --- a/src/pixi/utils/Polyk.js +++ b/src/pixi/utils/Polyk.js @@ -34,7 +34,7 @@ PIXI.PolyK = {}; /** - * Triangulates something or another + * Triangulates shapes for webGL graphic fills * * @method Triangulate * @namespace PolyK @@ -137,7 +137,7 @@ PIXI.PolyK._PointInTriangle = function(px, py, ax, ay, bx, by, cx, cy) } /** - * Something something something convex + * Checks if a shape is convex * * @class _convex * @namespace PolyK From 64dbf904b8179d34addc10323e2ec5810771ff35 Mon Sep 17 00:00:00 2001 From: Chad Engler Date: Mon, 8 Jul 2013 19:55:46 -0700 Subject: [PATCH 42/68] add a minor heading --- src/pixi/extras/Spine.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/pixi/extras/Spine.js b/src/pixi/extras/Spine.js index 0619839..006fb6d 100644 --- a/src/pixi/extras/Spine.js +++ b/src/pixi/extras/Spine.js @@ -60,6 +60,13 @@ PIXI.Spine = function(url) PIXI.Spine.constructor = PIXI.Spine; PIXI.Spine.prototype = Object.create( PIXI.DisplayObjectContainer.prototype ); + +/* + * Updates the object transform for rendering + * + * @method updateTransform + * @private + */ PIXI.Spine.prototype.updateTransform = function() { // TODO should make this time based really.. From 5141791ae71bda8bed842858da7f3d264627be0c Mon Sep 17 00:00:00 2001 From: Mat Groves Date: Thu, 11 Jul 2013 20:19:49 +0100 Subject: [PATCH 43/68] Minor updates and bug fixes Added new Matrix functions Added resize function to renderTexture Fixed RenderTexture Mask bug --- .../index double mask.html | 121 ++++++++++++++++++ src/pixi/InteractionManager.js | 1 - src/pixi/core/Matrix.js | 17 +++ src/pixi/display/DisplayObjectContainer.js | 1 - src/pixi/renderers/canvas/CanvasRenderer.js | 4 + src/pixi/renderers/webgl/WebGLRenderGroup.js | 8 +- src/pixi/textures/RenderTexture.js | 43 ++++++- 7 files changed, 189 insertions(+), 6 deletions(-) create mode 100644 examples/example 14 - Masking/index double mask.html diff --git a/examples/example 14 - Masking/index double mask.html b/examples/example 14 - Masking/index double mask.html new file mode 100644 index 0000000..f7ae8df --- /dev/null +++ b/examples/example 14 - Masking/index double mask.html @@ -0,0 +1,121 @@ + + + + pixi.js example 14 - Masking + + + + + + + + + diff --git a/src/pixi/InteractionManager.js b/src/pixi/InteractionManager.js index 4f30464..c150102 100644 --- a/src/pixi/InteractionManager.js +++ b/src/pixi/InteractionManager.js @@ -433,7 +433,6 @@ PIXI.InteractionManager.prototype.onTouchEnd = function(event) for (var i=0; i < changedTouches.length; i++) { - var touchEvent = changedTouches[i]; var touchData = this.touchs[touchEvent.identifier]; var up = false; diff --git a/src/pixi/core/Matrix.js b/src/pixi/core/Matrix.js index 63b8347..780fcd6 100644 --- a/src/pixi/core/Matrix.js +++ b/src/pixi/core/Matrix.js @@ -31,6 +31,23 @@ PIXI.mat3.create = function() return matrix; } + +PIXI.mat3.identity = function(matrix) +{ + matrix[0] = 1; + matrix[1] = 0; + matrix[2] = 0; + matrix[3] = 0; + matrix[4] = 1; + matrix[5] = 0; + matrix[6] = 0; + matrix[7] = 0; + matrix[8] = 1; + + return matrix; +} + + PIXI.mat4 = {}; PIXI.mat4.create = function() diff --git a/src/pixi/display/DisplayObjectContainer.js b/src/pixi/display/DisplayObjectContainer.js index 1a879f9..bfb5369 100644 --- a/src/pixi/display/DisplayObjectContainer.js +++ b/src/pixi/display/DisplayObjectContainer.js @@ -216,7 +216,6 @@ PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index) this.__renderGroup.addDisplayObjectAndChildren(child); } - console.log(this.children) } else { diff --git a/src/pixi/renderers/canvas/CanvasRenderer.js b/src/pixi/renderers/canvas/CanvasRenderer.js index 15044ee..5bdffc5 100644 --- a/src/pixi/renderers/canvas/CanvasRenderer.js +++ b/src/pixi/renderers/canvas/CanvasRenderer.js @@ -105,6 +105,8 @@ PIXI.CanvasRenderer.prototype.render = function(stage) { PIXI.Texture.frameUpdates = []; } + + } /** @@ -229,6 +231,8 @@ PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject) } while(displayObject != testObject) + + } diff --git a/src/pixi/renderers/webgl/WebGLRenderGroup.js b/src/pixi/renderers/webgl/WebGLRenderGroup.js index 6094829..2b58500 100644 --- a/src/pixi/renderers/webgl/WebGLRenderGroup.js +++ b/src/pixi/renderers/webgl/WebGLRenderGroup.js @@ -284,6 +284,9 @@ PIXI.WebGLRenderGroup.prototype.renderSpecial = function(renderable, projection) /* * for now only masks are supported.. */ + + var gl = PIXI.gl; + if(renderable.open) { gl.enable(gl.STENCIL_TEST); @@ -293,8 +296,9 @@ PIXI.WebGLRenderGroup.prototype.renderSpecial = function(renderable, projection) gl.stencilOp(gl.KEEP,gl.KEEP,gl.REPLACE); PIXI.WebGLGraphics.renderGraphics(renderable.mask, projection); - - gl.colorMask(true, true, true, false); + + // we know this is a render texture so enable alpha too.. + gl.colorMask(true, true, true, true); gl.stencilFunc(gl.NOTEQUAL,0,0xff); gl.stencilOp(gl.KEEP,gl.KEEP,gl.KEEP); } diff --git a/src/pixi/textures/RenderTexture.js b/src/pixi/textures/RenderTexture.js index f20f2a9..69ddf24 100644 --- a/src/pixi/textures/RenderTexture.js +++ b/src/pixi/textures/RenderTexture.js @@ -97,6 +97,30 @@ PIXI.RenderTexture.prototype.initWebGL = function() // set the correct render function.. this.render = this.renderWebGL; + + +} + + +PIXI.RenderTexture.prototype.resize = function(width, height) +{ + this.width = width; + this.height = height; + + this.projection = new PIXI.Point(this.width/2 , this.height/2); + + if(PIXI.gl) + { + var gl = PIXI.gl; + gl.bindTexture(gl.TEXTURE_2D, this.baseTexture._glTexture); + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, this.width, this.height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + } + else + { + this.frame.width = this.width + this.frame.height = this.height; + this.renderer.resize(this.width, this.height); + } } PIXI.RenderTexture.prototype.initCanvas = function() @@ -115,7 +139,7 @@ PIXI.RenderTexture.prototype.initCanvas = function() * @param displayObject {DisplayObject} * @param clear {Boolean} If true the texture will be cleared before the displayObject is drawn */ -PIXI.RenderTexture.prototype.renderWebGL = function(displayObject, clear) +PIXI.RenderTexture.prototype.renderWebGL = function(displayObject, position, clear) { var gl = PIXI.gl; @@ -141,6 +165,12 @@ PIXI.RenderTexture.prototype.renderWebGL = function(displayObject, clear) displayObject.worldTransform[4] = -1; displayObject.worldTransform[5] = this.projection.y * 2; + if(position) + { + displayObject.worldTransform[2] = position.x; + displayObject.worldTransform[5] -= position.y; + } + for(var i=0,j=children.length; i Date: Sat, 13 Jul 2013 08:21:30 -0700 Subject: [PATCH 44/68] allow a user to pass an DOM Image elemnt as a base textutrre source Accept a dom image as param to base texture, fixes #204 --- src/pixi/textures/BaseTexture.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pixi/textures/BaseTexture.js b/src/pixi/textures/BaseTexture.js index 7051e2d..25ff347 100644 --- a/src/pixi/textures/BaseTexture.js +++ b/src/pixi/textures/BaseTexture.js @@ -55,7 +55,7 @@ PIXI.BaseTexture = function(source) if(!source)return; - if(this.source instanceof Image) + if(this.source instanceof Image || this.source instanceof HTMLImageElement) { if(this.source.complete) { From 9dab185fe4e3bd7005497210a174d2e9f2e0b9b2 Mon Sep 17 00:00:00 2001 From: Chad Engler Date: Sat, 13 Jul 2013 08:30:02 -0700 Subject: [PATCH 45/68] also update text width/height properties, fixes #197 --- src/pixi/text/Text.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pixi/text/Text.js b/src/pixi/text/Text.js index 4152f58..0b62bc7 100644 --- a/src/pixi/text/Text.js +++ b/src/pixi/text/Text.js @@ -102,11 +102,11 @@ PIXI.Text.prototype.updateText = function() lineWidths[i] = lineWidth; maxLineWidth = Math.max(maxLineWidth, lineWidth); } - this.canvas.width = maxLineWidth + this.style.strokeThickness; + this.width = this.canvas.width = maxLineWidth + this.style.strokeThickness; //calculate text height var lineHeight = this.determineFontHeight("font: " + this.style.font + ";") + this.style.strokeThickness; - this.canvas.height = lineHeight * lines.length; + this.height = this.canvas.height = lineHeight * lines.length; //set canvas text styles this.context.fillStyle = this.style.fill; From f9e2af95fbd78a4b27f38cf37ada9d3c2243c6cd Mon Sep 17 00:00:00 2001 From: Chad Engler Date: Mon, 15 Jul 2013 12:11:26 -0700 Subject: [PATCH 46/68] move constructor property to prototype, fixes #189 --- src/pixi/InteractionManager.js | 4 ++-- src/pixi/core/Circle.js | 2 +- src/pixi/core/Ellipse.js | 2 +- src/pixi/core/Point.js | 2 +- src/pixi/core/Polygon.js | 2 +- src/pixi/core/Rectangle.js | 2 +- src/pixi/display/DisplayObject.js | 2 +- src/pixi/display/DisplayObjectContainer.js | 2 +- src/pixi/display/MovieClip.js | 2 +- src/pixi/display/Sprite.js | 2 +- src/pixi/display/Stage.js | 2 +- src/pixi/extras/CustomRenderable.js | 2 +- src/pixi/extras/Rope.js | 2 +- src/pixi/extras/Spine.js | 2 +- src/pixi/extras/Strip.js | 2 +- src/pixi/extras/TilingSprite.js | 2 +- src/pixi/loaders/AssetLoader.js | 2 +- src/pixi/loaders/BitmapFontLoader.js | 2 +- src/pixi/loaders/ImageLoader.js | 2 +- src/pixi/loaders/JsonLoader.js | 2 +- src/pixi/loaders/SpineLoader.js | 2 +- src/pixi/loaders/SpriteSheetLoader.js | 2 +- src/pixi/primitives/Graphics.js | 2 +- src/pixi/renderers/canvas/CanvasRenderer.js | 2 +- src/pixi/renderers/webgl/WebGLBatch.js | 2 +- src/pixi/renderers/webgl/WebGLRenderGroup.js | 2 +- src/pixi/renderers/webgl/WebGLRenderer.js | 2 +- src/pixi/text/BitmapText.js | 2 +- src/pixi/text/Text.js | 2 +- src/pixi/textures/BaseTexture.js | 2 +- src/pixi/textures/RenderTexture.js | 2 +- src/pixi/textures/Texture.js | 2 +- 32 files changed, 33 insertions(+), 33 deletions(-) diff --git a/src/pixi/InteractionManager.js b/src/pixi/InteractionManager.js index bdbb276..e125dc8 100644 --- a/src/pixi/InteractionManager.js +++ b/src/pixi/InteractionManager.js @@ -53,7 +53,7 @@ PIXI.InteractionManager = function(stage) } // constructor -PIXI.InteractionManager.constructor = PIXI.InteractionManager; +PIXI.InteractionManager.prototype.constructor = PIXI.InteractionManager; /** * Collects an interactive sprite recursively to have their interactions managed @@ -618,4 +618,4 @@ PIXI.InteractionData.prototype.getLocalPosition = function(displayObject) } // constructor -PIXI.InteractionData.constructor = PIXI.InteractionData; +PIXI.InteractionData.prototype.constructor = PIXI.InteractionData; diff --git a/src/pixi/core/Circle.js b/src/pixi/core/Circle.js index 6c3433d..a9ceed0 100644 --- a/src/pixi/core/Circle.js +++ b/src/pixi/core/Circle.js @@ -69,5 +69,5 @@ PIXI.Circle.prototype.contains = function(x, y) return (dx + dy <= r2); } -PIXI.Circle.constructor = PIXI.Circle; +PIXI.Circle.prototype.constructor = PIXI.Circle; diff --git a/src/pixi/core/Ellipse.js b/src/pixi/core/Ellipse.js index a0703ad..dd369da 100644 --- a/src/pixi/core/Ellipse.js +++ b/src/pixi/core/Ellipse.js @@ -83,5 +83,5 @@ PIXI.Ellipse.getBounds = function() return new PIXI.Rectangle(this.x, this.y, this.width, this.height); } -PIXI.Ellipse.constructor = PIXI.Ellipse; +PIXI.Ellipse.prototype.constructor = PIXI.Ellipse; diff --git a/src/pixi/core/Point.js b/src/pixi/core/Point.js index 294a8f8..8520861 100644 --- a/src/pixi/core/Point.js +++ b/src/pixi/core/Point.js @@ -39,5 +39,5 @@ PIXI.Point.prototype.clone = function() } // constructor -PIXI.Point.constructor = PIXI.Point; +PIXI.Point.prototype.constructor = PIXI.Point; diff --git a/src/pixi/core/Polygon.js b/src/pixi/core/Polygon.js index 5c1db06..47cf17b 100644 --- a/src/pixi/core/Polygon.js +++ b/src/pixi/core/Polygon.js @@ -73,5 +73,5 @@ PIXI.Polygon.prototype.contains = function(x, y) return inside; } -PIXI.Polygon.constructor = PIXI.Polygon; +PIXI.Polygon.prototype.constructor = PIXI.Polygon; diff --git a/src/pixi/core/Rectangle.js b/src/pixi/core/Rectangle.js index 64acf7a..66fb5d6 100644 --- a/src/pixi/core/Rectangle.js +++ b/src/pixi/core/Rectangle.js @@ -82,5 +82,5 @@ PIXI.Rectangle.prototype.contains = function(x, y) } // constructor -PIXI.Rectangle.constructor = PIXI.Rectangle; +PIXI.Rectangle.prototype.constructor = PIXI.Rectangle; diff --git a/src/pixi/display/DisplayObject.js b/src/pixi/display/DisplayObject.js index 3b51aaf..f8ee024 100644 --- a/src/pixi/display/DisplayObject.js +++ b/src/pixi/display/DisplayObject.js @@ -258,7 +258,7 @@ PIXI.DisplayObject = function() } // constructor -PIXI.DisplayObject.constructor = PIXI.DisplayObject; +PIXI.DisplayObject.prototype.constructor = PIXI.DisplayObject; //TODO make visible a getter setter /* diff --git a/src/pixi/display/DisplayObjectContainer.js b/src/pixi/display/DisplayObjectContainer.js index 4a3a204..649169f 100644 --- a/src/pixi/display/DisplayObjectContainer.js +++ b/src/pixi/display/DisplayObjectContainer.js @@ -26,8 +26,8 @@ PIXI.DisplayObjectContainer = function() } // constructor -PIXI.DisplayObjectContainer.constructor = PIXI.DisplayObjectContainer; PIXI.DisplayObjectContainer.prototype = Object.create( PIXI.DisplayObject.prototype ); +PIXI.DisplayObjectContainer.prototype.constructor = PIXI.DisplayObjectContainer; //TODO make visible a getter setter /* diff --git a/src/pixi/display/MovieClip.js b/src/pixi/display/MovieClip.js index b435ffe..7a77856 100644 --- a/src/pixi/display/MovieClip.js +++ b/src/pixi/display/MovieClip.js @@ -69,8 +69,8 @@ PIXI.MovieClip = function(textures) } // constructor -PIXI.MovieClip.constructor = PIXI.MovieClip; PIXI.MovieClip.prototype = Object.create( PIXI.Sprite.prototype ); +PIXI.MovieClip.prototype.constructor = PIXI.MovieClip; /** * Stops the MovieClip diff --git a/src/pixi/display/Sprite.js b/src/pixi/display/Sprite.js index 945331a..0713205 100644 --- a/src/pixi/display/Sprite.js +++ b/src/pixi/display/Sprite.js @@ -80,8 +80,8 @@ PIXI.Sprite = function(texture) } // constructor -PIXI.Sprite.constructor = PIXI.Sprite; PIXI.Sprite.prototype = Object.create( PIXI.DisplayObjectContainer.prototype ); +PIXI.Sprite.prototype.constructor = PIXI.Sprite; /** * The width of the sprite, setting this will actually modify the scale to acheive the value set diff --git a/src/pixi/display/Stage.js b/src/pixi/display/Stage.js index 447d77a..681c91b 100644 --- a/src/pixi/display/Stage.js +++ b/src/pixi/display/Stage.js @@ -65,8 +65,8 @@ PIXI.Stage = function(backgroundColor, interactive) } // constructor -PIXI.Stage.constructor = PIXI.Stage; PIXI.Stage.prototype = Object.create( PIXI.DisplayObjectContainer.prototype ); +PIXI.Stage.prototype.constructor = PIXI.Stage; /* * Updates the object transform for rendering diff --git a/src/pixi/extras/CustomRenderable.js b/src/pixi/extras/CustomRenderable.js index 7477195..eb0dc5b 100644 --- a/src/pixi/extras/CustomRenderable.js +++ b/src/pixi/extras/CustomRenderable.js @@ -17,8 +17,8 @@ PIXI.CustomRenderable = function() } // constructor -PIXI.CustomRenderable.constructor = PIXI.CustomRenderable; PIXI.CustomRenderable.prototype = Object.create( PIXI.DisplayObject.prototype ); +PIXI.CustomRenderable.prototype.constructor = PIXI.CustomRenderable; /** * If this object is being rendered by a CanvasRenderer it will call this callback diff --git a/src/pixi/extras/Rope.js b/src/pixi/extras/Rope.js index 879fd13..1c057c8 100644 --- a/src/pixi/extras/Rope.js +++ b/src/pixi/extras/Rope.js @@ -29,8 +29,8 @@ PIXI.Rope = function(texture, points) // constructor -PIXI.Rope.constructor = PIXI.Rope; PIXI.Rope.prototype = Object.create( PIXI.Strip.prototype ); +PIXI.Rope.prototype.constructor = PIXI.Rope; PIXI.Rope.prototype.refresh = function() { diff --git a/src/pixi/extras/Spine.js b/src/pixi/extras/Spine.js index 006fb6d..5ee161a 100644 --- a/src/pixi/extras/Spine.js +++ b/src/pixi/extras/Spine.js @@ -58,8 +58,8 @@ PIXI.Spine = function(url) }; } -PIXI.Spine.constructor = PIXI.Spine; PIXI.Spine.prototype = Object.create( PIXI.DisplayObjectContainer.prototype ); +PIXI.Spine.prototype.constructor = PIXI.Spine; /* * Updates the object transform for rendering diff --git a/src/pixi/extras/Strip.js b/src/pixi/extras/Strip.js index d2a6937..1e5ba3b 100644 --- a/src/pixi/extras/Strip.js +++ b/src/pixi/extras/Strip.js @@ -66,8 +66,8 @@ PIXI.Strip = function(texture, width, height) } // constructor -PIXI.Strip.constructor = PIXI.Strip; PIXI.Strip.prototype = Object.create( PIXI.DisplayObjectContainer.prototype ); +PIXI.Strip.prototype.constructor = PIXI.Strip; PIXI.Strip.prototype.setTexture = function(texture) { diff --git a/src/pixi/extras/TilingSprite.js b/src/pixi/extras/TilingSprite.js index 9a49e1c..2cb17fa 100644 --- a/src/pixi/extras/TilingSprite.js +++ b/src/pixi/extras/TilingSprite.js @@ -62,8 +62,8 @@ PIXI.TilingSprite = function(texture, width, height) } // constructor -PIXI.TilingSprite.constructor = PIXI.TilingSprite; PIXI.TilingSprite.prototype = Object.create( PIXI.DisplayObjectContainer.prototype ); +PIXI.TilingSprite.prototype.constructor = PIXI.TilingSprite; /** * Sets the texture of the tiling sprite diff --git a/src/pixi/loaders/AssetLoader.js b/src/pixi/loaders/AssetLoader.js index 7936b83..168a5f8 100644 --- a/src/pixi/loaders/AssetLoader.js +++ b/src/pixi/loaders/AssetLoader.js @@ -69,7 +69,7 @@ PIXI.AssetLoader = function(assetURLs, crossorigin) */ // constructor -PIXI.AssetLoader.constructor = PIXI.AssetLoader; +PIXI.AssetLoader.prototype.constructor = PIXI.AssetLoader; /** * Starts loading the assets sequentially diff --git a/src/pixi/loaders/BitmapFontLoader.js b/src/pixi/loaders/BitmapFontLoader.js index af08b83..4afd8aa 100644 --- a/src/pixi/loaders/BitmapFontLoader.js +++ b/src/pixi/loaders/BitmapFontLoader.js @@ -58,7 +58,7 @@ PIXI.BitmapFontLoader = function(url, crossorigin) }; // constructor -PIXI.BitmapFontLoader.constructor = PIXI.BitmapFontLoader; +PIXI.BitmapFontLoader.prototype.constructor = PIXI.BitmapFontLoader; /** * Loads the XML font data diff --git a/src/pixi/loaders/ImageLoader.js b/src/pixi/loaders/ImageLoader.js index 942b009..971c012 100644 --- a/src/pixi/loaders/ImageLoader.js +++ b/src/pixi/loaders/ImageLoader.js @@ -27,7 +27,7 @@ PIXI.ImageLoader = function(url, crossorigin) }; // constructor -PIXI.ImageLoader.constructor = PIXI.ImageLoader; +PIXI.ImageLoader.prototype.constructor = PIXI.ImageLoader; /** * Loads image or takes it from cache diff --git a/src/pixi/loaders/JsonLoader.js b/src/pixi/loaders/JsonLoader.js index 1fee06b..1f4ecfe 100644 --- a/src/pixi/loaders/JsonLoader.js +++ b/src/pixi/loaders/JsonLoader.js @@ -53,7 +53,7 @@ PIXI.JsonLoader = function (url, crossorigin) { }; // constructor -PIXI.JsonLoader.constructor = PIXI.JsonLoader; +PIXI.JsonLoader.prototype.constructor = PIXI.JsonLoader; /** * Loads the JSON data diff --git a/src/pixi/loaders/SpineLoader.js b/src/pixi/loaders/SpineLoader.js index ce32257..f5e16b0 100644 --- a/src/pixi/loaders/SpineLoader.js +++ b/src/pixi/loaders/SpineLoader.js @@ -51,7 +51,7 @@ PIXI.SpineLoader = function(url, crossorigin) this.loaded = false; } -PIXI.SpineLoader.constructor = PIXI.SpineLoader; +PIXI.SpineLoader.prototype.constructor = PIXI.SpineLoader; /** * Loads the JSON data diff --git a/src/pixi/loaders/SpriteSheetLoader.js b/src/pixi/loaders/SpriteSheetLoader.js index 5495f57..169fb70 100644 --- a/src/pixi/loaders/SpriteSheetLoader.js +++ b/src/pixi/loaders/SpriteSheetLoader.js @@ -69,7 +69,7 @@ PIXI.SpriteSheetLoader = function (url, crossorigin) { }; // constructor -PIXI.SpriteSheetLoader.constructor = PIXI.SpriteSheetLoader; +PIXI.SpriteSheetLoader.prototype.constructor = PIXI.SpriteSheetLoader; /** * This will begin loading the JSON file diff --git a/src/pixi/primitives/Graphics.js b/src/pixi/primitives/Graphics.js index 768fede..7a80553 100644 --- a/src/pixi/primitives/Graphics.js +++ b/src/pixi/primitives/Graphics.js @@ -62,8 +62,8 @@ PIXI.Graphics = function() } // constructor -PIXI.Graphics.constructor = PIXI.Graphics; PIXI.Graphics.prototype = Object.create( PIXI.DisplayObjectContainer.prototype ); +PIXI.Graphics.prototype.constructor = PIXI.Graphics; /** * Specifies a line style used for subsequent calls to Graphics methods such as the lineTo() method or the drawCircle() method. diff --git a/src/pixi/renderers/canvas/CanvasRenderer.js b/src/pixi/renderers/canvas/CanvasRenderer.js index d1be4b2..060327d 100644 --- a/src/pixi/renderers/canvas/CanvasRenderer.js +++ b/src/pixi/renderers/canvas/CanvasRenderer.js @@ -61,7 +61,7 @@ PIXI.CanvasRenderer = function(width, height, view, transparent) } // constructor -PIXI.CanvasRenderer.constructor = PIXI.CanvasRenderer; +PIXI.CanvasRenderer.prototype.constructor = PIXI.CanvasRenderer; /** * Renders the stage to its canvas view diff --git a/src/pixi/renderers/webgl/WebGLBatch.js b/src/pixi/renderers/webgl/WebGLBatch.js index 1eca2fa..f452d37 100644 --- a/src/pixi/renderers/webgl/WebGLBatch.js +++ b/src/pixi/renderers/webgl/WebGLBatch.js @@ -66,7 +66,7 @@ PIXI.WebGLBatch = function(gl) } // constructor -PIXI.WebGLBatch.constructor = PIXI.WebGLBatch; +PIXI.WebGLBatch.prototype.constructor = PIXI.WebGLBatch; /** * Cleans the batch so that is can be returned to an object pool and reused diff --git a/src/pixi/renderers/webgl/WebGLRenderGroup.js b/src/pixi/renderers/webgl/WebGLRenderGroup.js index 277d893..a4ad4e9 100644 --- a/src/pixi/renderers/webgl/WebGLRenderGroup.js +++ b/src/pixi/renderers/webgl/WebGLRenderGroup.js @@ -26,7 +26,7 @@ PIXI.WebGLRenderGroup = function(gl) } // constructor -PIXI.WebGLRenderGroup.constructor = PIXI.WebGLRenderGroup; +PIXI.WebGLRenderGroup.prototype.constructor = PIXI.WebGLRenderGroup; /** * Add a display object to the webgl renderer diff --git a/src/pixi/renderers/webgl/WebGLRenderer.js b/src/pixi/renderers/webgl/WebGLRenderer.js index 5ea5adc..2ecb971 100644 --- a/src/pixi/renderers/webgl/WebGLRenderer.js +++ b/src/pixi/renderers/webgl/WebGLRenderer.js @@ -81,7 +81,7 @@ PIXI.WebGLRenderer = function(width, height, view, transparent) } // constructor -PIXI.WebGLRenderer.constructor = PIXI.WebGLRenderer; +PIXI.WebGLRenderer.prototype.constructor = PIXI.WebGLRenderer; /** * Gets a new WebGLBatch from the pool diff --git a/src/pixi/text/BitmapText.js b/src/pixi/text/BitmapText.js index d982d1d..b667172 100644 --- a/src/pixi/text/BitmapText.js +++ b/src/pixi/text/BitmapText.js @@ -28,8 +28,8 @@ PIXI.BitmapText = function(text, style) }; // constructor -PIXI.BitmapText.constructor = PIXI.BitmapText; PIXI.BitmapText.prototype = Object.create(PIXI.DisplayObjectContainer.prototype); +PIXI.BitmapText.prototype.constructor = PIXI.BitmapText; /** * Set the copy for the text object diff --git a/src/pixi/text/Text.js b/src/pixi/text/Text.js index 0b62bc7..4a3d89f 100644 --- a/src/pixi/text/Text.js +++ b/src/pixi/text/Text.js @@ -32,8 +32,8 @@ PIXI.Text = function(text, style) }; // constructor -PIXI.Text.constructor = PIXI.Text; PIXI.Text.prototype = Object.create(PIXI.Sprite.prototype); +PIXI.Text.prototype.constructor = PIXI.Text; /** * Set the style of the text diff --git a/src/pixi/textures/BaseTexture.js b/src/pixi/textures/BaseTexture.js index 25ff347..4b7e7ac 100644 --- a/src/pixi/textures/BaseTexture.js +++ b/src/pixi/textures/BaseTexture.js @@ -94,7 +94,7 @@ PIXI.BaseTexture = function(source) this._powerOf2 = false; } -PIXI.BaseTexture.constructor = PIXI.BaseTexture; +PIXI.BaseTexture.prototype.constructor = PIXI.BaseTexture; /** * Destroys this base texture diff --git a/src/pixi/textures/RenderTexture.js b/src/pixi/textures/RenderTexture.js index 5328f80..cff3713 100644 --- a/src/pixi/textures/RenderTexture.js +++ b/src/pixi/textures/RenderTexture.js @@ -51,8 +51,8 @@ PIXI.RenderTexture = function(width, height) } } -PIXI.RenderTexture.constructor = PIXI.RenderTexture; PIXI.RenderTexture.prototype = Object.create( PIXI.Texture.prototype ); +PIXI.RenderTexture.prototype.constructor = PIXI.RenderTexture; /** * Initializes the webgl data for this texture diff --git a/src/pixi/textures/Texture.js b/src/pixi/textures/Texture.js index 748f996..419c7b2 100644 --- a/src/pixi/textures/Texture.js +++ b/src/pixi/textures/Texture.js @@ -68,7 +68,7 @@ PIXI.Texture = function(baseTexture, frame) } } -PIXI.Texture.constructor = PIXI.Texture; +PIXI.Texture.prototype.constructor = PIXI.Texture; /** * Called when the base texture is loaded From ff2b77bb2882f0af6697eb4b8f4972d906e1564f Mon Sep 17 00:00:00 2001 From: Louis Acresti Date: Mon, 15 Jul 2013 19:50:13 -0400 Subject: [PATCH 47/68] fix RenderTexture stage flipping --- src/pixi/textures/RenderTexture.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/pixi/textures/RenderTexture.js b/src/pixi/textures/RenderTexture.js index cff3713..544fb22 100644 --- a/src/pixi/textures/RenderTexture.js +++ b/src/pixi/textures/RenderTexture.js @@ -174,6 +174,7 @@ PIXI.RenderTexture.prototype.renderWebGL = function(displayObject, position, cle var children = displayObject.children; //TODO -? create a new one??? dont think so! + var originalWorldTransform = displayObject.worldTransform; displayObject.worldTransform = PIXI.mat3.create();//sthis.indetityMatrix; // modify to flip... displayObject.worldTransform[4] = -1; @@ -212,6 +213,8 @@ PIXI.RenderTexture.prototype.renderWebGL = function(displayObject, position, cle this.renderGroup.setRenderable(displayObject); this.renderGroup.render(this.projection); } + + displayObject.worldTransform = originalWorldTransform; } From 1a53bd9f6e8190c4541bf7646e913e6aefc6e987 Mon Sep 17 00:00:00 2001 From: Krzysztof Opalka Date: Sun, 21 Jul 2013 19:24:13 +0200 Subject: [PATCH 48/68] fixed typo in PIXI.Text.prototype.setText --- src/pixi/text/Text.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pixi/text/Text.js b/src/pixi/text/Text.js index 4a3d89f..6645cc8 100644 --- a/src/pixi/text/Text.js +++ b/src/pixi/text/Text.js @@ -68,7 +68,7 @@ PIXI.Text.prototype.setStyle = function(style) * @methos setText * @param {String} text The copy that you would like the text to display */ -PIXI.Sprite.prototype.setText = function(text) +PIXI.Text.prototype.setText = function(text) { this.text = text.toString() || " "; this.dirty = true; From 780ec2dca3ee4904adc55026e59754bbe08349e0 Mon Sep 17 00:00:00 2001 From: Louis Acresti Date: Tue, 23 Jul 2013 19:27:40 -0400 Subject: [PATCH 49/68] removed `childIndex` --- src/pixi/display/DisplayObject.js | 9 --------- src/pixi/display/DisplayObjectContainer.js | 1 - src/pixi/utils/Utils.js | 3 +-- 3 files changed, 1 insertion(+), 12 deletions(-) diff --git a/src/pixi/display/DisplayObject.js b/src/pixi/display/DisplayObject.js index f8ee024..cc31157 100644 --- a/src/pixi/display/DisplayObject.js +++ b/src/pixi/display/DisplayObject.js @@ -113,15 +113,6 @@ PIXI.DisplayObject = function() */ this.stage = null; - /** - * [read-only] The index of this object in the parent's `children` array - * - * @property childIndex - * @type Number - * @readOnly - */ - this.childIndex = 0; - /** * [read-only] The multiplied alpha of the displayobject * diff --git a/src/pixi/display/DisplayObjectContainer.js b/src/pixi/display/DisplayObjectContainer.js index 649169f..8ae41d7 100644 --- a/src/pixi/display/DisplayObjectContainer.js +++ b/src/pixi/display/DisplayObjectContainer.js @@ -58,7 +58,6 @@ PIXI.DisplayObjectContainer.prototype.addChild = function(child) } child.parent = this; - child.childIndex = this.children.length; this.children.push(child); diff --git a/src/pixi/utils/Utils.js b/src/pixi/utils/Utils.js index 6372c8a..9534c83 100644 --- a/src/pixi/utils/Utils.js +++ b/src/pixi/utils/Utils.js @@ -124,9 +124,8 @@ PIXI.runList = function(item) while(tmp._iNext) { safe++; -// console.log(tmp.childIndex + tmp); tmp = tmp._iNext; - console.log(tmp);//.childIndex); + console.log(tmp); // console.log(tmp); if(safe > 100) From 9d32a54bb8579a3047d7691b5ddbcc34aa6ce549 Mon Sep 17 00:00:00 2001 From: Mat Groves Date: Wed, 24 Jul 2013 14:43:59 +0100 Subject: [PATCH 50/68] Minor update resize function added to render texture fixed bug with masking in webGL causing mask to not show fixed bug with incorrect target being returned with interaction event --- bin/pixi.dev.js | 39 +++++++++++++------ bin/pixi.js | 10 ++--- examples/example 1 - Basics/pixi.js | 39 +++++++++++++------ examples/example 10 - Text/pixi.js | 39 +++++++++++++------ examples/example 11 - RenderTexture/pixi.js | 39 +++++++++++++------ examples/example 12 - Spine/pixi.js | 39 +++++++++++++------ examples/example 13 - Graphics/pixi.js | 39 +++++++++++++------ examples/example 14 - Masking/pixi.js | 39 +++++++++++++------ examples/example 2 - SpriteSheet/pixi.js | 39 +++++++++++++------ examples/example 3 - MovieClip/pixi.js | 39 +++++++++++++------ examples/example 4 - Balls/pixi.js | 39 +++++++++++++------ examples/example 5 - Morph/pixi.js | 39 +++++++++++++------ examples/example 6 - Interactivity/pixi.js | 39 +++++++++++++------ .../pixi.js | 39 +++++++++++++------ examples/example 8 - Dragging/pixi.js | 39 +++++++++++++------ examples/example 9 - Tiling Texture/pixi.js | 39 +++++++++++++------ src/pixi/InteractionManager.js | 16 ++++++-- src/pixi/display/DisplayObjectContainer.js | 2 +- src/pixi/renderers/webgl/WebGLBatch.js | 2 +- src/pixi/renderers/webgl/WebGLRenderGroup.js | 2 +- src/pixi/renderers/webgl/WebGLRenderer.js | 2 +- src/pixi/textures/RenderTexture.js | 13 +++++-- 22 files changed, 452 insertions(+), 180 deletions(-) diff --git a/bin/pixi.dev.js b/bin/pixi.dev.js index 825c2bd..a4bd036 100644 --- a/bin/pixi.dev.js +++ b/bin/pixi.dev.js @@ -4,7 +4,7 @@ * Copyright (c) 2012, Mat Groves * http://goodboydigital.com/ * - * Compiled: 2013-07-11 + * Compiled: 2013-07-24 * * Pixi.JS is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license.php @@ -1267,7 +1267,7 @@ PIXI.DisplayObjectContainer = function() } // constructor -PIXI.DisplayObjectContainer.constructor = PIXI.DisplayObjectContainer; +//PIXI.DisplayObjectContainer.constructor = PIXI.DisplayObjectContainer; PIXI.DisplayObjectContainer.prototype = Object.create( PIXI.DisplayObject.prototype ); //TODO make visible a getter setter @@ -2600,6 +2600,7 @@ PIXI.InteractionManager.prototype.update = function() { // ok so there are some functions so lets hit test it.. item.__hit = this.hitTest(item, this.mouse); + this.mouse.target = item; // ok so deal with interactions.. // loks like there was a hit! if(item.__hit) @@ -2780,14 +2781,18 @@ PIXI.InteractionManager.prototype.hitTest = function(item, interactionData) x = a11 * id * global.x + -a01 * id * global.y + (a12 * a01 - a02 * a11) * id, y = a00 * id * global.y + -a10 * id * global.x + (-a12 * a00 + a02 * a10) * id; + interactionData.target = item; + //a sprite or display object with a hit area defined if(item.hitArea && item.hitArea.contains) { if(item.hitArea.contains(x, y)) { - if(isSprite) - interactionData.target = item; + //if(isSprite) + interactionData.target = item; return true; } + + return false; } // a sprite with no hitarea defined else if(isSprite) @@ -2816,7 +2821,12 @@ PIXI.InteractionManager.prototype.hitTest = function(item, interactionData) { var tempItem = item.children[i]; var hit = this.hitTest(tempItem, interactionData); - if(hit)return true; + if(hit) + { + // hmm.. TODO SET CORRECT TARGET? + interactionData.target = item + return true; + } } return false; @@ -4554,7 +4564,7 @@ PIXI.WebGLRenderer.updateTextures = function() PIXI.WebGLRenderer.updateTexture = function(texture) { var gl = PIXI.gl; - + if(!texture._glTexture) { texture._glTexture = gl.createTexture(); @@ -5207,7 +5217,7 @@ PIXI.WebGLBatch.prototype.render = function(start, end) start = start || 0; //end = end || this.size; if(end == undefined)end = this.size; - + if(this.dirty) { this.refresh(); @@ -5764,7 +5774,7 @@ PIXI.WebGLRenderGroup.prototype.addDisplayObjectAndChildren = function(displayOb */ var previousRenderable = displayObject.first; - while(previousRenderable != this.root) + while(previousRenderable != this.root.first) { previousRenderable = previousRenderable._iPrev; if(previousRenderable.renderable && previousRenderable.__renderGroup)break; @@ -9494,7 +9504,7 @@ PIXI.RenderTexture.prototype.initWebGL = function() // create a projection matrix.. this.projection = new PIXI.Point(this.width/2 , this.height/2); - +/* this.projectionMatrix = PIXI.mat4.create(); this.projectionMatrix[5] = 2/this.height// * 0.5; @@ -9502,7 +9512,7 @@ PIXI.RenderTexture.prototype.initWebGL = function() this.projectionMatrix[0] = 2/this.width; this.projectionMatrix[12] = -1; - +*/ // set the correct render function.. this.render = this.renderWebGL; @@ -9512,19 +9522,26 @@ PIXI.RenderTexture.prototype.initWebGL = function() PIXI.RenderTexture.prototype.resize = function(width, height) { + this.width = width; this.height = height; - this.projection = new PIXI.Point(this.width/2 , this.height/2); + //this.frame.width = this.width + //this.frame.height = this.height; + if(PIXI.gl) { + this.projection.x = this.width/2 + this.projection.y = this.height/2; + var gl = PIXI.gl; gl.bindTexture(gl.TEXTURE_2D, this.baseTexture._glTexture); gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, this.width, this.height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); } else { + this.frame.width = this.width this.frame.height = this.height; this.renderer.resize(this.width, this.height); diff --git a/bin/pixi.js b/bin/pixi.js index 49b8346..35b60e2 100644 --- a/bin/pixi.js +++ b/bin/pixi.js @@ -4,12 +4,12 @@ * Copyright (c) 2012, Mat Groves * http://goodboydigital.com/ * - * Compiled: 2013-07-11 + * Compiled: 2013-07-24 * * Pixi.JS is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license.php */ -(function(){function t(){return n.Matrix="undefined"!=typeof Float32Array?Float32Array:Array,n.Matrix}function e(t){return[(255&t>>16)/255,(255&t>>8)/255,(255&t)/255]}function e(t){return[(255&t>>16)/255,(255&t>>8)/255,(255&t)/255]}var i=this,n=n||{};n.Point=function(t,e){this.x=t||0,this.y=e||0},n.Point.prototype.clone=function(){return new n.Point(this.x,this.y)},n.Point.constructor=n.Point,n.Rectangle=function(t,e,i,r){this.x=t||0,this.y=e||0,this.width=i||0,this.height=r||0},n.Rectangle.prototype.clone=function(){return new n.Rectangle(this.x,this.y,this.width,this.height)},n.Rectangle.prototype.contains=function(t,e){if(0>=this.width||0>=this.height)return!1;var i=this.x;if(t>i&&i+this.width>t){var r=this.y;if(e>r&&r+this.height>e)return!0}return!1},n.Rectangle.constructor=n.Rectangle,n.Polygon=function(t){if(t instanceof Array||(t=Array.prototype.slice.call(arguments)),"number"==typeof t[0]){for(var e=[],i=0,r=t.length;r>i;i+=2)e.push(new n.Point(t[i],t[i+1]));t=e}this.points=t},n.Polygon.prototype.clone=function(){for(var t=[],e=0;this.points.length>e;e++)t.push(this.points[e].clone());return new n.Polygon(t)},n.Polygon.prototype.contains=function(t,e){for(var i=!1,r=0,n=this.points.length-1;this.points.length>r;n=r++){var s=this.points[r].x,a=this.points[r].y,o=this.points[n].x,h=this.points[n].y,l=a>e!=h>e&&(o-s)*(e-a)/(h-a)+s>t;l&&(i=!i)}return i},n.Polygon.constructor=n.Polygon,n.Circle=function(t,e,i){this.x=t||0,this.y=e||0,this.radius=i||0},n.Circle.prototype.clone=function(){return new n.Circle(this.x,this.y,this.radius)},n.Circle.prototype.contains=function(t,e){if(0>=this.radius)return!1;var i=this.x-t,r=this.y-e,n=this.radius*this.radius;return i*=i,r*=r,n>=i+r},n.Circle.constructor=n.Circle,n.Ellipse=function(t,e,i,r){this.x=t||0,this.y=e||0,this.width=i||0,this.height=r||0},n.Ellipse.prototype.clone=function(){return new n.Ellipse(this.x,this.y,this.width,this.height)},n.Ellipse.prototype.contains=function(t,e){if(0>=this.width||0>=this.height)return!1;var i=(t-this.x)/this.width-.5,r=(e-this.y)/this.height-.5;return i*=i,r*=r,.25>i+r},n.Ellipse.getBounds=function(){return new n.Rectangle(this.x,this.y,this.width,this.height)},n.Ellipse.constructor=n.Ellipse,t(),n.mat3={},n.mat3.create=function(){var t=new n.Matrix(9);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},n.mat3.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},n.mat4={},n.mat4.create=function(){var t=new n.Matrix(16);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},n.mat3.multiply=function(t,e,i){i||(i=t);var r=t[0],n=t[1],s=t[2],a=t[3],o=t[4],h=t[5],l=t[6],u=t[7],c=t[8],d=e[0],p=e[1],f=e[2],v=e[3],m=e[4],g=e[5],x=e[6],b=e[7],y=e[8];return i[0]=d*r+p*a+f*l,i[1]=d*n+p*o+f*u,i[2]=d*s+p*h+f*c,i[3]=v*r+m*a+g*l,i[4]=v*n+m*o+g*u,i[5]=v*s+m*h+g*c,i[6]=x*r+b*a+y*l,i[7]=x*n+b*o+y*u,i[8]=x*s+b*h+y*c,i},n.mat3.clone=function(t){var e=new n.Matrix(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e},n.mat3.transpose=function(t,e){if(!e||t===e){var i=t[1],r=t[2],n=t[5];return t[1]=t[3],t[2]=t[6],t[3]=i,t[5]=t[7],t[6]=r,t[7]=n,t}return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],e},n.mat3.toMat4=function(t,e){return e||(e=n.mat4.create()),e[15]=1,e[14]=0,e[13]=0,e[12]=0,e[11]=0,e[10]=t[8],e[9]=t[7],e[8]=t[6],e[7]=0,e[6]=t[5],e[5]=t[4],e[4]=t[3],e[3]=0,e[2]=t[2],e[1]=t[1],e[0]=t[0],e},n.mat4.create=function(){var t=new n.Matrix(16);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},n.mat4.transpose=function(t,e){if(!e||t===e){var i=t[1],r=t[2],n=t[3],s=t[6],a=t[7],o=t[11];return t[1]=t[4],t[2]=t[8],t[3]=t[12],t[4]=i,t[6]=t[9],t[7]=t[13],t[8]=r,t[9]=s,t[11]=t[14],t[12]=n,t[13]=a,t[14]=o,t}return e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15],e},n.mat4.multiply=function(t,e,i){i||(i=t);var r=t[0],n=t[1],s=t[2],a=t[3],o=t[4],h=t[5],l=t[6],u=t[7],c=t[8],d=t[9],p=t[10],f=t[11],v=t[12],m=t[13],g=t[14],x=t[15],b=e[0],y=e[1],T=e[2],_=e[3];return i[0]=b*r+y*o+T*c+_*v,i[1]=b*n+y*h+T*d+_*m,i[2]=b*s+y*l+T*p+_*g,i[3]=b*a+y*u+T*f+_*x,b=e[4],y=e[5],T=e[6],_=e[7],i[4]=b*r+y*o+T*c+_*v,i[5]=b*n+y*h+T*d+_*m,i[6]=b*s+y*l+T*p+_*g,i[7]=b*a+y*u+T*f+_*x,b=e[8],y=e[9],T=e[10],_=e[11],i[8]=b*r+y*o+T*c+_*v,i[9]=b*n+y*h+T*d+_*m,i[10]=b*s+y*l+T*p+_*g,i[11]=b*a+y*u+T*f+_*x,b=e[12],y=e[13],T=e[14],_=e[15],i[12]=b*r+y*o+T*c+_*v,i[13]=b*n+y*h+T*d+_*m,i[14]=b*s+y*l+T*p+_*g,i[15]=b*a+y*u+T*f+_*x,i},n.DisplayObject=function(){this.last=this,this.first=this,this.position=new n.Point,this.scale=new n.Point(1,1),this.pivot=new n.Point(0,0),this.rotation=0,this.alpha=1,this.visible=!0,this.hitArea=null,this.buttonMode=!1,this.renderable=!1,this.worldVisible=!1,this.parent=null,this.stage=null,this.childIndex=0,this.worldAlpha=1,this._interactive=!1,this.worldTransform=n.mat3.create(),this.localTransform=n.mat3.create(),this.color=[],this.dynamic=!0,this._sr=0,this._cr=1},n.DisplayObject.constructor=n.DisplayObject,n.DisplayObject.prototype.setInteractive=function(t){this.interactive=t},Object.defineProperty(n.DisplayObject.prototype,"interactive",{get:function(){return this._interactive},set:function(t){this._interactive=t,this.stage&&(this.stage.dirty=!0)}}),Object.defineProperty(n.DisplayObject.prototype,"mask",{get:function(){return this._mask},set:function(t){this._mask=t,t?this.addFilter(t):this.removeFilter()}}),n.DisplayObject.prototype.addFilter=function(t){if(!this.filter){this.filter=!0;var e=new n.FilterBlock,i=new n.FilterBlock;e.mask=t,i.mask=t,e.first=e.last=this,i.first=i.last=this,e.open=!0;var r,s,a=e,o=e;s=this.first._iPrev,s?(r=s._iNext,a._iPrev=s,s._iNext=a):r=this,r&&(r._iPrev=o,o._iNext=r);var a=i,o=i,r=null,s=null;s=this.last,r=s._iNext,r&&(r._iPrev=o,o._iNext=r),a._iPrev=s,s._iNext=a;for(var h=this,l=this.last;h;)h.last==l&&(h.last=i),h=h.parent;this.first=e,this.__renderGroup&&this.__renderGroup.addFilterBlocks(e,i),t.renderable=!1}},n.DisplayObject.prototype.removeFilter=function(){if(this.filter){this.filter=!1;var t=this.first,e=t._iNext,i=t._iPrev;e&&(e._iPrev=i),i&&(i._iNext=e),this.first=t._iNext;var r=this.last,e=r._iNext,i=r._iPrev;e&&(e._iPrev=i),i._iNext=e;for(var n=r._iPrev,s=this;s.last==r&&(s.last=n,s=s.parent););var a=t.mask;a.renderable=!0,this.__renderGroup&&this.__renderGroup.removeFilterBlocks(t,r)}},n.DisplayObject.prototype.updateTransform=function(){this.rotation!=this.rotationCache&&(this.rotationCache=this.rotation,this._sr=Math.sin(this.rotation),this._cr=Math.cos(this.rotation));var t=this.localTransform,e=this.parent.worldTransform,i=this.worldTransform;t[0]=this._cr*this.scale.x,t[1]=-this._sr*this.scale.y,t[3]=this._sr*this.scale.x,t[4]=this._cr*this.scale.y;var r=this.pivot.x,n=this.pivot.y,s=t[0],a=t[1],o=this.position.x-t[0]*r-n*t[1],h=t[3],l=t[4],u=this.position.y-t[4]*n-r*t[3],c=e[0],d=e[1],p=e[2],f=e[3],v=e[4],m=e[5];t[2]=o,t[5]=u,i[0]=c*s+d*h,i[1]=c*a+d*l,i[2]=c*o+d*u+p,i[3]=f*s+v*h,i[4]=f*a+v*l,i[5]=f*o+v*u+m,this.worldAlpha=this.alpha*this.parent.worldAlpha},n.DisplayObjectContainer=function(){n.DisplayObject.call(this),this.children=[]},n.DisplayObjectContainer.constructor=n.DisplayObjectContainer,n.DisplayObjectContainer.prototype=Object.create(n.DisplayObject.prototype),n.DisplayObjectContainer.prototype.addChild=function(t){if(void 0!=t.parent&&t.parent.removeChild(t),t.parent=this,t.childIndex=this.children.length,this.children.push(t),this.stage){var e=t;do e.interactive&&(this.stage.dirty=!0),e.stage=this.stage,e=e._iNext;while(e)}var i,r,n=t.first,s=t.last;r=this.filter?this.last._iPrev:this.last,i=r._iNext;for(var a=this,o=r;a;)a.last==o&&(a.last=t.last),a=a.parent;i&&(i._iPrev=s,s._iNext=i),n._iPrev=r,r._iNext=n,this.__renderGroup&&(t.__renderGroup&&t.__renderGroup.removeDisplayObjectAndChildren(t),this.__renderGroup.addDisplayObjectAndChildren(t))},n.DisplayObjectContainer.prototype.addChildAt=function(t,e){if(!(e>=0&&this.children.length>=e))throw Error(t+" The index "+e+" supplied is out of bounds "+this.children.length);if(void 0!=t.parent&&t.parent.removeChild(t),t.parent=this,this.stage){var i=t;do i.interactive&&(this.stage.dirty=!0),i.stage=this.stage,i=i._iNext;while(i)}var r,n,s=t.first,a=t.last;if(e==this.children.length){n=this.last;for(var o=this,h=this.last;o;)o.last==h&&(o.last=t.last),o=o.parent}else n=0==e?this:this.children[e-1].last;r=n._iNext,r&&(r._iPrev=a,a._iNext=r),s._iPrev=n,n._iNext=s,this.children.splice(e,0,t),this.__renderGroup&&(t.__renderGroup&&t.__renderGroup.removeDisplayObjectAndChildren(t),this.__renderGroup.addDisplayObjectAndChildren(t))},n.DisplayObjectContainer.prototype.swapChildren=function(){},n.DisplayObjectContainer.prototype.getChildAt=function(t){if(t>=0&&this.children.length>t)return this.children[t];throw Error(child+" Both the supplied DisplayObjects must be a child of the caller "+this)},n.DisplayObjectContainer.prototype.removeChild=function(t){var e=this.children.indexOf(t);if(-1===e)throw Error(t+" The supplied DisplayObject must be a child of the caller "+this);var i=t.first,r=t.last,n=r._iNext,s=i._iPrev;if(n&&(n._iPrev=s),s._iNext=n,this.last==r)for(var a=i._iPrev,o=this;o.last==r.last&&(o.last=a,o=o.parent););if(r._iNext=null,i._iPrev=null,this.stage){var h=t;do h.interactive&&(this.stage.dirty=!0),h.stage=null,h=h._iNext;while(h)}t.__renderGroup&&t.__renderGroup.removeDisplayObjectAndChildren(t),t.parent=void 0,this.children.splice(e,1)},n.DisplayObjectContainer.prototype.updateTransform=function(){if(this.visible){n.DisplayObject.prototype.updateTransform.call(this);for(var t=0,e=this.children.length;e>t;t++)this.children[t].updateTransform()}},n.blendModes={},n.blendModes.NORMAL=0,n.blendModes.SCREEN=1,n.Sprite=function(t){n.DisplayObjectContainer.call(this),this.anchor=new n.Point,this.texture=t,this.blendMode=n.blendModes.NORMAL,this._width=0,this._height=0,t.baseTexture.hasLoaded?this.updateFrame=!0:(this.onTextureUpdateBind=this.onTextureUpdate.bind(this),this.texture.addEventListener("update",this.onTextureUpdateBind)),this.renderable=!0},n.Sprite.constructor=n.Sprite,n.Sprite.prototype=Object.create(n.DisplayObjectContainer.prototype),Object.defineProperty(n.Sprite.prototype,"width",{get:function(){return this.scale.x*this.texture.frame.width},set:function(t){this.scale.x=t/this.texture.frame.width,this._width=t}}),Object.defineProperty(n.Sprite.prototype,"height",{get:function(){return this.scale.y*this.texture.frame.height},set:function(t){this.scale.y=t/this.texture.frame.height,this._height=t}}),n.Sprite.prototype.setTexture=function(t){this.texture.baseTexture!=t.baseTexture&&(this.textureChange=!0),this.texture=t,this.updateFrame=!0},n.Sprite.prototype.onTextureUpdate=function(){this._width&&(this.scale.x=this._width/this.texture.frame.width),this._height&&(this.scale.y=this._height/this.texture.frame.height),this.updateFrame=!0},n.Sprite.fromFrame=function(t){var e=n.TextureCache[t];if(!e)throw Error("The frameId '"+t+"' does not exist in the texture cache"+this);return new n.Sprite(e)},n.Sprite.fromImage=function(t){var e=n.Texture.fromImage(t);return new n.Sprite(e)},n.MovieClip=function(t){n.Sprite.call(this,t[0]),this.textures=t,this.animationSpeed=1,this.loop=!0,this.onComplete=null,this.currentFrame=0,this.playing=!1},n.MovieClip.constructor=n.MovieClip,n.MovieClip.prototype=Object.create(n.Sprite.prototype),n.MovieClip.prototype.stop=function(){this.playing=!1},n.MovieClip.prototype.play=function(){this.playing=!0},n.MovieClip.prototype.gotoAndStop=function(t){this.playing=!1,this.currentFrame=t;var e=0|this.currentFrame+.5;this.setTexture(this.textures[e%this.textures.length])},n.MovieClip.prototype.gotoAndPlay=function(t){this.currentFrame=t,this.playing=!0},n.MovieClip.prototype.updateTransform=function(){if(n.Sprite.prototype.updateTransform.call(this),this.playing){this.currentFrame+=this.animationSpeed;var t=0|this.currentFrame+.5;this.loop||this.textures.length>t?this.setTexture(this.textures[t%this.textures.length]):t>=this.textures.length&&(this.gotoAndStop(this.textures.length-1),this.onComplete&&this.onComplete())}},n.FilterBlock=function(t){this.graphics=t,this.visible=!0,this.renderable=!0},n.Text=function(t,e){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"),n.Sprite.call(this,n.Texture.fromCanvas(this.canvas)),this.setText(t),this.setStyle(e),this.updateText(),this.dirty=!1},n.Text.constructor=n.Text,n.Text.prototype=Object.create(n.Sprite.prototype),n.Text.prototype.setStyle=function(t){t=t||{},t.font=t.font||"bold 20pt Arial",t.fill=t.fill||"black",t.align=t.align||"left",t.stroke=t.stroke||"black",t.strokeThickness=t.strokeThickness||0,t.wordWrap=t.wordWrap||!1,t.wordWrapWidth=t.wordWrapWidth||100,this.style=t,this.dirty=!0},n.Sprite.prototype.setText=function(t){this.text=""+t||" ",this.dirty=!0},n.Text.prototype.updateText=function(){this.context.font=this.style.font;var t=this.text;this.style.wordWrap&&(t=this.wordWrap(this.text));for(var e=t.split(/(?:\r\n|\r|\n)/),i=[],r=0,s=0;e.length>s;s++){var a=this.context.measureText(e[s]).width;i[s]=a,r=Math.max(r,a)}this.canvas.width=r+this.style.strokeThickness;var o=this.determineFontHeight("font: "+this.style.font+";")+this.style.strokeThickness;for(this.canvas.height=o*e.length,this.context.fillStyle=this.style.fill,this.context.font=this.style.font,this.context.strokeStyle=this.style.stroke,this.context.lineWidth=this.style.strokeThickness,this.context.textBaseline="top",s=0;e.length>s;s++){var h=new n.Point(this.style.strokeThickness/2,this.style.strokeThickness/2+s*o);"right"==this.style.align?h.x+=r-i[s]:"center"==this.style.align&&(h.x+=(r-i[s])/2),this.style.stroke&&this.style.strokeThickness&&this.context.strokeText(e[s],h.x,h.y),this.style.fill&&this.context.fillText(e[s],h.x,h.y)}this.updateTexture()},n.Text.prototype.updateTexture=function(){this.texture.baseTexture.width=this.canvas.width,this.texture.baseTexture.height=this.canvas.height,this.texture.frame.width=this.canvas.width,this.texture.frame.height=this.canvas.height,this._width=this.canvas.width,this._height=this.canvas.height,n.texturesToUpdate.push(this.texture.baseTexture)},n.Text.prototype.updateTransform=function(){this.dirty&&(this.updateText(),this.dirty=!1),n.Sprite.prototype.updateTransform.call(this)},n.Text.prototype.determineFontHeight=function(t){var e=n.Text.heightCache[t];if(!e){var i=document.getElementsByTagName("body")[0],r=document.createElement("div"),s=document.createTextNode("M");r.appendChild(s),r.setAttribute("style",t+";position:absolute;top:0;left:0"),i.appendChild(r),e=r.offsetHeight,n.Text.heightCache[t]=e,i.removeChild(r)}return e},n.Text.prototype.wordWrap=function(t){for(var e=function(t,e,i,r,n){var s=Math.floor((r-i)/2)+i;return s==i?1:n>=t.measureText(e.substring(0,s)).width?t.measureText(e.substring(0,s+1)).width>n?s:arguments.callee(t,e,s,r,n):arguments.callee(t,e,i,s,n)},i=function(t,i,r){if(r>=t.measureText(i).width||1>i.length)return i;var n=e(t,i,0,i.length,r);return i.substring(0,n)+"\n"+arguments.callee(t,i.substring(n),r)},r="",n=t.split("\n"),s=0;n.length>s;s++)r+=i(this.context,n[s],this.style.wordWrapWidth)+"\n";return r},n.Text.prototype.destroy=function(t){t&&this.texture.destroy()},n.Text.heightCache={},n.BitmapText=function(t,e){n.DisplayObjectContainer.call(this),this.setText(t),this.setStyle(e),this.updateText(),this.dirty=!1},n.BitmapText.constructor=n.BitmapText,n.BitmapText.prototype=Object.create(n.DisplayObjectContainer.prototype),n.BitmapText.prototype.setText=function(t){this.text=t||" ",this.dirty=!0},n.BitmapText.prototype.setStyle=function(t){t=t||{},t.align=t.align||"left",this.style=t;var e=t.font.split(" ");this.fontName=e[e.length-1],this.fontSize=e.length>=2?parseInt(e[e.length-2],10):n.BitmapText.fonts[this.fontName].size,this.dirty=!0},n.BitmapText.prototype.updateText=function(){for(var t=n.BitmapText.fonts[this.fontName],e=new n.Point,i=null,r=[],s=0,a=[],o=0,h=this.fontSize/t.size,l=0;this.text.length>l;l++){var u=this.text.charCodeAt(l);if(/(?:\r\n|\r|\n)/.test(this.text.charAt(l)))a.push(e.x),s=Math.max(s,e.x),o++,e.x=0,e.y+=t.lineHeight,i=null;else{var c=t.chars[u];c&&(i&&c[i]&&(e.x+=c.kerning[i]),r.push({texture:c.texture,line:o,charCode:u,position:new n.Point(e.x+c.xOffset,e.y+c.yOffset)}),e.x+=c.xAdvance,i=u)}}a.push(e.x),s=Math.max(s,e.x);var d=[];for(l=0;o>=l;l++){var p=0;"right"==this.style.align?p=s-a[l]:"center"==this.style.align&&(p=(s-a[l])/2),d.push(p)}for(l=0;r.length>l;l++){var f=new n.Sprite(r[l].texture);f.position.x=(r[l].position.x+d[r[l].line])*h,f.position.y=r[l].position.y*h,f.scale.x=f.scale.y=h,this.addChild(f)}this.width=e.x*h,this.height=(e.y+t.lineHeight)*h},n.BitmapText.prototype.updateTransform=function(){if(this.dirty){for(;this.children.length>0;)this.removeChild(this.getChildAt(0));this.updateText(),this.dirty=!1}n.DisplayObjectContainer.prototype.updateTransform.call(this)},n.BitmapText.fonts={},n.InteractionManager=function(t){this.stage=t,this.mouse=new n.InteractionData,this.touchs={},this.tempPoint=new n.Point,this.mouseoverEnabled=!0,this.pool=[],this.interactiveItems=[],this.last=0},n.InteractionManager.constructor=n.InteractionManager,n.InteractionManager.prototype.collectInteractiveSprite=function(t,e){for(var i=t.children,r=i.length,n=r-1;n>=0;n--){var s=i[n];s.visible&&(s.interactive?(e.interactiveChildren=!0,this.interactiveItems.push(s),s.children.length>0&&this.collectInteractiveSprite(s,s)):(s.__iParent=null,s.children.length>0&&this.collectInteractiveSprite(s,e)))}},n.InteractionManager.prototype.setTarget=function(t){window.navigator.msPointerEnabled&&(t.view.style["-ms-content-zooming"]="none",t.view.style["-ms-touch-action"]="none"),this.target=t,t.view.addEventListener("mousemove",this.onMouseMove.bind(this),!0),t.view.addEventListener("mousedown",this.onMouseDown.bind(this),!0),document.body.addEventListener("mouseup",this.onMouseUp.bind(this),!0),t.view.addEventListener("mouseout",this.onMouseUp.bind(this),!0),t.view.addEventListener("touchstart",this.onTouchStart.bind(this),!0),t.view.addEventListener("touchend",this.onTouchEnd.bind(this),!0),t.view.addEventListener("touchmove",this.onTouchMove.bind(this),!0)},n.InteractionManager.prototype.update=function(){if(this.target){var t=Date.now(),e=t-this.last;if(e=30*e/1e3,!(1>e)){if(this.last=t,this.dirty){this.dirty=!1;for(var i=this.interactiveItems.length,r=0;i>r;r++)this.interactiveItems[r].interactiveChildren=!1;this.interactiveItems=[],this.stage.interactive&&this.interactiveItems.push(this.stage),this.collectInteractiveSprite(this.stage,this.stage)}var n=this.interactiveItems.length;this.target.view.style.cursor="default";for(var r=0;n>r;r++){var s=this.interactiveItems[r];s.visible&&(s.mouseover||s.mouseout||s.buttonMode)&&(s.__hit=this.hitTest(s,this.mouse),s.__hit?(s.buttonMode&&(this.target.view.style.cursor="pointer"),s.__isOver||(s.mouseover&&s.mouseover(this.mouse),s.__isOver=!0)):s.__isOver&&(s.mouseout&&s.mouseout(this.mouse),s.__isOver=!1))}}}},n.InteractionManager.prototype.onMouseMove=function(t){this.mouse.originalEvent=t||window.event;var e=this.target.view.getBoundingClientRect();this.mouse.global.x=(t.clientX-e.left)*(this.target.width/e.width),this.mouse.global.y=(t.clientY-e.top)*(this.target.height/e.height);var i=this.interactiveItems.length;this.mouse.global;for(var r=0;i>r;r++){var n=this.interactiveItems[r];n.mousemove&&n.mousemove(this.mouse)}},n.InteractionManager.prototype.onMouseDown=function(t){t.preventDefault(),this.mouse.originalEvent=t||window.event;var e=this.interactiveItems.length;this.mouse.global,this.stage;for(var i=0;e>i;i++){var r=this.interactiveItems[i];if((r.mousedown||r.click)&&(r.__mouseIsDown=!0,r.__hit=this.hitTest(r,this.mouse),r.__hit&&(r.mousedown&&r.mousedown(this.mouse),r.__isDown=!0,!r.interactiveChildren)))break}},n.InteractionManager.prototype.onMouseUp=function(t){this.mouse.originalEvent=t||window.event,this.mouse.global;for(var e=this.interactiveItems.length,i=!1,r=0;e>r;r++){var n=this.interactiveItems[r];(n.mouseup||n.mouseupoutside||n.click)&&(n.__hit=this.hitTest(n,this.mouse),n.__hit&&!i?(n.mouseup&&n.mouseup(this.mouse),n.__isDown&&n.click&&n.click(this.mouse),n.interactiveChildren||(i=!0)):n.__isDown&&n.mouseupoutside&&n.mouseupoutside(this.mouse),n.__isDown=!1)}},n.InteractionManager.prototype.hitTest=function(t,e){var i=e.global;if(!t.visible)return!1;var r=t instanceof n.Sprite,s=t.worldTransform,a=s[0],o=s[1],h=s[2],l=s[3],u=s[4],c=s[5],d=1/(a*u+o*-l),p=u*d*i.x+-o*d*i.y+(c*o-h*u)*d,f=a*d*i.y+-l*d*i.x+(-c*a+h*l)*d;if(t.hitArea&&t.hitArea.contains){if(t.hitArea.contains(p,f))return r&&(e.target=t),!0}else if(r){var v,m=t.texture.frame.width,g=t.texture.frame.height,x=-m*t.anchor.x;if(p>x&&x+m>p&&(v=-g*t.anchor.y,f>v&&v+g>f))return e.target=t,!0}for(var b=t.children.length,y=0;b>y;y++){var T=t.children[y],_=this.hitTest(T,e);if(_)return!0}return!1},n.InteractionManager.prototype.onTouchMove=function(t){this.mouse.originalEvent=t||window.event;for(var e=this.target.view.getBoundingClientRect(),i=t.changedTouches,r=0;i.length>r;r++){var n=i[r],s=this.touchs[n.identifier];s.global.x=(n.clientX-e.left)*(this.target.width/e.width),s.global.y=(n.clientY-e.top)*(this.target.height/e.height)}for(var a=this.interactiveItems.length,r=0;a>r;r++){var o=this.interactiveItems[r];o.touchmove&&o.touchmove(s)}},n.InteractionManager.prototype.onTouchStart=function(t){t.preventDefault(),this.mouse.originalEvent=t||window.event;for(var e=this.target.view.getBoundingClientRect(),i=t.changedTouches,r=0;i.length>r;r++){var s=i[r],a=this.pool.pop();a||(a=new n.InteractionData),this.touchs[s.identifier]=a,a.global.x=(s.clientX-e.left)*(this.target.width/e.width),a.global.y=(s.clientY-e.top)*(this.target.height/e.height);for(var o=this.interactiveItems.length,h=0;o>h;h++){var l=this.interactiveItems[h];if((l.touchstart||l.tap)&&(l.__hit=this.hitTest(l,a),l.__hit&&(l.touchstart&&l.touchstart(a),l.__isDown=!0,l.__touchData=a,!l.interactiveChildren)))break}}},n.InteractionManager.prototype.onTouchEnd=function(t){this.mouse.originalEvent=t||window.event;for(var e=this.target.view.getBoundingClientRect(),i=t.changedTouches,r=0;i.length>r;r++){var n=i[r],s=this.touchs[n.identifier],a=!1;s.global.x=(n.clientX-e.left)*(this.target.width/e.width),s.global.y=(n.clientY-e.top)*(this.target.height/e.height);for(var o=this.interactiveItems.length,h=0;o>h;h++){var l=this.interactiveItems[h],u=l.__touchData;l.__hit=this.hitTest(l,s),u==s&&((l.touchend||l.tap)&&(l.__hit&&!a?(l.touchend&&l.touchend(s),l.__isDown&&l.tap&&l.tap(s),l.interactiveChildren||(a=!0)):l.__isDown&&l.touchendoutside&&l.touchendoutside(s),l.__isDown=!1),l.__touchData=null)}this.pool.push(s),this.touchs[n.identifier]=null}},n.InteractionData=function(){this.global=new n.Point,this.local=new n.Point,this.target,this.originalEvent},n.InteractionData.prototype.getLocalPosition=function(t){var e=t.worldTransform,i=this.global,r=e[0],s=e[1],a=e[2],o=e[3],h=e[4],l=e[5],u=1/(r*h+s*-o);return new n.Point(h*u*i.x+-s*u*i.y+(l*s-a*h)*u,r*u*i.y+-o*u*i.x+(-l*r+a*o)*u)},n.InteractionData.constructor=n.InteractionData,n.Stage=function(t,e){n.DisplayObjectContainer.call(this),this.worldTransform=n.mat3.create(),this.interactive=e,this.interactionManager=new n.InteractionManager(this),this.dirty=!0,this.__childrenAdded=[],this.__childrenRemoved=[],this.stage=this,this.stage.hitArea=new n.Rectangle(0,0,1e5,1e5),this.setBackgroundColor(t),this.worldVisible=!0},n.Stage.constructor=n.Stage,n.Stage.prototype=Object.create(n.DisplayObjectContainer.prototype),n.Stage.prototype.updateTransform=function(){this.worldAlpha=1;for(var t=0,e=this.children.length;e>t;t++)this.children[t].updateTransform();this.dirty&&(this.dirty=!1,this.interactionManager.dirty=!0),this.interactive&&this.interactionManager.update()},n.Stage.prototype.setBackgroundColor=function(t){this.backgroundColor=t||0,this.backgroundColorSplit=e(this.backgroundColor);var i=this.backgroundColor.toString(16);i="000000".substr(0,6-i.length)+i,this.backgroundColorString="#"+i},n.Stage.prototype.getMousePosition=function(){return this.interactionManager.mouse.global};for(var s=0,o=["ms","moz","webkit","o"],h=0;o.length>h&&!window.requestAnimationFrame;++h)window.requestAnimationFrame=window[o[h]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[o[h]+"CancelAnimationFrame"]||window[o[h]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(t){var e=(new Date).getTime(),i=Math.max(0,16-(e-s)),r=window.setTimeout(function(){t(e+i)},i);return s=e+i,r}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)}),window.requestAnimFrame=window.requestAnimationFrame,"function"!=typeof Function.prototype.bind&&(Function.prototype.bind=function(){var t=Array.prototype.slice;return function(e){function i(){var s=n.concat(t.call(arguments));r.apply(this instanceof i?this:e,s)}var r=this,n=t.call(arguments,1);if("function"!=typeof r)throw new TypeError;return i.prototype=function s(t){return t&&(s.prototype=t),this instanceof s?void 0:new s}(r.prototype),i}}());var l=n.AjaxRequest=function(){var t=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(!window.ActiveXObject)return window.XMLHttpRequest?new XMLHttpRequest:!1;for(var e=0;t.length>e;e++)try{return new ActiveXObject(t[e])}catch(i){}};n.runList=function(t){console.log(">>>>>>>>>"),console.log("_");var e=0,i=t.first;for(console.log(i);i._iNext;)if(e++,i=i._iNext,console.log(i),e>100){console.log("BREAK");break}},n.EventTarget=function(){var t={};this.addEventListener=this.on=function(e,i){void 0===t[e]&&(t[e]=[]),-1===t[e].indexOf(i)&&t[e].push(i)},this.dispatchEvent=this.emit=function(e){for(var i in t[e.type])t[e.type][i](e)},this.removeEventListener=this.off=function(e,i){var r=t[e].indexOf(i);-1!==r&&t[e].splice(r,1)}},n.autoDetectRenderer=function(t,e,i,r){t||(t=800),e||(e=600);var s=function(){try{return!!window.WebGLRenderingContext&&!!document.createElement("canvas").getContext("experimental-webgl")}catch(t){return!1}}();return s?new n.WebGLRenderer(t,e,i,r):new n.CanvasRenderer(t,e,i,r)},n.PolyK={},n.PolyK.Triangulate=function(t){var e=!0,i=t.length>>1;if(3>i)return[];for(var r=[],s=[],a=0;i>a;a++)s.push(a);for(var a=0,o=i;o>3;){var h=s[(a+0)%o],l=s[(a+1)%o],u=s[(a+2)%o],c=t[2*h],d=t[2*h+1],p=t[2*l],f=t[2*l+1],v=t[2*u],m=t[2*u+1],g=!1;if(n.PolyK._convex(c,d,p,f,v,m,e)){g=!0;for(var x=0;o>x;x++){var b=s[x];if(b!=h&&b!=l&&b!=u&&n.PolyK._PointInTriangle(t[2*b],t[2*b+1],c,d,p,f,v,m)){g=!1;break}}}if(g)r.push(h,l,u),s.splice((a+1)%o,1),o--,a=0;else if(a++>3*o){if(!e)return console.log("PIXI Warning: shape too complex to fill"),[];var r=[];s=[];for(var a=0;i>a;a++)s.push(a);a=0,o=i,e=!1}}return r.push(s[0],s[1],s[2]),r},n.PolyK._PointInTriangle=function(t,e,i,r,n,s,a,o){var h=a-i,l=o-r,u=n-i,c=s-r,d=t-i,p=e-r,f=h*h+l*l,v=h*u+l*c,m=h*d+l*p,g=u*u+c*c,x=u*d+c*p,b=1/(f*g-v*v),y=(g*m-v*x)*b,T=(f*x-v*m)*b;return y>=0&&T>=0&&1>y+T},n.PolyK._convex=function(t,e,i,r,n,s,a){return(e-r)*(n-i)+(i-t)*(s-r)>=0==a},n.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;","}"],n.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform vec2 projectionVector;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position = vec4( aVertexPosition.x / projectionVector.x -1.0, aVertexPosition.y / -projectionVector.y + 1.0 , 0.0, 1.0);","vTextureCoord = aTextureCoord;","vColor = aColor;","}"],n.stripShaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform float alpha;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor = gl_FragColor * alpha;","}"],n.stripShaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat3 translationMatrix;","uniform vec2 projectionVector;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","vec3 v = translationMatrix * vec3(aVertexPosition, 1.0);","gl_Position = vec4( v.x / projectionVector.x -1.0, v.y / -projectionVector.y + 1.0 , 0.0, 1.0);","vTextureCoord = aTextureCoord;","vColor = aColor;","}"],n.primitiveShaderFragmentSrc=["precision mediump float;","varying vec4 vColor;","void main(void) {","gl_FragColor = vColor;","}"],n.primitiveShaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec4 aColor;","uniform mat3 translationMatrix;","uniform vec2 projectionVector;","uniform float alpha;","varying vec4 vColor;","void main(void) {","vec3 v = translationMatrix * vec3(aVertexPosition, 1.0);","gl_Position = vec4( v.x / projectionVector.x -1.0, v.y / -projectionVector.y + 1.0 , 0.0, 1.0);","vColor = aColor * alpha;","}"],n.initPrimitiveShader=function(){var t=n.gl,e=n.compileProgram(n.primitiveShaderVertexSrc,n.primitiveShaderFragmentSrc);t.useProgram(e),e.vertexPositionAttribute=t.getAttribLocation(e,"aVertexPosition"),e.colorAttribute=t.getAttribLocation(e,"aColor"),e.projectionVector=t.getUniformLocation(e,"projectionVector"),e.translationMatrix=t.getUniformLocation(e,"translationMatrix"),e.alpha=t.getUniformLocation(e,"alpha"),n.primitiveProgram=e},n.initDefaultShader=function(){var t=this.gl,e=n.compileProgram(n.shaderVertexSrc,n.shaderFragmentSrc);t.useProgram(e),e.vertexPositionAttribute=t.getAttribLocation(e,"aVertexPosition"),e.projectionVector=t.getUniformLocation(e,"projectionVector"),e.textureCoordAttribute=t.getAttribLocation(e,"aTextureCoord"),e.colorAttribute=t.getAttribLocation(e,"aColor"),e.samplerUniform=t.getUniformLocation(e,"uSampler"),n.shaderProgram=e},n.initDefaultStripShader=function(){var t=this.gl,e=n.compileProgram(n.stripShaderVertexSrc,n.stripShaderFragmentSrc);t.useProgram(e),e.vertexPositionAttribute=t.getAttribLocation(e,"aVertexPosition"),e.projectionVector=t.getUniformLocation(e,"projectionVector"),e.textureCoordAttribute=t.getAttribLocation(e,"aTextureCoord"),e.translationMatrix=t.getUniformLocation(e,"translationMatrix"),e.alpha=t.getUniformLocation(e,"alpha"),e.colorAttribute=t.getAttribLocation(e,"aColor"),e.projectionVector=t.getUniformLocation(e,"projectionVector"),e.samplerUniform=t.getUniformLocation(e,"uSampler"),n.stripShaderProgram=e},n.CompileVertexShader=function(t,e){return n._CompileShader(t,e,t.VERTEX_SHADER)},n.CompileFragmentShader=function(t,e){return n._CompileShader(t,e,t.FRAGMENT_SHADER)},n._CompileShader=function(t,e,i){var r=e.join("\n"),n=t.createShader(i);return t.shaderSource(n,r),t.compileShader(n),t.getShaderParameter(n,t.COMPILE_STATUS)?n:(alert(t.getShaderInfoLog(n)),null)},n.compileProgram=function(t,e){var i=n.gl,r=n.CompileFragmentShader(i,e),s=n.CompileVertexShader(i,t),a=i.createProgram();return i.attachShader(a,s),i.attachShader(a,r),i.linkProgram(a),i.getProgramParameter(a,i.LINK_STATUS)||alert("Could not initialise shaders"),a},n.activateDefaultShader=function(){var t=n.gl,e=n.shaderProgram;t.useProgram(e),t.enableVertexAttribArray(e.vertexPositionAttribute),t.enableVertexAttribArray(e.textureCoordAttribute),t.enableVertexAttribArray(e.colorAttribute)},n.activatePrimitiveShader=function(){var t=n.gl;t.disableVertexAttribArray(n.shaderProgram.textureCoordAttribute),t.disableVertexAttribArray(n.shaderProgram.colorAttribute),t.useProgram(n.primitiveProgram),t.enableVertexAttribArray(n.primitiveProgram.vertexPositionAttribute),t.enableVertexAttribArray(n.primitiveProgram.colorAttribute) -},n.WebGLGraphics=function(){},n.WebGLGraphics.renderGraphics=function(t,e){var i=n.gl;t._webGL||(t._webGL={points:[],indices:[],lastIndex:0,buffer:i.createBuffer(),indexBuffer:i.createBuffer()}),t.dirty&&(t.dirty=!1,t.clearDirty&&(t.clearDirty=!1,t._webGL.lastIndex=0,t._webGL.points=[],t._webGL.indices=[]),n.WebGLGraphics.updateGraphics(t)),n.activatePrimitiveShader();var r=n.mat3.clone(t.worldTransform);n.mat3.transpose(r),i.blendFunc(i.ONE,i.ONE_MINUS_SRC_ALPHA),i.uniformMatrix3fv(n.primitiveProgram.translationMatrix,!1,r),i.uniform2f(n.primitiveProgram.projectionVector,e.x,e.y),i.uniform1f(n.primitiveProgram.alpha,t.worldAlpha),i.bindBuffer(i.ARRAY_BUFFER,t._webGL.buffer),i.vertexAttribPointer(n.shaderProgram.vertexPositionAttribute,2,i.FLOAT,!1,0,0),i.vertexAttribPointer(n.primitiveProgram.vertexPositionAttribute,2,i.FLOAT,!1,24,0),i.vertexAttribPointer(n.primitiveProgram.colorAttribute,4,i.FLOAT,!1,24,8),i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,t._webGL.indexBuffer),i.drawElements(i.TRIANGLE_STRIP,t._webGL.indices.length,i.UNSIGNED_SHORT,0),n.activateDefaultShader()},n.WebGLGraphics.updateGraphics=function(t){for(var e=t._webGL.lastIndex;t.graphicsData.length>e;e++){var i=t.graphicsData[e];i.type==n.Graphics.POLY?(i.fill&&i.points.length>3&&n.WebGLGraphics.buildPoly(i,t._webGL),i.lineWidth>0&&n.WebGLGraphics.buildLine(i,t._webGL)):i.type==n.Graphics.RECT?n.WebGLGraphics.buildRectangle(i,t._webGL):(i.type==n.Graphics.CIRC||i.type==n.Graphics.ELIP)&&n.WebGLGraphics.buildCircle(i,t._webGL)}t._webGL.lastIndex=t.graphicsData.length;var r=n.gl;t._webGL.glPoints=new Float32Array(t._webGL.points),r.bindBuffer(r.ARRAY_BUFFER,t._webGL.buffer),r.bufferData(r.ARRAY_BUFFER,t._webGL.glPoints,r.STATIC_DRAW),t._webGL.glIndicies=new Uint16Array(t._webGL.indices),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,t._webGL.indexBuffer),r.bufferData(r.ELEMENT_ARRAY_BUFFER,t._webGL.glIndicies,r.STATIC_DRAW)},n.WebGLGraphics.buildRectangle=function(t,i){var r=t.points,s=r[0],a=r[1],o=r[2],h=r[3];if(t.fill){var l=e(t.fillColor),u=t.fillAlpha,c=l[0]*u,d=l[1]*u,p=l[2]*u,f=i.points,v=i.indices,m=f.length/6;f.push(s,a),f.push(c,d,p,u),f.push(s+o,a),f.push(c,d,p,u),f.push(s,a+h),f.push(c,d,p,u),f.push(s+o,a+h),f.push(c,d,p,u),v.push(m,m,m+1,m+2,m+3,m+3)}t.lineWidth&&(t.points=[s,a,s+o,a,s+o,a+h,s,a+h,s,a],n.WebGLGraphics.buildLine(t,i))},n.WebGLGraphics.buildCircle=function(t,i){var r=t.points,s=r[0],a=r[1],o=r[2],h=r[3],l=40,u=2*Math.PI/l;if(t.fill){var c=e(t.fillColor),d=t.fillAlpha,p=c[0]*d,f=c[1]*d,v=c[2]*d,m=i.points,g=i.indices,x=m.length/6;g.push(x);for(var b=0;l+1>b;b++)m.push(s,a,p,f,v,d),m.push(s+Math.sin(u*b)*o,a+Math.cos(u*b)*h,p,f,v,d),g.push(x++,x++);g.push(x-1)}if(t.lineWidth){t.points=[];for(var b=0;l+1>b;b++)t.points.push(s+Math.sin(u*b)*o,a+Math.cos(u*b)*h);n.WebGLGraphics.buildLine(t,i)}},n.WebGLGraphics.buildLine=function(t,i){var r=t.points;if(0!=r.length){var s=new n.Point(r[0],r[1]),a=new n.Point(r[r.length-2],r[r.length-1]);if(s.x==a.x&&s.y==a.y){r.pop(),r.pop(),a=new n.Point(r[r.length-2],r[r.length-1]);var o=a.x+.5*(s.x-a.x),h=a.y+.5*(s.y-a.y);r.unshift(o,h),r.push(o,h)}var l,u,c,d,p,f,v,m,g,x,b,y,T,_,w,A,R,S,C,L,E,P=i.points,B=i.indices,F=r.length/2,G=r.length,I=P.length/6,D=t.lineWidth/2,M=e(t.lineColor),O=t.lineAlpha,W=M[0]*O,U=M[1]*O,k=M[2]*O;l=r[0],u=r[1],c=r[2],d=r[3],v=-(u-d),m=l-c,E=Math.sqrt(v*v+m*m),v/=E,m/=E,v*=D,m*=D,P.push(l-v,u-m,W,U,k,O),P.push(l+v,u+m,W,U,k,O);for(var j=1;F-1>j;j++)l=r[2*(j-1)],u=r[2*(j-1)+1],c=r[2*j],d=r[2*j+1],p=r[2*(j+1)],f=r[2*(j+1)+1],v=-(u-d),m=l-c,E=Math.sqrt(v*v+m*m),v/=E,m/=E,v*=D,m*=D,g=-(d-f),x=c-p,E=Math.sqrt(g*g+x*x),g/=E,x/=E,g*=D,x*=D,T=-m+u-(-m+d),_=-v+c-(-v+l),w=(-v+l)*(-m+d)-(-v+c)*(-m+u),A=-x+f-(-x+d),R=-g+c-(-g+p),S=(-g+p)*(-x+d)-(-g+c)*(-x+f),C=T*R-A*_,0==C&&(C+=1),px=(_*S-R*w)/C,py=(A*w-T*S)/C,L=(px-c)*(px-c)+(py-d)+(py-d),L>19600?(b=v-g,y=m-x,E=Math.sqrt(b*b+y*y),b/=E,y/=E,b*=D,y*=D,P.push(c-b,d-y),P.push(W,U,k,O),P.push(c+b,d+y),P.push(W,U,k,O),P.push(c-b,d-y),P.push(W,U,k,O),G++):(P.push(px,py),P.push(W,U,k,O),P.push(c-(px-c),d-(py-d)),P.push(W,U,k,O));l=r[2*(F-2)],u=r[2*(F-2)+1],c=r[2*(F-1)],d=r[2*(F-1)+1],v=-(u-d),m=l-c,E=Math.sqrt(v*v+m*m),v/=E,m/=E,v*=D,m*=D,P.push(c-v,d-m),P.push(W,U,k,O),P.push(c+v,d+m),P.push(W,U,k,O),B.push(I);for(var j=0;G>j;j++)B.push(I++);B.push(I-1)}},n.WebGLGraphics.buildPoly=function(t,i){var r=t.points;if(!(6>r.length)){for(var s=i.points,a=i.indices,o=r.length/2,h=e(t.fillColor),l=t.fillAlpha,u=h[0]*l,c=h[1]*l,d=h[2]*l,p=n.PolyK.Triangulate(r),f=s.length/6,v=0;p.length>v;v+=3)a.push(p[v]+f),a.push(p[v]+f),a.push(p[v+1]+f),a.push(p[v+2]+f),a.push(p[v+2]+f);for(var v=0;o>v;v++)s.push(r[2*v],r[2*v+1],u,c,d,l)}},n._defaultFrame=new n.Rectangle(0,0,1,1),n.gl,n.WebGLRenderer=function(t,e,i,r){this.transparent=!!r,this.width=t||800,this.height=e||600,this.view=i||document.createElement("canvas"),this.view.width=this.width,this.view.height=this.height;var s=this;this.view.addEventListener("webglcontextlost",function(t){s.handleContextLost(t)},!1),this.view.addEventListener("webglcontextrestored",function(t){s.handleContextRestored(t)},!1),this.batchs=[];try{n.gl=this.gl=this.view.getContext("experimental-webgl",{alpha:this.transparent,antialias:!0,premultipliedAlpha:!1,stencil:!0})}catch(a){throw Error(" This browser does not support webGL. Try using the canvas renderer"+this)}n.initPrimitiveShader(),n.initDefaultShader(),n.initDefaultStripShader(),n.activateDefaultShader();var o=this.gl;n.WebGLRenderer.gl=o,this.batch=new n.WebGLBatch(o),o.disable(o.DEPTH_TEST),o.disable(o.CULL_FACE),o.enable(o.BLEND),o.colorMask(!0,!0,!0,this.transparent),n.projection=new n.Point(400,300),this.resize(this.width,this.height),this.contextLost=!1,this.stageRenderGroup=new n.WebGLRenderGroup(this.gl)},n.WebGLRenderer.constructor=n.WebGLRenderer,n.WebGLRenderer.getBatch=function(){return 0==n._batchs.length?new n.WebGLBatch(n.WebGLRenderer.gl):n._batchs.pop()},n.WebGLRenderer.returnBatch=function(t){t.clean(),n._batchs.push(t)},n.WebGLRenderer.prototype.render=function(t){if(!this.contextLost){this.__stage!==t&&(this.__stage=t,this.stageRenderGroup.setRenderable(t)),n.WebGLRenderer.updateTextures(),t.updateTransform();var e=this.gl;if(e.colorMask(!0,!0,!0,this.transparent),e.viewport(0,0,this.width,this.height),e.bindFramebuffer(e.FRAMEBUFFER,null),e.clearColor(t.backgroundColorSplit[0],t.backgroundColorSplit[1],t.backgroundColorSplit[2],!this.transparent),e.clear(e.COLOR_BUFFER_BIT),this.stageRenderGroup.backgroundColor=t.backgroundColorSplit,this.stageRenderGroup.render(n.projection),t.interactive&&(t._interactiveEventsAdded||(t._interactiveEventsAdded=!0,t.interactionManager.setTarget(this))),n.Texture.frameUpdates.length>0){for(var i=0;n.Texture.frameUpdates.length>i;i++)n.Texture.frameUpdates[i].updateFrame=!1;n.Texture.frameUpdates=[]}}},n.WebGLRenderer.updateTextures=function(){for(var t=0;n.texturesToUpdate.length>t;t++)this.updateTexture(n.texturesToUpdate[t]);for(var t=0;n.texturesToDestroy.length>t;t++)this.destroyTexture(n.texturesToDestroy[t]);n.texturesToUpdate=[],n.texturesToDestroy=[]},n.WebGLRenderer.updateTexture=function(t){var e=n.gl;t._glTexture||(t._glTexture=e.createTexture()),t.hasLoaded&&(e.bindTexture(e.TEXTURE_2D,t._glTexture),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,t.source),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),t._powerOf2?(e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.REPEAT)):(e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE)),e.bindTexture(e.TEXTURE_2D,null))},n.WebGLRenderer.prototype.destroyTexture=function(t){var e=this.gl;t._glTexture&&(t._glTexture=e.createTexture(),e.deleteTexture(e.TEXTURE_2D,t._glTexture))},n.WebGLRenderer.prototype.resize=function(t,e){this.width=t,this.height=e,this.view.width=t,this.view.height=e,this.gl.viewport(0,0,this.width,this.height),n.projection.x=this.width/2,n.projection.y=this.height/2},n.WebGLRenderer.prototype.handleContextLost=function(t){t.preventDefault(),this.contextLost=!0},n.WebGLRenderer.prototype.handleContextRestored=function(){this.gl=this.view.getContext("experimental-webgl",{alpha:!0}),this.initShaders();for(var t in n.TextureCache){var e=n.TextureCache[t].baseTexture;e._glTexture=null,n.WebGLRenderer.updateTexture(e)}for(var i=0;this.batchs.length>i;i++)this.batchs[i].restoreLostContext(this.gl),this.batchs[i].dirty=!0;n._restoreBatchs(this.gl),this.contextLost=!1},n._batchs=[],n._getBatch=function(t){return 0==n._batchs.length?new n.WebGLBatch(t):n._batchs.pop()},n._returnBatch=function(t){t.clean(),n._batchs.push(t)},n._restoreBatchs=function(t){for(var e=0;n._batchs.length>e;e++)n._batchs[e].restoreLostContext(t)},n.WebGLBatch=function(t){this.gl=t,this.size=0,this.vertexBuffer=t.createBuffer(),this.indexBuffer=t.createBuffer(),this.uvBuffer=t.createBuffer(),this.colorBuffer=t.createBuffer(),this.blendMode=n.blendModes.NORMAL,this.dynamicSize=1},n.WebGLBatch.constructor=n.WebGLBatch,n.WebGLBatch.prototype.clean=function(){this.verticies=[],this.uvs=[],this.indices=[],this.colors=[],this.dynamicSize=1,this.texture=null,this.last=null,this.size=0,this.head,this.tail},n.WebGLBatch.prototype.restoreLostContext=function(t){this.gl=t,this.vertexBuffer=t.createBuffer(),this.indexBuffer=t.createBuffer(),this.uvBuffer=t.createBuffer(),this.colorBuffer=t.createBuffer()},n.WebGLBatch.prototype.init=function(t){t.batch=this,this.dirty=!0,this.blendMode=t.blendMode,this.texture=t.texture.baseTexture,this.head=t,this.tail=t,this.size=1,this.growBatch()},n.WebGLBatch.prototype.insertBefore=function(t,e){this.size++,t.batch=this,this.dirty=!0;var i=e.__prev;e.__prev=t,t.__next=e,i?(t.__prev=i,i.__next=t):this.head=t},n.WebGLBatch.prototype.insertAfter=function(t,e){this.size++,t.batch=this,this.dirty=!0;var i=e.__next;e.__next=t,t.__prev=e,i?(t.__next=i,i.__prev=t):this.tail=t},n.WebGLBatch.prototype.remove=function(t){return this.size--,0==this.size?(t.batch=null,t.__prev=null,t.__next=null,void 0):(t.__prev?t.__prev.__next=t.__next:(this.head=t.__next,this.head.__prev=null),t.__next?t.__next.__prev=t.__prev:(this.tail=t.__prev,this.tail.__next=null),t.batch=null,t.__next=null,t.__prev=null,this.dirty=!0,void 0)},n.WebGLBatch.prototype.split=function(t){this.dirty=!0;var e=new n.WebGLBatch(this.gl);e.init(t),e.texture=this.texture,e.tail=this.tail,this.tail=t.__prev,this.tail.__next=null,t.__prev=null;for(var i=0;t;)i++,t.batch=e,t=t.__next;return e.size=i,this.size-=i,e},n.WebGLBatch.prototype.merge=function(t){this.dirty=!0,this.tail.__next=t.head,t.head.__prev=this.tail,this.size+=t.size,this.tail=t.tail;for(var e=t.head;e;)e.batch=this,e=e.__next},n.WebGLBatch.prototype.growBatch=function(){var t=this.gl;this.dynamicSize=1==this.size?1:1.5*this.size,this.verticies=new Float32Array(8*this.dynamicSize),t.bindBuffer(t.ARRAY_BUFFER,this.vertexBuffer),t.bufferData(t.ARRAY_BUFFER,this.verticies,t.DYNAMIC_DRAW),this.uvs=new Float32Array(8*this.dynamicSize),t.bindBuffer(t.ARRAY_BUFFER,this.uvBuffer),t.bufferData(t.ARRAY_BUFFER,this.uvs,t.DYNAMIC_DRAW),this.dirtyUVS=!0,this.colors=new Float32Array(4*this.dynamicSize),t.bindBuffer(t.ARRAY_BUFFER,this.colorBuffer),t.bufferData(t.ARRAY_BUFFER,this.colors,t.DYNAMIC_DRAW),this.dirtyColors=!0,this.indices=new Uint16Array(6*this.dynamicSize);for(var e=this.indices.length/6,i=0;e>i;i++){var r=6*i,n=4*i;this.indices[r+0]=n+0,this.indices[r+1]=n+1,this.indices[r+2]=n+2,this.indices[r+3]=n+0,this.indices[r+4]=n+2,this.indices[r+5]=n+3}t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indexBuffer),t.bufferData(t.ELEMENT_ARRAY_BUFFER,this.indices,t.STATIC_DRAW)},n.WebGLBatch.prototype.refresh=function(){this.gl,this.dynamicSizer;r++)i=this.batchs[r],i instanceof n.WebGLBatch?this.batchs[r].render():i instanceof n.TilingSprite?i.visible&&this.renderTilingSprite(i,t):i instanceof n.Strip?i.visible&&this.renderStrip(i,t):i instanceof n.Graphics?i.visible&&i.renderable&&n.WebGLGraphics.renderGraphics(i,t):i instanceof n.FilterBlock&&(i.open?(e.enable(e.STENCIL_TEST),e.colorMask(!1,!1,!1,!1),e.stencilFunc(e.ALWAYS,1,255),e.stencilOp(e.KEEP,e.KEEP,e.REPLACE),n.WebGLGraphics.renderGraphics(i.mask,t),e.colorMask(!0,!0,!0,!1),e.stencilFunc(e.NOTEQUAL,0,255),e.stencilOp(e.KEEP,e.KEEP,e.KEEP)):e.disable(e.STENCIL_TEST))},n.WebGLRenderGroup.prototype.handleFilter=function(){},n.WebGLRenderGroup.prototype.renderSpecific=function(t,e){n.WebGLRenderer.updateTextures();var i=this.gl;this.checkVisibility(t,t.visible),i.uniform2f(n.shaderProgram.projectionVector,e.x,e.y);for(var r,s,a,o,h=t.first;h._iNext&&(h=h._iNext,!h.renderable||!h.__renderGroup););var l=h.batch;if(h instanceof n.Sprite){l=h.batch;var u=l.head;if(u==h)r=0;else for(r=1;u.__next!=h;)r++,u=u.__next}else l=h;for(var c,d=t,p=t;p.children.length>0;)p=p.children[p.children.length-1],p.renderable&&(d=p);if(d instanceof n.Sprite){c=d.batch;var u=c.head;if(u==d)a=0;else for(a=1;u.__next!=d;)a++,u=u.__next}else c=d;if(l==c)return l instanceof n.WebGLBatch?l.render(r,a+1):this.renderSpecial(l,e),void 0;s=this.batchs.indexOf(l),o=this.batchs.indexOf(c),l instanceof n.WebGLBatch?l.render(r):this.renderSpecial(l,e);for(var f=s+1;o>f;f++)renderable=this.batchs[f],renderable instanceof n.WebGLBatch?this.batchs[f].render():this.renderSpecial(renderable,e);c instanceof n.WebGLBatch?c.render(0,a+1):this.renderSpecial(c,e)},n.WebGLRenderGroup.prototype.renderSpecial=function(t,e){if(t instanceof n.TilingSprite)t.visible&&this.renderTilingSprite(t,e);else if(t instanceof n.Strip)t.visible&&this.renderStrip(t,e);else if(t instanceof n.CustomRenderable)t.visible&&t.renderWebGL(this,e);else if(t instanceof n.Graphics)t.visible&&t.renderable&&n.WebGLGraphics.renderGraphics(t,e);else if(t instanceof n.FilterBlock){var i=n.gl;t.open?(i.enable(i.STENCIL_TEST),i.colorMask(!1,!1,!1,!1),i.stencilFunc(i.ALWAYS,1,255),i.stencilOp(i.KEEP,i.KEEP,i.REPLACE),n.WebGLGraphics.renderGraphics(t.mask,e),i.colorMask(!0,!0,!0,!0),i.stencilFunc(i.NOTEQUAL,0,255),i.stencilOp(i.KEEP,i.KEEP,i.KEEP)):i.disable(i.STENCIL_TEST)}},n.WebGLRenderGroup.prototype.checkVisibility=function(t,e){for(var i=t.children,r=0;i.length>r;r++){var n=i[r];n.worldVisible=n.visible&&e,n.textureChange&&(n.textureChange=!1,n.worldVisible&&this.updateTexture(n)),n.children.length>0&&this.checkVisibility(n,n.worldVisible)}},n.WebGLRenderGroup.prototype.updateTexture=function(t){this.removeObject(t);for(var e=t.first;e!=this.root&&(e=e._iPrev,!e.renderable||!e.__renderGroup););for(var i=t.last;i._iNext&&(i=i._iNext,!i.renderable||!i.__renderGroup););this.insertObject(t,e,i)},n.WebGLRenderGroup.prototype.addFilterBlocks=function(t,e){t.__renderGroup=this,e.__renderGroup=this;for(var i=t;i!=this.root&&(i=i._iPrev,!i.renderable||!i.__renderGroup););this.insertAfter(t,i);for(var r=e;r!=this.root&&(r=r._iPrev,!r.renderable||!r.__renderGroup););this.insertAfter(e,r)},n.WebGLRenderGroup.prototype.removeFilterBlocks=function(t,e){this.removeObject(t),this.removeObject(e)},n.WebGLRenderGroup.prototype.addDisplayObjectAndChildren=function(t){t.__renderGroup&&t.__renderGroup.removeDisplayObjectAndChildren(t);for(var e=t.first;e!=this.root&&(e=e._iPrev,!e.renderable||!e.__renderGroup););for(var i=t.last;i._iNext&&(i=i._iNext,!i.renderable||!i.__renderGroup););var r=t.first,n=t.last._iNext;do r.__renderGroup=this,r.renderable&&(this.insertObject(r,e,i),e=r),r=r._iNext;while(r!=n)},n.WebGLRenderGroup.prototype.removeDisplayObjectAndChildren=function(t){if(t.__renderGroup==this){t.last;do t.__renderGroup=null,t.renderable&&this.removeObject(t),t=t._iNext;while(t)}},n.WebGLRenderGroup.prototype.insertObject=function(t,e,i){var r=e,s=i;if(t instanceof n.Sprite){var a,o;if(r instanceof n.Sprite){if(a=r.batch,a&&a.texture==t.texture.baseTexture&&a.blendMode==t.blendMode)return a.insertAfter(t,r),void 0}else a=r;if(s)if(s instanceof n.Sprite){if(o=s.batch){if(o.texture==t.texture.baseTexture&&o.blendMode==t.blendMode)return o.insertBefore(t,s),void 0;if(o==a){var h=a.split(s),l=n.WebGLRenderer.getBatch(),u=this.batchs.indexOf(a);return l.init(t),this.batchs.splice(u+1,0,l,h),void 0}}}else o=s;var l=n.WebGLRenderer.getBatch();if(l.init(t),a){var u=this.batchs.indexOf(a);this.batchs.splice(u+1,0,l)}else this.batchs.push(l)}else t instanceof n.TilingSprite?this.initTilingSprite(t):t instanceof n.Strip&&this.initStrip(t),this.insertAfter(t,r)},n.WebGLRenderGroup.prototype.insertAfter=function(t,e){if(e instanceof n.Sprite){var i=e.batch;if(i)if(i.tail==e){var r=this.batchs.indexOf(i);this.batchs.splice(r+1,0,t)}else{var s=i.split(e.__next),r=this.batchs.indexOf(i);this.batchs.splice(r+1,0,t,s)}else this.batchs.push(t)}else{var r=this.batchs.indexOf(e);this.batchs.splice(r+1,0,t)}},n.WebGLRenderGroup.prototype.removeObject=function(t){var e;if(t instanceof n.Sprite){var i=t.batch;if(!i)return;i.remove(t),0==i.size&&(e=i)}else e=t;if(e){var r=this.batchs.indexOf(e);if(-1==r)return;if(0==r||r==this.batchs.length-1)return this.batchs.splice(r,1),e instanceof n.WebGLBatch&&n.WebGLRenderer.returnBatch(e),void 0;if(this.batchs[r-1]instanceof n.WebGLBatch&&this.batchs[r+1]instanceof n.WebGLBatch&&this.batchs[r-1].texture==this.batchs[r+1].texture&&this.batchs[r-1].blendMode==this.batchs[r+1].blendMode)return this.batchs[r-1].merge(this.batchs[r+1]),e instanceof n.WebGLBatch&&n.WebGLRenderer.returnBatch(e),n.WebGLRenderer.returnBatch(this.batchs[r+1]),this.batchs.splice(r,2),void 0;this.batchs.splice(r,1),e instanceof n.WebGLBatch&&n.WebGLRenderer.returnBatch(e)}},n.WebGLRenderGroup.prototype.initTilingSprite=function(t){var e=this.gl;t.verticies=new Float32Array([0,0,t.width,0,t.width,t.height,0,t.height]),t.uvs=new Float32Array([0,0,1,0,1,1,0,1]),t.colors=new Float32Array([1,1,1,1]),t.indices=new Uint16Array([0,1,3,2]),t._vertexBuffer=e.createBuffer(),t._indexBuffer=e.createBuffer(),t._uvBuffer=e.createBuffer(),t._colorBuffer=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,t._vertexBuffer),e.bufferData(e.ARRAY_BUFFER,t.verticies,e.STATIC_DRAW),e.bindBuffer(e.ARRAY_BUFFER,t._uvBuffer),e.bufferData(e.ARRAY_BUFFER,t.uvs,e.DYNAMIC_DRAW),e.bindBuffer(e.ARRAY_BUFFER,t._colorBuffer),e.bufferData(e.ARRAY_BUFFER,t.colors,e.STATIC_DRAW),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t._indexBuffer),e.bufferData(e.ELEMENT_ARRAY_BUFFER,t.indices,e.STATIC_DRAW),t.texture.baseTexture._glTexture?(e.bindTexture(e.TEXTURE_2D,t.texture.baseTexture._glTexture),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.REPEAT),t.texture.baseTexture._powerOf2=!0):t.texture.baseTexture._powerOf2=!0},n.WebGLRenderGroup.prototype.renderStrip=function(t,e){var i=this.gl,r=n.shaderProgram;i.useProgram(n.stripShaderProgram);var s=n.mat3.clone(t.worldTransform);n.mat3.transpose(s),i.uniformMatrix3fv(n.stripShaderProgram.translationMatrix,!1,s),i.uniform2f(n.stripShaderProgram.projectionVector,e.x,e.y),i.uniform1f(n.stripShaderProgram.alpha,t.worldAlpha),t.dirty?(t.dirty=!1,i.bindBuffer(i.ARRAY_BUFFER,t._vertexBuffer),i.bufferData(i.ARRAY_BUFFER,t.verticies,i.STATIC_DRAW),i.vertexAttribPointer(r.vertexPositionAttribute,2,i.FLOAT,!1,0,0),i.bindBuffer(i.ARRAY_BUFFER,t._uvBuffer),i.bufferData(i.ARRAY_BUFFER,t.uvs,i.STATIC_DRAW),i.vertexAttribPointer(r.textureCoordAttribute,2,i.FLOAT,!1,0,0),i.activeTexture(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,t.texture.baseTexture._glTexture),i.bindBuffer(i.ARRAY_BUFFER,t._colorBuffer),i.bufferData(i.ARRAY_BUFFER,t.colors,i.STATIC_DRAW),i.vertexAttribPointer(r.colorAttribute,1,i.FLOAT,!1,0,0),i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,t._indexBuffer),i.bufferData(i.ELEMENT_ARRAY_BUFFER,t.indices,i.STATIC_DRAW)):(i.bindBuffer(i.ARRAY_BUFFER,t._vertexBuffer),i.bufferSubData(i.ARRAY_BUFFER,0,t.verticies),i.vertexAttribPointer(r.vertexPositionAttribute,2,i.FLOAT,!1,0,0),i.bindBuffer(i.ARRAY_BUFFER,t._uvBuffer),i.vertexAttribPointer(r.textureCoordAttribute,2,i.FLOAT,!1,0,0),i.activeTexture(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,t.texture.baseTexture._glTexture),i.bindBuffer(i.ARRAY_BUFFER,t._colorBuffer),i.vertexAttribPointer(r.colorAttribute,1,i.FLOAT,!1,0,0),i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,t._indexBuffer)),i.drawElements(i.TRIANGLE_STRIP,t.indices.length,i.UNSIGNED_SHORT,0),i.useProgram(n.shaderProgram)},n.WebGLRenderGroup.prototype.renderTilingSprite=function(t,e){var i=this.gl;n.shaderProgram;var r=t.tilePosition,s=t.tileScale,a=r.x/t.texture.baseTexture.width,o=r.y/t.texture.baseTexture.height,h=t.width/t.texture.baseTexture.width/s.x,l=t.height/t.texture.baseTexture.height/s.y;t.uvs[0]=0-a,t.uvs[1]=0-o,t.uvs[2]=1*h-a,t.uvs[3]=0-o,t.uvs[4]=1*h-a,t.uvs[5]=1*l-o,t.uvs[6]=0-a,t.uvs[7]=1*l-o,i.bindBuffer(i.ARRAY_BUFFER,t._uvBuffer),i.bufferSubData(i.ARRAY_BUFFER,0,t.uvs),this.renderStrip(t,e)},n.WebGLRenderGroup.prototype.initStrip=function(t){var e=this.gl;this.shaderProgram,t._vertexBuffer=e.createBuffer(),t._indexBuffer=e.createBuffer(),t._uvBuffer=e.createBuffer(),t._colorBuffer=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,t._vertexBuffer),e.bufferData(e.ARRAY_BUFFER,t.verticies,e.DYNAMIC_DRAW),e.bindBuffer(e.ARRAY_BUFFER,t._uvBuffer),e.bufferData(e.ARRAY_BUFFER,t.uvs,e.STATIC_DRAW),e.bindBuffer(e.ARRAY_BUFFER,t._colorBuffer),e.bufferData(e.ARRAY_BUFFER,t.colors,e.STATIC_DRAW),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t._indexBuffer),e.bufferData(e.ELEMENT_ARRAY_BUFFER,t.indices,e.STATIC_DRAW)},n.CanvasRenderer=function(t,e,i,r){this.transparent=r,this.width=t||800,this.height=e||600,this.view=i||document.createElement("canvas"),this.context=this.view.getContext("2d"),this.refresh=!0,this.view.width=this.width,this.view.height=this.height,this.count=0},n.CanvasRenderer.constructor=n.CanvasRenderer,n.CanvasRenderer.prototype.render=function(t){n.texturesToUpdate=[],n.texturesToDestroy=[],t.updateTransform(),this.view.style.backgroundColor==t.backgroundColorString||this.transparent||(this.view.style.backgroundColor=t.backgroundColorString),this.context.setTransform(1,0,0,1,0,0),this.context.clearRect(0,0,this.width,this.height),this.renderDisplayObject(t),t.interactive&&(t._interactiveEventsAdded||(t._interactiveEventsAdded=!0,t.interactionManager.setTarget(this))),n.Texture.frameUpdates.length>0&&(n.Texture.frameUpdates=[])},n.CanvasRenderer.prototype.resize=function(t,e){this.width=t,this.height=e,this.view.width=t,this.view.height=e},n.CanvasRenderer.prototype.renderDisplayObject=function(t){var e,i=this.context;i.globalCompositeOperation="source-over";var r=t.last._iNext;t=t.first;do if(e=t.worldTransform,t.visible)if(t.renderable){if(t instanceof n.Sprite){var s=t.texture.frame;s&&(i.globalAlpha=t.worldAlpha,i.setTransform(e[0],e[3],e[1],e[4],e[2],e[5]),i.drawImage(t.texture.baseTexture.source,s.x,s.y,s.width,s.height,t.anchor.x*-s.width,t.anchor.y*-s.height,s.width,s.height))}else if(t instanceof n.Strip)i.setTransform(e[0],e[3],e[1],e[4],e[2],e[5]),this.renderStrip(t);else if(t instanceof n.TilingSprite)i.setTransform(e[0],e[3],e[1],e[4],e[2],e[5]),this.renderTilingSprite(t);else if(t instanceof n.CustomRenderable)t.renderCanvas(this);else if(t instanceof n.Graphics)i.setTransform(e[0],e[3],e[1],e[4],e[2],e[5]),n.CanvasGraphics.renderGraphics(t,i);else if(t instanceof n.FilterBlock)if(t.open){i.save();var a=t.mask.alpha,o=t.mask.worldTransform;i.setTransform(o[0],o[3],o[1],o[4],o[2],o[5]),t.mask.worldAlpha=.5,i.worldAlpha=0,n.CanvasGraphics.renderGraphicsMask(t.mask,i),i.clip(),t.mask.worldAlpha=a}else i.restore();t=t._iNext}else t=t._iNext;else t=t.last._iNext;while(t!=r)},n.CanvasRenderer.prototype.renderStripFlat=function(t){var e=this.context,i=t.verticies;t.uvs;var r=i.length/2;this.count++,e.beginPath();for(var n=1;r-2>n;n++){var s=2*n,a=i[s],o=i[s+2],h=i[s+4],l=i[s+1],u=i[s+3],c=i[s+5];e.moveTo(a,l),e.lineTo(o,u),e.lineTo(h,c)}e.fillStyle="#FF0000",e.fill(),e.closePath()},n.CanvasRenderer.prototype.renderTilingSprite=function(t){var e=this.context;e.globalAlpha=t.worldAlpha,t.__tilePattern||(t.__tilePattern=e.createPattern(t.texture.baseTexture.source,"repeat")),e.beginPath();var i=t.tilePosition,r=t.tileScale;e.scale(r.x,r.y),e.translate(i.x,i.y),e.fillStyle=t.__tilePattern,e.fillRect(-i.x,-i.y,t.width/r.x,t.height/r.y),e.scale(1/r.x,1/r.y),e.translate(-i.x,-i.y),e.closePath()},n.CanvasRenderer.prototype.renderStrip=function(t){var e=this.context,i=t.verticies,r=t.uvs,n=i.length/2;this.count++;for(var s=1;n-2>s;s++){var a=2*s,o=i[a],h=i[a+2],l=i[a+4],u=i[a+1],c=i[a+3],d=i[a+5],p=r[a]*t.texture.width,f=r[a+2]*t.texture.width,v=r[a+4]*t.texture.width,m=r[a+1]*t.texture.height,g=r[a+3]*t.texture.height,x=r[a+5]*t.texture.height;e.save(),e.beginPath(),e.moveTo(o,u),e.lineTo(h,c),e.lineTo(l,d),e.closePath(),e.clip();var b=p*g+m*v+f*x-g*v-m*f-p*x,y=o*g+m*l+h*x-g*l-m*h-o*x,T=p*h+o*v+f*l-h*v-o*f-p*l,_=p*g*l+m*h*v+o*f*x-o*g*v-m*f*l-p*h*x,w=u*g+m*d+c*x-g*d-m*c-u*x,A=p*c+u*v+f*d-c*v-u*f-p*d,R=p*g*d+m*c*v+u*f*x-u*g*v-m*f*d-p*c*x;e.transform(y/b,w/b,T/b,A/b,_/b,R/b),e.drawImage(t.texture.baseTexture.source,0,0),e.restore()}},n.CanvasGraphics=function(){},n.CanvasGraphics.renderGraphics=function(t,e){for(var i=t.worldAlpha,r=0;t.graphicsData.length>r;r++){var s=t.graphicsData[r],a=s.points;if(e.strokeStyle=color="#"+("00000"+(0|s.lineColor).toString(16)).substr(-6),e.lineWidth=s.lineWidth,s.type==n.Graphics.POLY){e.beginPath(),e.moveTo(a[0],a[1]);for(var o=1;a.length/2>o;o++)e.lineTo(a[2*o],a[2*o+1]);a[0]==a[a.length-2]&&a[1]==a[a.length-1]&&e.closePath(),s.fill&&(e.globalAlpha=s.fillAlpha*i,e.fillStyle=color="#"+("00000"+(0|s.fillColor).toString(16)).substr(-6),e.fill()),s.lineWidth&&(e.globalAlpha=s.lineAlpha*i,e.stroke())}else if(s.type==n.Graphics.RECT)s.fillColor&&(e.globalAlpha=s.fillAlpha*i,e.fillStyle=color="#"+("00000"+(0|s.fillColor).toString(16)).substr(-6),e.fillRect(a[0],a[1],a[2],a[3])),s.lineWidth&&(e.globalAlpha=s.lineAlpha*i,e.strokeRect(a[0],a[1],a[2],a[3]));else if(s.type==n.Graphics.CIRC)e.beginPath(),e.arc(a[0],a[1],a[2],0,2*Math.PI),e.closePath(),s.fill&&(e.globalAlpha=s.fillAlpha*i,e.fillStyle=color="#"+("00000"+(0|s.fillColor).toString(16)).substr(-6),e.fill()),s.lineWidth&&(e.globalAlpha=s.lineAlpha*i,e.stroke());else if(s.type==n.Graphics.ELIP){var h=s.points,l=2*h[2],u=2*h[3],c=h[0]-l/2,d=h[1]-u/2;e.beginPath();var p=.5522848,f=l/2*p,v=u/2*p,m=c+l,g=d+u,x=c+l/2,b=d+u/2;e.moveTo(c,b),e.bezierCurveTo(c,b-v,x-f,d,x,d),e.bezierCurveTo(x+f,d,m,b-v,m,b),e.bezierCurveTo(m,b+v,x+f,g,x,g),e.bezierCurveTo(x-f,g,c,b+v,c,b),e.closePath(),s.fill&&(e.globalAlpha=s.fillAlpha*i,e.fillStyle=color="#"+("00000"+(0|s.fillColor).toString(16)).substr(-6),e.fill()),s.lineWidth&&(e.globalAlpha=s.lineAlpha*i,e.stroke())}}},n.CanvasGraphics.renderGraphicsMask=function(t,e){t.worldAlpha;var i=t.graphicsData.length;i>1&&(i=1,console.log("Pixi.js warning: masks in canvas can only mask using the first path in the graphics object"));for(var r=0;1>r;r++){var s=t.graphicsData[r],a=s.points;if(s.type==n.Graphics.POLY){e.beginPath(),e.moveTo(a[0],a[1]);for(var o=1;a.length/2>o;o++)e.lineTo(a[2*o],a[2*o+1]);a[0]==a[a.length-2]&&a[1]==a[a.length-1]&&e.closePath()}else if(s.type==n.Graphics.RECT)e.beginPath(),e.rect(a[0],a[1],a[2],a[3]),e.closePath();else if(s.type==n.Graphics.CIRC)e.beginPath(),e.arc(a[0],a[1],a[2],0,2*Math.PI),e.closePath();else if(s.type==n.Graphics.ELIP){var h=s.points,l=2*h[2],u=2*h[3],c=h[0]-l/2,d=h[1]-u/2;e.beginPath();var p=.5522848,f=l/2*p,v=u/2*p,m=c+l,g=d+u,x=c+l/2,b=d+u/2;e.moveTo(c,b),e.bezierCurveTo(c,b-v,x-f,d,x,d),e.bezierCurveTo(x+f,d,m,b-v,m,b),e.bezierCurveTo(m,b+v,x+f,g,x,g),e.bezierCurveTo(x-f,g,c,b+v,c,b),e.closePath()}}},n.Graphics=function(){n.DisplayObjectContainer.call(this),this.renderable=!0,this.fillAlpha=1,this.lineWidth=0,this.lineColor="black",this.graphicsData=[],this.currentPath={points:[]}},n.Graphics.constructor=n.Graphics,n.Graphics.prototype=Object.create(n.DisplayObjectContainer.prototype),n.Graphics.prototype.lineStyle=function(t,e,i){0==this.currentPath.points.length&&this.graphicsData.pop(),this.lineWidth=t||0,this.lineColor=e||0,this.lineAlpha=void 0==i?1:i,this.currentPath={lineWidth:this.lineWidth,lineColor:this.lineColor,lineAlpha:this.lineAlpha,fillColor:this.fillColor,fillAlpha:this.fillAlpha,fill:this.filling,points:[],type:n.Graphics.POLY},this.graphicsData.push(this.currentPath)},n.Graphics.prototype.moveTo=function(t,e){0==this.currentPath.points.length&&this.graphicsData.pop(),this.currentPath=this.currentPath={lineWidth:this.lineWidth,lineColor:this.lineColor,lineAlpha:this.lineAlpha,fillColor:this.fillColor,fillAlpha:this.fillAlpha,fill:this.filling,points:[],type:n.Graphics.POLY},this.currentPath.points.push(t,e),this.graphicsData.push(this.currentPath) -},n.Graphics.prototype.lineTo=function(t,e){this.currentPath.points.push(t,e),this.dirty=!0},n.Graphics.prototype.beginFill=function(t,e){this.filling=!0,this.fillColor=t||0,this.fillAlpha=e||1},n.Graphics.prototype.endFill=function(){this.filling=!1,this.fillColor=null,this.fillAlpha=1},n.Graphics.prototype.drawRect=function(t,e,i,r){0==this.currentPath.points.length&&this.graphicsData.pop(),this.currentPath={lineWidth:this.lineWidth,lineColor:this.lineColor,lineAlpha:this.lineAlpha,fillColor:this.fillColor,fillAlpha:this.fillAlpha,fill:this.filling,points:[t,e,i,r],type:n.Graphics.RECT},this.graphicsData.push(this.currentPath),this.dirty=!0},n.Graphics.prototype.drawCircle=function(t,e,i){0==this.currentPath.points.length&&this.graphicsData.pop(),this.currentPath={lineWidth:this.lineWidth,lineColor:this.lineColor,lineAlpha:this.lineAlpha,fillColor:this.fillColor,fillAlpha:this.fillAlpha,fill:this.filling,points:[t,e,i,i],type:n.Graphics.CIRC},this.graphicsData.push(this.currentPath),this.dirty=!0},n.Graphics.prototype.drawElipse=function(t,e,i,r){0==this.currentPath.points.length&&this.graphicsData.pop(),this.currentPath={lineWidth:this.lineWidth,lineColor:this.lineColor,lineAlpha:this.lineAlpha,fillColor:this.fillColor,fillAlpha:this.fillAlpha,fill:this.filling,points:[t,e,i,r],type:n.Graphics.ELIP},this.graphicsData.push(this.currentPath),this.dirty=!0},n.Graphics.prototype.clear=function(){this.lineWidth=0,this.filling=!1,this.dirty=!0,this.clearDirty=!0,this.graphicsData=[]},n.Graphics.POLY=0,n.Graphics.RECT=1,n.Graphics.CIRC=2,n.Graphics.ELIP=3,n.Strip=function(t,e,i){n.DisplayObjectContainer.call(this),this.texture=t,this.blendMode=n.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(r){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=e,this.height=i,t.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},n.Strip.constructor=n.Strip,n.Strip.prototype=Object.create(n.DisplayObjectContainer.prototype),n.Strip.prototype.setTexture=function(t){this.texture=t,this.width=t.frame.width,this.height=t.frame.height,this.updateFrame=!0},n.Strip.prototype.onTextureUpdate=function(){this.updateFrame=!0},n.Rope=function(t,e){n.Strip.call(this,t),this.points=e;try{this.verticies=new Float32Array(4*e.length),this.uvs=new Float32Array(4*e.length),this.colors=new Float32Array(2*e.length),this.indices=new Uint16Array(2*e.length)}catch(i){this.verticies=verticies,this.uvs=uvs,this.colors=colors,this.indices=indices}this.refresh()},n.Rope.constructor=n.Rope,n.Rope.prototype=Object.create(n.Strip.prototype),n.Rope.prototype.refresh=function(){var t=this.points;if(!(1>t.length)){var e=this.uvs,i=this.indices,r=this.colors,n=t[0],s=t[0];this.count-=.2,e[0]=0,e[1]=1,e[2]=0,e[3]=1,r[0]=1,r[1]=1,i[0]=0,i[1]=1;for(var a=t.length,o=1;a>o;o++){var s=t[o],h=4*o,l=o/(a-1);o%2?(e[h]=l,e[h+1]=0,e[h+2]=l,e[h+3]=1):(e[h]=l,e[h+1]=0,e[h+2]=l,e[h+3]=1),h=2*o,r[h]=1,r[h+1]=1,h=2*o,i[h]=h,i[h+1]=h+1,n=s}}},n.Rope.prototype.updateTransform=function(){var t=this.points;if(!(1>t.length)){var e,i=this.verticies,r=t[0],s={x:0,y:0},a=t[0];this.count-=.2,i[0]=a.x+s.x,i[1]=a.y+s.y,i[2]=a.x-s.x,i[3]=a.y-s.y;for(var o=t.length,h=1;o>h;h++){var a=t[h],l=4*h;e=t.length-1>h?t[h+1]:a,s.y=-(e.x-r.x),s.x=e.y-r.y;var u=10*(1-h/(o-1));u>1&&(u=1);var c=Math.sqrt(s.x*s.x+s.y*s.y),d=this.texture.height/2;s.x/=c,s.y/=c,s.x*=d,s.y*=d,i[l]=a.x+s.x,i[l+1]=a.y+s.y,i[l+2]=a.x-s.x,i[l+3]=a.y-s.y,r=a}n.DisplayObjectContainer.prototype.updateTransform.call(this)}},n.Rope.prototype.setTexture=function(t){this.texture=t,this.updateFrame=!0},n.TilingSprite=function(t,e,i){n.DisplayObjectContainer.call(this),this.texture=t,this.width=e,this.height=i,this.tileScale=new n.Point(1,1),this.tilePosition=new n.Point(0,0),this.renderable=!0,this.blendMode=n.blendModes.NORMAL},n.TilingSprite.constructor=n.TilingSprite,n.TilingSprite.prototype=Object.create(n.DisplayObjectContainer.prototype),n.TilingSprite.prototype.setTexture=function(t){this.texture=t,this.updateFrame=!0},n.TilingSprite.prototype.onTextureUpdate=function(){this.updateFrame=!0},n.Spine=function(t){if(n.DisplayObjectContainer.call(this),this.spineData=n.AnimCache[t],!this.spineData)throw Error("Spine data must be preloaded using PIXI.SpineLoader or PIXI.AssetLoader: "+t);this.count=0,this.sprites=[],this.skeleton=new u.Skeleton(this.spineData),this.skeleton.updateWorldTransform(),this.stateData=new u.AnimationStateData(this.spineData),this.state=new u.AnimationState(this.stateData);for(var e=0;this.skeleton.drawOrder.length>e;e++){var i=this.skeleton.drawOrder[e].data.attachmentName;n.TextureCache[i]||(i+=".png");var r=new n.Sprite(n.Texture.fromFrame(i));r.anchor.x=r.anchor.y=.5,this.addChild(r),this.sprites.push(r)}},n.Spine.constructor=n.Spine,n.Spine.prototype=Object.create(n.DisplayObjectContainer.prototype),n.Spine.prototype.updateTransform=function(){this.state.update(1/60),this.state.apply(this.skeleton),this.skeleton.updateWorldTransform();for(var t=0;this.skeleton.drawOrder.length>t;t++){var e=this.skeleton.drawOrder[t],i=e.bone.worldX+e.attachment.x*e.bone.m00+e.attachment.y*e.bone.m01+.5*e.attachment.width,r=e.bone.worldY+e.attachment.x*e.bone.m10+e.attachment.y*e.bone.m11+.5*e.attachment.height;if(e.cacheName!=e.attachment.name){var s=e.attachment.name;n.TextureCache[s]||(s+=".png"),this.sprites[t].setTexture(n.TextureCache[s]),e.cacheName=e.attachment.name}i+=-(e.attachment.width*(e.bone.worldScaleX+e.attachment.scaleX-1)>>1),r+=-(e.attachment.height*(e.bone.worldScaleY+e.attachment.scaleY-1)>>1),this.sprites[t].position.x=i,this.sprites[t].position.y=r,this.sprites[t].rotation=-(e.bone.worldRotation+e.attachment.rotation)*(Math.PI/180)}n.DisplayObjectContainer.prototype.updateTransform.call(this)};var u={};u.BoneData=function(t,e){this.name=t,this.parent=e},u.BoneData.prototype={length:0,x:0,y:0,rotation:0,scaleX:1,scaleY:1},u.SlotData=function(t,e){this.name=t,this.boneData=e},u.SlotData.prototype={r:1,g:1,b:1,a:1,attachmentName:null},u.Bone=function(t,e){this.data=t,this.parent=e,this.setToSetupPose()},u.Bone.yDown=!1,u.Bone.prototype={x:0,y:0,rotation:0,scaleX:1,scaleY:1,m00:0,m01:0,worldX:0,m10:0,m11:0,worldY:0,worldRotation:0,worldScaleX:1,worldScaleY:1,updateWorldTransform:function(t,e){var i=this.parent;null!=i?(this.worldX=this.x*i.m00+this.y*i.m01+i.worldX,this.worldY=this.x*i.m10+this.y*i.m11+i.worldY,this.worldScaleX=i.worldScaleX*this.scaleX,this.worldScaleY=i.worldScaleY*this.scaleY,this.worldRotation=i.worldRotation+this.rotation):(this.worldX=this.x,this.worldY=this.y,this.worldScaleX=this.scaleX,this.worldScaleY=this.scaleY,this.worldRotation=this.rotation);var r=this.worldRotation*Math.PI/180,n=Math.cos(r),s=Math.sin(r);this.m00=n*this.worldScaleX,this.m10=s*this.worldScaleX,this.m01=-s*this.worldScaleY,this.m11=n*this.worldScaleY,t&&(this.m00=-this.m00,this.m01=-this.m01),e&&(this.m10=-this.m10,this.m11=-this.m11),u.Bone.yDown&&(this.m10=-this.m10,this.m11=-this.m11)},setToSetupPose:function(){var t=this.data;this.x=t.x,this.y=t.y,this.rotation=t.rotation,this.scaleX=t.scaleX,this.scaleY=t.scaleY}},u.Slot=function(t,e,i){this.data=t,this.skeleton=e,this.bone=i,this.setToSetupPose()},u.Slot.prototype={r:1,g:1,b:1,a:1,_attachmentTime:0,attachment:null,setAttachment:function(t){this.attachment=t,this._attachmentTime=this.skeleton.time},setAttachmentTime:function(t){this._attachmentTime=this.skeleton.time-t},getAttachmentTime:function(){return this.skeleton.time-this._attachmentTime},setToSetupPose:function(){var t=this.data;this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a;for(var e=this.skeleton.data.slots,i=0,r=e.length;r>i;i++)if(e[i]==t){this.setAttachment(t.attachmentName?this.skeleton.getAttachmentBySlotIndex(i,t.attachmentName):null);break}}},u.Skin=function(t){this.name=t,this.attachments={}},u.Skin.prototype={addAttachment:function(t,e,i){this.attachments[t+":"+e]=i},getAttachment:function(t,e){return this.attachments[t+":"+e]},_attachAll:function(t,e){for(var i in e.attachments){var r=i.indexOf(":"),n=parseInt(i.substring(0,r)),s=i.substring(r+1),a=t.slots[n];if(a.attachment&&a.attachment.name==s){var o=this.getAttachment(n,s);o&&a.setAttachment(o)}}}},u.Animation=function(t,e,i){this.name=t,this.timelines=e,this.duration=i},u.Animation.prototype={apply:function(t,e,i){i&&0!=this.duration&&(e%=this.duration);for(var r=this.timelines,n=0,s=r.length;s>n;n++)r[n].apply(t,e,1)},mix:function(t,e,i,r){i&&0!=this.duration&&(e%=this.duration);for(var n=this.timelines,s=0,a=n.length;a>s;s++)n[s].apply(t,e,r)}},u.binarySearch=function(t,e,i){var r=0,n=Math.floor(t.length/i)-2;if(0==n)return i;for(var s=n>>>1;;){if(e>=t[(s+1)*i]?r=s+1:n=s,r==n)return(r+1)*i;s=r+n>>>1}},u.linearSearch=function(t,e,i){for(var r=0,n=t.length-i;n>=r;r+=i)if(t[r]>e)return r;return-1},u.Curves=function(t){this.curves=[],this.curves.length=6*(t-1)},u.Curves.prototype={setLinear:function(t){this.curves[6*t]=0},setStepped:function(t){this.curves[6*t]=-1},setCurve:function(t,e,i,r,n){var s=.1,a=s*s,o=a*s,h=3*s,l=3*a,u=6*a,c=6*o,d=2*-e+r,p=2*-i+n,f=3*(e-r)+1,v=3*(i-n)+1,m=6*t,g=this.curves;g[m]=e*h+d*l+f*o,g[m+1]=i*h+p*l+v*o,g[m+2]=d*u+f*c,g[m+3]=p*u+v*c,g[m+4]=f*c,g[m+5]=v*c},getCurvePercent:function(t,e){e=0>e?0:e>1?1:e;var i=6*t,r=this.curves,n=r[i];if(!n)return e;if(-1==n)return 0;for(var s=r[i+1],a=r[i+2],o=r[i+3],h=r[i+4],l=r[i+5],u=n,c=s,d=8;;){if(u>=e){var p=u-n,f=c-s;return f+(c-f)*(e-p)/(u-p)}if(0==d)break;d--,n+=a,s+=o,a+=h,o+=l,u+=n,c+=s}return c+(1-c)*(e-u)/(1-u)}},u.RotateTimeline=function(t){this.curves=new u.Curves(t),this.frames=[],this.frames.length=2*t},u.RotateTimeline.prototype={boneIndex:0,getFrameCount:function(){return this.frames.length/2},setFrame:function(t,e,i){t*=2,this.frames[t]=e,this.frames[t+1]=i},apply:function(t,e,i){var r=this.frames;if(!(r[0]>e)){var n=t.bones[this.boneIndex];if(e>=r[r.length-2]){for(var s=n.data.rotation+r[r.length-1]-n.rotation;s>180;)s-=360;for(;-180>s;)s+=360;return n.rotation+=s*i,void 0}var a=u.binarySearch(r,e,2),o=r[a-1],h=r[a],l=1-(e-h)/(r[a-2]-h);l=this.curves.getCurvePercent(a/2-1,l);for(var s=r[a+1]-o;s>180;)s-=360;for(;-180>s;)s+=360;for(s=n.data.rotation+(o+s*l)-n.rotation;s>180;)s-=360;for(;-180>s;)s+=360;n.rotation+=s*i}}},u.TranslateTimeline=function(t){this.curves=new u.Curves(t),this.frames=[],this.frames.length=3*t},u.TranslateTimeline.prototype={boneIndex:0,getFrameCount:function(){return this.frames.length/3},setFrame:function(t,e,i,r){t*=3,this.frames[t]=e,this.frames[t+1]=i,this.frames[t+2]=r},apply:function(t,e,i){var r=this.frames;if(!(r[0]>e)){var n=t.bones[this.boneIndex];if(e>=r[r.length-3])return n.x+=(n.data.x+r[r.length-2]-n.x)*i,n.y+=(n.data.y+r[r.length-1]-n.y)*i,void 0;var s=u.binarySearch(r,e,3),a=r[s-2],o=r[s-1],h=r[s],l=1-(e-h)/(r[s+-3]-h);l=this.curves.getCurvePercent(s/3-1,l),n.x+=(n.data.x+a+(r[s+1]-a)*l-n.x)*i,n.y+=(n.data.y+o+(r[s+2]-o)*l-n.y)*i}}},u.ScaleTimeline=function(t){this.curves=new u.Curves(t),this.frames=[],this.frames.length=3*t},u.ScaleTimeline.prototype={boneIndex:0,getFrameCount:function(){return this.frames.length/3},setFrame:function(t,e,i,r){t*=3,this.frames[t]=e,this.frames[t+1]=i,this.frames[t+2]=r},apply:function(t,e,i){var r=this.frames;if(!(r[0]>e)){var n=t.bones[this.boneIndex];if(e>=r[r.length-3])return n.scaleX+=(n.data.scaleX-1+r[r.length-2]-n.scaleX)*i,n.scaleY+=(n.data.scaleY-1+r[r.length-1]-n.scaleY)*i,void 0;var s=u.binarySearch(r,e,3),a=r[s-2],o=r[s-1],h=r[s],l=1-(e-h)/(r[s+-3]-h);l=this.curves.getCurvePercent(s/3-1,l),n.scaleX+=(n.data.scaleX-1+a+(r[s+1]-a)*l-n.scaleX)*i,n.scaleY+=(n.data.scaleY-1+o+(r[s+2]-o)*l-n.scaleY)*i}}},u.ColorTimeline=function(t){this.curves=new u.Curves(t),this.frames=[],this.frames.length=5*t},u.ColorTimeline.prototype={slotIndex:0,getFrameCount:function(){return this.frames.length/2},setFrame:function(t,e){t*=5,this.frames[t]=e,this.frames[t+1]=r,this.frames[t+2]=g,this.frames[t+3]=b,this.frames[t+4]=a},apply:function(t,e,i){var r=this.frames;if(!(r[0]>e)){var n=t.slots[this.slotIndex];if(e>=r[r.length-5]){var s=r.length-1;return n.r=r[s-3],n.g=r[s-2],n.b=r[s-1],n.a=r[s],void 0}var a=u.binarySearch(r,e,5),o=r[a-4],h=r[a-3],l=r[a-2],c=r[a-1],d=r[a],p=1-(e-d)/(r[a-5]-d);p=this.curves.getCurvePercent(a/5-1,p);var f=o+(r[a+1]-o)*p,v=h+(r[a+2]-h)*p,m=l+(r[a+3]-l)*p,g=c+(r[a+4]-c)*p;1>i?(n.r+=(f-n.r)*i,n.g+=(v-n.g)*i,n.b+=(m-n.b)*i,n.a+=(g-n.a)*i):(n.r=f,n.g=v,n.b=m,n.a=g)}}},u.AttachmentTimeline=function(t){this.curves=new u.Curves(t),this.frames=[],this.frames.length=t,this.attachmentNames=[],this.attachmentNames.length=t},u.AttachmentTimeline.prototype={slotIndex:0,getFrameCount:function(){return this.frames.length/2},setFrame:function(t,e,i){this.frames[t]=e,this.attachmentNames[t]=i},apply:function(t,e){var i=this.frames;if(!(i[0]>e)){var r;r=e>=i[i.length-1]?i.length-1:u.binarySearch(i,e,1)-1;var n=this.attachmentNames[r];t.slots[this.slotIndex].setAttachment(n?t.getAttachmentBySlotIndex(this.slotIndex,n):null)}}},u.SkeletonData=function(){this.bones=[],this.slots=[],this.skins=[],this.animations=[]},u.SkeletonData.prototype={defaultSkin:null,findBone:function(t){for(var e=this.bones,i=0,r=e.length;r>i;i++)if(e[i].name==t)return e[i];return null},findBoneIndex:function(t){for(var e=this.bones,i=0,r=e.length;r>i;i++)if(e[i].name==t)return i;return-1},findSlot:function(t){for(var e=this.slots,i=0,r=e.length;r>i;i++)if(e[i].name==t)return slot[i];return null},findSlotIndex:function(t){for(var e=this.slots,i=0,r=e.length;r>i;i++)if(e[i].name==t)return i;return-1},findSkin:function(t){for(var e=this.skins,i=0,r=e.length;r>i;i++)if(e[i].name==t)return e[i];return null},findAnimation:function(t){for(var e=this.animations,i=0,r=e.length;r>i;i++)if(e[i].name==t)return e[i];return null}},u.Skeleton=function(t){this.data=t,this.bones=[];for(var e=0,i=t.bones.length;i>e;e++){var r=t.bones[e],n=r.parent?this.bones[t.bones.indexOf(r.parent)]:null;this.bones.push(new u.Bone(r,n))}this.slots=[],this.drawOrder=[];for(var e=0,i=t.slots.length;i>e;e++){var s=t.slots[e],a=this.bones[t.bones.indexOf(s.boneData)],o=new u.Slot(s,this,a);this.slots.push(o),this.drawOrder.push(o)}},u.Skeleton.prototype={x:0,y:0,skin:null,r:1,g:1,b:1,a:1,time:0,flipX:!1,flipY:!1,updateWorldTransform:function(){for(var t=this.flipX,e=this.flipY,i=this.bones,r=0,n=i.length;n>r;r++)i[r].updateWorldTransform(t,e)},setToSetupPose:function(){this.setBonesToSetupPose(),this.setSlotsToSetupPose()},setBonesToSetupPose:function(){for(var t=this.bones,e=0,i=t.length;i>e;e++)t[e].setToSetupPose()},setSlotsToSetupPose:function(){for(var t=this.slots,e=0,i=t.length;i>e;e++)t[e].setToSetupPose(e)},getRootBone:function(){return 0==this.bones.length?null:this.bones[0]},findBone:function(t){for(var e=this.bones,i=0,r=e.length;r>i;i++)if(e[i].data.name==t)return e[i];return null},findBoneIndex:function(t){for(var e=this.bones,i=0,r=e.length;r>i;i++)if(e[i].data.name==t)return i;return-1},findSlot:function(t){for(var e=this.slots,i=0,r=e.length;r>i;i++)if(e[i].data.name==t)return e[i];return null},findSlotIndex:function(t){for(var e=this.slots,i=0,r=e.length;r>i;i++)if(e[i].data.name==t)return i;return-1},setSkinByName:function(t){var e=this.data.findSkin(t);if(!e)throw"Skin not found: "+t;this.setSkin(e)},setSkin:function(t){this.skin&&t&&t._attachAll(this,this.skin),this.skin=t},getAttachmentBySlotName:function(t,e){return this.getAttachmentBySlotIndex(this.data.findSlotIndex(t),e)},getAttachmentBySlotIndex:function(t,e){if(this.skin){var i=this.skin.getAttachment(t,e);if(i)return i}return this.data.defaultSkin?this.data.defaultSkin.getAttachment(t,e):null},setAttachment:function(t,e){for(var i=this.slots,r=0,n=i.size;n>r;r++){var s=i[r];if(s.data.name==t){var a=null;if(e&&(a=this.getAttachment(r,e),null==a))throw"Attachment not found: "+e+", for slot: "+t;return s.setAttachment(a),void 0}}throw"Slot not found: "+t},update:function(t){time+=t}},u.AttachmentType={region:0},u.RegionAttachment=function(){this.offset=[],this.offset.length=8,this.uvs=[],this.uvs.length=8},u.RegionAttachment.prototype={x:0,y:0,rotation:0,scaleX:1,scaleY:1,width:0,height:0,rendererObject:null,regionOffsetX:0,regionOffsetY:0,regionWidth:0,regionHeight:0,regionOriginalWidth:0,regionOriginalHeight:0,setUVs:function(t,e,i,r,n){var s=this.uvs;n?(s[2]=t,s[3]=r,s[4]=t,s[5]=e,s[6]=i,s[7]=e,s[0]=i,s[1]=r):(s[0]=t,s[1]=r,s[2]=t,s[3]=e,s[4]=i,s[5]=e,s[6]=i,s[7]=r)},updateOffset:function(){var t=this.width/this.regionOriginalWidth*this.scaleX,e=this.height/this.regionOriginalHeight*this.scaleY,i=-this.width/2*this.scaleX+this.regionOffsetX*t,r=-this.height/2*this.scaleY+this.regionOffsetY*e,n=i+this.regionWidth*t,s=r+this.regionHeight*e,a=this.rotation*Math.PI/180,o=Math.cos(a),h=Math.sin(a),l=i*o+this.x,u=i*h,c=r*o+this.y,d=r*h,p=n*o+this.x,f=n*h,v=s*o+this.y,m=s*h,g=this.offset;g[0]=l-d,g[1]=c+u,g[2]=l-m,g[3]=v+u,g[4]=p-m,g[5]=v+f,g[6]=p-d,g[7]=c+f},computeVertices:function(t,e,i,r){t+=i.worldX,e+=i.worldY;var n=i.m00,s=i.m01,a=i.m10,o=i.m11,h=this.offset;r[0]=h[0]*n+h[1]*s+t,r[1]=h[0]*a+h[1]*o+e,r[2]=h[2]*n+h[3]*s+t,r[3]=h[2]*a+h[3]*o+e,r[4]=h[4]*n+h[5]*s+t,r[5]=h[4]*a+h[5]*o+e,r[6]=h[6]*n+h[7]*s+t,r[7]=h[6]*a+h[7]*o+e}},u.AnimationStateData=function(t){this.skeletonData=t,this.animationToMixTime={}},u.AnimationStateData.prototype={setMixByName:function(t,e,i){var r=this.skeletonData.findAnimation(t);if(!r)throw"Animation not found: "+t;var n=this.skeletonData.findAnimation(e);if(!n)throw"Animation not found: "+e;this.setMix(r,n,i)},setMix:function(t,e,i){this.animationToMixTime[t.name+":"+e.name]=i},getMix:function(t,e){var i=this.animationToMixTime[t.name+":"+e.name];return i?i:0}},u.AnimationState=function(t){this.data=t,this.queue=[]},u.AnimationState.prototype={current:null,previous:null,currentTime:0,previousTime:0,currentLoop:!1,previousLoop:!1,mixTime:0,mixDuration:0,update:function(t){if(this.currentTime+=t,this.previousTime+=t,this.mixTime+=t,this.queue.length>0){var e=this.queue[0];this.currentTime>=e.delay&&(this._setAnimation(e.animation,e.loop),this.queue.shift())}},apply:function(t){if(this.current)if(this.previous){this.previous.apply(t,this.previousTime,this.previousLoop);var e=this.mixTime/this.mixDuration;e>=1&&(e=1,this.previous=null),this.current.mix(t,this.currentTime,this.currentLoop,e)}else this.current.apply(t,this.currentTime,this.currentLoop)},clearAnimation:function(){this.previous=null,this.current=null,this.queue.length=0},_setAnimation:function(t,e){this.previous=null,t&&this.current&&(this.mixDuration=this.data.getMix(this.current,t),this.mixDuration>0&&(this.mixTime=0,this.previous=this.current,this.previousTime=this.currentTime,this.previousLoop=this.currentLoop)),this.current=t,this.currentLoop=e,this.currentTime=0},setAnimationByName:function(t,e){var i=this.data.skeletonData.findAnimation(t);if(!i)throw"Animation not found: "+t;this.setAnimation(i,e)},setAnimation:function(t,e){this.queue.length=0,this._setAnimation(t,e)},addAnimationByName:function(t,e,i){var r=this.data.skeletonData.findAnimation(t);if(!r)throw"Animation not found: "+t;this.addAnimation(r,e,i)},addAnimation:function(t,e,i){var r={};if(r.animation=t,r.loop=e,!i||0>=i){var n=0==this.queue.length?this.current:this.queue[this.queue.length-1].animation;i=null!=n?n.duration-this.data.getMix(n,t)+(i||0):0}r.delay=i,this.queue.push(r)},isComplete:function(){return!this.current||this.currentTime>=this.current.duration}},u.SkeletonJson=function(t){this.attachmentLoader=t},u.SkeletonJson.prototype={scale:1,readSkeletonData:function(t){for(var e=new u.SkeletonData,i=t.bones,r=0,n=i.length;n>r;r++){var s=i[r],a=null;if(s.parent&&(a=e.findBone(s.parent),!a))throw"Parent bone not found: "+s.parent;var o=new u.BoneData(s.name,a);o.length=(s.length||0)*this.scale,o.x=(s.x||0)*this.scale,o.y=(s.y||0)*this.scale,o.rotation=s.rotation||0,o.scaleX=s.scaleX||1,o.scaleY=s.scaleY||1,e.bones.push(o)}for(var h=t.slots,r=0,n=h.length;n>r;r++){var l=h[r],o=e.findBone(l.bone);if(!o)throw"Slot bone not found: "+l.bone;var c=new u.SlotData(l.name,o),d=l.color;d&&(c.r=u.SkeletonJson.toColor(d,0),c.g=u.SkeletonJson.toColor(d,1),c.b=u.SkeletonJson.toColor(d,2),c.a=u.SkeletonJson.toColor(d,3)),c.attachmentName=l.attachment,e.slots.push(c)}var p=t.skins;for(var f in p)if(p.hasOwnProperty(f)){var v=p[f],m=new u.Skin(f);for(var g in v)if(v.hasOwnProperty(g)){var x=e.findSlotIndex(g),b=v[g];for(var y in b)if(b.hasOwnProperty(y)){var T=this.readAttachment(m,y,b[y]);null!=T&&m.addAttachment(x,y,T)}}e.skins.push(m),"default"==m.name&&(e.defaultSkin=m)}var _=t.animations;for(var w in _)_.hasOwnProperty(w)&&this.readAnimation(w,_[w],e);return e},readAttachment:function(t,e,i){e=i.name||e;var r=u.AttachmentType[i.type||"region"],n=new u.RegionAttachment;return n.name=e,r==u.AttachmentType.region&&(n.x=(i.x||0)*this.scale,n.y=(i.y||0)*this.scale,n.scaleX=i.scaleX||1,n.scaleY=i.scaleY||1,n.rotation=i.rotation||0,n.width=(i.width||32)*this.scale,n.height=(i.height||32)*this.scale,n.updateOffset()),n},readAnimation:function(t,e,i){var r=[],n=0,s=e.bones;for(var a in s)if(s.hasOwnProperty(a)){var o=i.findBoneIndex(a);if(-1==o)throw"Bone not found: "+a;var h=s[a];for(var l in h)if(h.hasOwnProperty(l)){var c=h[l];if("rotate"==l){var d=new u.RotateTimeline(c.length);d.boneIndex=o;for(var p=0,f=0,v=c.length;v>f;f++){var m=c[f];d.setFrame(p,m.time,m.angle),u.SkeletonJson.readCurve(d,p,m),p++}r.push(d),n=Math.max(n,d.frames[2*d.getFrameCount()-2])}else{if("translate"!=l&&"scale"!=l)throw"Invalid timeline type for a bone: "+l+" ("+a+")";var d,g=1;"scale"==l?d=new u.ScaleTimeline(c.length):(d=new u.TranslateTimeline(c.length),g=this.scale),d.boneIndex=o;for(var p=0,f=0,v=c.length;v>f;f++){var m=c[f],x=(m.x||0)*g,b=(m.y||0)*g;d.setFrame(p,m.time,x,b),u.SkeletonJson.readCurve(d,p,m),p++}r.push(d),n=Math.max(n,d.frames[3*d.getFrameCount()-3])}}}var y=e.slots;for(var T in y)if(y.hasOwnProperty(T)){var _=y[T],w=i.findSlotIndex(T);for(var l in _)if(_.hasOwnProperty(l)){var c=_[l];if("color"==l){var d=new u.ColorTimeline(c.length);d.slotIndex=w;for(var p=0,f=0,v=c.length;v>f;f++){var m=c[f],A=m.color,R=u.SkeletonJson.toColor(A,0),S=u.SkeletonJson.toColor(A,1),C=u.SkeletonJson.toColor(A,2),L=u.SkeletonJson.toColor(A,3);d.setFrame(p,m.time,R,S,C,L),u.SkeletonJson.readCurve(d,p,m),p++}r.push(d),n=Math.max(n,d.frames[5*d.getFrameCount()-5])}else{if("attachment"!=l)throw"Invalid timeline type for a slot: "+l+" ("+T+")";var d=new u.AttachmentTimeline(c.length);d.slotIndex=w;for(var p=0,f=0,v=c.length;v>f;f++){var m=c[f];d.setFrame(p++,m.time,m.name)}r.push(d),n=Math.max(n,d.frames[Math.floor(d.getFrameCount())-1])}}}i.animations.push(new u.Animation(t,r,n))}},u.SkeletonJson.readCurve=function(t,e,i){var r=i.curve;r&&("stepped"==r?t.curves.setStepped(e):r instanceof Array&&t.curves.setCurve(e,r[0],r[1],r[2],r[3]))},u.SkeletonJson.toColor=function(t,e){if(8!=t.length)throw"Color hexidecimal length must be 8, recieved: "+t;return parseInt(t.substring(2*e,2),16)/255},u.Atlas=function(t,e){this.textureLoader=e,this.pages=[],this.regions=[];var i=new u.AtlasReader(t),r=[];r.length=4;for(var n=null;;){var s=i.readLine();if(null==s)break;if(s=i.trim(s),0==s.length)n=null;else if(n){var a=new u.AtlasRegion;a.name=s,a.page=n,a.rotate="true"==i.readValue(),i.readTuple(r);var o=parseInt(r[0]),h=parseInt(r[1]);i.readTuple(r);var l=parseInt(r[0]),c=parseInt(r[1]);a.u=o/n.width,a.v=h/n.height,a.rotate?(a.u2=(o+c)/n.width,a.v2=(h+l)/n.height):(a.u2=(o+l)/n.width,a.v2=(h+c)/n.height),a.x=o,a.y=h,a.width=Math.abs(l),a.height=Math.abs(c),4==i.readTuple(r)&&(a.splits=[parseInt(r[0]),parseInt(r[1]),parseInt(r[2]),parseInt(r[3])],4==i.readTuple(r)&&(a.pads=[parseInt(r[0]),parseInt(r[1]),parseInt(r[2]),parseInt(r[3])],i.readTuple(r))),a.originalWidth=parseInt(r[0]),a.originalHeight=parseInt(r[1]),i.readTuple(r),a.offsetX=parseInt(r[0]),a.offsetY=parseInt(r[1]),a.index=parseInt(i.readValue()),this.regions.push(a)}else{n=new u.AtlasPage,n.name=s,n.format=u.Atlas.Format[i.readValue()],i.readTuple(r),n.minFilter=u.Atlas.TextureFilter[r[0]],n.magFilter=u.Atlas.TextureFilter[r[1]];var d=i.readValue();n.uWrap=u.Atlas.TextureWrap.clampToEdge,n.vWrap=u.Atlas.TextureWrap.clampToEdge,"x"==d?n.uWrap=u.Atlas.TextureWrap.repeat:"y"==d?n.vWrap=u.Atlas.TextureWrap.repeat:"xy"==d&&(n.uWrap=n.vWrap=u.Atlas.TextureWrap.repeat),e.load(n,s),this.pages.push(n)}}},u.Atlas.prototype={findRegion:function(t){for(var e=this.regions,i=0,r=e.length;r>i;i++)if(e[i].name==t)return e[i];return null},dispose:function(){for(var t=this.pages,e=0,i=t.length;i>e;e++)this.textureLoader.unload(t[e].rendererObject)},updateUVs:function(t){for(var e=this.regions,i=0,r=e.length;r>i;i++){var n=e[i];n.page==t&&(n.u=n.x/t.width,n.v=n.y/t.height,n.rotate?(n.u2=(n.x+n.height)/t.width,n.v2=(n.y+n.width)/t.height):(n.u2=(n.x+n.width)/t.width,n.v2=(n.y+n.height)/t.height))}}},u.Atlas.Format={alpha:0,intensity:1,luminanceAlpha:2,rgb565:3,rgba4444:4,rgb888:5,rgba8888:6},u.Atlas.TextureFilter={nearest:0,linear:1,mipMap:2,mipMapNearestNearest:3,mipMapLinearNearest:4,mipMapNearestLinear:5,mipMapLinearLinear:6},u.Atlas.TextureWrap={mirroredRepeat:0,clampToEdge:1,repeat:2},u.AtlasPage=function(){},u.AtlasPage.prototype={name:null,format:null,minFilter:null,magFilter:null,uWrap:null,vWrap:null,rendererObject:null,width:0,height:0},u.AtlasRegion=function(){},u.AtlasRegion.prototype={page:null,name:null,x:0,y:0,width:0,height:0,u:0,v:0,u2:0,v2:0,offsetX:0,offsetY:0,originalWidth:0,originalHeight:0,index:0,rotate:!1,splits:null,pads:null},u.AtlasReader=function(t){this.lines=t.split(/\r\n|\r|\n/)},u.AtlasReader.prototype={index:0,trim:function(t){return t.replace(/^\s+|\s+$/g,"")},readLine:function(){return this.index>=this.lines.length?null:this.lines[this.index++]},readValue:function(){var t=this.readLine(),e=t.indexOf(":");if(-1==e)throw"Invalid line: "+t;return this.trim(t.substring(e+1))},readTuple:function(t){var e=this.readLine(),i=e.indexOf(":");if(-1==i)throw"Invalid line: "+e;for(var r=0,n=i+1;3>r;r++){var s=e.indexOf(",",n);if(-1==s){if(0==r)throw"Invalid line: "+e;break}t[r]=this.trim(e.substr(n,s-n)),n=s+1}return t[r]=this.trim(e.substring(n)),r+1}},u.AtlasAttachmentLoader=function(t){this.atlas=t},u.AtlasAttachmentLoader.prototype={newAttachment:function(t,e,i){switch(e){case u.AttachmentType.region:var r=this.atlas.findRegion(i);if(!r)throw"Region not found in atlas: "+i+" ("+e+")";var n=new u.RegionAttachment(i);return n.rendererObject=r,n.setUVs(r.u,r.v,r.u2,r.v2,r.rotate),n.regionOffsetX=r.offsetX,n.regionOffsetY=r.offsetY,n.regionWidth=r.width,n.regionHeight=r.height,n.regionOriginalWidth=r.originalWidth,n.regionOriginalHeight=r.originalHeight,n}throw"Unknown attachment type: "+e}},n.AnimCache={},u.Bone.yDown=!0,n.CustomRenderable=function(){n.DisplayObject.call(this)},n.CustomRenderable.constructor=n.CustomRenderable,n.CustomRenderable.prototype=Object.create(n.DisplayObject.prototype),n.CustomRenderable.prototype.renderCanvas=function(){},n.CustomRenderable.prototype.initWebGL=function(){},n.CustomRenderable.prototype.renderWebGL=function(){},n.BaseTextureCache={},n.texturesToUpdate=[],n.texturesToDestroy=[],n.BaseTexture=function(t){if(n.EventTarget.call(this),this.width=100,this.height=100,this.hasLoaded=!1,this.source=t,t){if(this.source instanceof Image)if(this.source.complete)this.hasLoaded=!0,this.width=this.source.width,this.height=this.source.height,n.texturesToUpdate.push(this);else{var e=this;this.source.onload=function(){e.hasLoaded=!0,e.width=e.source.width,e.height=e.source.height,n.texturesToUpdate.push(e),e.dispatchEvent({type:"loaded",content:e})}}else this.hasLoaded=!0,this.width=this.source.width,this.height=this.source.height,n.texturesToUpdate.push(this);this._powerOf2=!1}},n.BaseTexture.constructor=n.BaseTexture,n.BaseTexture.prototype.destroy=function(){this.source instanceof Image&&(this.source.src=null),this.source=null,n.texturesToDestroy.push(this)},n.BaseTexture.fromImage=function(t,e){var i=n.BaseTextureCache[t];if(!i){var r=new Image;e&&(r.crossOrigin=""),r.src=t,i=new n.BaseTexture(r),n.BaseTextureCache[t]=i}return i},n.TextureCache={},n.FrameCache={},n.Texture=function(t,e){if(n.EventTarget.call(this),e||(this.noFrame=!0,e=new n.Rectangle(0,0,1,1)),t instanceof n.Texture&&(t=t.baseTexture),this.baseTexture=t,this.frame=e,this.trim=new n.Point,this.scope=this,t.hasLoaded)this.noFrame&&(e=new n.Rectangle(0,0,t.width,t.height)),this.setFrame(e);else{var i=this;t.addEventListener("loaded",function(){i.onBaseTextureLoaded()})}},n.Texture.constructor=n.Texture,n.Texture.prototype.onBaseTextureLoaded=function(){var t=this.baseTexture;t.removeEventListener("loaded",this.onLoaded),this.noFrame&&(this.frame=new n.Rectangle(0,0,t.width,t.height)),this.noFrame=!1,this.width=this.frame.width,this.height=this.frame.height,this.scope.dispatchEvent({type:"update",content:this})},n.Texture.prototype.destroy=function(t){t&&this.baseTexture.destroy()},n.Texture.prototype.setFrame=function(t){if(this.frame=t,this.width=t.width,this.height=t.height,t.x+t.width>this.baseTexture.width||t.y+t.height>this.baseTexture.height)throw Error("Texture Error: frame does not fit inside the base Texture dimensions "+this);this.updateFrame=!0,n.Texture.frameUpdates.push(this)},n.Texture.fromImage=function(t,e){var i=n.TextureCache[t];return i||(i=new n.Texture(n.BaseTexture.fromImage(t,e)),n.TextureCache[t]=i),i},n.Texture.fromFrame=function(t){var e=n.TextureCache[t];if(!e)throw Error("The frameId '"+t+"' does not exist in the texture cache "+this);return e},n.Texture.fromCanvas=function(t){var e=new n.BaseTexture(t);return new n.Texture(e)},n.Texture.addTextureToCache=function(t,e){n.TextureCache[e]=t},n.Texture.removeTextureFromCache=function(t){var e=n.TextureCache[t];return n.TextureCache[t]=null,e},n.Texture.frameUpdates=[],n.RenderTexture=function(t,e){n.EventTarget.call(this),this.width=t||100,this.height=e||100,this.indetityMatrix=n.mat3.create(),this.frame=new n.Rectangle(0,0,this.width,this.height),n.gl?this.initWebGL():this.initCanvas()},n.RenderTexture.constructor=n.RenderTexture,n.RenderTexture.prototype=Object.create(n.Texture.prototype),n.RenderTexture.prototype.initWebGL=function(){var t=n.gl;this.glFramebuffer=t.createFramebuffer(),t.bindFramebuffer(t.FRAMEBUFFER,this.glFramebuffer),this.glFramebuffer.width=this.width,this.glFramebuffer.height=this.height,this.baseTexture=new n.BaseTexture,this.baseTexture.width=this.width,this.baseTexture.height=this.height,this.baseTexture._glTexture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.baseTexture._glTexture),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,this.width,this.height,0,t.RGBA,t.UNSIGNED_BYTE,null),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),this.baseTexture.isRender=!0,t.bindFramebuffer(t.FRAMEBUFFER,this.glFramebuffer),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,this.baseTexture._glTexture,0),this.projection=new n.Point(this.width/2,this.height/2),this.projectionMatrix=n.mat4.create(),this.projectionMatrix[5]=2/this.height,this.projectionMatrix[13]=-1,this.projectionMatrix[0]=2/this.width,this.projectionMatrix[12]=-1,this.render=this.renderWebGL},n.RenderTexture.prototype.resize=function(t,e){if(this.width=t,this.height=e,this.projection=new n.Point(this.width/2,this.height/2),n.gl){var i=n.gl;i.bindTexture(i.TEXTURE_2D,this.baseTexture._glTexture),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,this.width,this.height,0,i.RGBA,i.UNSIGNED_BYTE,null)}else this.frame.width=this.width,this.frame.height=this.height,this.renderer.resize(this.width,this.height) -},n.RenderTexture.prototype.initCanvas=function(){this.renderer=new n.CanvasRenderer(this.width,this.height,null,0),this.baseTexture=new n.BaseTexture(this.renderer.view),this.frame=new n.Rectangle(0,0,this.width,this.height),this.render=this.renderCanvas},n.RenderTexture.prototype.renderWebGL=function(t,e,i){var r=n.gl;r.colorMask(!0,!0,!0,!0),r.viewport(0,0,this.width,this.height),r.bindFramebuffer(r.FRAMEBUFFER,this.glFramebuffer),i&&(r.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT));var s=t.children;t.worldTransform=n.mat3.create(),t.worldTransform[4]=-1,t.worldTransform[5]=2*this.projection.y,e&&(t.worldTransform[2]=e.x,t.worldTransform[5]-=e.y);for(var a=0,o=s.length;o>a;a++)s[a].updateTransform();var h=t.__renderGroup;h?t==h.root?h.render(this.projection):h.renderSpecific(t,this.projection):(this.renderGroup||(this.renderGroup=new n.WebGLRenderGroup(r)),this.renderGroup.setRenderable(t),this.renderGroup.render(this.projection))},n.RenderTexture.prototype.renderCanvas=function(t,e,i){var r=t.children;t.worldTransform=n.mat3.create(),e&&(t.worldTransform[2]=e.x,t.worldTransform[5]=e.y);for(var s=0,a=r.length;a>s;s++)r[s].updateTransform();i&&this.renderer.context.clearRect(0,0,this.width,this.height),this.renderer.renderDisplayObject(t),this.renderer.context.setTransform(1,0,0,1,0,0)},n.AssetLoader=function(t,e){n.EventTarget.call(this),this.assetURLs=t,this.crossorigin=e,this.loadersByType={jpg:n.ImageLoader,jpeg:n.ImageLoader,png:n.ImageLoader,gif:n.ImageLoader,json:n.JsonLoader,anim:n.SpineLoader,xml:n.BitmapFontLoader,fnt:n.BitmapFontLoader}},n.AssetLoader.constructor=n.AssetLoader,n.AssetLoader.prototype.load=function(){var t=this;this.loadCount=this.assetURLs.length;for(var e=0;this.assetURLs.length>e;e++){var i=this.assetURLs[e],r=i.split(".").pop().toLowerCase(),n=this.loadersByType[r];if(!n)throw Error(r+" is an unsupported file type");var s=new n(i,this.crossorigin);s.addEventListener("loaded",function(){t.onAssetLoaded()}),s.load()}},n.AssetLoader.prototype.onAssetLoaded=function(){this.loadCount--,this.dispatchEvent({type:"onProgress",content:this}),this.onProgress&&this.onProgress(),0==this.loadCount&&(this.dispatchEvent({type:"onComplete",content:this}),this.onComplete&&this.onComplete())},n.JsonLoader=function(t,e){n.EventTarget.call(this),this.url=t,this.crossorigin=e,this.baseUrl=t.replace(/[^\/]*$/,""),this.loaded=!1},n.JsonLoader.constructor=n.JsonLoader,n.JsonLoader.prototype.load=function(){this.ajaxRequest=new l;var t=this;this.ajaxRequest.onreadystatechange=function(){t.onJSONLoaded()},this.ajaxRequest.open("GET",this.url,!0),this.ajaxRequest.overrideMimeType&&this.ajaxRequest.overrideMimeType("application/json"),this.ajaxRequest.send(null)},n.JsonLoader.prototype.onJSONLoaded=function(){if(4==this.ajaxRequest.readyState)if(200==this.ajaxRequest.status||-1==window.location.href.indexOf("http"))if(this.json=JSON.parse(this.ajaxRequest.responseText),this.json.frames){var t=this,e=this.baseUrl+this.json.meta.image,i=new n.ImageLoader(e,this.crossorigin),r=this.json.frames;this.texture=i.texture.baseTexture,i.addEventListener("loaded",function(){t.onLoaded()});for(var s in r){var a=r[s].frame;a&&(n.TextureCache[s]=new n.Texture(this.texture,{x:a.x,y:a.y,width:a.w,height:a.h}),r[s].trimmed&&(n.TextureCache[s].realSize=r[s].spriteSourceSize,n.TextureCache[s].trim.x=0))}i.load()}else if(this.json.bones){var o=new u.SkeletonJson,h=o.readSkeletonData(this.json);n.AnimCache[this.url]=h,this.onLoaded()}else this.onLoaded();else this.onError()},n.JsonLoader.prototype.onLoaded=function(){this.loaded=!0,this.dispatchEvent({type:"loaded",content:this})},n.JsonLoader.prototype.onError=function(){this.dispatchEvent({type:"error",content:this})},n.SpriteSheetLoader=function(t,e){n.EventTarget.call(this),this.url=t,this.crossorigin=e,this.baseUrl=t.replace(/[^\/]*$/,""),this.texture=null,this.frames={}},n.SpriteSheetLoader.constructor=n.SpriteSheetLoader,n.SpriteSheetLoader.prototype.load=function(){var t=this,e=new n.JsonLoader(this.url,this.crossorigin);e.addEventListener("loaded",function(e){t.json=e.content.json,t.onJSONLoaded()}),e.load()},n.SpriteSheetLoader.prototype.onJSONLoaded=function(){var t=this,e=this.baseUrl+this.json.meta.image,i=new n.ImageLoader(e,this.crossorigin),r=this.json.frames;this.texture=i.texture.baseTexture,i.addEventListener("loaded",function(){t.onLoaded()});for(var s in r){var a=r[s].frame;a&&(n.TextureCache[s]=new n.Texture(this.texture,{x:a.x,y:a.y,width:a.w,height:a.h}),r[s].trimmed&&(n.TextureCache[s].realSize=r[s].spriteSourceSize,n.TextureCache[s].trim.x=0))}i.load()},n.SpriteSheetLoader.prototype.onLoaded=function(){this.dispatchEvent({type:"loaded",content:this})},n.ImageLoader=function(t,e){n.EventTarget.call(this),this.texture=n.Texture.fromImage(t,e)},n.ImageLoader.constructor=n.ImageLoader,n.ImageLoader.prototype.load=function(){if(this.texture.baseTexture.hasLoaded)this.onLoaded();else{var t=this;this.texture.baseTexture.addEventListener("loaded",function(){t.onLoaded()})}},n.ImageLoader.prototype.onLoaded=function(){this.dispatchEvent({type:"loaded",content:this})},n.BitmapFontLoader=function(t,e){n.EventTarget.call(this),this.url=t,this.crossorigin=e,this.baseUrl=t.replace(/[^\/]*$/,""),this.texture=null},n.BitmapFontLoader.constructor=n.BitmapFontLoader,n.BitmapFontLoader.prototype.load=function(){this.ajaxRequest=new XMLHttpRequest;var t=this;this.ajaxRequest.onreadystatechange=function(){t.onXMLLoaded()},this.ajaxRequest.open("GET",this.url,!0),this.ajaxRequest.overrideMimeType&&this.ajaxRequest.overrideMimeType("application/xml"),this.ajaxRequest.send(null)},n.BitmapFontLoader.prototype.onXMLLoaded=function(){if(4==this.ajaxRequest.readyState&&(200==this.ajaxRequest.status||-1==window.location.href.indexOf("http"))){var t=this.baseUrl+this.ajaxRequest.responseXML.getElementsByTagName("page")[0].attributes.getNamedItem("file").nodeValue,e=new n.ImageLoader(t,this.crossorigin);this.texture=e.texture.baseTexture;var i={},r=this.ajaxRequest.responseXML.getElementsByTagName("info")[0],s=this.ajaxRequest.responseXML.getElementsByTagName("common")[0];i.font=r.attributes.getNamedItem("face").nodeValue,i.size=parseInt(r.attributes.getNamedItem("size").nodeValue,10),i.lineHeight=parseInt(s.attributes.getNamedItem("lineHeight").nodeValue,10),i.chars={};for(var a=this.ajaxRequest.responseXML.getElementsByTagName("char"),o=0;a.length>o;o++){var h=parseInt(a[o].attributes.getNamedItem("id").nodeValue,10),l={x:parseInt(a[o].attributes.getNamedItem("x").nodeValue,10),y:parseInt(a[o].attributes.getNamedItem("y").nodeValue,10),width:parseInt(a[o].attributes.getNamedItem("width").nodeValue,10),height:parseInt(a[o].attributes.getNamedItem("height").nodeValue,10)};n.TextureCache[h]=new n.Texture(this.texture,l),i.chars[h]={xOffset:parseInt(a[o].attributes.getNamedItem("xoffset").nodeValue,10),yOffset:parseInt(a[o].attributes.getNamedItem("yoffset").nodeValue,10),xAdvance:parseInt(a[o].attributes.getNamedItem("xadvance").nodeValue,10),kerning:{},texture:new n.Texture(this.texture,l)}}var u=this.ajaxRequest.responseXML.getElementsByTagName("kerning");for(o=0;u.length>o;o++){var c=parseInt(u[o].attributes.getNamedItem("first").nodeValue,10),d=parseInt(u[o].attributes.getNamedItem("second").nodeValue,10),p=parseInt(u[o].attributes.getNamedItem("amount").nodeValue,10);i.chars[d].kerning[c]=p}n.BitmapText.fonts[i.font]=i;var f=this;e.addEventListener("loaded",function(){f.onLoaded()}),e.load()}},n.BitmapFontLoader.prototype.onLoaded=function(){this.dispatchEvent({type:"loaded",content:this})},n.SpineLoader=function(t,e){n.EventTarget.call(this),this.url=t,this.crossorigin=e,this.loaded=!1},n.SpineLoader.constructor=n.SpineLoader,n.SpineLoader.prototype.load=function(){var t=this,e=new n.JsonLoader(this.url,this.crossorigin);e.addEventListener("loaded",function(e){t.json=e.content.json,t.onJSONLoaded()}),e.load()},n.SpineLoader.prototype.onJSONLoaded=function(){var t=new u.SkeletonJson,e=t.readSkeletonData(this.json);n.AnimCache[this.url]=e,this.onLoaded()},n.SpineLoader.prototype.onLoaded=function(){this.loaded=!0,this.dispatchEvent({type:"loaded",content:this})},"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=n),exports.PIXI=n):i.PIXI=n}).call(this); \ No newline at end of file +(function(){function t(){return n.Matrix="undefined"!=typeof Float32Array?Float32Array:Array,n.Matrix}function e(t){return[(255&t>>16)/255,(255&t>>8)/255,(255&t)/255]}function e(t){return[(255&t>>16)/255,(255&t>>8)/255,(255&t)/255]}var i=this,n=n||{};n.Point=function(t,e){this.x=t||0,this.y=e||0},n.Point.prototype.clone=function(){return new n.Point(this.x,this.y)},n.Point.constructor=n.Point,n.Rectangle=function(t,e,i,r){this.x=t||0,this.y=e||0,this.width=i||0,this.height=r||0},n.Rectangle.prototype.clone=function(){return new n.Rectangle(this.x,this.y,this.width,this.height)},n.Rectangle.prototype.contains=function(t,e){if(0>=this.width||0>=this.height)return!1;var i=this.x;if(t>i&&i+this.width>t){var r=this.y;if(e>r&&r+this.height>e)return!0}return!1},n.Rectangle.constructor=n.Rectangle,n.Polygon=function(t){if(t instanceof Array||(t=Array.prototype.slice.call(arguments)),"number"==typeof t[0]){for(var e=[],i=0,r=t.length;r>i;i+=2)e.push(new n.Point(t[i],t[i+1]));t=e}this.points=t},n.Polygon.prototype.clone=function(){for(var t=[],e=0;this.points.length>e;e++)t.push(this.points[e].clone());return new n.Polygon(t)},n.Polygon.prototype.contains=function(t,e){for(var i=!1,r=0,n=this.points.length-1;this.points.length>r;n=r++){var s=this.points[r].x,a=this.points[r].y,o=this.points[n].x,h=this.points[n].y,l=a>e!=h>e&&(o-s)*(e-a)/(h-a)+s>t;l&&(i=!i)}return i},n.Polygon.constructor=n.Polygon,n.Circle=function(t,e,i){this.x=t||0,this.y=e||0,this.radius=i||0},n.Circle.prototype.clone=function(){return new n.Circle(this.x,this.y,this.radius)},n.Circle.prototype.contains=function(t,e){if(0>=this.radius)return!1;var i=this.x-t,r=this.y-e,n=this.radius*this.radius;return i*=i,r*=r,n>=i+r},n.Circle.constructor=n.Circle,n.Ellipse=function(t,e,i,r){this.x=t||0,this.y=e||0,this.width=i||0,this.height=r||0},n.Ellipse.prototype.clone=function(){return new n.Ellipse(this.x,this.y,this.width,this.height)},n.Ellipse.prototype.contains=function(t,e){if(0>=this.width||0>=this.height)return!1;var i=(t-this.x)/this.width-.5,r=(e-this.y)/this.height-.5;return i*=i,r*=r,.25>i+r},n.Ellipse.getBounds=function(){return new n.Rectangle(this.x,this.y,this.width,this.height)},n.Ellipse.constructor=n.Ellipse,t(),n.mat3={},n.mat3.create=function(){var t=new n.Matrix(9);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},n.mat3.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},n.mat4={},n.mat4.create=function(){var t=new n.Matrix(16);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},n.mat3.multiply=function(t,e,i){i||(i=t);var r=t[0],n=t[1],s=t[2],a=t[3],o=t[4],h=t[5],l=t[6],u=t[7],c=t[8],d=e[0],p=e[1],f=e[2],v=e[3],m=e[4],g=e[5],x=e[6],b=e[7],y=e[8];return i[0]=d*r+p*a+f*l,i[1]=d*n+p*o+f*u,i[2]=d*s+p*h+f*c,i[3]=v*r+m*a+g*l,i[4]=v*n+m*o+g*u,i[5]=v*s+m*h+g*c,i[6]=x*r+b*a+y*l,i[7]=x*n+b*o+y*u,i[8]=x*s+b*h+y*c,i},n.mat3.clone=function(t){var e=new n.Matrix(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e},n.mat3.transpose=function(t,e){if(!e||t===e){var i=t[1],r=t[2],n=t[5];return t[1]=t[3],t[2]=t[6],t[3]=i,t[5]=t[7],t[6]=r,t[7]=n,t}return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],e},n.mat3.toMat4=function(t,e){return e||(e=n.mat4.create()),e[15]=1,e[14]=0,e[13]=0,e[12]=0,e[11]=0,e[10]=t[8],e[9]=t[7],e[8]=t[6],e[7]=0,e[6]=t[5],e[5]=t[4],e[4]=t[3],e[3]=0,e[2]=t[2],e[1]=t[1],e[0]=t[0],e},n.mat4.create=function(){var t=new n.Matrix(16);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},n.mat4.transpose=function(t,e){if(!e||t===e){var i=t[1],r=t[2],n=t[3],s=t[6],a=t[7],o=t[11];return t[1]=t[4],t[2]=t[8],t[3]=t[12],t[4]=i,t[6]=t[9],t[7]=t[13],t[8]=r,t[9]=s,t[11]=t[14],t[12]=n,t[13]=a,t[14]=o,t}return e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15],e},n.mat4.multiply=function(t,e,i){i||(i=t);var r=t[0],n=t[1],s=t[2],a=t[3],o=t[4],h=t[5],l=t[6],u=t[7],c=t[8],d=t[9],p=t[10],f=t[11],v=t[12],m=t[13],g=t[14],x=t[15],b=e[0],y=e[1],T=e[2],_=e[3];return i[0]=b*r+y*o+T*c+_*v,i[1]=b*n+y*h+T*d+_*m,i[2]=b*s+y*l+T*p+_*g,i[3]=b*a+y*u+T*f+_*x,b=e[4],y=e[5],T=e[6],_=e[7],i[4]=b*r+y*o+T*c+_*v,i[5]=b*n+y*h+T*d+_*m,i[6]=b*s+y*l+T*p+_*g,i[7]=b*a+y*u+T*f+_*x,b=e[8],y=e[9],T=e[10],_=e[11],i[8]=b*r+y*o+T*c+_*v,i[9]=b*n+y*h+T*d+_*m,i[10]=b*s+y*l+T*p+_*g,i[11]=b*a+y*u+T*f+_*x,b=e[12],y=e[13],T=e[14],_=e[15],i[12]=b*r+y*o+T*c+_*v,i[13]=b*n+y*h+T*d+_*m,i[14]=b*s+y*l+T*p+_*g,i[15]=b*a+y*u+T*f+_*x,i},n.DisplayObject=function(){this.last=this,this.first=this,this.position=new n.Point,this.scale=new n.Point(1,1),this.pivot=new n.Point(0,0),this.rotation=0,this.alpha=1,this.visible=!0,this.hitArea=null,this.buttonMode=!1,this.renderable=!1,this.worldVisible=!1,this.parent=null,this.stage=null,this.childIndex=0,this.worldAlpha=1,this._interactive=!1,this.worldTransform=n.mat3.create(),this.localTransform=n.mat3.create(),this.color=[],this.dynamic=!0,this._sr=0,this._cr=1},n.DisplayObject.constructor=n.DisplayObject,n.DisplayObject.prototype.setInteractive=function(t){this.interactive=t},Object.defineProperty(n.DisplayObject.prototype,"interactive",{get:function(){return this._interactive},set:function(t){this._interactive=t,this.stage&&(this.stage.dirty=!0)}}),Object.defineProperty(n.DisplayObject.prototype,"mask",{get:function(){return this._mask},set:function(t){this._mask=t,t?this.addFilter(t):this.removeFilter()}}),n.DisplayObject.prototype.addFilter=function(t){if(!this.filter){this.filter=!0;var e=new n.FilterBlock,i=new n.FilterBlock;e.mask=t,i.mask=t,e.first=e.last=this,i.first=i.last=this,e.open=!0;var r,s,a=e,o=e;s=this.first._iPrev,s?(r=s._iNext,a._iPrev=s,s._iNext=a):r=this,r&&(r._iPrev=o,o._iNext=r);var a=i,o=i,r=null,s=null;s=this.last,r=s._iNext,r&&(r._iPrev=o,o._iNext=r),a._iPrev=s,s._iNext=a;for(var h=this,l=this.last;h;)h.last==l&&(h.last=i),h=h.parent;this.first=e,this.__renderGroup&&this.__renderGroup.addFilterBlocks(e,i),t.renderable=!1}},n.DisplayObject.prototype.removeFilter=function(){if(this.filter){this.filter=!1;var t=this.first,e=t._iNext,i=t._iPrev;e&&(e._iPrev=i),i&&(i._iNext=e),this.first=t._iNext;var r=this.last,e=r._iNext,i=r._iPrev;e&&(e._iPrev=i),i._iNext=e;for(var n=r._iPrev,s=this;s.last==r&&(s.last=n,s=s.parent););var a=t.mask;a.renderable=!0,this.__renderGroup&&this.__renderGroup.removeFilterBlocks(t,r)}},n.DisplayObject.prototype.updateTransform=function(){this.rotation!=this.rotationCache&&(this.rotationCache=this.rotation,this._sr=Math.sin(this.rotation),this._cr=Math.cos(this.rotation));var t=this.localTransform,e=this.parent.worldTransform,i=this.worldTransform;t[0]=this._cr*this.scale.x,t[1]=-this._sr*this.scale.y,t[3]=this._sr*this.scale.x,t[4]=this._cr*this.scale.y;var r=this.pivot.x,n=this.pivot.y,s=t[0],a=t[1],o=this.position.x-t[0]*r-n*t[1],h=t[3],l=t[4],u=this.position.y-t[4]*n-r*t[3],c=e[0],d=e[1],p=e[2],f=e[3],v=e[4],m=e[5];t[2]=o,t[5]=u,i[0]=c*s+d*h,i[1]=c*a+d*l,i[2]=c*o+d*u+p,i[3]=f*s+v*h,i[4]=f*a+v*l,i[5]=f*o+v*u+m,this.worldAlpha=this.alpha*this.parent.worldAlpha},n.DisplayObjectContainer=function(){n.DisplayObject.call(this),this.children=[]},n.DisplayObjectContainer.prototype=Object.create(n.DisplayObject.prototype),n.DisplayObjectContainer.prototype.addChild=function(t){if(void 0!=t.parent&&t.parent.removeChild(t),t.parent=this,t.childIndex=this.children.length,this.children.push(t),this.stage){var e=t;do e.interactive&&(this.stage.dirty=!0),e.stage=this.stage,e=e._iNext;while(e)}var i,r,n=t.first,s=t.last;r=this.filter?this.last._iPrev:this.last,i=r._iNext;for(var a=this,o=r;a;)a.last==o&&(a.last=t.last),a=a.parent;i&&(i._iPrev=s,s._iNext=i),n._iPrev=r,r._iNext=n,this.__renderGroup&&(t.__renderGroup&&t.__renderGroup.removeDisplayObjectAndChildren(t),this.__renderGroup.addDisplayObjectAndChildren(t))},n.DisplayObjectContainer.prototype.addChildAt=function(t,e){if(!(e>=0&&this.children.length>=e))throw Error(t+" The index "+e+" supplied is out of bounds "+this.children.length);if(void 0!=t.parent&&t.parent.removeChild(t),t.parent=this,this.stage){var i=t;do i.interactive&&(this.stage.dirty=!0),i.stage=this.stage,i=i._iNext;while(i)}var r,n,s=t.first,a=t.last;if(e==this.children.length){n=this.last;for(var o=this,h=this.last;o;)o.last==h&&(o.last=t.last),o=o.parent}else n=0==e?this:this.children[e-1].last;r=n._iNext,r&&(r._iPrev=a,a._iNext=r),s._iPrev=n,n._iNext=s,this.children.splice(e,0,t),this.__renderGroup&&(t.__renderGroup&&t.__renderGroup.removeDisplayObjectAndChildren(t),this.__renderGroup.addDisplayObjectAndChildren(t))},n.DisplayObjectContainer.prototype.swapChildren=function(){},n.DisplayObjectContainer.prototype.getChildAt=function(t){if(t>=0&&this.children.length>t)return this.children[t];throw Error(child+" Both the supplied DisplayObjects must be a child of the caller "+this)},n.DisplayObjectContainer.prototype.removeChild=function(t){var e=this.children.indexOf(t);if(-1===e)throw Error(t+" The supplied DisplayObject must be a child of the caller "+this);var i=t.first,r=t.last,n=r._iNext,s=i._iPrev;if(n&&(n._iPrev=s),s._iNext=n,this.last==r)for(var a=i._iPrev,o=this;o.last==r.last&&(o.last=a,o=o.parent););if(r._iNext=null,i._iPrev=null,this.stage){var h=t;do h.interactive&&(this.stage.dirty=!0),h.stage=null,h=h._iNext;while(h)}t.__renderGroup&&t.__renderGroup.removeDisplayObjectAndChildren(t),t.parent=void 0,this.children.splice(e,1)},n.DisplayObjectContainer.prototype.updateTransform=function(){if(this.visible){n.DisplayObject.prototype.updateTransform.call(this);for(var t=0,e=this.children.length;e>t;t++)this.children[t].updateTransform()}},n.blendModes={},n.blendModes.NORMAL=0,n.blendModes.SCREEN=1,n.Sprite=function(t){n.DisplayObjectContainer.call(this),this.anchor=new n.Point,this.texture=t,this.blendMode=n.blendModes.NORMAL,this._width=0,this._height=0,t.baseTexture.hasLoaded?this.updateFrame=!0:(this.onTextureUpdateBind=this.onTextureUpdate.bind(this),this.texture.addEventListener("update",this.onTextureUpdateBind)),this.renderable=!0},n.Sprite.constructor=n.Sprite,n.Sprite.prototype=Object.create(n.DisplayObjectContainer.prototype),Object.defineProperty(n.Sprite.prototype,"width",{get:function(){return this.scale.x*this.texture.frame.width},set:function(t){this.scale.x=t/this.texture.frame.width,this._width=t}}),Object.defineProperty(n.Sprite.prototype,"height",{get:function(){return this.scale.y*this.texture.frame.height},set:function(t){this.scale.y=t/this.texture.frame.height,this._height=t}}),n.Sprite.prototype.setTexture=function(t){this.texture.baseTexture!=t.baseTexture&&(this.textureChange=!0),this.texture=t,this.updateFrame=!0},n.Sprite.prototype.onTextureUpdate=function(){this._width&&(this.scale.x=this._width/this.texture.frame.width),this._height&&(this.scale.y=this._height/this.texture.frame.height),this.updateFrame=!0},n.Sprite.fromFrame=function(t){var e=n.TextureCache[t];if(!e)throw Error("The frameId '"+t+"' does not exist in the texture cache"+this);return new n.Sprite(e)},n.Sprite.fromImage=function(t){var e=n.Texture.fromImage(t);return new n.Sprite(e)},n.MovieClip=function(t){n.Sprite.call(this,t[0]),this.textures=t,this.animationSpeed=1,this.loop=!0,this.onComplete=null,this.currentFrame=0,this.playing=!1},n.MovieClip.constructor=n.MovieClip,n.MovieClip.prototype=Object.create(n.Sprite.prototype),n.MovieClip.prototype.stop=function(){this.playing=!1},n.MovieClip.prototype.play=function(){this.playing=!0},n.MovieClip.prototype.gotoAndStop=function(t){this.playing=!1,this.currentFrame=t;var e=0|this.currentFrame+.5;this.setTexture(this.textures[e%this.textures.length])},n.MovieClip.prototype.gotoAndPlay=function(t){this.currentFrame=t,this.playing=!0},n.MovieClip.prototype.updateTransform=function(){if(n.Sprite.prototype.updateTransform.call(this),this.playing){this.currentFrame+=this.animationSpeed;var t=0|this.currentFrame+.5;this.loop||this.textures.length>t?this.setTexture(this.textures[t%this.textures.length]):t>=this.textures.length&&(this.gotoAndStop(this.textures.length-1),this.onComplete&&this.onComplete())}},n.FilterBlock=function(t){this.graphics=t,this.visible=!0,this.renderable=!0},n.Text=function(t,e){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"),n.Sprite.call(this,n.Texture.fromCanvas(this.canvas)),this.setText(t),this.setStyle(e),this.updateText(),this.dirty=!1},n.Text.constructor=n.Text,n.Text.prototype=Object.create(n.Sprite.prototype),n.Text.prototype.setStyle=function(t){t=t||{},t.font=t.font||"bold 20pt Arial",t.fill=t.fill||"black",t.align=t.align||"left",t.stroke=t.stroke||"black",t.strokeThickness=t.strokeThickness||0,t.wordWrap=t.wordWrap||!1,t.wordWrapWidth=t.wordWrapWidth||100,this.style=t,this.dirty=!0},n.Sprite.prototype.setText=function(t){this.text=""+t||" ",this.dirty=!0},n.Text.prototype.updateText=function(){this.context.font=this.style.font;var t=this.text;this.style.wordWrap&&(t=this.wordWrap(this.text));for(var e=t.split(/(?:\r\n|\r|\n)/),i=[],r=0,s=0;e.length>s;s++){var a=this.context.measureText(e[s]).width;i[s]=a,r=Math.max(r,a)}this.canvas.width=r+this.style.strokeThickness;var o=this.determineFontHeight("font: "+this.style.font+";")+this.style.strokeThickness;for(this.canvas.height=o*e.length,this.context.fillStyle=this.style.fill,this.context.font=this.style.font,this.context.strokeStyle=this.style.stroke,this.context.lineWidth=this.style.strokeThickness,this.context.textBaseline="top",s=0;e.length>s;s++){var h=new n.Point(this.style.strokeThickness/2,this.style.strokeThickness/2+s*o);"right"==this.style.align?h.x+=r-i[s]:"center"==this.style.align&&(h.x+=(r-i[s])/2),this.style.stroke&&this.style.strokeThickness&&this.context.strokeText(e[s],h.x,h.y),this.style.fill&&this.context.fillText(e[s],h.x,h.y)}this.updateTexture()},n.Text.prototype.updateTexture=function(){this.texture.baseTexture.width=this.canvas.width,this.texture.baseTexture.height=this.canvas.height,this.texture.frame.width=this.canvas.width,this.texture.frame.height=this.canvas.height,this._width=this.canvas.width,this._height=this.canvas.height,n.texturesToUpdate.push(this.texture.baseTexture)},n.Text.prototype.updateTransform=function(){this.dirty&&(this.updateText(),this.dirty=!1),n.Sprite.prototype.updateTransform.call(this)},n.Text.prototype.determineFontHeight=function(t){var e=n.Text.heightCache[t];if(!e){var i=document.getElementsByTagName("body")[0],r=document.createElement("div"),s=document.createTextNode("M");r.appendChild(s),r.setAttribute("style",t+";position:absolute;top:0;left:0"),i.appendChild(r),e=r.offsetHeight,n.Text.heightCache[t]=e,i.removeChild(r)}return e},n.Text.prototype.wordWrap=function(t){for(var e=function(t,e,i,r,n){var s=Math.floor((r-i)/2)+i;return s==i?1:n>=t.measureText(e.substring(0,s)).width?t.measureText(e.substring(0,s+1)).width>n?s:arguments.callee(t,e,s,r,n):arguments.callee(t,e,i,s,n)},i=function(t,i,r){if(r>=t.measureText(i).width||1>i.length)return i;var n=e(t,i,0,i.length,r);return i.substring(0,n)+"\n"+arguments.callee(t,i.substring(n),r)},r="",n=t.split("\n"),s=0;n.length>s;s++)r+=i(this.context,n[s],this.style.wordWrapWidth)+"\n";return r},n.Text.prototype.destroy=function(t){t&&this.texture.destroy()},n.Text.heightCache={},n.BitmapText=function(t,e){n.DisplayObjectContainer.call(this),this.setText(t),this.setStyle(e),this.updateText(),this.dirty=!1},n.BitmapText.constructor=n.BitmapText,n.BitmapText.prototype=Object.create(n.DisplayObjectContainer.prototype),n.BitmapText.prototype.setText=function(t){this.text=t||" ",this.dirty=!0},n.BitmapText.prototype.setStyle=function(t){t=t||{},t.align=t.align||"left",this.style=t;var e=t.font.split(" ");this.fontName=e[e.length-1],this.fontSize=e.length>=2?parseInt(e[e.length-2],10):n.BitmapText.fonts[this.fontName].size,this.dirty=!0},n.BitmapText.prototype.updateText=function(){for(var t=n.BitmapText.fonts[this.fontName],e=new n.Point,i=null,r=[],s=0,a=[],o=0,h=this.fontSize/t.size,l=0;this.text.length>l;l++){var u=this.text.charCodeAt(l);if(/(?:\r\n|\r|\n)/.test(this.text.charAt(l)))a.push(e.x),s=Math.max(s,e.x),o++,e.x=0,e.y+=t.lineHeight,i=null;else{var c=t.chars[u];c&&(i&&c[i]&&(e.x+=c.kerning[i]),r.push({texture:c.texture,line:o,charCode:u,position:new n.Point(e.x+c.xOffset,e.y+c.yOffset)}),e.x+=c.xAdvance,i=u)}}a.push(e.x),s=Math.max(s,e.x);var d=[];for(l=0;o>=l;l++){var p=0;"right"==this.style.align?p=s-a[l]:"center"==this.style.align&&(p=(s-a[l])/2),d.push(p)}for(l=0;r.length>l;l++){var f=new n.Sprite(r[l].texture);f.position.x=(r[l].position.x+d[r[l].line])*h,f.position.y=r[l].position.y*h,f.scale.x=f.scale.y=h,this.addChild(f)}this.width=e.x*h,this.height=(e.y+t.lineHeight)*h},n.BitmapText.prototype.updateTransform=function(){if(this.dirty){for(;this.children.length>0;)this.removeChild(this.getChildAt(0));this.updateText(),this.dirty=!1}n.DisplayObjectContainer.prototype.updateTransform.call(this)},n.BitmapText.fonts={},n.InteractionManager=function(t){this.stage=t,this.mouse=new n.InteractionData,this.touchs={},this.tempPoint=new n.Point,this.mouseoverEnabled=!0,this.pool=[],this.interactiveItems=[],this.last=0},n.InteractionManager.constructor=n.InteractionManager,n.InteractionManager.prototype.collectInteractiveSprite=function(t,e){for(var i=t.children,r=i.length,n=r-1;n>=0;n--){var s=i[n];s.visible&&(s.interactive?(e.interactiveChildren=!0,this.interactiveItems.push(s),s.children.length>0&&this.collectInteractiveSprite(s,s)):(s.__iParent=null,s.children.length>0&&this.collectInteractiveSprite(s,e)))}},n.InteractionManager.prototype.setTarget=function(t){window.navigator.msPointerEnabled&&(t.view.style["-ms-content-zooming"]="none",t.view.style["-ms-touch-action"]="none"),this.target=t,t.view.addEventListener("mousemove",this.onMouseMove.bind(this),!0),t.view.addEventListener("mousedown",this.onMouseDown.bind(this),!0),document.body.addEventListener("mouseup",this.onMouseUp.bind(this),!0),t.view.addEventListener("mouseout",this.onMouseUp.bind(this),!0),t.view.addEventListener("touchstart",this.onTouchStart.bind(this),!0),t.view.addEventListener("touchend",this.onTouchEnd.bind(this),!0),t.view.addEventListener("touchmove",this.onTouchMove.bind(this),!0)},n.InteractionManager.prototype.update=function(){if(this.target){var t=Date.now(),e=t-this.last;if(e=30*e/1e3,!(1>e)){if(this.last=t,this.dirty){this.dirty=!1;for(var i=this.interactiveItems.length,r=0;i>r;r++)this.interactiveItems[r].interactiveChildren=!1;this.interactiveItems=[],this.stage.interactive&&this.interactiveItems.push(this.stage),this.collectInteractiveSprite(this.stage,this.stage)}var n=this.interactiveItems.length;this.target.view.style.cursor="default";for(var r=0;n>r;r++){var s=this.interactiveItems[r];s.visible&&(s.mouseover||s.mouseout||s.buttonMode)&&(s.__hit=this.hitTest(s,this.mouse),this.mouse.target=s,s.__hit?(s.buttonMode&&(this.target.view.style.cursor="pointer"),s.__isOver||(s.mouseover&&s.mouseover(this.mouse),s.__isOver=!0)):s.__isOver&&(s.mouseout&&s.mouseout(this.mouse),s.__isOver=!1))}}}},n.InteractionManager.prototype.onMouseMove=function(t){this.mouse.originalEvent=t||window.event;var e=this.target.view.getBoundingClientRect();this.mouse.global.x=(t.clientX-e.left)*(this.target.width/e.width),this.mouse.global.y=(t.clientY-e.top)*(this.target.height/e.height);var i=this.interactiveItems.length;this.mouse.global;for(var r=0;i>r;r++){var n=this.interactiveItems[r];n.mousemove&&n.mousemove(this.mouse)}},n.InteractionManager.prototype.onMouseDown=function(t){t.preventDefault(),this.mouse.originalEvent=t||window.event;var e=this.interactiveItems.length;this.mouse.global,this.stage;for(var i=0;e>i;i++){var r=this.interactiveItems[i];if((r.mousedown||r.click)&&(r.__mouseIsDown=!0,r.__hit=this.hitTest(r,this.mouse),r.__hit&&(r.mousedown&&r.mousedown(this.mouse),r.__isDown=!0,!r.interactiveChildren)))break}},n.InteractionManager.prototype.onMouseUp=function(t){this.mouse.originalEvent=t||window.event,this.mouse.global;for(var e=this.interactiveItems.length,i=!1,r=0;e>r;r++){var n=this.interactiveItems[r];(n.mouseup||n.mouseupoutside||n.click)&&(n.__hit=this.hitTest(n,this.mouse),n.__hit&&!i?(n.mouseup&&n.mouseup(this.mouse),n.__isDown&&n.click&&n.click(this.mouse),n.interactiveChildren||(i=!0)):n.__isDown&&n.mouseupoutside&&n.mouseupoutside(this.mouse),n.__isDown=!1)}},n.InteractionManager.prototype.hitTest=function(t,e){var i=e.global;if(!t.visible)return!1;var r=t instanceof n.Sprite,s=t.worldTransform,a=s[0],o=s[1],h=s[2],l=s[3],u=s[4],c=s[5],d=1/(a*u+o*-l),p=u*d*i.x+-o*d*i.y+(c*o-h*u)*d,f=a*d*i.y+-l*d*i.x+(-c*a+h*l)*d;if(e.target=t,t.hitArea&&t.hitArea.contains)return t.hitArea.contains(p,f)?(e.target=t,!0):!1;if(r){var v,m=t.texture.frame.width,g=t.texture.frame.height,x=-m*t.anchor.x;if(p>x&&x+m>p&&(v=-g*t.anchor.y,f>v&&v+g>f))return e.target=t,!0}for(var b=t.children.length,y=0;b>y;y++){var T=t.children[y],_=this.hitTest(T,e);if(_)return e.target=t,!0}return!1},n.InteractionManager.prototype.onTouchMove=function(t){this.mouse.originalEvent=t||window.event;for(var e=this.target.view.getBoundingClientRect(),i=t.changedTouches,r=0;i.length>r;r++){var n=i[r],s=this.touchs[n.identifier];s.global.x=(n.clientX-e.left)*(this.target.width/e.width),s.global.y=(n.clientY-e.top)*(this.target.height/e.height)}for(var a=this.interactiveItems.length,r=0;a>r;r++){var o=this.interactiveItems[r];o.touchmove&&o.touchmove(s)}},n.InteractionManager.prototype.onTouchStart=function(t){t.preventDefault(),this.mouse.originalEvent=t||window.event;for(var e=this.target.view.getBoundingClientRect(),i=t.changedTouches,r=0;i.length>r;r++){var s=i[r],a=this.pool.pop();a||(a=new n.InteractionData),this.touchs[s.identifier]=a,a.global.x=(s.clientX-e.left)*(this.target.width/e.width),a.global.y=(s.clientY-e.top)*(this.target.height/e.height);for(var o=this.interactiveItems.length,h=0;o>h;h++){var l=this.interactiveItems[h];if((l.touchstart||l.tap)&&(l.__hit=this.hitTest(l,a),l.__hit&&(l.touchstart&&l.touchstart(a),l.__isDown=!0,l.__touchData=a,!l.interactiveChildren)))break}}},n.InteractionManager.prototype.onTouchEnd=function(t){this.mouse.originalEvent=t||window.event;for(var e=this.target.view.getBoundingClientRect(),i=t.changedTouches,r=0;i.length>r;r++){var n=i[r],s=this.touchs[n.identifier],a=!1;s.global.x=(n.clientX-e.left)*(this.target.width/e.width),s.global.y=(n.clientY-e.top)*(this.target.height/e.height);for(var o=this.interactiveItems.length,h=0;o>h;h++){var l=this.interactiveItems[h],u=l.__touchData;l.__hit=this.hitTest(l,s),u==s&&((l.touchend||l.tap)&&(l.__hit&&!a?(l.touchend&&l.touchend(s),l.__isDown&&l.tap&&l.tap(s),l.interactiveChildren||(a=!0)):l.__isDown&&l.touchendoutside&&l.touchendoutside(s),l.__isDown=!1),l.__touchData=null)}this.pool.push(s),this.touchs[n.identifier]=null}},n.InteractionData=function(){this.global=new n.Point,this.local=new n.Point,this.target,this.originalEvent},n.InteractionData.prototype.getLocalPosition=function(t){var e=t.worldTransform,i=this.global,r=e[0],s=e[1],a=e[2],o=e[3],h=e[4],l=e[5],u=1/(r*h+s*-o);return new n.Point(h*u*i.x+-s*u*i.y+(l*s-a*h)*u,r*u*i.y+-o*u*i.x+(-l*r+a*o)*u)},n.InteractionData.constructor=n.InteractionData,n.Stage=function(t,e){n.DisplayObjectContainer.call(this),this.worldTransform=n.mat3.create(),this.interactive=e,this.interactionManager=new n.InteractionManager(this),this.dirty=!0,this.__childrenAdded=[],this.__childrenRemoved=[],this.stage=this,this.stage.hitArea=new n.Rectangle(0,0,1e5,1e5),this.setBackgroundColor(t),this.worldVisible=!0},n.Stage.constructor=n.Stage,n.Stage.prototype=Object.create(n.DisplayObjectContainer.prototype),n.Stage.prototype.updateTransform=function(){this.worldAlpha=1;for(var t=0,e=this.children.length;e>t;t++)this.children[t].updateTransform();this.dirty&&(this.dirty=!1,this.interactionManager.dirty=!0),this.interactive&&this.interactionManager.update()},n.Stage.prototype.setBackgroundColor=function(t){this.backgroundColor=t||0,this.backgroundColorSplit=e(this.backgroundColor);var i=this.backgroundColor.toString(16);i="000000".substr(0,6-i.length)+i,this.backgroundColorString="#"+i},n.Stage.prototype.getMousePosition=function(){return this.interactionManager.mouse.global};for(var s=0,o=["ms","moz","webkit","o"],h=0;o.length>h&&!window.requestAnimationFrame;++h)window.requestAnimationFrame=window[o[h]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[o[h]+"CancelAnimationFrame"]||window[o[h]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(t){var e=(new Date).getTime(),i=Math.max(0,16-(e-s)),r=window.setTimeout(function(){t(e+i)},i);return s=e+i,r}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)}),window.requestAnimFrame=window.requestAnimationFrame,"function"!=typeof Function.prototype.bind&&(Function.prototype.bind=function(){var t=Array.prototype.slice;return function(e){function i(){var s=n.concat(t.call(arguments));r.apply(this instanceof i?this:e,s)}var r=this,n=t.call(arguments,1);if("function"!=typeof r)throw new TypeError;return i.prototype=function s(t){return t&&(s.prototype=t),this instanceof s?void 0:new s}(r.prototype),i}}());var l=n.AjaxRequest=function(){var t=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(!window.ActiveXObject)return window.XMLHttpRequest?new XMLHttpRequest:!1;for(var e=0;t.length>e;e++)try{return new ActiveXObject(t[e])}catch(i){}};n.runList=function(t){console.log(">>>>>>>>>"),console.log("_");var e=0,i=t.first;for(console.log(i);i._iNext;)if(e++,i=i._iNext,console.log(i),e>100){console.log("BREAK");break}},n.EventTarget=function(){var t={};this.addEventListener=this.on=function(e,i){void 0===t[e]&&(t[e]=[]),-1===t[e].indexOf(i)&&t[e].push(i)},this.dispatchEvent=this.emit=function(e){for(var i in t[e.type])t[e.type][i](e)},this.removeEventListener=this.off=function(e,i){var r=t[e].indexOf(i);-1!==r&&t[e].splice(r,1)}},n.autoDetectRenderer=function(t,e,i,r){t||(t=800),e||(e=600);var s=function(){try{return!!window.WebGLRenderingContext&&!!document.createElement("canvas").getContext("experimental-webgl")}catch(t){return!1}}();return s?new n.WebGLRenderer(t,e,i,r):new n.CanvasRenderer(t,e,i,r)},n.PolyK={},n.PolyK.Triangulate=function(t){var e=!0,i=t.length>>1;if(3>i)return[];for(var r=[],s=[],a=0;i>a;a++)s.push(a);for(var a=0,o=i;o>3;){var h=s[(a+0)%o],l=s[(a+1)%o],u=s[(a+2)%o],c=t[2*h],d=t[2*h+1],p=t[2*l],f=t[2*l+1],v=t[2*u],m=t[2*u+1],g=!1;if(n.PolyK._convex(c,d,p,f,v,m,e)){g=!0;for(var x=0;o>x;x++){var b=s[x];if(b!=h&&b!=l&&b!=u&&n.PolyK._PointInTriangle(t[2*b],t[2*b+1],c,d,p,f,v,m)){g=!1;break}}}if(g)r.push(h,l,u),s.splice((a+1)%o,1),o--,a=0;else if(a++>3*o){if(!e)return console.log("PIXI Warning: shape too complex to fill"),[];var r=[];s=[];for(var a=0;i>a;a++)s.push(a);a=0,o=i,e=!1}}return r.push(s[0],s[1],s[2]),r},n.PolyK._PointInTriangle=function(t,e,i,r,n,s,a,o){var h=a-i,l=o-r,u=n-i,c=s-r,d=t-i,p=e-r,f=h*h+l*l,v=h*u+l*c,m=h*d+l*p,g=u*u+c*c,x=u*d+c*p,b=1/(f*g-v*v),y=(g*m-v*x)*b,T=(f*x-v*m)*b;return y>=0&&T>=0&&1>y+T},n.PolyK._convex=function(t,e,i,r,n,s,a){return(e-r)*(n-i)+(i-t)*(s-r)>=0==a},n.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;","}"],n.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform vec2 projectionVector;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position = vec4( aVertexPosition.x / projectionVector.x -1.0, aVertexPosition.y / -projectionVector.y + 1.0 , 0.0, 1.0);","vTextureCoord = aTextureCoord;","vColor = aColor;","}"],n.stripShaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform float alpha;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor = gl_FragColor * alpha;","}"],n.stripShaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat3 translationMatrix;","uniform vec2 projectionVector;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","vec3 v = translationMatrix * vec3(aVertexPosition, 1.0);","gl_Position = vec4( v.x / projectionVector.x -1.0, v.y / -projectionVector.y + 1.0 , 0.0, 1.0);","vTextureCoord = aTextureCoord;","vColor = aColor;","}"],n.primitiveShaderFragmentSrc=["precision mediump float;","varying vec4 vColor;","void main(void) {","gl_FragColor = vColor;","}"],n.primitiveShaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec4 aColor;","uniform mat3 translationMatrix;","uniform vec2 projectionVector;","uniform float alpha;","varying vec4 vColor;","void main(void) {","vec3 v = translationMatrix * vec3(aVertexPosition, 1.0);","gl_Position = vec4( v.x / projectionVector.x -1.0, v.y / -projectionVector.y + 1.0 , 0.0, 1.0);","vColor = aColor * alpha;","}"],n.initPrimitiveShader=function(){var t=n.gl,e=n.compileProgram(n.primitiveShaderVertexSrc,n.primitiveShaderFragmentSrc);t.useProgram(e),e.vertexPositionAttribute=t.getAttribLocation(e,"aVertexPosition"),e.colorAttribute=t.getAttribLocation(e,"aColor"),e.projectionVector=t.getUniformLocation(e,"projectionVector"),e.translationMatrix=t.getUniformLocation(e,"translationMatrix"),e.alpha=t.getUniformLocation(e,"alpha"),n.primitiveProgram=e},n.initDefaultShader=function(){var t=this.gl,e=n.compileProgram(n.shaderVertexSrc,n.shaderFragmentSrc);t.useProgram(e),e.vertexPositionAttribute=t.getAttribLocation(e,"aVertexPosition"),e.projectionVector=t.getUniformLocation(e,"projectionVector"),e.textureCoordAttribute=t.getAttribLocation(e,"aTextureCoord"),e.colorAttribute=t.getAttribLocation(e,"aColor"),e.samplerUniform=t.getUniformLocation(e,"uSampler"),n.shaderProgram=e},n.initDefaultStripShader=function(){var t=this.gl,e=n.compileProgram(n.stripShaderVertexSrc,n.stripShaderFragmentSrc);t.useProgram(e),e.vertexPositionAttribute=t.getAttribLocation(e,"aVertexPosition"),e.projectionVector=t.getUniformLocation(e,"projectionVector"),e.textureCoordAttribute=t.getAttribLocation(e,"aTextureCoord"),e.translationMatrix=t.getUniformLocation(e,"translationMatrix"),e.alpha=t.getUniformLocation(e,"alpha"),e.colorAttribute=t.getAttribLocation(e,"aColor"),e.projectionVector=t.getUniformLocation(e,"projectionVector"),e.samplerUniform=t.getUniformLocation(e,"uSampler"),n.stripShaderProgram=e},n.CompileVertexShader=function(t,e){return n._CompileShader(t,e,t.VERTEX_SHADER)},n.CompileFragmentShader=function(t,e){return n._CompileShader(t,e,t.FRAGMENT_SHADER)},n._CompileShader=function(t,e,i){var r=e.join("\n"),n=t.createShader(i);return t.shaderSource(n,r),t.compileShader(n),t.getShaderParameter(n,t.COMPILE_STATUS)?n:(alert(t.getShaderInfoLog(n)),null)},n.compileProgram=function(t,e){var i=n.gl,r=n.CompileFragmentShader(i,e),s=n.CompileVertexShader(i,t),a=i.createProgram();return i.attachShader(a,s),i.attachShader(a,r),i.linkProgram(a),i.getProgramParameter(a,i.LINK_STATUS)||alert("Could not initialise shaders"),a},n.activateDefaultShader=function(){var t=n.gl,e=n.shaderProgram;t.useProgram(e),t.enableVertexAttribArray(e.vertexPositionAttribute),t.enableVertexAttribArray(e.textureCoordAttribute),t.enableVertexAttribArray(e.colorAttribute)},n.activatePrimitiveShader=function(){var t=n.gl;t.disableVertexAttribArray(n.shaderProgram.textureCoordAttribute),t.disableVertexAttribArray(n.shaderProgram.colorAttribute),t.useProgram(n.primitiveProgram),t.enableVertexAttribArray(n.primitiveProgram.vertexPositionAttribute),t.enableVertexAttribArray(n.primitiveProgram.colorAttribute)},n.WebGLGraphics=function(){},n.WebGLGraphics.renderGraphics=function(t,e){var i=n.gl; +t._webGL||(t._webGL={points:[],indices:[],lastIndex:0,buffer:i.createBuffer(),indexBuffer:i.createBuffer()}),t.dirty&&(t.dirty=!1,t.clearDirty&&(t.clearDirty=!1,t._webGL.lastIndex=0,t._webGL.points=[],t._webGL.indices=[]),n.WebGLGraphics.updateGraphics(t)),n.activatePrimitiveShader();var r=n.mat3.clone(t.worldTransform);n.mat3.transpose(r),i.blendFunc(i.ONE,i.ONE_MINUS_SRC_ALPHA),i.uniformMatrix3fv(n.primitiveProgram.translationMatrix,!1,r),i.uniform2f(n.primitiveProgram.projectionVector,e.x,e.y),i.uniform1f(n.primitiveProgram.alpha,t.worldAlpha),i.bindBuffer(i.ARRAY_BUFFER,t._webGL.buffer),i.vertexAttribPointer(n.shaderProgram.vertexPositionAttribute,2,i.FLOAT,!1,0,0),i.vertexAttribPointer(n.primitiveProgram.vertexPositionAttribute,2,i.FLOAT,!1,24,0),i.vertexAttribPointer(n.primitiveProgram.colorAttribute,4,i.FLOAT,!1,24,8),i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,t._webGL.indexBuffer),i.drawElements(i.TRIANGLE_STRIP,t._webGL.indices.length,i.UNSIGNED_SHORT,0),n.activateDefaultShader()},n.WebGLGraphics.updateGraphics=function(t){for(var e=t._webGL.lastIndex;t.graphicsData.length>e;e++){var i=t.graphicsData[e];i.type==n.Graphics.POLY?(i.fill&&i.points.length>3&&n.WebGLGraphics.buildPoly(i,t._webGL),i.lineWidth>0&&n.WebGLGraphics.buildLine(i,t._webGL)):i.type==n.Graphics.RECT?n.WebGLGraphics.buildRectangle(i,t._webGL):(i.type==n.Graphics.CIRC||i.type==n.Graphics.ELIP)&&n.WebGLGraphics.buildCircle(i,t._webGL)}t._webGL.lastIndex=t.graphicsData.length;var r=n.gl;t._webGL.glPoints=new Float32Array(t._webGL.points),r.bindBuffer(r.ARRAY_BUFFER,t._webGL.buffer),r.bufferData(r.ARRAY_BUFFER,t._webGL.glPoints,r.STATIC_DRAW),t._webGL.glIndicies=new Uint16Array(t._webGL.indices),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,t._webGL.indexBuffer),r.bufferData(r.ELEMENT_ARRAY_BUFFER,t._webGL.glIndicies,r.STATIC_DRAW)},n.WebGLGraphics.buildRectangle=function(t,i){var r=t.points,s=r[0],a=r[1],o=r[2],h=r[3];if(t.fill){var l=e(t.fillColor),u=t.fillAlpha,c=l[0]*u,d=l[1]*u,p=l[2]*u,f=i.points,v=i.indices,m=f.length/6;f.push(s,a),f.push(c,d,p,u),f.push(s+o,a),f.push(c,d,p,u),f.push(s,a+h),f.push(c,d,p,u),f.push(s+o,a+h),f.push(c,d,p,u),v.push(m,m,m+1,m+2,m+3,m+3)}t.lineWidth&&(t.points=[s,a,s+o,a,s+o,a+h,s,a+h,s,a],n.WebGLGraphics.buildLine(t,i))},n.WebGLGraphics.buildCircle=function(t,i){var r=t.points,s=r[0],a=r[1],o=r[2],h=r[3],l=40,u=2*Math.PI/l;if(t.fill){var c=e(t.fillColor),d=t.fillAlpha,p=c[0]*d,f=c[1]*d,v=c[2]*d,m=i.points,g=i.indices,x=m.length/6;g.push(x);for(var b=0;l+1>b;b++)m.push(s,a,p,f,v,d),m.push(s+Math.sin(u*b)*o,a+Math.cos(u*b)*h,p,f,v,d),g.push(x++,x++);g.push(x-1)}if(t.lineWidth){t.points=[];for(var b=0;l+1>b;b++)t.points.push(s+Math.sin(u*b)*o,a+Math.cos(u*b)*h);n.WebGLGraphics.buildLine(t,i)}},n.WebGLGraphics.buildLine=function(t,i){var r=t.points;if(0!=r.length){var s=new n.Point(r[0],r[1]),a=new n.Point(r[r.length-2],r[r.length-1]);if(s.x==a.x&&s.y==a.y){r.pop(),r.pop(),a=new n.Point(r[r.length-2],r[r.length-1]);var o=a.x+.5*(s.x-a.x),h=a.y+.5*(s.y-a.y);r.unshift(o,h),r.push(o,h)}var l,u,c,d,p,f,v,m,g,x,b,y,T,_,w,A,R,S,C,L,E,P=i.points,B=i.indices,F=r.length/2,G=r.length,I=P.length/6,D=t.lineWidth/2,M=e(t.lineColor),O=t.lineAlpha,W=M[0]*O,U=M[1]*O,k=M[2]*O;l=r[0],u=r[1],c=r[2],d=r[3],v=-(u-d),m=l-c,E=Math.sqrt(v*v+m*m),v/=E,m/=E,v*=D,m*=D,P.push(l-v,u-m,W,U,k,O),P.push(l+v,u+m,W,U,k,O);for(var j=1;F-1>j;j++)l=r[2*(j-1)],u=r[2*(j-1)+1],c=r[2*j],d=r[2*j+1],p=r[2*(j+1)],f=r[2*(j+1)+1],v=-(u-d),m=l-c,E=Math.sqrt(v*v+m*m),v/=E,m/=E,v*=D,m*=D,g=-(d-f),x=c-p,E=Math.sqrt(g*g+x*x),g/=E,x/=E,g*=D,x*=D,T=-m+u-(-m+d),_=-v+c-(-v+l),w=(-v+l)*(-m+d)-(-v+c)*(-m+u),A=-x+f-(-x+d),R=-g+c-(-g+p),S=(-g+p)*(-x+d)-(-g+c)*(-x+f),C=T*R-A*_,0==C&&(C+=1),px=(_*S-R*w)/C,py=(A*w-T*S)/C,L=(px-c)*(px-c)+(py-d)+(py-d),L>19600?(b=v-g,y=m-x,E=Math.sqrt(b*b+y*y),b/=E,y/=E,b*=D,y*=D,P.push(c-b,d-y),P.push(W,U,k,O),P.push(c+b,d+y),P.push(W,U,k,O),P.push(c-b,d-y),P.push(W,U,k,O),G++):(P.push(px,py),P.push(W,U,k,O),P.push(c-(px-c),d-(py-d)),P.push(W,U,k,O));l=r[2*(F-2)],u=r[2*(F-2)+1],c=r[2*(F-1)],d=r[2*(F-1)+1],v=-(u-d),m=l-c,E=Math.sqrt(v*v+m*m),v/=E,m/=E,v*=D,m*=D,P.push(c-v,d-m),P.push(W,U,k,O),P.push(c+v,d+m),P.push(W,U,k,O),B.push(I);for(var j=0;G>j;j++)B.push(I++);B.push(I-1)}},n.WebGLGraphics.buildPoly=function(t,i){var r=t.points;if(!(6>r.length)){for(var s=i.points,a=i.indices,o=r.length/2,h=e(t.fillColor),l=t.fillAlpha,u=h[0]*l,c=h[1]*l,d=h[2]*l,p=n.PolyK.Triangulate(r),f=s.length/6,v=0;p.length>v;v+=3)a.push(p[v]+f),a.push(p[v]+f),a.push(p[v+1]+f),a.push(p[v+2]+f),a.push(p[v+2]+f);for(var v=0;o>v;v++)s.push(r[2*v],r[2*v+1],u,c,d,l)}},n._defaultFrame=new n.Rectangle(0,0,1,1),n.gl,n.WebGLRenderer=function(t,e,i,r){this.transparent=!!r,this.width=t||800,this.height=e||600,this.view=i||document.createElement("canvas"),this.view.width=this.width,this.view.height=this.height;var s=this;this.view.addEventListener("webglcontextlost",function(t){s.handleContextLost(t)},!1),this.view.addEventListener("webglcontextrestored",function(t){s.handleContextRestored(t)},!1),this.batchs=[];try{n.gl=this.gl=this.view.getContext("experimental-webgl",{alpha:this.transparent,antialias:!0,premultipliedAlpha:!1,stencil:!0})}catch(a){throw Error(" This browser does not support webGL. Try using the canvas renderer"+this)}n.initPrimitiveShader(),n.initDefaultShader(),n.initDefaultStripShader(),n.activateDefaultShader();var o=this.gl;n.WebGLRenderer.gl=o,this.batch=new n.WebGLBatch(o),o.disable(o.DEPTH_TEST),o.disable(o.CULL_FACE),o.enable(o.BLEND),o.colorMask(!0,!0,!0,this.transparent),n.projection=new n.Point(400,300),this.resize(this.width,this.height),this.contextLost=!1,this.stageRenderGroup=new n.WebGLRenderGroup(this.gl)},n.WebGLRenderer.constructor=n.WebGLRenderer,n.WebGLRenderer.getBatch=function(){return 0==n._batchs.length?new n.WebGLBatch(n.WebGLRenderer.gl):n._batchs.pop()},n.WebGLRenderer.returnBatch=function(t){t.clean(),n._batchs.push(t)},n.WebGLRenderer.prototype.render=function(t){if(!this.contextLost){this.__stage!==t&&(this.__stage=t,this.stageRenderGroup.setRenderable(t)),n.WebGLRenderer.updateTextures(),t.updateTransform();var e=this.gl;if(e.colorMask(!0,!0,!0,this.transparent),e.viewport(0,0,this.width,this.height),e.bindFramebuffer(e.FRAMEBUFFER,null),e.clearColor(t.backgroundColorSplit[0],t.backgroundColorSplit[1],t.backgroundColorSplit[2],!this.transparent),e.clear(e.COLOR_BUFFER_BIT),this.stageRenderGroup.backgroundColor=t.backgroundColorSplit,this.stageRenderGroup.render(n.projection),t.interactive&&(t._interactiveEventsAdded||(t._interactiveEventsAdded=!0,t.interactionManager.setTarget(this))),n.Texture.frameUpdates.length>0){for(var i=0;n.Texture.frameUpdates.length>i;i++)n.Texture.frameUpdates[i].updateFrame=!1;n.Texture.frameUpdates=[]}}},n.WebGLRenderer.updateTextures=function(){for(var t=0;n.texturesToUpdate.length>t;t++)this.updateTexture(n.texturesToUpdate[t]);for(var t=0;n.texturesToDestroy.length>t;t++)this.destroyTexture(n.texturesToDestroy[t]);n.texturesToUpdate=[],n.texturesToDestroy=[]},n.WebGLRenderer.updateTexture=function(t){var e=n.gl;t._glTexture||(t._glTexture=e.createTexture()),t.hasLoaded&&(e.bindTexture(e.TEXTURE_2D,t._glTexture),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,t.source),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),t._powerOf2?(e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.REPEAT)):(e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE)),e.bindTexture(e.TEXTURE_2D,null))},n.WebGLRenderer.prototype.destroyTexture=function(t){var e=this.gl;t._glTexture&&(t._glTexture=e.createTexture(),e.deleteTexture(e.TEXTURE_2D,t._glTexture))},n.WebGLRenderer.prototype.resize=function(t,e){this.width=t,this.height=e,this.view.width=t,this.view.height=e,this.gl.viewport(0,0,this.width,this.height),n.projection.x=this.width/2,n.projection.y=this.height/2},n.WebGLRenderer.prototype.handleContextLost=function(t){t.preventDefault(),this.contextLost=!0},n.WebGLRenderer.prototype.handleContextRestored=function(){this.gl=this.view.getContext("experimental-webgl",{alpha:!0}),this.initShaders();for(var t in n.TextureCache){var e=n.TextureCache[t].baseTexture;e._glTexture=null,n.WebGLRenderer.updateTexture(e)}for(var i=0;this.batchs.length>i;i++)this.batchs[i].restoreLostContext(this.gl),this.batchs[i].dirty=!0;n._restoreBatchs(this.gl),this.contextLost=!1},n._batchs=[],n._getBatch=function(t){return 0==n._batchs.length?new n.WebGLBatch(t):n._batchs.pop()},n._returnBatch=function(t){t.clean(),n._batchs.push(t)},n._restoreBatchs=function(t){for(var e=0;n._batchs.length>e;e++)n._batchs[e].restoreLostContext(t)},n.WebGLBatch=function(t){this.gl=t,this.size=0,this.vertexBuffer=t.createBuffer(),this.indexBuffer=t.createBuffer(),this.uvBuffer=t.createBuffer(),this.colorBuffer=t.createBuffer(),this.blendMode=n.blendModes.NORMAL,this.dynamicSize=1},n.WebGLBatch.constructor=n.WebGLBatch,n.WebGLBatch.prototype.clean=function(){this.verticies=[],this.uvs=[],this.indices=[],this.colors=[],this.dynamicSize=1,this.texture=null,this.last=null,this.size=0,this.head,this.tail},n.WebGLBatch.prototype.restoreLostContext=function(t){this.gl=t,this.vertexBuffer=t.createBuffer(),this.indexBuffer=t.createBuffer(),this.uvBuffer=t.createBuffer(),this.colorBuffer=t.createBuffer()},n.WebGLBatch.prototype.init=function(t){t.batch=this,this.dirty=!0,this.blendMode=t.blendMode,this.texture=t.texture.baseTexture,this.head=t,this.tail=t,this.size=1,this.growBatch()},n.WebGLBatch.prototype.insertBefore=function(t,e){this.size++,t.batch=this,this.dirty=!0;var i=e.__prev;e.__prev=t,t.__next=e,i?(t.__prev=i,i.__next=t):this.head=t},n.WebGLBatch.prototype.insertAfter=function(t,e){this.size++,t.batch=this,this.dirty=!0;var i=e.__next;e.__next=t,t.__prev=e,i?(t.__next=i,i.__prev=t):this.tail=t},n.WebGLBatch.prototype.remove=function(t){return this.size--,0==this.size?(t.batch=null,t.__prev=null,t.__next=null,void 0):(t.__prev?t.__prev.__next=t.__next:(this.head=t.__next,this.head.__prev=null),t.__next?t.__next.__prev=t.__prev:(this.tail=t.__prev,this.tail.__next=null),t.batch=null,t.__next=null,t.__prev=null,this.dirty=!0,void 0)},n.WebGLBatch.prototype.split=function(t){this.dirty=!0;var e=new n.WebGLBatch(this.gl);e.init(t),e.texture=this.texture,e.tail=this.tail,this.tail=t.__prev,this.tail.__next=null,t.__prev=null;for(var i=0;t;)i++,t.batch=e,t=t.__next;return e.size=i,this.size-=i,e},n.WebGLBatch.prototype.merge=function(t){this.dirty=!0,this.tail.__next=t.head,t.head.__prev=this.tail,this.size+=t.size,this.tail=t.tail;for(var e=t.head;e;)e.batch=this,e=e.__next},n.WebGLBatch.prototype.growBatch=function(){var t=this.gl;this.dynamicSize=1==this.size?1:1.5*this.size,this.verticies=new Float32Array(8*this.dynamicSize),t.bindBuffer(t.ARRAY_BUFFER,this.vertexBuffer),t.bufferData(t.ARRAY_BUFFER,this.verticies,t.DYNAMIC_DRAW),this.uvs=new Float32Array(8*this.dynamicSize),t.bindBuffer(t.ARRAY_BUFFER,this.uvBuffer),t.bufferData(t.ARRAY_BUFFER,this.uvs,t.DYNAMIC_DRAW),this.dirtyUVS=!0,this.colors=new Float32Array(4*this.dynamicSize),t.bindBuffer(t.ARRAY_BUFFER,this.colorBuffer),t.bufferData(t.ARRAY_BUFFER,this.colors,t.DYNAMIC_DRAW),this.dirtyColors=!0,this.indices=new Uint16Array(6*this.dynamicSize);for(var e=this.indices.length/6,i=0;e>i;i++){var r=6*i,n=4*i;this.indices[r+0]=n+0,this.indices[r+1]=n+1,this.indices[r+2]=n+2,this.indices[r+3]=n+0,this.indices[r+4]=n+2,this.indices[r+5]=n+3}t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indexBuffer),t.bufferData(t.ELEMENT_ARRAY_BUFFER,this.indices,t.STATIC_DRAW)},n.WebGLBatch.prototype.refresh=function(){this.gl,this.dynamicSizer;r++)i=this.batchs[r],i instanceof n.WebGLBatch?this.batchs[r].render():i instanceof n.TilingSprite?i.visible&&this.renderTilingSprite(i,t):i instanceof n.Strip?i.visible&&this.renderStrip(i,t):i instanceof n.Graphics?i.visible&&i.renderable&&n.WebGLGraphics.renderGraphics(i,t):i instanceof n.FilterBlock&&(i.open?(e.enable(e.STENCIL_TEST),e.colorMask(!1,!1,!1,!1),e.stencilFunc(e.ALWAYS,1,255),e.stencilOp(e.KEEP,e.KEEP,e.REPLACE),n.WebGLGraphics.renderGraphics(i.mask,t),e.colorMask(!0,!0,!0,!1),e.stencilFunc(e.NOTEQUAL,0,255),e.stencilOp(e.KEEP,e.KEEP,e.KEEP)):e.disable(e.STENCIL_TEST))},n.WebGLRenderGroup.prototype.handleFilter=function(){},n.WebGLRenderGroup.prototype.renderSpecific=function(t,e){n.WebGLRenderer.updateTextures();var i=this.gl;this.checkVisibility(t,t.visible),i.uniform2f(n.shaderProgram.projectionVector,e.x,e.y);for(var r,s,a,o,h=t.first;h._iNext&&(h=h._iNext,!h.renderable||!h.__renderGroup););var l=h.batch;if(h instanceof n.Sprite){l=h.batch;var u=l.head;if(u==h)r=0;else for(r=1;u.__next!=h;)r++,u=u.__next}else l=h;for(var c,d=t,p=t;p.children.length>0;)p=p.children[p.children.length-1],p.renderable&&(d=p);if(d instanceof n.Sprite){c=d.batch;var u=c.head;if(u==d)a=0;else for(a=1;u.__next!=d;)a++,u=u.__next}else c=d;if(l==c)return l instanceof n.WebGLBatch?l.render(r,a+1):this.renderSpecial(l,e),void 0;s=this.batchs.indexOf(l),o=this.batchs.indexOf(c),l instanceof n.WebGLBatch?l.render(r):this.renderSpecial(l,e);for(var f=s+1;o>f;f++)renderable=this.batchs[f],renderable instanceof n.WebGLBatch?this.batchs[f].render():this.renderSpecial(renderable,e);c instanceof n.WebGLBatch?c.render(0,a+1):this.renderSpecial(c,e)},n.WebGLRenderGroup.prototype.renderSpecial=function(t,e){if(t instanceof n.TilingSprite)t.visible&&this.renderTilingSprite(t,e);else if(t instanceof n.Strip)t.visible&&this.renderStrip(t,e);else if(t instanceof n.CustomRenderable)t.visible&&t.renderWebGL(this,e);else if(t instanceof n.Graphics)t.visible&&t.renderable&&n.WebGLGraphics.renderGraphics(t,e);else if(t instanceof n.FilterBlock){var i=n.gl;t.open?(i.enable(i.STENCIL_TEST),i.colorMask(!1,!1,!1,!1),i.stencilFunc(i.ALWAYS,1,255),i.stencilOp(i.KEEP,i.KEEP,i.REPLACE),n.WebGLGraphics.renderGraphics(t.mask,e),i.colorMask(!0,!0,!0,!0),i.stencilFunc(i.NOTEQUAL,0,255),i.stencilOp(i.KEEP,i.KEEP,i.KEEP)):i.disable(i.STENCIL_TEST)}},n.WebGLRenderGroup.prototype.checkVisibility=function(t,e){for(var i=t.children,r=0;i.length>r;r++){var n=i[r];n.worldVisible=n.visible&&e,n.textureChange&&(n.textureChange=!1,n.worldVisible&&this.updateTexture(n)),n.children.length>0&&this.checkVisibility(n,n.worldVisible)}},n.WebGLRenderGroup.prototype.updateTexture=function(t){this.removeObject(t);for(var e=t.first;e!=this.root&&(e=e._iPrev,!e.renderable||!e.__renderGroup););for(var i=t.last;i._iNext&&(i=i._iNext,!i.renderable||!i.__renderGroup););this.insertObject(t,e,i)},n.WebGLRenderGroup.prototype.addFilterBlocks=function(t,e){t.__renderGroup=this,e.__renderGroup=this;for(var i=t;i!=this.root&&(i=i._iPrev,!i.renderable||!i.__renderGroup););this.insertAfter(t,i);for(var r=e;r!=this.root&&(r=r._iPrev,!r.renderable||!r.__renderGroup););this.insertAfter(e,r)},n.WebGLRenderGroup.prototype.removeFilterBlocks=function(t,e){this.removeObject(t),this.removeObject(e)},n.WebGLRenderGroup.prototype.addDisplayObjectAndChildren=function(t){t.__renderGroup&&t.__renderGroup.removeDisplayObjectAndChildren(t);for(var e=t.first;e!=this.root.first&&(e=e._iPrev,!e.renderable||!e.__renderGroup););for(var i=t.last;i._iNext&&(i=i._iNext,!i.renderable||!i.__renderGroup););var r=t.first,n=t.last._iNext;do r.__renderGroup=this,r.renderable&&(this.insertObject(r,e,i),e=r),r=r._iNext;while(r!=n)},n.WebGLRenderGroup.prototype.removeDisplayObjectAndChildren=function(t){if(t.__renderGroup==this){t.last;do t.__renderGroup=null,t.renderable&&this.removeObject(t),t=t._iNext;while(t)}},n.WebGLRenderGroup.prototype.insertObject=function(t,e,i){var r=e,s=i;if(t instanceof n.Sprite){var a,o;if(r instanceof n.Sprite){if(a=r.batch,a&&a.texture==t.texture.baseTexture&&a.blendMode==t.blendMode)return a.insertAfter(t,r),void 0}else a=r;if(s)if(s instanceof n.Sprite){if(o=s.batch){if(o.texture==t.texture.baseTexture&&o.blendMode==t.blendMode)return o.insertBefore(t,s),void 0;if(o==a){var h=a.split(s),l=n.WebGLRenderer.getBatch(),u=this.batchs.indexOf(a);return l.init(t),this.batchs.splice(u+1,0,l,h),void 0}}}else o=s;var l=n.WebGLRenderer.getBatch();if(l.init(t),a){var u=this.batchs.indexOf(a);this.batchs.splice(u+1,0,l)}else this.batchs.push(l)}else t instanceof n.TilingSprite?this.initTilingSprite(t):t instanceof n.Strip&&this.initStrip(t),this.insertAfter(t,r)},n.WebGLRenderGroup.prototype.insertAfter=function(t,e){if(e instanceof n.Sprite){var i=e.batch;if(i)if(i.tail==e){var r=this.batchs.indexOf(i);this.batchs.splice(r+1,0,t)}else{var s=i.split(e.__next),r=this.batchs.indexOf(i);this.batchs.splice(r+1,0,t,s)}else this.batchs.push(t)}else{var r=this.batchs.indexOf(e);this.batchs.splice(r+1,0,t)}},n.WebGLRenderGroup.prototype.removeObject=function(t){var e;if(t instanceof n.Sprite){var i=t.batch;if(!i)return;i.remove(t),0==i.size&&(e=i)}else e=t;if(e){var r=this.batchs.indexOf(e);if(-1==r)return;if(0==r||r==this.batchs.length-1)return this.batchs.splice(r,1),e instanceof n.WebGLBatch&&n.WebGLRenderer.returnBatch(e),void 0;if(this.batchs[r-1]instanceof n.WebGLBatch&&this.batchs[r+1]instanceof n.WebGLBatch&&this.batchs[r-1].texture==this.batchs[r+1].texture&&this.batchs[r-1].blendMode==this.batchs[r+1].blendMode)return this.batchs[r-1].merge(this.batchs[r+1]),e instanceof n.WebGLBatch&&n.WebGLRenderer.returnBatch(e),n.WebGLRenderer.returnBatch(this.batchs[r+1]),this.batchs.splice(r,2),void 0;this.batchs.splice(r,1),e instanceof n.WebGLBatch&&n.WebGLRenderer.returnBatch(e)}},n.WebGLRenderGroup.prototype.initTilingSprite=function(t){var e=this.gl;t.verticies=new Float32Array([0,0,t.width,0,t.width,t.height,0,t.height]),t.uvs=new Float32Array([0,0,1,0,1,1,0,1]),t.colors=new Float32Array([1,1,1,1]),t.indices=new Uint16Array([0,1,3,2]),t._vertexBuffer=e.createBuffer(),t._indexBuffer=e.createBuffer(),t._uvBuffer=e.createBuffer(),t._colorBuffer=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,t._vertexBuffer),e.bufferData(e.ARRAY_BUFFER,t.verticies,e.STATIC_DRAW),e.bindBuffer(e.ARRAY_BUFFER,t._uvBuffer),e.bufferData(e.ARRAY_BUFFER,t.uvs,e.DYNAMIC_DRAW),e.bindBuffer(e.ARRAY_BUFFER,t._colorBuffer),e.bufferData(e.ARRAY_BUFFER,t.colors,e.STATIC_DRAW),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t._indexBuffer),e.bufferData(e.ELEMENT_ARRAY_BUFFER,t.indices,e.STATIC_DRAW),t.texture.baseTexture._glTexture?(e.bindTexture(e.TEXTURE_2D,t.texture.baseTexture._glTexture),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.REPEAT),t.texture.baseTexture._powerOf2=!0):t.texture.baseTexture._powerOf2=!0},n.WebGLRenderGroup.prototype.renderStrip=function(t,e){var i=this.gl,r=n.shaderProgram;i.useProgram(n.stripShaderProgram);var s=n.mat3.clone(t.worldTransform);n.mat3.transpose(s),i.uniformMatrix3fv(n.stripShaderProgram.translationMatrix,!1,s),i.uniform2f(n.stripShaderProgram.projectionVector,e.x,e.y),i.uniform1f(n.stripShaderProgram.alpha,t.worldAlpha),t.dirty?(t.dirty=!1,i.bindBuffer(i.ARRAY_BUFFER,t._vertexBuffer),i.bufferData(i.ARRAY_BUFFER,t.verticies,i.STATIC_DRAW),i.vertexAttribPointer(r.vertexPositionAttribute,2,i.FLOAT,!1,0,0),i.bindBuffer(i.ARRAY_BUFFER,t._uvBuffer),i.bufferData(i.ARRAY_BUFFER,t.uvs,i.STATIC_DRAW),i.vertexAttribPointer(r.textureCoordAttribute,2,i.FLOAT,!1,0,0),i.activeTexture(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,t.texture.baseTexture._glTexture),i.bindBuffer(i.ARRAY_BUFFER,t._colorBuffer),i.bufferData(i.ARRAY_BUFFER,t.colors,i.STATIC_DRAW),i.vertexAttribPointer(r.colorAttribute,1,i.FLOAT,!1,0,0),i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,t._indexBuffer),i.bufferData(i.ELEMENT_ARRAY_BUFFER,t.indices,i.STATIC_DRAW)):(i.bindBuffer(i.ARRAY_BUFFER,t._vertexBuffer),i.bufferSubData(i.ARRAY_BUFFER,0,t.verticies),i.vertexAttribPointer(r.vertexPositionAttribute,2,i.FLOAT,!1,0,0),i.bindBuffer(i.ARRAY_BUFFER,t._uvBuffer),i.vertexAttribPointer(r.textureCoordAttribute,2,i.FLOAT,!1,0,0),i.activeTexture(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,t.texture.baseTexture._glTexture),i.bindBuffer(i.ARRAY_BUFFER,t._colorBuffer),i.vertexAttribPointer(r.colorAttribute,1,i.FLOAT,!1,0,0),i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,t._indexBuffer)),i.drawElements(i.TRIANGLE_STRIP,t.indices.length,i.UNSIGNED_SHORT,0),i.useProgram(n.shaderProgram)},n.WebGLRenderGroup.prototype.renderTilingSprite=function(t,e){var i=this.gl;n.shaderProgram;var r=t.tilePosition,s=t.tileScale,a=r.x/t.texture.baseTexture.width,o=r.y/t.texture.baseTexture.height,h=t.width/t.texture.baseTexture.width/s.x,l=t.height/t.texture.baseTexture.height/s.y;t.uvs[0]=0-a,t.uvs[1]=0-o,t.uvs[2]=1*h-a,t.uvs[3]=0-o,t.uvs[4]=1*h-a,t.uvs[5]=1*l-o,t.uvs[6]=0-a,t.uvs[7]=1*l-o,i.bindBuffer(i.ARRAY_BUFFER,t._uvBuffer),i.bufferSubData(i.ARRAY_BUFFER,0,t.uvs),this.renderStrip(t,e)},n.WebGLRenderGroup.prototype.initStrip=function(t){var e=this.gl;this.shaderProgram,t._vertexBuffer=e.createBuffer(),t._indexBuffer=e.createBuffer(),t._uvBuffer=e.createBuffer(),t._colorBuffer=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,t._vertexBuffer),e.bufferData(e.ARRAY_BUFFER,t.verticies,e.DYNAMIC_DRAW),e.bindBuffer(e.ARRAY_BUFFER,t._uvBuffer),e.bufferData(e.ARRAY_BUFFER,t.uvs,e.STATIC_DRAW),e.bindBuffer(e.ARRAY_BUFFER,t._colorBuffer),e.bufferData(e.ARRAY_BUFFER,t.colors,e.STATIC_DRAW),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t._indexBuffer),e.bufferData(e.ELEMENT_ARRAY_BUFFER,t.indices,e.STATIC_DRAW)},n.CanvasRenderer=function(t,e,i,r){this.transparent=r,this.width=t||800,this.height=e||600,this.view=i||document.createElement("canvas"),this.context=this.view.getContext("2d"),this.refresh=!0,this.view.width=this.width,this.view.height=this.height,this.count=0},n.CanvasRenderer.constructor=n.CanvasRenderer,n.CanvasRenderer.prototype.render=function(t){n.texturesToUpdate=[],n.texturesToDestroy=[],t.updateTransform(),this.view.style.backgroundColor==t.backgroundColorString||this.transparent||(this.view.style.backgroundColor=t.backgroundColorString),this.context.setTransform(1,0,0,1,0,0),this.context.clearRect(0,0,this.width,this.height),this.renderDisplayObject(t),t.interactive&&(t._interactiveEventsAdded||(t._interactiveEventsAdded=!0,t.interactionManager.setTarget(this))),n.Texture.frameUpdates.length>0&&(n.Texture.frameUpdates=[])},n.CanvasRenderer.prototype.resize=function(t,e){this.width=t,this.height=e,this.view.width=t,this.view.height=e},n.CanvasRenderer.prototype.renderDisplayObject=function(t){var e,i=this.context;i.globalCompositeOperation="source-over";var r=t.last._iNext;t=t.first;do if(e=t.worldTransform,t.visible)if(t.renderable){if(t instanceof n.Sprite){var s=t.texture.frame;s&&(i.globalAlpha=t.worldAlpha,i.setTransform(e[0],e[3],e[1],e[4],e[2],e[5]),i.drawImage(t.texture.baseTexture.source,s.x,s.y,s.width,s.height,t.anchor.x*-s.width,t.anchor.y*-s.height,s.width,s.height))}else if(t instanceof n.Strip)i.setTransform(e[0],e[3],e[1],e[4],e[2],e[5]),this.renderStrip(t);else if(t instanceof n.TilingSprite)i.setTransform(e[0],e[3],e[1],e[4],e[2],e[5]),this.renderTilingSprite(t);else if(t instanceof n.CustomRenderable)t.renderCanvas(this);else if(t instanceof n.Graphics)i.setTransform(e[0],e[3],e[1],e[4],e[2],e[5]),n.CanvasGraphics.renderGraphics(t,i);else if(t instanceof n.FilterBlock)if(t.open){i.save();var a=t.mask.alpha,o=t.mask.worldTransform;i.setTransform(o[0],o[3],o[1],o[4],o[2],o[5]),t.mask.worldAlpha=.5,i.worldAlpha=0,n.CanvasGraphics.renderGraphicsMask(t.mask,i),i.clip(),t.mask.worldAlpha=a}else i.restore();t=t._iNext}else t=t._iNext;else t=t.last._iNext;while(t!=r)},n.CanvasRenderer.prototype.renderStripFlat=function(t){var e=this.context,i=t.verticies;t.uvs;var r=i.length/2;this.count++,e.beginPath();for(var n=1;r-2>n;n++){var s=2*n,a=i[s],o=i[s+2],h=i[s+4],l=i[s+1],u=i[s+3],c=i[s+5];e.moveTo(a,l),e.lineTo(o,u),e.lineTo(h,c)}e.fillStyle="#FF0000",e.fill(),e.closePath()},n.CanvasRenderer.prototype.renderTilingSprite=function(t){var e=this.context;e.globalAlpha=t.worldAlpha,t.__tilePattern||(t.__tilePattern=e.createPattern(t.texture.baseTexture.source,"repeat")),e.beginPath();var i=t.tilePosition,r=t.tileScale;e.scale(r.x,r.y),e.translate(i.x,i.y),e.fillStyle=t.__tilePattern,e.fillRect(-i.x,-i.y,t.width/r.x,t.height/r.y),e.scale(1/r.x,1/r.y),e.translate(-i.x,-i.y),e.closePath()},n.CanvasRenderer.prototype.renderStrip=function(t){var e=this.context,i=t.verticies,r=t.uvs,n=i.length/2;this.count++;for(var s=1;n-2>s;s++){var a=2*s,o=i[a],h=i[a+2],l=i[a+4],u=i[a+1],c=i[a+3],d=i[a+5],p=r[a]*t.texture.width,f=r[a+2]*t.texture.width,v=r[a+4]*t.texture.width,m=r[a+1]*t.texture.height,g=r[a+3]*t.texture.height,x=r[a+5]*t.texture.height;e.save(),e.beginPath(),e.moveTo(o,u),e.lineTo(h,c),e.lineTo(l,d),e.closePath(),e.clip();var b=p*g+m*v+f*x-g*v-m*f-p*x,y=o*g+m*l+h*x-g*l-m*h-o*x,T=p*h+o*v+f*l-h*v-o*f-p*l,_=p*g*l+m*h*v+o*f*x-o*g*v-m*f*l-p*h*x,w=u*g+m*d+c*x-g*d-m*c-u*x,A=p*c+u*v+f*d-c*v-u*f-p*d,R=p*g*d+m*c*v+u*f*x-u*g*v-m*f*d-p*c*x;e.transform(y/b,w/b,T/b,A/b,_/b,R/b),e.drawImage(t.texture.baseTexture.source,0,0),e.restore()}},n.CanvasGraphics=function(){},n.CanvasGraphics.renderGraphics=function(t,e){for(var i=t.worldAlpha,r=0;t.graphicsData.length>r;r++){var s=t.graphicsData[r],a=s.points;if(e.strokeStyle=color="#"+("00000"+(0|s.lineColor).toString(16)).substr(-6),e.lineWidth=s.lineWidth,s.type==n.Graphics.POLY){e.beginPath(),e.moveTo(a[0],a[1]);for(var o=1;a.length/2>o;o++)e.lineTo(a[2*o],a[2*o+1]);a[0]==a[a.length-2]&&a[1]==a[a.length-1]&&e.closePath(),s.fill&&(e.globalAlpha=s.fillAlpha*i,e.fillStyle=color="#"+("00000"+(0|s.fillColor).toString(16)).substr(-6),e.fill()),s.lineWidth&&(e.globalAlpha=s.lineAlpha*i,e.stroke())}else if(s.type==n.Graphics.RECT)s.fillColor&&(e.globalAlpha=s.fillAlpha*i,e.fillStyle=color="#"+("00000"+(0|s.fillColor).toString(16)).substr(-6),e.fillRect(a[0],a[1],a[2],a[3])),s.lineWidth&&(e.globalAlpha=s.lineAlpha*i,e.strokeRect(a[0],a[1],a[2],a[3]));else if(s.type==n.Graphics.CIRC)e.beginPath(),e.arc(a[0],a[1],a[2],0,2*Math.PI),e.closePath(),s.fill&&(e.globalAlpha=s.fillAlpha*i,e.fillStyle=color="#"+("00000"+(0|s.fillColor).toString(16)).substr(-6),e.fill()),s.lineWidth&&(e.globalAlpha=s.lineAlpha*i,e.stroke());else if(s.type==n.Graphics.ELIP){var h=s.points,l=2*h[2],u=2*h[3],c=h[0]-l/2,d=h[1]-u/2;e.beginPath();var p=.5522848,f=l/2*p,v=u/2*p,m=c+l,g=d+u,x=c+l/2,b=d+u/2;e.moveTo(c,b),e.bezierCurveTo(c,b-v,x-f,d,x,d),e.bezierCurveTo(x+f,d,m,b-v,m,b),e.bezierCurveTo(m,b+v,x+f,g,x,g),e.bezierCurveTo(x-f,g,c,b+v,c,b),e.closePath(),s.fill&&(e.globalAlpha=s.fillAlpha*i,e.fillStyle=color="#"+("00000"+(0|s.fillColor).toString(16)).substr(-6),e.fill()),s.lineWidth&&(e.globalAlpha=s.lineAlpha*i,e.stroke())}}},n.CanvasGraphics.renderGraphicsMask=function(t,e){t.worldAlpha;var i=t.graphicsData.length;i>1&&(i=1,console.log("Pixi.js warning: masks in canvas can only mask using the first path in the graphics object"));for(var r=0;1>r;r++){var s=t.graphicsData[r],a=s.points;if(s.type==n.Graphics.POLY){e.beginPath(),e.moveTo(a[0],a[1]);for(var o=1;a.length/2>o;o++)e.lineTo(a[2*o],a[2*o+1]);a[0]==a[a.length-2]&&a[1]==a[a.length-1]&&e.closePath()}else if(s.type==n.Graphics.RECT)e.beginPath(),e.rect(a[0],a[1],a[2],a[3]),e.closePath();else if(s.type==n.Graphics.CIRC)e.beginPath(),e.arc(a[0],a[1],a[2],0,2*Math.PI),e.closePath();else if(s.type==n.Graphics.ELIP){var h=s.points,l=2*h[2],u=2*h[3],c=h[0]-l/2,d=h[1]-u/2;e.beginPath();var p=.5522848,f=l/2*p,v=u/2*p,m=c+l,g=d+u,x=c+l/2,b=d+u/2;e.moveTo(c,b),e.bezierCurveTo(c,b-v,x-f,d,x,d),e.bezierCurveTo(x+f,d,m,b-v,m,b),e.bezierCurveTo(m,b+v,x+f,g,x,g),e.bezierCurveTo(x-f,g,c,b+v,c,b),e.closePath()}}},n.Graphics=function(){n.DisplayObjectContainer.call(this),this.renderable=!0,this.fillAlpha=1,this.lineWidth=0,this.lineColor="black",this.graphicsData=[],this.currentPath={points:[]}},n.Graphics.constructor=n.Graphics,n.Graphics.prototype=Object.create(n.DisplayObjectContainer.prototype),n.Graphics.prototype.lineStyle=function(t,e,i){0==this.currentPath.points.length&&this.graphicsData.pop(),this.lineWidth=t||0,this.lineColor=e||0,this.lineAlpha=void 0==i?1:i,this.currentPath={lineWidth:this.lineWidth,lineColor:this.lineColor,lineAlpha:this.lineAlpha,fillColor:this.fillColor,fillAlpha:this.fillAlpha,fill:this.filling,points:[],type:n.Graphics.POLY},this.graphicsData.push(this.currentPath)},n.Graphics.prototype.moveTo=function(t,e){0==this.currentPath.points.length&&this.graphicsData.pop(),this.currentPath=this.currentPath={lineWidth:this.lineWidth,lineColor:this.lineColor,lineAlpha:this.lineAlpha,fillColor:this.fillColor,fillAlpha:this.fillAlpha,fill:this.filling,points:[],type:n.Graphics.POLY},this.currentPath.points.push(t,e),this.graphicsData.push(this.currentPath) +},n.Graphics.prototype.lineTo=function(t,e){this.currentPath.points.push(t,e),this.dirty=!0},n.Graphics.prototype.beginFill=function(t,e){this.filling=!0,this.fillColor=t||0,this.fillAlpha=e||1},n.Graphics.prototype.endFill=function(){this.filling=!1,this.fillColor=null,this.fillAlpha=1},n.Graphics.prototype.drawRect=function(t,e,i,r){0==this.currentPath.points.length&&this.graphicsData.pop(),this.currentPath={lineWidth:this.lineWidth,lineColor:this.lineColor,lineAlpha:this.lineAlpha,fillColor:this.fillColor,fillAlpha:this.fillAlpha,fill:this.filling,points:[t,e,i,r],type:n.Graphics.RECT},this.graphicsData.push(this.currentPath),this.dirty=!0},n.Graphics.prototype.drawCircle=function(t,e,i){0==this.currentPath.points.length&&this.graphicsData.pop(),this.currentPath={lineWidth:this.lineWidth,lineColor:this.lineColor,lineAlpha:this.lineAlpha,fillColor:this.fillColor,fillAlpha:this.fillAlpha,fill:this.filling,points:[t,e,i,i],type:n.Graphics.CIRC},this.graphicsData.push(this.currentPath),this.dirty=!0},n.Graphics.prototype.drawElipse=function(t,e,i,r){0==this.currentPath.points.length&&this.graphicsData.pop(),this.currentPath={lineWidth:this.lineWidth,lineColor:this.lineColor,lineAlpha:this.lineAlpha,fillColor:this.fillColor,fillAlpha:this.fillAlpha,fill:this.filling,points:[t,e,i,r],type:n.Graphics.ELIP},this.graphicsData.push(this.currentPath),this.dirty=!0},n.Graphics.prototype.clear=function(){this.lineWidth=0,this.filling=!1,this.dirty=!0,this.clearDirty=!0,this.graphicsData=[]},n.Graphics.POLY=0,n.Graphics.RECT=1,n.Graphics.CIRC=2,n.Graphics.ELIP=3,n.Strip=function(t,e,i){n.DisplayObjectContainer.call(this),this.texture=t,this.blendMode=n.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(r){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=e,this.height=i,t.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},n.Strip.constructor=n.Strip,n.Strip.prototype=Object.create(n.DisplayObjectContainer.prototype),n.Strip.prototype.setTexture=function(t){this.texture=t,this.width=t.frame.width,this.height=t.frame.height,this.updateFrame=!0},n.Strip.prototype.onTextureUpdate=function(){this.updateFrame=!0},n.Rope=function(t,e){n.Strip.call(this,t),this.points=e;try{this.verticies=new Float32Array(4*e.length),this.uvs=new Float32Array(4*e.length),this.colors=new Float32Array(2*e.length),this.indices=new Uint16Array(2*e.length)}catch(i){this.verticies=verticies,this.uvs=uvs,this.colors=colors,this.indices=indices}this.refresh()},n.Rope.constructor=n.Rope,n.Rope.prototype=Object.create(n.Strip.prototype),n.Rope.prototype.refresh=function(){var t=this.points;if(!(1>t.length)){var e=this.uvs,i=this.indices,r=this.colors,n=t[0],s=t[0];this.count-=.2,e[0]=0,e[1]=1,e[2]=0,e[3]=1,r[0]=1,r[1]=1,i[0]=0,i[1]=1;for(var a=t.length,o=1;a>o;o++){var s=t[o],h=4*o,l=o/(a-1);o%2?(e[h]=l,e[h+1]=0,e[h+2]=l,e[h+3]=1):(e[h]=l,e[h+1]=0,e[h+2]=l,e[h+3]=1),h=2*o,r[h]=1,r[h+1]=1,h=2*o,i[h]=h,i[h+1]=h+1,n=s}}},n.Rope.prototype.updateTransform=function(){var t=this.points;if(!(1>t.length)){var e,i=this.verticies,r=t[0],s={x:0,y:0},a=t[0];this.count-=.2,i[0]=a.x+s.x,i[1]=a.y+s.y,i[2]=a.x-s.x,i[3]=a.y-s.y;for(var o=t.length,h=1;o>h;h++){var a=t[h],l=4*h;e=t.length-1>h?t[h+1]:a,s.y=-(e.x-r.x),s.x=e.y-r.y;var u=10*(1-h/(o-1));u>1&&(u=1);var c=Math.sqrt(s.x*s.x+s.y*s.y),d=this.texture.height/2;s.x/=c,s.y/=c,s.x*=d,s.y*=d,i[l]=a.x+s.x,i[l+1]=a.y+s.y,i[l+2]=a.x-s.x,i[l+3]=a.y-s.y,r=a}n.DisplayObjectContainer.prototype.updateTransform.call(this)}},n.Rope.prototype.setTexture=function(t){this.texture=t,this.updateFrame=!0},n.TilingSprite=function(t,e,i){n.DisplayObjectContainer.call(this),this.texture=t,this.width=e,this.height=i,this.tileScale=new n.Point(1,1),this.tilePosition=new n.Point(0,0),this.renderable=!0,this.blendMode=n.blendModes.NORMAL},n.TilingSprite.constructor=n.TilingSprite,n.TilingSprite.prototype=Object.create(n.DisplayObjectContainer.prototype),n.TilingSprite.prototype.setTexture=function(t){this.texture=t,this.updateFrame=!0},n.TilingSprite.prototype.onTextureUpdate=function(){this.updateFrame=!0},n.Spine=function(t){if(n.DisplayObjectContainer.call(this),this.spineData=n.AnimCache[t],!this.spineData)throw Error("Spine data must be preloaded using PIXI.SpineLoader or PIXI.AssetLoader: "+t);this.count=0,this.sprites=[],this.skeleton=new u.Skeleton(this.spineData),this.skeleton.updateWorldTransform(),this.stateData=new u.AnimationStateData(this.spineData),this.state=new u.AnimationState(this.stateData);for(var e=0;this.skeleton.drawOrder.length>e;e++){var i=this.skeleton.drawOrder[e].data.attachmentName;n.TextureCache[i]||(i+=".png");var r=new n.Sprite(n.Texture.fromFrame(i));r.anchor.x=r.anchor.y=.5,this.addChild(r),this.sprites.push(r)}},n.Spine.constructor=n.Spine,n.Spine.prototype=Object.create(n.DisplayObjectContainer.prototype),n.Spine.prototype.updateTransform=function(){this.state.update(1/60),this.state.apply(this.skeleton),this.skeleton.updateWorldTransform();for(var t=0;this.skeleton.drawOrder.length>t;t++){var e=this.skeleton.drawOrder[t],i=e.bone.worldX+e.attachment.x*e.bone.m00+e.attachment.y*e.bone.m01+.5*e.attachment.width,r=e.bone.worldY+e.attachment.x*e.bone.m10+e.attachment.y*e.bone.m11+.5*e.attachment.height;if(e.cacheName!=e.attachment.name){var s=e.attachment.name;n.TextureCache[s]||(s+=".png"),this.sprites[t].setTexture(n.TextureCache[s]),e.cacheName=e.attachment.name}i+=-(e.attachment.width*(e.bone.worldScaleX+e.attachment.scaleX-1)>>1),r+=-(e.attachment.height*(e.bone.worldScaleY+e.attachment.scaleY-1)>>1),this.sprites[t].position.x=i,this.sprites[t].position.y=r,this.sprites[t].rotation=-(e.bone.worldRotation+e.attachment.rotation)*(Math.PI/180)}n.DisplayObjectContainer.prototype.updateTransform.call(this)};var u={};u.BoneData=function(t,e){this.name=t,this.parent=e},u.BoneData.prototype={length:0,x:0,y:0,rotation:0,scaleX:1,scaleY:1},u.SlotData=function(t,e){this.name=t,this.boneData=e},u.SlotData.prototype={r:1,g:1,b:1,a:1,attachmentName:null},u.Bone=function(t,e){this.data=t,this.parent=e,this.setToSetupPose()},u.Bone.yDown=!1,u.Bone.prototype={x:0,y:0,rotation:0,scaleX:1,scaleY:1,m00:0,m01:0,worldX:0,m10:0,m11:0,worldY:0,worldRotation:0,worldScaleX:1,worldScaleY:1,updateWorldTransform:function(t,e){var i=this.parent;null!=i?(this.worldX=this.x*i.m00+this.y*i.m01+i.worldX,this.worldY=this.x*i.m10+this.y*i.m11+i.worldY,this.worldScaleX=i.worldScaleX*this.scaleX,this.worldScaleY=i.worldScaleY*this.scaleY,this.worldRotation=i.worldRotation+this.rotation):(this.worldX=this.x,this.worldY=this.y,this.worldScaleX=this.scaleX,this.worldScaleY=this.scaleY,this.worldRotation=this.rotation);var r=this.worldRotation*Math.PI/180,n=Math.cos(r),s=Math.sin(r);this.m00=n*this.worldScaleX,this.m10=s*this.worldScaleX,this.m01=-s*this.worldScaleY,this.m11=n*this.worldScaleY,t&&(this.m00=-this.m00,this.m01=-this.m01),e&&(this.m10=-this.m10,this.m11=-this.m11),u.Bone.yDown&&(this.m10=-this.m10,this.m11=-this.m11)},setToSetupPose:function(){var t=this.data;this.x=t.x,this.y=t.y,this.rotation=t.rotation,this.scaleX=t.scaleX,this.scaleY=t.scaleY}},u.Slot=function(t,e,i){this.data=t,this.skeleton=e,this.bone=i,this.setToSetupPose()},u.Slot.prototype={r:1,g:1,b:1,a:1,_attachmentTime:0,attachment:null,setAttachment:function(t){this.attachment=t,this._attachmentTime=this.skeleton.time},setAttachmentTime:function(t){this._attachmentTime=this.skeleton.time-t},getAttachmentTime:function(){return this.skeleton.time-this._attachmentTime},setToSetupPose:function(){var t=this.data;this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a;for(var e=this.skeleton.data.slots,i=0,r=e.length;r>i;i++)if(e[i]==t){this.setAttachment(t.attachmentName?this.skeleton.getAttachmentBySlotIndex(i,t.attachmentName):null);break}}},u.Skin=function(t){this.name=t,this.attachments={}},u.Skin.prototype={addAttachment:function(t,e,i){this.attachments[t+":"+e]=i},getAttachment:function(t,e){return this.attachments[t+":"+e]},_attachAll:function(t,e){for(var i in e.attachments){var r=i.indexOf(":"),n=parseInt(i.substring(0,r)),s=i.substring(r+1),a=t.slots[n];if(a.attachment&&a.attachment.name==s){var o=this.getAttachment(n,s);o&&a.setAttachment(o)}}}},u.Animation=function(t,e,i){this.name=t,this.timelines=e,this.duration=i},u.Animation.prototype={apply:function(t,e,i){i&&0!=this.duration&&(e%=this.duration);for(var r=this.timelines,n=0,s=r.length;s>n;n++)r[n].apply(t,e,1)},mix:function(t,e,i,r){i&&0!=this.duration&&(e%=this.duration);for(var n=this.timelines,s=0,a=n.length;a>s;s++)n[s].apply(t,e,r)}},u.binarySearch=function(t,e,i){var r=0,n=Math.floor(t.length/i)-2;if(0==n)return i;for(var s=n>>>1;;){if(e>=t[(s+1)*i]?r=s+1:n=s,r==n)return(r+1)*i;s=r+n>>>1}},u.linearSearch=function(t,e,i){for(var r=0,n=t.length-i;n>=r;r+=i)if(t[r]>e)return r;return-1},u.Curves=function(t){this.curves=[],this.curves.length=6*(t-1)},u.Curves.prototype={setLinear:function(t){this.curves[6*t]=0},setStepped:function(t){this.curves[6*t]=-1},setCurve:function(t,e,i,r,n){var s=.1,a=s*s,o=a*s,h=3*s,l=3*a,u=6*a,c=6*o,d=2*-e+r,p=2*-i+n,f=3*(e-r)+1,v=3*(i-n)+1,m=6*t,g=this.curves;g[m]=e*h+d*l+f*o,g[m+1]=i*h+p*l+v*o,g[m+2]=d*u+f*c,g[m+3]=p*u+v*c,g[m+4]=f*c,g[m+5]=v*c},getCurvePercent:function(t,e){e=0>e?0:e>1?1:e;var i=6*t,r=this.curves,n=r[i];if(!n)return e;if(-1==n)return 0;for(var s=r[i+1],a=r[i+2],o=r[i+3],h=r[i+4],l=r[i+5],u=n,c=s,d=8;;){if(u>=e){var p=u-n,f=c-s;return f+(c-f)*(e-p)/(u-p)}if(0==d)break;d--,n+=a,s+=o,a+=h,o+=l,u+=n,c+=s}return c+(1-c)*(e-u)/(1-u)}},u.RotateTimeline=function(t){this.curves=new u.Curves(t),this.frames=[],this.frames.length=2*t},u.RotateTimeline.prototype={boneIndex:0,getFrameCount:function(){return this.frames.length/2},setFrame:function(t,e,i){t*=2,this.frames[t]=e,this.frames[t+1]=i},apply:function(t,e,i){var r=this.frames;if(!(r[0]>e)){var n=t.bones[this.boneIndex];if(e>=r[r.length-2]){for(var s=n.data.rotation+r[r.length-1]-n.rotation;s>180;)s-=360;for(;-180>s;)s+=360;return n.rotation+=s*i,void 0}var a=u.binarySearch(r,e,2),o=r[a-1],h=r[a],l=1-(e-h)/(r[a-2]-h);l=this.curves.getCurvePercent(a/2-1,l);for(var s=r[a+1]-o;s>180;)s-=360;for(;-180>s;)s+=360;for(s=n.data.rotation+(o+s*l)-n.rotation;s>180;)s-=360;for(;-180>s;)s+=360;n.rotation+=s*i}}},u.TranslateTimeline=function(t){this.curves=new u.Curves(t),this.frames=[],this.frames.length=3*t},u.TranslateTimeline.prototype={boneIndex:0,getFrameCount:function(){return this.frames.length/3},setFrame:function(t,e,i,r){t*=3,this.frames[t]=e,this.frames[t+1]=i,this.frames[t+2]=r},apply:function(t,e,i){var r=this.frames;if(!(r[0]>e)){var n=t.bones[this.boneIndex];if(e>=r[r.length-3])return n.x+=(n.data.x+r[r.length-2]-n.x)*i,n.y+=(n.data.y+r[r.length-1]-n.y)*i,void 0;var s=u.binarySearch(r,e,3),a=r[s-2],o=r[s-1],h=r[s],l=1-(e-h)/(r[s+-3]-h);l=this.curves.getCurvePercent(s/3-1,l),n.x+=(n.data.x+a+(r[s+1]-a)*l-n.x)*i,n.y+=(n.data.y+o+(r[s+2]-o)*l-n.y)*i}}},u.ScaleTimeline=function(t){this.curves=new u.Curves(t),this.frames=[],this.frames.length=3*t},u.ScaleTimeline.prototype={boneIndex:0,getFrameCount:function(){return this.frames.length/3},setFrame:function(t,e,i,r){t*=3,this.frames[t]=e,this.frames[t+1]=i,this.frames[t+2]=r},apply:function(t,e,i){var r=this.frames;if(!(r[0]>e)){var n=t.bones[this.boneIndex];if(e>=r[r.length-3])return n.scaleX+=(n.data.scaleX-1+r[r.length-2]-n.scaleX)*i,n.scaleY+=(n.data.scaleY-1+r[r.length-1]-n.scaleY)*i,void 0;var s=u.binarySearch(r,e,3),a=r[s-2],o=r[s-1],h=r[s],l=1-(e-h)/(r[s+-3]-h);l=this.curves.getCurvePercent(s/3-1,l),n.scaleX+=(n.data.scaleX-1+a+(r[s+1]-a)*l-n.scaleX)*i,n.scaleY+=(n.data.scaleY-1+o+(r[s+2]-o)*l-n.scaleY)*i}}},u.ColorTimeline=function(t){this.curves=new u.Curves(t),this.frames=[],this.frames.length=5*t},u.ColorTimeline.prototype={slotIndex:0,getFrameCount:function(){return this.frames.length/2},setFrame:function(t,e){t*=5,this.frames[t]=e,this.frames[t+1]=r,this.frames[t+2]=g,this.frames[t+3]=b,this.frames[t+4]=a},apply:function(t,e,i){var r=this.frames;if(!(r[0]>e)){var n=t.slots[this.slotIndex];if(e>=r[r.length-5]){var s=r.length-1;return n.r=r[s-3],n.g=r[s-2],n.b=r[s-1],n.a=r[s],void 0}var a=u.binarySearch(r,e,5),o=r[a-4],h=r[a-3],l=r[a-2],c=r[a-1],d=r[a],p=1-(e-d)/(r[a-5]-d);p=this.curves.getCurvePercent(a/5-1,p);var f=o+(r[a+1]-o)*p,v=h+(r[a+2]-h)*p,m=l+(r[a+3]-l)*p,g=c+(r[a+4]-c)*p;1>i?(n.r+=(f-n.r)*i,n.g+=(v-n.g)*i,n.b+=(m-n.b)*i,n.a+=(g-n.a)*i):(n.r=f,n.g=v,n.b=m,n.a=g)}}},u.AttachmentTimeline=function(t){this.curves=new u.Curves(t),this.frames=[],this.frames.length=t,this.attachmentNames=[],this.attachmentNames.length=t},u.AttachmentTimeline.prototype={slotIndex:0,getFrameCount:function(){return this.frames.length/2},setFrame:function(t,e,i){this.frames[t]=e,this.attachmentNames[t]=i},apply:function(t,e){var i=this.frames;if(!(i[0]>e)){var r;r=e>=i[i.length-1]?i.length-1:u.binarySearch(i,e,1)-1;var n=this.attachmentNames[r];t.slots[this.slotIndex].setAttachment(n?t.getAttachmentBySlotIndex(this.slotIndex,n):null)}}},u.SkeletonData=function(){this.bones=[],this.slots=[],this.skins=[],this.animations=[]},u.SkeletonData.prototype={defaultSkin:null,findBone:function(t){for(var e=this.bones,i=0,r=e.length;r>i;i++)if(e[i].name==t)return e[i];return null},findBoneIndex:function(t){for(var e=this.bones,i=0,r=e.length;r>i;i++)if(e[i].name==t)return i;return-1},findSlot:function(t){for(var e=this.slots,i=0,r=e.length;r>i;i++)if(e[i].name==t)return slot[i];return null},findSlotIndex:function(t){for(var e=this.slots,i=0,r=e.length;r>i;i++)if(e[i].name==t)return i;return-1},findSkin:function(t){for(var e=this.skins,i=0,r=e.length;r>i;i++)if(e[i].name==t)return e[i];return null},findAnimation:function(t){for(var e=this.animations,i=0,r=e.length;r>i;i++)if(e[i].name==t)return e[i];return null}},u.Skeleton=function(t){this.data=t,this.bones=[];for(var e=0,i=t.bones.length;i>e;e++){var r=t.bones[e],n=r.parent?this.bones[t.bones.indexOf(r.parent)]:null;this.bones.push(new u.Bone(r,n))}this.slots=[],this.drawOrder=[];for(var e=0,i=t.slots.length;i>e;e++){var s=t.slots[e],a=this.bones[t.bones.indexOf(s.boneData)],o=new u.Slot(s,this,a);this.slots.push(o),this.drawOrder.push(o)}},u.Skeleton.prototype={x:0,y:0,skin:null,r:1,g:1,b:1,a:1,time:0,flipX:!1,flipY:!1,updateWorldTransform:function(){for(var t=this.flipX,e=this.flipY,i=this.bones,r=0,n=i.length;n>r;r++)i[r].updateWorldTransform(t,e)},setToSetupPose:function(){this.setBonesToSetupPose(),this.setSlotsToSetupPose()},setBonesToSetupPose:function(){for(var t=this.bones,e=0,i=t.length;i>e;e++)t[e].setToSetupPose()},setSlotsToSetupPose:function(){for(var t=this.slots,e=0,i=t.length;i>e;e++)t[e].setToSetupPose(e)},getRootBone:function(){return 0==this.bones.length?null:this.bones[0]},findBone:function(t){for(var e=this.bones,i=0,r=e.length;r>i;i++)if(e[i].data.name==t)return e[i];return null},findBoneIndex:function(t){for(var e=this.bones,i=0,r=e.length;r>i;i++)if(e[i].data.name==t)return i;return-1},findSlot:function(t){for(var e=this.slots,i=0,r=e.length;r>i;i++)if(e[i].data.name==t)return e[i];return null},findSlotIndex:function(t){for(var e=this.slots,i=0,r=e.length;r>i;i++)if(e[i].data.name==t)return i;return-1},setSkinByName:function(t){var e=this.data.findSkin(t);if(!e)throw"Skin not found: "+t;this.setSkin(e)},setSkin:function(t){this.skin&&t&&t._attachAll(this,this.skin),this.skin=t},getAttachmentBySlotName:function(t,e){return this.getAttachmentBySlotIndex(this.data.findSlotIndex(t),e)},getAttachmentBySlotIndex:function(t,e){if(this.skin){var i=this.skin.getAttachment(t,e);if(i)return i}return this.data.defaultSkin?this.data.defaultSkin.getAttachment(t,e):null},setAttachment:function(t,e){for(var i=this.slots,r=0,n=i.size;n>r;r++){var s=i[r];if(s.data.name==t){var a=null;if(e&&(a=this.getAttachment(r,e),null==a))throw"Attachment not found: "+e+", for slot: "+t;return s.setAttachment(a),void 0}}throw"Slot not found: "+t},update:function(t){time+=t}},u.AttachmentType={region:0},u.RegionAttachment=function(){this.offset=[],this.offset.length=8,this.uvs=[],this.uvs.length=8},u.RegionAttachment.prototype={x:0,y:0,rotation:0,scaleX:1,scaleY:1,width:0,height:0,rendererObject:null,regionOffsetX:0,regionOffsetY:0,regionWidth:0,regionHeight:0,regionOriginalWidth:0,regionOriginalHeight:0,setUVs:function(t,e,i,r,n){var s=this.uvs;n?(s[2]=t,s[3]=r,s[4]=t,s[5]=e,s[6]=i,s[7]=e,s[0]=i,s[1]=r):(s[0]=t,s[1]=r,s[2]=t,s[3]=e,s[4]=i,s[5]=e,s[6]=i,s[7]=r)},updateOffset:function(){var t=this.width/this.regionOriginalWidth*this.scaleX,e=this.height/this.regionOriginalHeight*this.scaleY,i=-this.width/2*this.scaleX+this.regionOffsetX*t,r=-this.height/2*this.scaleY+this.regionOffsetY*e,n=i+this.regionWidth*t,s=r+this.regionHeight*e,a=this.rotation*Math.PI/180,o=Math.cos(a),h=Math.sin(a),l=i*o+this.x,u=i*h,c=r*o+this.y,d=r*h,p=n*o+this.x,f=n*h,v=s*o+this.y,m=s*h,g=this.offset;g[0]=l-d,g[1]=c+u,g[2]=l-m,g[3]=v+u,g[4]=p-m,g[5]=v+f,g[6]=p-d,g[7]=c+f},computeVertices:function(t,e,i,r){t+=i.worldX,e+=i.worldY;var n=i.m00,s=i.m01,a=i.m10,o=i.m11,h=this.offset;r[0]=h[0]*n+h[1]*s+t,r[1]=h[0]*a+h[1]*o+e,r[2]=h[2]*n+h[3]*s+t,r[3]=h[2]*a+h[3]*o+e,r[4]=h[4]*n+h[5]*s+t,r[5]=h[4]*a+h[5]*o+e,r[6]=h[6]*n+h[7]*s+t,r[7]=h[6]*a+h[7]*o+e}},u.AnimationStateData=function(t){this.skeletonData=t,this.animationToMixTime={}},u.AnimationStateData.prototype={setMixByName:function(t,e,i){var r=this.skeletonData.findAnimation(t);if(!r)throw"Animation not found: "+t;var n=this.skeletonData.findAnimation(e);if(!n)throw"Animation not found: "+e;this.setMix(r,n,i)},setMix:function(t,e,i){this.animationToMixTime[t.name+":"+e.name]=i},getMix:function(t,e){var i=this.animationToMixTime[t.name+":"+e.name];return i?i:0}},u.AnimationState=function(t){this.data=t,this.queue=[]},u.AnimationState.prototype={current:null,previous:null,currentTime:0,previousTime:0,currentLoop:!1,previousLoop:!1,mixTime:0,mixDuration:0,update:function(t){if(this.currentTime+=t,this.previousTime+=t,this.mixTime+=t,this.queue.length>0){var e=this.queue[0];this.currentTime>=e.delay&&(this._setAnimation(e.animation,e.loop),this.queue.shift())}},apply:function(t){if(this.current)if(this.previous){this.previous.apply(t,this.previousTime,this.previousLoop);var e=this.mixTime/this.mixDuration;e>=1&&(e=1,this.previous=null),this.current.mix(t,this.currentTime,this.currentLoop,e)}else this.current.apply(t,this.currentTime,this.currentLoop)},clearAnimation:function(){this.previous=null,this.current=null,this.queue.length=0},_setAnimation:function(t,e){this.previous=null,t&&this.current&&(this.mixDuration=this.data.getMix(this.current,t),this.mixDuration>0&&(this.mixTime=0,this.previous=this.current,this.previousTime=this.currentTime,this.previousLoop=this.currentLoop)),this.current=t,this.currentLoop=e,this.currentTime=0},setAnimationByName:function(t,e){var i=this.data.skeletonData.findAnimation(t);if(!i)throw"Animation not found: "+t;this.setAnimation(i,e)},setAnimation:function(t,e){this.queue.length=0,this._setAnimation(t,e)},addAnimationByName:function(t,e,i){var r=this.data.skeletonData.findAnimation(t);if(!r)throw"Animation not found: "+t;this.addAnimation(r,e,i)},addAnimation:function(t,e,i){var r={};if(r.animation=t,r.loop=e,!i||0>=i){var n=0==this.queue.length?this.current:this.queue[this.queue.length-1].animation;i=null!=n?n.duration-this.data.getMix(n,t)+(i||0):0}r.delay=i,this.queue.push(r)},isComplete:function(){return!this.current||this.currentTime>=this.current.duration}},u.SkeletonJson=function(t){this.attachmentLoader=t},u.SkeletonJson.prototype={scale:1,readSkeletonData:function(t){for(var e=new u.SkeletonData,i=t.bones,r=0,n=i.length;n>r;r++){var s=i[r],a=null;if(s.parent&&(a=e.findBone(s.parent),!a))throw"Parent bone not found: "+s.parent;var o=new u.BoneData(s.name,a);o.length=(s.length||0)*this.scale,o.x=(s.x||0)*this.scale,o.y=(s.y||0)*this.scale,o.rotation=s.rotation||0,o.scaleX=s.scaleX||1,o.scaleY=s.scaleY||1,e.bones.push(o)}for(var h=t.slots,r=0,n=h.length;n>r;r++){var l=h[r],o=e.findBone(l.bone);if(!o)throw"Slot bone not found: "+l.bone;var c=new u.SlotData(l.name,o),d=l.color;d&&(c.r=u.SkeletonJson.toColor(d,0),c.g=u.SkeletonJson.toColor(d,1),c.b=u.SkeletonJson.toColor(d,2),c.a=u.SkeletonJson.toColor(d,3)),c.attachmentName=l.attachment,e.slots.push(c)}var p=t.skins;for(var f in p)if(p.hasOwnProperty(f)){var v=p[f],m=new u.Skin(f);for(var g in v)if(v.hasOwnProperty(g)){var x=e.findSlotIndex(g),b=v[g];for(var y in b)if(b.hasOwnProperty(y)){var T=this.readAttachment(m,y,b[y]);null!=T&&m.addAttachment(x,y,T)}}e.skins.push(m),"default"==m.name&&(e.defaultSkin=m)}var _=t.animations;for(var w in _)_.hasOwnProperty(w)&&this.readAnimation(w,_[w],e);return e},readAttachment:function(t,e,i){e=i.name||e;var r=u.AttachmentType[i.type||"region"],n=new u.RegionAttachment;return n.name=e,r==u.AttachmentType.region&&(n.x=(i.x||0)*this.scale,n.y=(i.y||0)*this.scale,n.scaleX=i.scaleX||1,n.scaleY=i.scaleY||1,n.rotation=i.rotation||0,n.width=(i.width||32)*this.scale,n.height=(i.height||32)*this.scale,n.updateOffset()),n},readAnimation:function(t,e,i){var r=[],n=0,s=e.bones;for(var a in s)if(s.hasOwnProperty(a)){var o=i.findBoneIndex(a);if(-1==o)throw"Bone not found: "+a;var h=s[a];for(var l in h)if(h.hasOwnProperty(l)){var c=h[l];if("rotate"==l){var d=new u.RotateTimeline(c.length);d.boneIndex=o;for(var p=0,f=0,v=c.length;v>f;f++){var m=c[f];d.setFrame(p,m.time,m.angle),u.SkeletonJson.readCurve(d,p,m),p++}r.push(d),n=Math.max(n,d.frames[2*d.getFrameCount()-2])}else{if("translate"!=l&&"scale"!=l)throw"Invalid timeline type for a bone: "+l+" ("+a+")";var d,g=1;"scale"==l?d=new u.ScaleTimeline(c.length):(d=new u.TranslateTimeline(c.length),g=this.scale),d.boneIndex=o;for(var p=0,f=0,v=c.length;v>f;f++){var m=c[f],x=(m.x||0)*g,b=(m.y||0)*g;d.setFrame(p,m.time,x,b),u.SkeletonJson.readCurve(d,p,m),p++}r.push(d),n=Math.max(n,d.frames[3*d.getFrameCount()-3])}}}var y=e.slots;for(var T in y)if(y.hasOwnProperty(T)){var _=y[T],w=i.findSlotIndex(T);for(var l in _)if(_.hasOwnProperty(l)){var c=_[l];if("color"==l){var d=new u.ColorTimeline(c.length);d.slotIndex=w;for(var p=0,f=0,v=c.length;v>f;f++){var m=c[f],A=m.color,R=u.SkeletonJson.toColor(A,0),S=u.SkeletonJson.toColor(A,1),C=u.SkeletonJson.toColor(A,2),L=u.SkeletonJson.toColor(A,3);d.setFrame(p,m.time,R,S,C,L),u.SkeletonJson.readCurve(d,p,m),p++}r.push(d),n=Math.max(n,d.frames[5*d.getFrameCount()-5])}else{if("attachment"!=l)throw"Invalid timeline type for a slot: "+l+" ("+T+")";var d=new u.AttachmentTimeline(c.length);d.slotIndex=w;for(var p=0,f=0,v=c.length;v>f;f++){var m=c[f];d.setFrame(p++,m.time,m.name)}r.push(d),n=Math.max(n,d.frames[Math.floor(d.getFrameCount())-1])}}}i.animations.push(new u.Animation(t,r,n))}},u.SkeletonJson.readCurve=function(t,e,i){var r=i.curve;r&&("stepped"==r?t.curves.setStepped(e):r instanceof Array&&t.curves.setCurve(e,r[0],r[1],r[2],r[3]))},u.SkeletonJson.toColor=function(t,e){if(8!=t.length)throw"Color hexidecimal length must be 8, recieved: "+t;return parseInt(t.substring(2*e,2),16)/255},u.Atlas=function(t,e){this.textureLoader=e,this.pages=[],this.regions=[];var i=new u.AtlasReader(t),r=[];r.length=4;for(var n=null;;){var s=i.readLine();if(null==s)break;if(s=i.trim(s),0==s.length)n=null;else if(n){var a=new u.AtlasRegion;a.name=s,a.page=n,a.rotate="true"==i.readValue(),i.readTuple(r);var o=parseInt(r[0]),h=parseInt(r[1]);i.readTuple(r);var l=parseInt(r[0]),c=parseInt(r[1]);a.u=o/n.width,a.v=h/n.height,a.rotate?(a.u2=(o+c)/n.width,a.v2=(h+l)/n.height):(a.u2=(o+l)/n.width,a.v2=(h+c)/n.height),a.x=o,a.y=h,a.width=Math.abs(l),a.height=Math.abs(c),4==i.readTuple(r)&&(a.splits=[parseInt(r[0]),parseInt(r[1]),parseInt(r[2]),parseInt(r[3])],4==i.readTuple(r)&&(a.pads=[parseInt(r[0]),parseInt(r[1]),parseInt(r[2]),parseInt(r[3])],i.readTuple(r))),a.originalWidth=parseInt(r[0]),a.originalHeight=parseInt(r[1]),i.readTuple(r),a.offsetX=parseInt(r[0]),a.offsetY=parseInt(r[1]),a.index=parseInt(i.readValue()),this.regions.push(a)}else{n=new u.AtlasPage,n.name=s,n.format=u.Atlas.Format[i.readValue()],i.readTuple(r),n.minFilter=u.Atlas.TextureFilter[r[0]],n.magFilter=u.Atlas.TextureFilter[r[1]];var d=i.readValue();n.uWrap=u.Atlas.TextureWrap.clampToEdge,n.vWrap=u.Atlas.TextureWrap.clampToEdge,"x"==d?n.uWrap=u.Atlas.TextureWrap.repeat:"y"==d?n.vWrap=u.Atlas.TextureWrap.repeat:"xy"==d&&(n.uWrap=n.vWrap=u.Atlas.TextureWrap.repeat),e.load(n,s),this.pages.push(n)}}},u.Atlas.prototype={findRegion:function(t){for(var e=this.regions,i=0,r=e.length;r>i;i++)if(e[i].name==t)return e[i];return null},dispose:function(){for(var t=this.pages,e=0,i=t.length;i>e;e++)this.textureLoader.unload(t[e].rendererObject)},updateUVs:function(t){for(var e=this.regions,i=0,r=e.length;r>i;i++){var n=e[i];n.page==t&&(n.u=n.x/t.width,n.v=n.y/t.height,n.rotate?(n.u2=(n.x+n.height)/t.width,n.v2=(n.y+n.width)/t.height):(n.u2=(n.x+n.width)/t.width,n.v2=(n.y+n.height)/t.height))}}},u.Atlas.Format={alpha:0,intensity:1,luminanceAlpha:2,rgb565:3,rgba4444:4,rgb888:5,rgba8888:6},u.Atlas.TextureFilter={nearest:0,linear:1,mipMap:2,mipMapNearestNearest:3,mipMapLinearNearest:4,mipMapNearestLinear:5,mipMapLinearLinear:6},u.Atlas.TextureWrap={mirroredRepeat:0,clampToEdge:1,repeat:2},u.AtlasPage=function(){},u.AtlasPage.prototype={name:null,format:null,minFilter:null,magFilter:null,uWrap:null,vWrap:null,rendererObject:null,width:0,height:0},u.AtlasRegion=function(){},u.AtlasRegion.prototype={page:null,name:null,x:0,y:0,width:0,height:0,u:0,v:0,u2:0,v2:0,offsetX:0,offsetY:0,originalWidth:0,originalHeight:0,index:0,rotate:!1,splits:null,pads:null},u.AtlasReader=function(t){this.lines=t.split(/\r\n|\r|\n/)},u.AtlasReader.prototype={index:0,trim:function(t){return t.replace(/^\s+|\s+$/g,"")},readLine:function(){return this.index>=this.lines.length?null:this.lines[this.index++]},readValue:function(){var t=this.readLine(),e=t.indexOf(":");if(-1==e)throw"Invalid line: "+t;return this.trim(t.substring(e+1))},readTuple:function(t){var e=this.readLine(),i=e.indexOf(":");if(-1==i)throw"Invalid line: "+e;for(var r=0,n=i+1;3>r;r++){var s=e.indexOf(",",n);if(-1==s){if(0==r)throw"Invalid line: "+e;break}t[r]=this.trim(e.substr(n,s-n)),n=s+1}return t[r]=this.trim(e.substring(n)),r+1}},u.AtlasAttachmentLoader=function(t){this.atlas=t},u.AtlasAttachmentLoader.prototype={newAttachment:function(t,e,i){switch(e){case u.AttachmentType.region:var r=this.atlas.findRegion(i);if(!r)throw"Region not found in atlas: "+i+" ("+e+")";var n=new u.RegionAttachment(i);return n.rendererObject=r,n.setUVs(r.u,r.v,r.u2,r.v2,r.rotate),n.regionOffsetX=r.offsetX,n.regionOffsetY=r.offsetY,n.regionWidth=r.width,n.regionHeight=r.height,n.regionOriginalWidth=r.originalWidth,n.regionOriginalHeight=r.originalHeight,n}throw"Unknown attachment type: "+e}},n.AnimCache={},u.Bone.yDown=!0,n.CustomRenderable=function(){n.DisplayObject.call(this)},n.CustomRenderable.constructor=n.CustomRenderable,n.CustomRenderable.prototype=Object.create(n.DisplayObject.prototype),n.CustomRenderable.prototype.renderCanvas=function(){},n.CustomRenderable.prototype.initWebGL=function(){},n.CustomRenderable.prototype.renderWebGL=function(){},n.BaseTextureCache={},n.texturesToUpdate=[],n.texturesToDestroy=[],n.BaseTexture=function(t){if(n.EventTarget.call(this),this.width=100,this.height=100,this.hasLoaded=!1,this.source=t,t){if(this.source instanceof Image)if(this.source.complete)this.hasLoaded=!0,this.width=this.source.width,this.height=this.source.height,n.texturesToUpdate.push(this);else{var e=this;this.source.onload=function(){e.hasLoaded=!0,e.width=e.source.width,e.height=e.source.height,n.texturesToUpdate.push(e),e.dispatchEvent({type:"loaded",content:e})}}else this.hasLoaded=!0,this.width=this.source.width,this.height=this.source.height,n.texturesToUpdate.push(this);this._powerOf2=!1}},n.BaseTexture.constructor=n.BaseTexture,n.BaseTexture.prototype.destroy=function(){this.source instanceof Image&&(this.source.src=null),this.source=null,n.texturesToDestroy.push(this)},n.BaseTexture.fromImage=function(t,e){var i=n.BaseTextureCache[t];if(!i){var r=new Image;e&&(r.crossOrigin=""),r.src=t,i=new n.BaseTexture(r),n.BaseTextureCache[t]=i}return i},n.TextureCache={},n.FrameCache={},n.Texture=function(t,e){if(n.EventTarget.call(this),e||(this.noFrame=!0,e=new n.Rectangle(0,0,1,1)),t instanceof n.Texture&&(t=t.baseTexture),this.baseTexture=t,this.frame=e,this.trim=new n.Point,this.scope=this,t.hasLoaded)this.noFrame&&(e=new n.Rectangle(0,0,t.width,t.height)),this.setFrame(e);else{var i=this;t.addEventListener("loaded",function(){i.onBaseTextureLoaded()})}},n.Texture.constructor=n.Texture,n.Texture.prototype.onBaseTextureLoaded=function(){var t=this.baseTexture;t.removeEventListener("loaded",this.onLoaded),this.noFrame&&(this.frame=new n.Rectangle(0,0,t.width,t.height)),this.noFrame=!1,this.width=this.frame.width,this.height=this.frame.height,this.scope.dispatchEvent({type:"update",content:this})},n.Texture.prototype.destroy=function(t){t&&this.baseTexture.destroy()},n.Texture.prototype.setFrame=function(t){if(this.frame=t,this.width=t.width,this.height=t.height,t.x+t.width>this.baseTexture.width||t.y+t.height>this.baseTexture.height)throw Error("Texture Error: frame does not fit inside the base Texture dimensions "+this);this.updateFrame=!0,n.Texture.frameUpdates.push(this)},n.Texture.fromImage=function(t,e){var i=n.TextureCache[t];return i||(i=new n.Texture(n.BaseTexture.fromImage(t,e)),n.TextureCache[t]=i),i},n.Texture.fromFrame=function(t){var e=n.TextureCache[t];if(!e)throw Error("The frameId '"+t+"' does not exist in the texture cache "+this);return e},n.Texture.fromCanvas=function(t){var e=new n.BaseTexture(t);return new n.Texture(e)},n.Texture.addTextureToCache=function(t,e){n.TextureCache[e]=t},n.Texture.removeTextureFromCache=function(t){var e=n.TextureCache[t];return n.TextureCache[t]=null,e},n.Texture.frameUpdates=[],n.RenderTexture=function(t,e){n.EventTarget.call(this),this.width=t||100,this.height=e||100,this.indetityMatrix=n.mat3.create(),this.frame=new n.Rectangle(0,0,this.width,this.height),n.gl?this.initWebGL():this.initCanvas()},n.RenderTexture.constructor=n.RenderTexture,n.RenderTexture.prototype=Object.create(n.Texture.prototype),n.RenderTexture.prototype.initWebGL=function(){var t=n.gl;this.glFramebuffer=t.createFramebuffer(),t.bindFramebuffer(t.FRAMEBUFFER,this.glFramebuffer),this.glFramebuffer.width=this.width,this.glFramebuffer.height=this.height,this.baseTexture=new n.BaseTexture,this.baseTexture.width=this.width,this.baseTexture.height=this.height,this.baseTexture._glTexture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.baseTexture._glTexture),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,this.width,this.height,0,t.RGBA,t.UNSIGNED_BYTE,null),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),this.baseTexture.isRender=!0,t.bindFramebuffer(t.FRAMEBUFFER,this.glFramebuffer),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,this.baseTexture._glTexture,0),this.projection=new n.Point(this.width/2,this.height/2),this.render=this.renderWebGL},n.RenderTexture.prototype.resize=function(t,e){if(this.width=t,this.height=e,n.gl){this.projection.x=this.width/2,this.projection.y=this.height/2;var i=n.gl;i.bindTexture(i.TEXTURE_2D,this.baseTexture._glTexture),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,this.width,this.height,0,i.RGBA,i.UNSIGNED_BYTE,null)}else this.frame.width=this.width,this.frame.height=this.height,this.renderer.resize(this.width,this.height)},n.RenderTexture.prototype.initCanvas=function(){this.renderer=new n.CanvasRenderer(this.width,this.height,null,0),this.baseTexture=new n.BaseTexture(this.renderer.view),this.frame=new n.Rectangle(0,0,this.width,this.height),this.render=this.renderCanvas +},n.RenderTexture.prototype.renderWebGL=function(t,e,i){var r=n.gl;r.colorMask(!0,!0,!0,!0),r.viewport(0,0,this.width,this.height),r.bindFramebuffer(r.FRAMEBUFFER,this.glFramebuffer),i&&(r.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT));var s=t.children;t.worldTransform=n.mat3.create(),t.worldTransform[4]=-1,t.worldTransform[5]=2*this.projection.y,e&&(t.worldTransform[2]=e.x,t.worldTransform[5]-=e.y);for(var a=0,o=s.length;o>a;a++)s[a].updateTransform();var h=t.__renderGroup;h?t==h.root?h.render(this.projection):h.renderSpecific(t,this.projection):(this.renderGroup||(this.renderGroup=new n.WebGLRenderGroup(r)),this.renderGroup.setRenderable(t),this.renderGroup.render(this.projection))},n.RenderTexture.prototype.renderCanvas=function(t,e,i){var r=t.children;t.worldTransform=n.mat3.create(),e&&(t.worldTransform[2]=e.x,t.worldTransform[5]=e.y);for(var s=0,a=r.length;a>s;s++)r[s].updateTransform();i&&this.renderer.context.clearRect(0,0,this.width,this.height),this.renderer.renderDisplayObject(t),this.renderer.context.setTransform(1,0,0,1,0,0)},n.AssetLoader=function(t,e){n.EventTarget.call(this),this.assetURLs=t,this.crossorigin=e,this.loadersByType={jpg:n.ImageLoader,jpeg:n.ImageLoader,png:n.ImageLoader,gif:n.ImageLoader,json:n.JsonLoader,anim:n.SpineLoader,xml:n.BitmapFontLoader,fnt:n.BitmapFontLoader}},n.AssetLoader.constructor=n.AssetLoader,n.AssetLoader.prototype.load=function(){var t=this;this.loadCount=this.assetURLs.length;for(var e=0;this.assetURLs.length>e;e++){var i=this.assetURLs[e],r=i.split(".").pop().toLowerCase(),n=this.loadersByType[r];if(!n)throw Error(r+" is an unsupported file type");var s=new n(i,this.crossorigin);s.addEventListener("loaded",function(){t.onAssetLoaded()}),s.load()}},n.AssetLoader.prototype.onAssetLoaded=function(){this.loadCount--,this.dispatchEvent({type:"onProgress",content:this}),this.onProgress&&this.onProgress(),0==this.loadCount&&(this.dispatchEvent({type:"onComplete",content:this}),this.onComplete&&this.onComplete())},n.JsonLoader=function(t,e){n.EventTarget.call(this),this.url=t,this.crossorigin=e,this.baseUrl=t.replace(/[^\/]*$/,""),this.loaded=!1},n.JsonLoader.constructor=n.JsonLoader,n.JsonLoader.prototype.load=function(){this.ajaxRequest=new l;var t=this;this.ajaxRequest.onreadystatechange=function(){t.onJSONLoaded()},this.ajaxRequest.open("GET",this.url,!0),this.ajaxRequest.overrideMimeType&&this.ajaxRequest.overrideMimeType("application/json"),this.ajaxRequest.send(null)},n.JsonLoader.prototype.onJSONLoaded=function(){if(4==this.ajaxRequest.readyState)if(200==this.ajaxRequest.status||-1==window.location.href.indexOf("http"))if(this.json=JSON.parse(this.ajaxRequest.responseText),this.json.frames){var t=this,e=this.baseUrl+this.json.meta.image,i=new n.ImageLoader(e,this.crossorigin),r=this.json.frames;this.texture=i.texture.baseTexture,i.addEventListener("loaded",function(){t.onLoaded()});for(var s in r){var a=r[s].frame;a&&(n.TextureCache[s]=new n.Texture(this.texture,{x:a.x,y:a.y,width:a.w,height:a.h}),r[s].trimmed&&(n.TextureCache[s].realSize=r[s].spriteSourceSize,n.TextureCache[s].trim.x=0))}i.load()}else if(this.json.bones){var o=new u.SkeletonJson,h=o.readSkeletonData(this.json);n.AnimCache[this.url]=h,this.onLoaded()}else this.onLoaded();else this.onError()},n.JsonLoader.prototype.onLoaded=function(){this.loaded=!0,this.dispatchEvent({type:"loaded",content:this})},n.JsonLoader.prototype.onError=function(){this.dispatchEvent({type:"error",content:this})},n.SpriteSheetLoader=function(t,e){n.EventTarget.call(this),this.url=t,this.crossorigin=e,this.baseUrl=t.replace(/[^\/]*$/,""),this.texture=null,this.frames={}},n.SpriteSheetLoader.constructor=n.SpriteSheetLoader,n.SpriteSheetLoader.prototype.load=function(){var t=this,e=new n.JsonLoader(this.url,this.crossorigin);e.addEventListener("loaded",function(e){t.json=e.content.json,t.onJSONLoaded()}),e.load()},n.SpriteSheetLoader.prototype.onJSONLoaded=function(){var t=this,e=this.baseUrl+this.json.meta.image,i=new n.ImageLoader(e,this.crossorigin),r=this.json.frames;this.texture=i.texture.baseTexture,i.addEventListener("loaded",function(){t.onLoaded()});for(var s in r){var a=r[s].frame;a&&(n.TextureCache[s]=new n.Texture(this.texture,{x:a.x,y:a.y,width:a.w,height:a.h}),r[s].trimmed&&(n.TextureCache[s].realSize=r[s].spriteSourceSize,n.TextureCache[s].trim.x=0))}i.load()},n.SpriteSheetLoader.prototype.onLoaded=function(){this.dispatchEvent({type:"loaded",content:this})},n.ImageLoader=function(t,e){n.EventTarget.call(this),this.texture=n.Texture.fromImage(t,e)},n.ImageLoader.constructor=n.ImageLoader,n.ImageLoader.prototype.load=function(){if(this.texture.baseTexture.hasLoaded)this.onLoaded();else{var t=this;this.texture.baseTexture.addEventListener("loaded",function(){t.onLoaded()})}},n.ImageLoader.prototype.onLoaded=function(){this.dispatchEvent({type:"loaded",content:this})},n.BitmapFontLoader=function(t,e){n.EventTarget.call(this),this.url=t,this.crossorigin=e,this.baseUrl=t.replace(/[^\/]*$/,""),this.texture=null},n.BitmapFontLoader.constructor=n.BitmapFontLoader,n.BitmapFontLoader.prototype.load=function(){this.ajaxRequest=new XMLHttpRequest;var t=this;this.ajaxRequest.onreadystatechange=function(){t.onXMLLoaded()},this.ajaxRequest.open("GET",this.url,!0),this.ajaxRequest.overrideMimeType&&this.ajaxRequest.overrideMimeType("application/xml"),this.ajaxRequest.send(null)},n.BitmapFontLoader.prototype.onXMLLoaded=function(){if(4==this.ajaxRequest.readyState&&(200==this.ajaxRequest.status||-1==window.location.href.indexOf("http"))){var t=this.baseUrl+this.ajaxRequest.responseXML.getElementsByTagName("page")[0].attributes.getNamedItem("file").nodeValue,e=new n.ImageLoader(t,this.crossorigin);this.texture=e.texture.baseTexture;var i={},r=this.ajaxRequest.responseXML.getElementsByTagName("info")[0],s=this.ajaxRequest.responseXML.getElementsByTagName("common")[0];i.font=r.attributes.getNamedItem("face").nodeValue,i.size=parseInt(r.attributes.getNamedItem("size").nodeValue,10),i.lineHeight=parseInt(s.attributes.getNamedItem("lineHeight").nodeValue,10),i.chars={};for(var a=this.ajaxRequest.responseXML.getElementsByTagName("char"),o=0;a.length>o;o++){var h=parseInt(a[o].attributes.getNamedItem("id").nodeValue,10),l={x:parseInt(a[o].attributes.getNamedItem("x").nodeValue,10),y:parseInt(a[o].attributes.getNamedItem("y").nodeValue,10),width:parseInt(a[o].attributes.getNamedItem("width").nodeValue,10),height:parseInt(a[o].attributes.getNamedItem("height").nodeValue,10)};n.TextureCache[h]=new n.Texture(this.texture,l),i.chars[h]={xOffset:parseInt(a[o].attributes.getNamedItem("xoffset").nodeValue,10),yOffset:parseInt(a[o].attributes.getNamedItem("yoffset").nodeValue,10),xAdvance:parseInt(a[o].attributes.getNamedItem("xadvance").nodeValue,10),kerning:{},texture:new n.Texture(this.texture,l)}}var u=this.ajaxRequest.responseXML.getElementsByTagName("kerning");for(o=0;u.length>o;o++){var c=parseInt(u[o].attributes.getNamedItem("first").nodeValue,10),d=parseInt(u[o].attributes.getNamedItem("second").nodeValue,10),p=parseInt(u[o].attributes.getNamedItem("amount").nodeValue,10);i.chars[d].kerning[c]=p}n.BitmapText.fonts[i.font]=i;var f=this;e.addEventListener("loaded",function(){f.onLoaded()}),e.load()}},n.BitmapFontLoader.prototype.onLoaded=function(){this.dispatchEvent({type:"loaded",content:this})},n.SpineLoader=function(t,e){n.EventTarget.call(this),this.url=t,this.crossorigin=e,this.loaded=!1},n.SpineLoader.constructor=n.SpineLoader,n.SpineLoader.prototype.load=function(){var t=this,e=new n.JsonLoader(this.url,this.crossorigin);e.addEventListener("loaded",function(e){t.json=e.content.json,t.onJSONLoaded()}),e.load()},n.SpineLoader.prototype.onJSONLoaded=function(){var t=new u.SkeletonJson,e=t.readSkeletonData(this.json);n.AnimCache[this.url]=e,this.onLoaded()},n.SpineLoader.prototype.onLoaded=function(){this.loaded=!0,this.dispatchEvent({type:"loaded",content:this})},"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=n),exports.PIXI=n):i.PIXI=n}).call(this); \ No newline at end of file diff --git a/examples/example 1 - Basics/pixi.js b/examples/example 1 - Basics/pixi.js index 825c2bd..a4bd036 100644 --- a/examples/example 1 - Basics/pixi.js +++ b/examples/example 1 - Basics/pixi.js @@ -4,7 +4,7 @@ * Copyright (c) 2012, Mat Groves * http://goodboydigital.com/ * - * Compiled: 2013-07-11 + * Compiled: 2013-07-24 * * Pixi.JS is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license.php @@ -1267,7 +1267,7 @@ PIXI.DisplayObjectContainer = function() } // constructor -PIXI.DisplayObjectContainer.constructor = PIXI.DisplayObjectContainer; +//PIXI.DisplayObjectContainer.constructor = PIXI.DisplayObjectContainer; PIXI.DisplayObjectContainer.prototype = Object.create( PIXI.DisplayObject.prototype ); //TODO make visible a getter setter @@ -2600,6 +2600,7 @@ PIXI.InteractionManager.prototype.update = function() { // ok so there are some functions so lets hit test it.. item.__hit = this.hitTest(item, this.mouse); + this.mouse.target = item; // ok so deal with interactions.. // loks like there was a hit! if(item.__hit) @@ -2780,14 +2781,18 @@ PIXI.InteractionManager.prototype.hitTest = function(item, interactionData) x = a11 * id * global.x + -a01 * id * global.y + (a12 * a01 - a02 * a11) * id, y = a00 * id * global.y + -a10 * id * global.x + (-a12 * a00 + a02 * a10) * id; + interactionData.target = item; + //a sprite or display object with a hit area defined if(item.hitArea && item.hitArea.contains) { if(item.hitArea.contains(x, y)) { - if(isSprite) - interactionData.target = item; + //if(isSprite) + interactionData.target = item; return true; } + + return false; } // a sprite with no hitarea defined else if(isSprite) @@ -2816,7 +2821,12 @@ PIXI.InteractionManager.prototype.hitTest = function(item, interactionData) { var tempItem = item.children[i]; var hit = this.hitTest(tempItem, interactionData); - if(hit)return true; + if(hit) + { + // hmm.. TODO SET CORRECT TARGET? + interactionData.target = item + return true; + } } return false; @@ -4554,7 +4564,7 @@ PIXI.WebGLRenderer.updateTextures = function() PIXI.WebGLRenderer.updateTexture = function(texture) { var gl = PIXI.gl; - + if(!texture._glTexture) { texture._glTexture = gl.createTexture(); @@ -5207,7 +5217,7 @@ PIXI.WebGLBatch.prototype.render = function(start, end) start = start || 0; //end = end || this.size; if(end == undefined)end = this.size; - + if(this.dirty) { this.refresh(); @@ -5764,7 +5774,7 @@ PIXI.WebGLRenderGroup.prototype.addDisplayObjectAndChildren = function(displayOb */ var previousRenderable = displayObject.first; - while(previousRenderable != this.root) + while(previousRenderable != this.root.first) { previousRenderable = previousRenderable._iPrev; if(previousRenderable.renderable && previousRenderable.__renderGroup)break; @@ -9494,7 +9504,7 @@ PIXI.RenderTexture.prototype.initWebGL = function() // create a projection matrix.. this.projection = new PIXI.Point(this.width/2 , this.height/2); - +/* this.projectionMatrix = PIXI.mat4.create(); this.projectionMatrix[5] = 2/this.height// * 0.5; @@ -9502,7 +9512,7 @@ PIXI.RenderTexture.prototype.initWebGL = function() this.projectionMatrix[0] = 2/this.width; this.projectionMatrix[12] = -1; - +*/ // set the correct render function.. this.render = this.renderWebGL; @@ -9512,19 +9522,26 @@ PIXI.RenderTexture.prototype.initWebGL = function() PIXI.RenderTexture.prototype.resize = function(width, height) { + this.width = width; this.height = height; - this.projection = new PIXI.Point(this.width/2 , this.height/2); + //this.frame.width = this.width + //this.frame.height = this.height; + if(PIXI.gl) { + this.projection.x = this.width/2 + this.projection.y = this.height/2; + var gl = PIXI.gl; gl.bindTexture(gl.TEXTURE_2D, this.baseTexture._glTexture); gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, this.width, this.height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); } else { + this.frame.width = this.width this.frame.height = this.height; this.renderer.resize(this.width, this.height); diff --git a/examples/example 10 - Text/pixi.js b/examples/example 10 - Text/pixi.js index 825c2bd..a4bd036 100644 --- a/examples/example 10 - Text/pixi.js +++ b/examples/example 10 - Text/pixi.js @@ -4,7 +4,7 @@ * Copyright (c) 2012, Mat Groves * http://goodboydigital.com/ * - * Compiled: 2013-07-11 + * Compiled: 2013-07-24 * * Pixi.JS is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license.php @@ -1267,7 +1267,7 @@ PIXI.DisplayObjectContainer = function() } // constructor -PIXI.DisplayObjectContainer.constructor = PIXI.DisplayObjectContainer; +//PIXI.DisplayObjectContainer.constructor = PIXI.DisplayObjectContainer; PIXI.DisplayObjectContainer.prototype = Object.create( PIXI.DisplayObject.prototype ); //TODO make visible a getter setter @@ -2600,6 +2600,7 @@ PIXI.InteractionManager.prototype.update = function() { // ok so there are some functions so lets hit test it.. item.__hit = this.hitTest(item, this.mouse); + this.mouse.target = item; // ok so deal with interactions.. // loks like there was a hit! if(item.__hit) @@ -2780,14 +2781,18 @@ PIXI.InteractionManager.prototype.hitTest = function(item, interactionData) x = a11 * id * global.x + -a01 * id * global.y + (a12 * a01 - a02 * a11) * id, y = a00 * id * global.y + -a10 * id * global.x + (-a12 * a00 + a02 * a10) * id; + interactionData.target = item; + //a sprite or display object with a hit area defined if(item.hitArea && item.hitArea.contains) { if(item.hitArea.contains(x, y)) { - if(isSprite) - interactionData.target = item; + //if(isSprite) + interactionData.target = item; return true; } + + return false; } // a sprite with no hitarea defined else if(isSprite) @@ -2816,7 +2821,12 @@ PIXI.InteractionManager.prototype.hitTest = function(item, interactionData) { var tempItem = item.children[i]; var hit = this.hitTest(tempItem, interactionData); - if(hit)return true; + if(hit) + { + // hmm.. TODO SET CORRECT TARGET? + interactionData.target = item + return true; + } } return false; @@ -4554,7 +4564,7 @@ PIXI.WebGLRenderer.updateTextures = function() PIXI.WebGLRenderer.updateTexture = function(texture) { var gl = PIXI.gl; - + if(!texture._glTexture) { texture._glTexture = gl.createTexture(); @@ -5207,7 +5217,7 @@ PIXI.WebGLBatch.prototype.render = function(start, end) start = start || 0; //end = end || this.size; if(end == undefined)end = this.size; - + if(this.dirty) { this.refresh(); @@ -5764,7 +5774,7 @@ PIXI.WebGLRenderGroup.prototype.addDisplayObjectAndChildren = function(displayOb */ var previousRenderable = displayObject.first; - while(previousRenderable != this.root) + while(previousRenderable != this.root.first) { previousRenderable = previousRenderable._iPrev; if(previousRenderable.renderable && previousRenderable.__renderGroup)break; @@ -9494,7 +9504,7 @@ PIXI.RenderTexture.prototype.initWebGL = function() // create a projection matrix.. this.projection = new PIXI.Point(this.width/2 , this.height/2); - +/* this.projectionMatrix = PIXI.mat4.create(); this.projectionMatrix[5] = 2/this.height// * 0.5; @@ -9502,7 +9512,7 @@ PIXI.RenderTexture.prototype.initWebGL = function() this.projectionMatrix[0] = 2/this.width; this.projectionMatrix[12] = -1; - +*/ // set the correct render function.. this.render = this.renderWebGL; @@ -9512,19 +9522,26 @@ PIXI.RenderTexture.prototype.initWebGL = function() PIXI.RenderTexture.prototype.resize = function(width, height) { + this.width = width; this.height = height; - this.projection = new PIXI.Point(this.width/2 , this.height/2); + //this.frame.width = this.width + //this.frame.height = this.height; + if(PIXI.gl) { + this.projection.x = this.width/2 + this.projection.y = this.height/2; + var gl = PIXI.gl; gl.bindTexture(gl.TEXTURE_2D, this.baseTexture._glTexture); gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, this.width, this.height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); } else { + this.frame.width = this.width this.frame.height = this.height; this.renderer.resize(this.width, this.height); diff --git a/examples/example 11 - RenderTexture/pixi.js b/examples/example 11 - RenderTexture/pixi.js index 825c2bd..a4bd036 100644 --- a/examples/example 11 - RenderTexture/pixi.js +++ b/examples/example 11 - RenderTexture/pixi.js @@ -4,7 +4,7 @@ * Copyright (c) 2012, Mat Groves * http://goodboydigital.com/ * - * Compiled: 2013-07-11 + * Compiled: 2013-07-24 * * Pixi.JS is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license.php @@ -1267,7 +1267,7 @@ PIXI.DisplayObjectContainer = function() } // constructor -PIXI.DisplayObjectContainer.constructor = PIXI.DisplayObjectContainer; +//PIXI.DisplayObjectContainer.constructor = PIXI.DisplayObjectContainer; PIXI.DisplayObjectContainer.prototype = Object.create( PIXI.DisplayObject.prototype ); //TODO make visible a getter setter @@ -2600,6 +2600,7 @@ PIXI.InteractionManager.prototype.update = function() { // ok so there are some functions so lets hit test it.. item.__hit = this.hitTest(item, this.mouse); + this.mouse.target = item; // ok so deal with interactions.. // loks like there was a hit! if(item.__hit) @@ -2780,14 +2781,18 @@ PIXI.InteractionManager.prototype.hitTest = function(item, interactionData) x = a11 * id * global.x + -a01 * id * global.y + (a12 * a01 - a02 * a11) * id, y = a00 * id * global.y + -a10 * id * global.x + (-a12 * a00 + a02 * a10) * id; + interactionData.target = item; + //a sprite or display object with a hit area defined if(item.hitArea && item.hitArea.contains) { if(item.hitArea.contains(x, y)) { - if(isSprite) - interactionData.target = item; + //if(isSprite) + interactionData.target = item; return true; } + + return false; } // a sprite with no hitarea defined else if(isSprite) @@ -2816,7 +2821,12 @@ PIXI.InteractionManager.prototype.hitTest = function(item, interactionData) { var tempItem = item.children[i]; var hit = this.hitTest(tempItem, interactionData); - if(hit)return true; + if(hit) + { + // hmm.. TODO SET CORRECT TARGET? + interactionData.target = item + return true; + } } return false; @@ -4554,7 +4564,7 @@ PIXI.WebGLRenderer.updateTextures = function() PIXI.WebGLRenderer.updateTexture = function(texture) { var gl = PIXI.gl; - + if(!texture._glTexture) { texture._glTexture = gl.createTexture(); @@ -5207,7 +5217,7 @@ PIXI.WebGLBatch.prototype.render = function(start, end) start = start || 0; //end = end || this.size; if(end == undefined)end = this.size; - + if(this.dirty) { this.refresh(); @@ -5764,7 +5774,7 @@ PIXI.WebGLRenderGroup.prototype.addDisplayObjectAndChildren = function(displayOb */ var previousRenderable = displayObject.first; - while(previousRenderable != this.root) + while(previousRenderable != this.root.first) { previousRenderable = previousRenderable._iPrev; if(previousRenderable.renderable && previousRenderable.__renderGroup)break; @@ -9494,7 +9504,7 @@ PIXI.RenderTexture.prototype.initWebGL = function() // create a projection matrix.. this.projection = new PIXI.Point(this.width/2 , this.height/2); - +/* this.projectionMatrix = PIXI.mat4.create(); this.projectionMatrix[5] = 2/this.height// * 0.5; @@ -9502,7 +9512,7 @@ PIXI.RenderTexture.prototype.initWebGL = function() this.projectionMatrix[0] = 2/this.width; this.projectionMatrix[12] = -1; - +*/ // set the correct render function.. this.render = this.renderWebGL; @@ -9512,19 +9522,26 @@ PIXI.RenderTexture.prototype.initWebGL = function() PIXI.RenderTexture.prototype.resize = function(width, height) { + this.width = width; this.height = height; - this.projection = new PIXI.Point(this.width/2 , this.height/2); + //this.frame.width = this.width + //this.frame.height = this.height; + if(PIXI.gl) { + this.projection.x = this.width/2 + this.projection.y = this.height/2; + var gl = PIXI.gl; gl.bindTexture(gl.TEXTURE_2D, this.baseTexture._glTexture); gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, this.width, this.height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); } else { + this.frame.width = this.width this.frame.height = this.height; this.renderer.resize(this.width, this.height); diff --git a/examples/example 12 - Spine/pixi.js b/examples/example 12 - Spine/pixi.js index 825c2bd..a4bd036 100644 --- a/examples/example 12 - Spine/pixi.js +++ b/examples/example 12 - Spine/pixi.js @@ -4,7 +4,7 @@ * Copyright (c) 2012, Mat Groves * http://goodboydigital.com/ * - * Compiled: 2013-07-11 + * Compiled: 2013-07-24 * * Pixi.JS is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license.php @@ -1267,7 +1267,7 @@ PIXI.DisplayObjectContainer = function() } // constructor -PIXI.DisplayObjectContainer.constructor = PIXI.DisplayObjectContainer; +//PIXI.DisplayObjectContainer.constructor = PIXI.DisplayObjectContainer; PIXI.DisplayObjectContainer.prototype = Object.create( PIXI.DisplayObject.prototype ); //TODO make visible a getter setter @@ -2600,6 +2600,7 @@ PIXI.InteractionManager.prototype.update = function() { // ok so there are some functions so lets hit test it.. item.__hit = this.hitTest(item, this.mouse); + this.mouse.target = item; // ok so deal with interactions.. // loks like there was a hit! if(item.__hit) @@ -2780,14 +2781,18 @@ PIXI.InteractionManager.prototype.hitTest = function(item, interactionData) x = a11 * id * global.x + -a01 * id * global.y + (a12 * a01 - a02 * a11) * id, y = a00 * id * global.y + -a10 * id * global.x + (-a12 * a00 + a02 * a10) * id; + interactionData.target = item; + //a sprite or display object with a hit area defined if(item.hitArea && item.hitArea.contains) { if(item.hitArea.contains(x, y)) { - if(isSprite) - interactionData.target = item; + //if(isSprite) + interactionData.target = item; return true; } + + return false; } // a sprite with no hitarea defined else if(isSprite) @@ -2816,7 +2821,12 @@ PIXI.InteractionManager.prototype.hitTest = function(item, interactionData) { var tempItem = item.children[i]; var hit = this.hitTest(tempItem, interactionData); - if(hit)return true; + if(hit) + { + // hmm.. TODO SET CORRECT TARGET? + interactionData.target = item + return true; + } } return false; @@ -4554,7 +4564,7 @@ PIXI.WebGLRenderer.updateTextures = function() PIXI.WebGLRenderer.updateTexture = function(texture) { var gl = PIXI.gl; - + if(!texture._glTexture) { texture._glTexture = gl.createTexture(); @@ -5207,7 +5217,7 @@ PIXI.WebGLBatch.prototype.render = function(start, end) start = start || 0; //end = end || this.size; if(end == undefined)end = this.size; - + if(this.dirty) { this.refresh(); @@ -5764,7 +5774,7 @@ PIXI.WebGLRenderGroup.prototype.addDisplayObjectAndChildren = function(displayOb */ var previousRenderable = displayObject.first; - while(previousRenderable != this.root) + while(previousRenderable != this.root.first) { previousRenderable = previousRenderable._iPrev; if(previousRenderable.renderable && previousRenderable.__renderGroup)break; @@ -9494,7 +9504,7 @@ PIXI.RenderTexture.prototype.initWebGL = function() // create a projection matrix.. this.projection = new PIXI.Point(this.width/2 , this.height/2); - +/* this.projectionMatrix = PIXI.mat4.create(); this.projectionMatrix[5] = 2/this.height// * 0.5; @@ -9502,7 +9512,7 @@ PIXI.RenderTexture.prototype.initWebGL = function() this.projectionMatrix[0] = 2/this.width; this.projectionMatrix[12] = -1; - +*/ // set the correct render function.. this.render = this.renderWebGL; @@ -9512,19 +9522,26 @@ PIXI.RenderTexture.prototype.initWebGL = function() PIXI.RenderTexture.prototype.resize = function(width, height) { + this.width = width; this.height = height; - this.projection = new PIXI.Point(this.width/2 , this.height/2); + //this.frame.width = this.width + //this.frame.height = this.height; + if(PIXI.gl) { + this.projection.x = this.width/2 + this.projection.y = this.height/2; + var gl = PIXI.gl; gl.bindTexture(gl.TEXTURE_2D, this.baseTexture._glTexture); gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, this.width, this.height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); } else { + this.frame.width = this.width this.frame.height = this.height; this.renderer.resize(this.width, this.height); diff --git a/examples/example 13 - Graphics/pixi.js b/examples/example 13 - Graphics/pixi.js index 825c2bd..a4bd036 100644 --- a/examples/example 13 - Graphics/pixi.js +++ b/examples/example 13 - Graphics/pixi.js @@ -4,7 +4,7 @@ * Copyright (c) 2012, Mat Groves * http://goodboydigital.com/ * - * Compiled: 2013-07-11 + * Compiled: 2013-07-24 * * Pixi.JS is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license.php @@ -1267,7 +1267,7 @@ PIXI.DisplayObjectContainer = function() } // constructor -PIXI.DisplayObjectContainer.constructor = PIXI.DisplayObjectContainer; +//PIXI.DisplayObjectContainer.constructor = PIXI.DisplayObjectContainer; PIXI.DisplayObjectContainer.prototype = Object.create( PIXI.DisplayObject.prototype ); //TODO make visible a getter setter @@ -2600,6 +2600,7 @@ PIXI.InteractionManager.prototype.update = function() { // ok so there are some functions so lets hit test it.. item.__hit = this.hitTest(item, this.mouse); + this.mouse.target = item; // ok so deal with interactions.. // loks like there was a hit! if(item.__hit) @@ -2780,14 +2781,18 @@ PIXI.InteractionManager.prototype.hitTest = function(item, interactionData) x = a11 * id * global.x + -a01 * id * global.y + (a12 * a01 - a02 * a11) * id, y = a00 * id * global.y + -a10 * id * global.x + (-a12 * a00 + a02 * a10) * id; + interactionData.target = item; + //a sprite or display object with a hit area defined if(item.hitArea && item.hitArea.contains) { if(item.hitArea.contains(x, y)) { - if(isSprite) - interactionData.target = item; + //if(isSprite) + interactionData.target = item; return true; } + + return false; } // a sprite with no hitarea defined else if(isSprite) @@ -2816,7 +2821,12 @@ PIXI.InteractionManager.prototype.hitTest = function(item, interactionData) { var tempItem = item.children[i]; var hit = this.hitTest(tempItem, interactionData); - if(hit)return true; + if(hit) + { + // hmm.. TODO SET CORRECT TARGET? + interactionData.target = item + return true; + } } return false; @@ -4554,7 +4564,7 @@ PIXI.WebGLRenderer.updateTextures = function() PIXI.WebGLRenderer.updateTexture = function(texture) { var gl = PIXI.gl; - + if(!texture._glTexture) { texture._glTexture = gl.createTexture(); @@ -5207,7 +5217,7 @@ PIXI.WebGLBatch.prototype.render = function(start, end) start = start || 0; //end = end || this.size; if(end == undefined)end = this.size; - + if(this.dirty) { this.refresh(); @@ -5764,7 +5774,7 @@ PIXI.WebGLRenderGroup.prototype.addDisplayObjectAndChildren = function(displayOb */ var previousRenderable = displayObject.first; - while(previousRenderable != this.root) + while(previousRenderable != this.root.first) { previousRenderable = previousRenderable._iPrev; if(previousRenderable.renderable && previousRenderable.__renderGroup)break; @@ -9494,7 +9504,7 @@ PIXI.RenderTexture.prototype.initWebGL = function() // create a projection matrix.. this.projection = new PIXI.Point(this.width/2 , this.height/2); - +/* this.projectionMatrix = PIXI.mat4.create(); this.projectionMatrix[5] = 2/this.height// * 0.5; @@ -9502,7 +9512,7 @@ PIXI.RenderTexture.prototype.initWebGL = function() this.projectionMatrix[0] = 2/this.width; this.projectionMatrix[12] = -1; - +*/ // set the correct render function.. this.render = this.renderWebGL; @@ -9512,19 +9522,26 @@ PIXI.RenderTexture.prototype.initWebGL = function() PIXI.RenderTexture.prototype.resize = function(width, height) { + this.width = width; this.height = height; - this.projection = new PIXI.Point(this.width/2 , this.height/2); + //this.frame.width = this.width + //this.frame.height = this.height; + if(PIXI.gl) { + this.projection.x = this.width/2 + this.projection.y = this.height/2; + var gl = PIXI.gl; gl.bindTexture(gl.TEXTURE_2D, this.baseTexture._glTexture); gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, this.width, this.height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); } else { + this.frame.width = this.width this.frame.height = this.height; this.renderer.resize(this.width, this.height); diff --git a/examples/example 14 - Masking/pixi.js b/examples/example 14 - Masking/pixi.js index 825c2bd..a4bd036 100644 --- a/examples/example 14 - Masking/pixi.js +++ b/examples/example 14 - Masking/pixi.js @@ -4,7 +4,7 @@ * Copyright (c) 2012, Mat Groves * http://goodboydigital.com/ * - * Compiled: 2013-07-11 + * Compiled: 2013-07-24 * * Pixi.JS is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license.php @@ -1267,7 +1267,7 @@ PIXI.DisplayObjectContainer = function() } // constructor -PIXI.DisplayObjectContainer.constructor = PIXI.DisplayObjectContainer; +//PIXI.DisplayObjectContainer.constructor = PIXI.DisplayObjectContainer; PIXI.DisplayObjectContainer.prototype = Object.create( PIXI.DisplayObject.prototype ); //TODO make visible a getter setter @@ -2600,6 +2600,7 @@ PIXI.InteractionManager.prototype.update = function() { // ok so there are some functions so lets hit test it.. item.__hit = this.hitTest(item, this.mouse); + this.mouse.target = item; // ok so deal with interactions.. // loks like there was a hit! if(item.__hit) @@ -2780,14 +2781,18 @@ PIXI.InteractionManager.prototype.hitTest = function(item, interactionData) x = a11 * id * global.x + -a01 * id * global.y + (a12 * a01 - a02 * a11) * id, y = a00 * id * global.y + -a10 * id * global.x + (-a12 * a00 + a02 * a10) * id; + interactionData.target = item; + //a sprite or display object with a hit area defined if(item.hitArea && item.hitArea.contains) { if(item.hitArea.contains(x, y)) { - if(isSprite) - interactionData.target = item; + //if(isSprite) + interactionData.target = item; return true; } + + return false; } // a sprite with no hitarea defined else if(isSprite) @@ -2816,7 +2821,12 @@ PIXI.InteractionManager.prototype.hitTest = function(item, interactionData) { var tempItem = item.children[i]; var hit = this.hitTest(tempItem, interactionData); - if(hit)return true; + if(hit) + { + // hmm.. TODO SET CORRECT TARGET? + interactionData.target = item + return true; + } } return false; @@ -4554,7 +4564,7 @@ PIXI.WebGLRenderer.updateTextures = function() PIXI.WebGLRenderer.updateTexture = function(texture) { var gl = PIXI.gl; - + if(!texture._glTexture) { texture._glTexture = gl.createTexture(); @@ -5207,7 +5217,7 @@ PIXI.WebGLBatch.prototype.render = function(start, end) start = start || 0; //end = end || this.size; if(end == undefined)end = this.size; - + if(this.dirty) { this.refresh(); @@ -5764,7 +5774,7 @@ PIXI.WebGLRenderGroup.prototype.addDisplayObjectAndChildren = function(displayOb */ var previousRenderable = displayObject.first; - while(previousRenderable != this.root) + while(previousRenderable != this.root.first) { previousRenderable = previousRenderable._iPrev; if(previousRenderable.renderable && previousRenderable.__renderGroup)break; @@ -9494,7 +9504,7 @@ PIXI.RenderTexture.prototype.initWebGL = function() // create a projection matrix.. this.projection = new PIXI.Point(this.width/2 , this.height/2); - +/* this.projectionMatrix = PIXI.mat4.create(); this.projectionMatrix[5] = 2/this.height// * 0.5; @@ -9502,7 +9512,7 @@ PIXI.RenderTexture.prototype.initWebGL = function() this.projectionMatrix[0] = 2/this.width; this.projectionMatrix[12] = -1; - +*/ // set the correct render function.. this.render = this.renderWebGL; @@ -9512,19 +9522,26 @@ PIXI.RenderTexture.prototype.initWebGL = function() PIXI.RenderTexture.prototype.resize = function(width, height) { + this.width = width; this.height = height; - this.projection = new PIXI.Point(this.width/2 , this.height/2); + //this.frame.width = this.width + //this.frame.height = this.height; + if(PIXI.gl) { + this.projection.x = this.width/2 + this.projection.y = this.height/2; + var gl = PIXI.gl; gl.bindTexture(gl.TEXTURE_2D, this.baseTexture._glTexture); gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, this.width, this.height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); } else { + this.frame.width = this.width this.frame.height = this.height; this.renderer.resize(this.width, this.height); diff --git a/examples/example 2 - SpriteSheet/pixi.js b/examples/example 2 - SpriteSheet/pixi.js index 825c2bd..a4bd036 100644 --- a/examples/example 2 - SpriteSheet/pixi.js +++ b/examples/example 2 - SpriteSheet/pixi.js @@ -4,7 +4,7 @@ * Copyright (c) 2012, Mat Groves * http://goodboydigital.com/ * - * Compiled: 2013-07-11 + * Compiled: 2013-07-24 * * Pixi.JS is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license.php @@ -1267,7 +1267,7 @@ PIXI.DisplayObjectContainer = function() } // constructor -PIXI.DisplayObjectContainer.constructor = PIXI.DisplayObjectContainer; +//PIXI.DisplayObjectContainer.constructor = PIXI.DisplayObjectContainer; PIXI.DisplayObjectContainer.prototype = Object.create( PIXI.DisplayObject.prototype ); //TODO make visible a getter setter @@ -2600,6 +2600,7 @@ PIXI.InteractionManager.prototype.update = function() { // ok so there are some functions so lets hit test it.. item.__hit = this.hitTest(item, this.mouse); + this.mouse.target = item; // ok so deal with interactions.. // loks like there was a hit! if(item.__hit) @@ -2780,14 +2781,18 @@ PIXI.InteractionManager.prototype.hitTest = function(item, interactionData) x = a11 * id * global.x + -a01 * id * global.y + (a12 * a01 - a02 * a11) * id, y = a00 * id * global.y + -a10 * id * global.x + (-a12 * a00 + a02 * a10) * id; + interactionData.target = item; + //a sprite or display object with a hit area defined if(item.hitArea && item.hitArea.contains) { if(item.hitArea.contains(x, y)) { - if(isSprite) - interactionData.target = item; + //if(isSprite) + interactionData.target = item; return true; } + + return false; } // a sprite with no hitarea defined else if(isSprite) @@ -2816,7 +2821,12 @@ PIXI.InteractionManager.prototype.hitTest = function(item, interactionData) { var tempItem = item.children[i]; var hit = this.hitTest(tempItem, interactionData); - if(hit)return true; + if(hit) + { + // hmm.. TODO SET CORRECT TARGET? + interactionData.target = item + return true; + } } return false; @@ -4554,7 +4564,7 @@ PIXI.WebGLRenderer.updateTextures = function() PIXI.WebGLRenderer.updateTexture = function(texture) { var gl = PIXI.gl; - + if(!texture._glTexture) { texture._glTexture = gl.createTexture(); @@ -5207,7 +5217,7 @@ PIXI.WebGLBatch.prototype.render = function(start, end) start = start || 0; //end = end || this.size; if(end == undefined)end = this.size; - + if(this.dirty) { this.refresh(); @@ -5764,7 +5774,7 @@ PIXI.WebGLRenderGroup.prototype.addDisplayObjectAndChildren = function(displayOb */ var previousRenderable = displayObject.first; - while(previousRenderable != this.root) + while(previousRenderable != this.root.first) { previousRenderable = previousRenderable._iPrev; if(previousRenderable.renderable && previousRenderable.__renderGroup)break; @@ -9494,7 +9504,7 @@ PIXI.RenderTexture.prototype.initWebGL = function() // create a projection matrix.. this.projection = new PIXI.Point(this.width/2 , this.height/2); - +/* this.projectionMatrix = PIXI.mat4.create(); this.projectionMatrix[5] = 2/this.height// * 0.5; @@ -9502,7 +9512,7 @@ PIXI.RenderTexture.prototype.initWebGL = function() this.projectionMatrix[0] = 2/this.width; this.projectionMatrix[12] = -1; - +*/ // set the correct render function.. this.render = this.renderWebGL; @@ -9512,19 +9522,26 @@ PIXI.RenderTexture.prototype.initWebGL = function() PIXI.RenderTexture.prototype.resize = function(width, height) { + this.width = width; this.height = height; - this.projection = new PIXI.Point(this.width/2 , this.height/2); + //this.frame.width = this.width + //this.frame.height = this.height; + if(PIXI.gl) { + this.projection.x = this.width/2 + this.projection.y = this.height/2; + var gl = PIXI.gl; gl.bindTexture(gl.TEXTURE_2D, this.baseTexture._glTexture); gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, this.width, this.height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); } else { + this.frame.width = this.width this.frame.height = this.height; this.renderer.resize(this.width, this.height); diff --git a/examples/example 3 - MovieClip/pixi.js b/examples/example 3 - MovieClip/pixi.js index 825c2bd..a4bd036 100755 --- a/examples/example 3 - MovieClip/pixi.js +++ b/examples/example 3 - MovieClip/pixi.js @@ -4,7 +4,7 @@ * Copyright (c) 2012, Mat Groves * http://goodboydigital.com/ * - * Compiled: 2013-07-11 + * Compiled: 2013-07-24 * * Pixi.JS is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license.php @@ -1267,7 +1267,7 @@ PIXI.DisplayObjectContainer = function() } // constructor -PIXI.DisplayObjectContainer.constructor = PIXI.DisplayObjectContainer; +//PIXI.DisplayObjectContainer.constructor = PIXI.DisplayObjectContainer; PIXI.DisplayObjectContainer.prototype = Object.create( PIXI.DisplayObject.prototype ); //TODO make visible a getter setter @@ -2600,6 +2600,7 @@ PIXI.InteractionManager.prototype.update = function() { // ok so there are some functions so lets hit test it.. item.__hit = this.hitTest(item, this.mouse); + this.mouse.target = item; // ok so deal with interactions.. // loks like there was a hit! if(item.__hit) @@ -2780,14 +2781,18 @@ PIXI.InteractionManager.prototype.hitTest = function(item, interactionData) x = a11 * id * global.x + -a01 * id * global.y + (a12 * a01 - a02 * a11) * id, y = a00 * id * global.y + -a10 * id * global.x + (-a12 * a00 + a02 * a10) * id; + interactionData.target = item; + //a sprite or display object with a hit area defined if(item.hitArea && item.hitArea.contains) { if(item.hitArea.contains(x, y)) { - if(isSprite) - interactionData.target = item; + //if(isSprite) + interactionData.target = item; return true; } + + return false; } // a sprite with no hitarea defined else if(isSprite) @@ -2816,7 +2821,12 @@ PIXI.InteractionManager.prototype.hitTest = function(item, interactionData) { var tempItem = item.children[i]; var hit = this.hitTest(tempItem, interactionData); - if(hit)return true; + if(hit) + { + // hmm.. TODO SET CORRECT TARGET? + interactionData.target = item + return true; + } } return false; @@ -4554,7 +4564,7 @@ PIXI.WebGLRenderer.updateTextures = function() PIXI.WebGLRenderer.updateTexture = function(texture) { var gl = PIXI.gl; - + if(!texture._glTexture) { texture._glTexture = gl.createTexture(); @@ -5207,7 +5217,7 @@ PIXI.WebGLBatch.prototype.render = function(start, end) start = start || 0; //end = end || this.size; if(end == undefined)end = this.size; - + if(this.dirty) { this.refresh(); @@ -5764,7 +5774,7 @@ PIXI.WebGLRenderGroup.prototype.addDisplayObjectAndChildren = function(displayOb */ var previousRenderable = displayObject.first; - while(previousRenderable != this.root) + while(previousRenderable != this.root.first) { previousRenderable = previousRenderable._iPrev; if(previousRenderable.renderable && previousRenderable.__renderGroup)break; @@ -9494,7 +9504,7 @@ PIXI.RenderTexture.prototype.initWebGL = function() // create a projection matrix.. this.projection = new PIXI.Point(this.width/2 , this.height/2); - +/* this.projectionMatrix = PIXI.mat4.create(); this.projectionMatrix[5] = 2/this.height// * 0.5; @@ -9502,7 +9512,7 @@ PIXI.RenderTexture.prototype.initWebGL = function() this.projectionMatrix[0] = 2/this.width; this.projectionMatrix[12] = -1; - +*/ // set the correct render function.. this.render = this.renderWebGL; @@ -9512,19 +9522,26 @@ PIXI.RenderTexture.prototype.initWebGL = function() PIXI.RenderTexture.prototype.resize = function(width, height) { + this.width = width; this.height = height; - this.projection = new PIXI.Point(this.width/2 , this.height/2); + //this.frame.width = this.width + //this.frame.height = this.height; + if(PIXI.gl) { + this.projection.x = this.width/2 + this.projection.y = this.height/2; + var gl = PIXI.gl; gl.bindTexture(gl.TEXTURE_2D, this.baseTexture._glTexture); gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, this.width, this.height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); } else { + this.frame.width = this.width this.frame.height = this.height; this.renderer.resize(this.width, this.height); diff --git a/examples/example 4 - Balls/pixi.js b/examples/example 4 - Balls/pixi.js index 825c2bd..a4bd036 100644 --- a/examples/example 4 - Balls/pixi.js +++ b/examples/example 4 - Balls/pixi.js @@ -4,7 +4,7 @@ * Copyright (c) 2012, Mat Groves * http://goodboydigital.com/ * - * Compiled: 2013-07-11 + * Compiled: 2013-07-24 * * Pixi.JS is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license.php @@ -1267,7 +1267,7 @@ PIXI.DisplayObjectContainer = function() } // constructor -PIXI.DisplayObjectContainer.constructor = PIXI.DisplayObjectContainer; +//PIXI.DisplayObjectContainer.constructor = PIXI.DisplayObjectContainer; PIXI.DisplayObjectContainer.prototype = Object.create( PIXI.DisplayObject.prototype ); //TODO make visible a getter setter @@ -2600,6 +2600,7 @@ PIXI.InteractionManager.prototype.update = function() { // ok so there are some functions so lets hit test it.. item.__hit = this.hitTest(item, this.mouse); + this.mouse.target = item; // ok so deal with interactions.. // loks like there was a hit! if(item.__hit) @@ -2780,14 +2781,18 @@ PIXI.InteractionManager.prototype.hitTest = function(item, interactionData) x = a11 * id * global.x + -a01 * id * global.y + (a12 * a01 - a02 * a11) * id, y = a00 * id * global.y + -a10 * id * global.x + (-a12 * a00 + a02 * a10) * id; + interactionData.target = item; + //a sprite or display object with a hit area defined if(item.hitArea && item.hitArea.contains) { if(item.hitArea.contains(x, y)) { - if(isSprite) - interactionData.target = item; + //if(isSprite) + interactionData.target = item; return true; } + + return false; } // a sprite with no hitarea defined else if(isSprite) @@ -2816,7 +2821,12 @@ PIXI.InteractionManager.prototype.hitTest = function(item, interactionData) { var tempItem = item.children[i]; var hit = this.hitTest(tempItem, interactionData); - if(hit)return true; + if(hit) + { + // hmm.. TODO SET CORRECT TARGET? + interactionData.target = item + return true; + } } return false; @@ -4554,7 +4564,7 @@ PIXI.WebGLRenderer.updateTextures = function() PIXI.WebGLRenderer.updateTexture = function(texture) { var gl = PIXI.gl; - + if(!texture._glTexture) { texture._glTexture = gl.createTexture(); @@ -5207,7 +5217,7 @@ PIXI.WebGLBatch.prototype.render = function(start, end) start = start || 0; //end = end || this.size; if(end == undefined)end = this.size; - + if(this.dirty) { this.refresh(); @@ -5764,7 +5774,7 @@ PIXI.WebGLRenderGroup.prototype.addDisplayObjectAndChildren = function(displayOb */ var previousRenderable = displayObject.first; - while(previousRenderable != this.root) + while(previousRenderable != this.root.first) { previousRenderable = previousRenderable._iPrev; if(previousRenderable.renderable && previousRenderable.__renderGroup)break; @@ -9494,7 +9504,7 @@ PIXI.RenderTexture.prototype.initWebGL = function() // create a projection matrix.. this.projection = new PIXI.Point(this.width/2 , this.height/2); - +/* this.projectionMatrix = PIXI.mat4.create(); this.projectionMatrix[5] = 2/this.height// * 0.5; @@ -9502,7 +9512,7 @@ PIXI.RenderTexture.prototype.initWebGL = function() this.projectionMatrix[0] = 2/this.width; this.projectionMatrix[12] = -1; - +*/ // set the correct render function.. this.render = this.renderWebGL; @@ -9512,19 +9522,26 @@ PIXI.RenderTexture.prototype.initWebGL = function() PIXI.RenderTexture.prototype.resize = function(width, height) { + this.width = width; this.height = height; - this.projection = new PIXI.Point(this.width/2 , this.height/2); + //this.frame.width = this.width + //this.frame.height = this.height; + if(PIXI.gl) { + this.projection.x = this.width/2 + this.projection.y = this.height/2; + var gl = PIXI.gl; gl.bindTexture(gl.TEXTURE_2D, this.baseTexture._glTexture); gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, this.width, this.height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); } else { + this.frame.width = this.width this.frame.height = this.height; this.renderer.resize(this.width, this.height); diff --git a/examples/example 5 - Morph/pixi.js b/examples/example 5 - Morph/pixi.js index 825c2bd..a4bd036 100644 --- a/examples/example 5 - Morph/pixi.js +++ b/examples/example 5 - Morph/pixi.js @@ -4,7 +4,7 @@ * Copyright (c) 2012, Mat Groves * http://goodboydigital.com/ * - * Compiled: 2013-07-11 + * Compiled: 2013-07-24 * * Pixi.JS is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license.php @@ -1267,7 +1267,7 @@ PIXI.DisplayObjectContainer = function() } // constructor -PIXI.DisplayObjectContainer.constructor = PIXI.DisplayObjectContainer; +//PIXI.DisplayObjectContainer.constructor = PIXI.DisplayObjectContainer; PIXI.DisplayObjectContainer.prototype = Object.create( PIXI.DisplayObject.prototype ); //TODO make visible a getter setter @@ -2600,6 +2600,7 @@ PIXI.InteractionManager.prototype.update = function() { // ok so there are some functions so lets hit test it.. item.__hit = this.hitTest(item, this.mouse); + this.mouse.target = item; // ok so deal with interactions.. // loks like there was a hit! if(item.__hit) @@ -2780,14 +2781,18 @@ PIXI.InteractionManager.prototype.hitTest = function(item, interactionData) x = a11 * id * global.x + -a01 * id * global.y + (a12 * a01 - a02 * a11) * id, y = a00 * id * global.y + -a10 * id * global.x + (-a12 * a00 + a02 * a10) * id; + interactionData.target = item; + //a sprite or display object with a hit area defined if(item.hitArea && item.hitArea.contains) { if(item.hitArea.contains(x, y)) { - if(isSprite) - interactionData.target = item; + //if(isSprite) + interactionData.target = item; return true; } + + return false; } // a sprite with no hitarea defined else if(isSprite) @@ -2816,7 +2821,12 @@ PIXI.InteractionManager.prototype.hitTest = function(item, interactionData) { var tempItem = item.children[i]; var hit = this.hitTest(tempItem, interactionData); - if(hit)return true; + if(hit) + { + // hmm.. TODO SET CORRECT TARGET? + interactionData.target = item + return true; + } } return false; @@ -4554,7 +4564,7 @@ PIXI.WebGLRenderer.updateTextures = function() PIXI.WebGLRenderer.updateTexture = function(texture) { var gl = PIXI.gl; - + if(!texture._glTexture) { texture._glTexture = gl.createTexture(); @@ -5207,7 +5217,7 @@ PIXI.WebGLBatch.prototype.render = function(start, end) start = start || 0; //end = end || this.size; if(end == undefined)end = this.size; - + if(this.dirty) { this.refresh(); @@ -5764,7 +5774,7 @@ PIXI.WebGLRenderGroup.prototype.addDisplayObjectAndChildren = function(displayOb */ var previousRenderable = displayObject.first; - while(previousRenderable != this.root) + while(previousRenderable != this.root.first) { previousRenderable = previousRenderable._iPrev; if(previousRenderable.renderable && previousRenderable.__renderGroup)break; @@ -9494,7 +9504,7 @@ PIXI.RenderTexture.prototype.initWebGL = function() // create a projection matrix.. this.projection = new PIXI.Point(this.width/2 , this.height/2); - +/* this.projectionMatrix = PIXI.mat4.create(); this.projectionMatrix[5] = 2/this.height// * 0.5; @@ -9502,7 +9512,7 @@ PIXI.RenderTexture.prototype.initWebGL = function() this.projectionMatrix[0] = 2/this.width; this.projectionMatrix[12] = -1; - +*/ // set the correct render function.. this.render = this.renderWebGL; @@ -9512,19 +9522,26 @@ PIXI.RenderTexture.prototype.initWebGL = function() PIXI.RenderTexture.prototype.resize = function(width, height) { + this.width = width; this.height = height; - this.projection = new PIXI.Point(this.width/2 , this.height/2); + //this.frame.width = this.width + //this.frame.height = this.height; + if(PIXI.gl) { + this.projection.x = this.width/2 + this.projection.y = this.height/2; + var gl = PIXI.gl; gl.bindTexture(gl.TEXTURE_2D, this.baseTexture._glTexture); gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, this.width, this.height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); } else { + this.frame.width = this.width this.frame.height = this.height; this.renderer.resize(this.width, this.height); diff --git a/examples/example 6 - Interactivity/pixi.js b/examples/example 6 - Interactivity/pixi.js index 825c2bd..a4bd036 100644 --- a/examples/example 6 - Interactivity/pixi.js +++ b/examples/example 6 - Interactivity/pixi.js @@ -4,7 +4,7 @@ * Copyright (c) 2012, Mat Groves * http://goodboydigital.com/ * - * Compiled: 2013-07-11 + * Compiled: 2013-07-24 * * Pixi.JS is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license.php @@ -1267,7 +1267,7 @@ PIXI.DisplayObjectContainer = function() } // constructor -PIXI.DisplayObjectContainer.constructor = PIXI.DisplayObjectContainer; +//PIXI.DisplayObjectContainer.constructor = PIXI.DisplayObjectContainer; PIXI.DisplayObjectContainer.prototype = Object.create( PIXI.DisplayObject.prototype ); //TODO make visible a getter setter @@ -2600,6 +2600,7 @@ PIXI.InteractionManager.prototype.update = function() { // ok so there are some functions so lets hit test it.. item.__hit = this.hitTest(item, this.mouse); + this.mouse.target = item; // ok so deal with interactions.. // loks like there was a hit! if(item.__hit) @@ -2780,14 +2781,18 @@ PIXI.InteractionManager.prototype.hitTest = function(item, interactionData) x = a11 * id * global.x + -a01 * id * global.y + (a12 * a01 - a02 * a11) * id, y = a00 * id * global.y + -a10 * id * global.x + (-a12 * a00 + a02 * a10) * id; + interactionData.target = item; + //a sprite or display object with a hit area defined if(item.hitArea && item.hitArea.contains) { if(item.hitArea.contains(x, y)) { - if(isSprite) - interactionData.target = item; + //if(isSprite) + interactionData.target = item; return true; } + + return false; } // a sprite with no hitarea defined else if(isSprite) @@ -2816,7 +2821,12 @@ PIXI.InteractionManager.prototype.hitTest = function(item, interactionData) { var tempItem = item.children[i]; var hit = this.hitTest(tempItem, interactionData); - if(hit)return true; + if(hit) + { + // hmm.. TODO SET CORRECT TARGET? + interactionData.target = item + return true; + } } return false; @@ -4554,7 +4564,7 @@ PIXI.WebGLRenderer.updateTextures = function() PIXI.WebGLRenderer.updateTexture = function(texture) { var gl = PIXI.gl; - + if(!texture._glTexture) { texture._glTexture = gl.createTexture(); @@ -5207,7 +5217,7 @@ PIXI.WebGLBatch.prototype.render = function(start, end) start = start || 0; //end = end || this.size; if(end == undefined)end = this.size; - + if(this.dirty) { this.refresh(); @@ -5764,7 +5774,7 @@ PIXI.WebGLRenderGroup.prototype.addDisplayObjectAndChildren = function(displayOb */ var previousRenderable = displayObject.first; - while(previousRenderable != this.root) + while(previousRenderable != this.root.first) { previousRenderable = previousRenderable._iPrev; if(previousRenderable.renderable && previousRenderable.__renderGroup)break; @@ -9494,7 +9504,7 @@ PIXI.RenderTexture.prototype.initWebGL = function() // create a projection matrix.. this.projection = new PIXI.Point(this.width/2 , this.height/2); - +/* this.projectionMatrix = PIXI.mat4.create(); this.projectionMatrix[5] = 2/this.height// * 0.5; @@ -9502,7 +9512,7 @@ PIXI.RenderTexture.prototype.initWebGL = function() this.projectionMatrix[0] = 2/this.width; this.projectionMatrix[12] = -1; - +*/ // set the correct render function.. this.render = this.renderWebGL; @@ -9512,19 +9522,26 @@ PIXI.RenderTexture.prototype.initWebGL = function() PIXI.RenderTexture.prototype.resize = function(width, height) { + this.width = width; this.height = height; - this.projection = new PIXI.Point(this.width/2 , this.height/2); + //this.frame.width = this.width + //this.frame.height = this.height; + if(PIXI.gl) { + this.projection.x = this.width/2 + this.projection.y = this.height/2; + var gl = PIXI.gl; gl.bindTexture(gl.TEXTURE_2D, this.baseTexture._glTexture); gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, this.width, this.height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); } else { + this.frame.width = this.width this.frame.height = this.height; this.renderer.resize(this.width, this.height); diff --git a/examples/example 7 - Transparent Background/pixi.js b/examples/example 7 - Transparent Background/pixi.js index 825c2bd..a4bd036 100644 --- a/examples/example 7 - Transparent Background/pixi.js +++ b/examples/example 7 - Transparent Background/pixi.js @@ -4,7 +4,7 @@ * Copyright (c) 2012, Mat Groves * http://goodboydigital.com/ * - * Compiled: 2013-07-11 + * Compiled: 2013-07-24 * * Pixi.JS is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license.php @@ -1267,7 +1267,7 @@ PIXI.DisplayObjectContainer = function() } // constructor -PIXI.DisplayObjectContainer.constructor = PIXI.DisplayObjectContainer; +//PIXI.DisplayObjectContainer.constructor = PIXI.DisplayObjectContainer; PIXI.DisplayObjectContainer.prototype = Object.create( PIXI.DisplayObject.prototype ); //TODO make visible a getter setter @@ -2600,6 +2600,7 @@ PIXI.InteractionManager.prototype.update = function() { // ok so there are some functions so lets hit test it.. item.__hit = this.hitTest(item, this.mouse); + this.mouse.target = item; // ok so deal with interactions.. // loks like there was a hit! if(item.__hit) @@ -2780,14 +2781,18 @@ PIXI.InteractionManager.prototype.hitTest = function(item, interactionData) x = a11 * id * global.x + -a01 * id * global.y + (a12 * a01 - a02 * a11) * id, y = a00 * id * global.y + -a10 * id * global.x + (-a12 * a00 + a02 * a10) * id; + interactionData.target = item; + //a sprite or display object with a hit area defined if(item.hitArea && item.hitArea.contains) { if(item.hitArea.contains(x, y)) { - if(isSprite) - interactionData.target = item; + //if(isSprite) + interactionData.target = item; return true; } + + return false; } // a sprite with no hitarea defined else if(isSprite) @@ -2816,7 +2821,12 @@ PIXI.InteractionManager.prototype.hitTest = function(item, interactionData) { var tempItem = item.children[i]; var hit = this.hitTest(tempItem, interactionData); - if(hit)return true; + if(hit) + { + // hmm.. TODO SET CORRECT TARGET? + interactionData.target = item + return true; + } } return false; @@ -4554,7 +4564,7 @@ PIXI.WebGLRenderer.updateTextures = function() PIXI.WebGLRenderer.updateTexture = function(texture) { var gl = PIXI.gl; - + if(!texture._glTexture) { texture._glTexture = gl.createTexture(); @@ -5207,7 +5217,7 @@ PIXI.WebGLBatch.prototype.render = function(start, end) start = start || 0; //end = end || this.size; if(end == undefined)end = this.size; - + if(this.dirty) { this.refresh(); @@ -5764,7 +5774,7 @@ PIXI.WebGLRenderGroup.prototype.addDisplayObjectAndChildren = function(displayOb */ var previousRenderable = displayObject.first; - while(previousRenderable != this.root) + while(previousRenderable != this.root.first) { previousRenderable = previousRenderable._iPrev; if(previousRenderable.renderable && previousRenderable.__renderGroup)break; @@ -9494,7 +9504,7 @@ PIXI.RenderTexture.prototype.initWebGL = function() // create a projection matrix.. this.projection = new PIXI.Point(this.width/2 , this.height/2); - +/* this.projectionMatrix = PIXI.mat4.create(); this.projectionMatrix[5] = 2/this.height// * 0.5; @@ -9502,7 +9512,7 @@ PIXI.RenderTexture.prototype.initWebGL = function() this.projectionMatrix[0] = 2/this.width; this.projectionMatrix[12] = -1; - +*/ // set the correct render function.. this.render = this.renderWebGL; @@ -9512,19 +9522,26 @@ PIXI.RenderTexture.prototype.initWebGL = function() PIXI.RenderTexture.prototype.resize = function(width, height) { + this.width = width; this.height = height; - this.projection = new PIXI.Point(this.width/2 , this.height/2); + //this.frame.width = this.width + //this.frame.height = this.height; + if(PIXI.gl) { + this.projection.x = this.width/2 + this.projection.y = this.height/2; + var gl = PIXI.gl; gl.bindTexture(gl.TEXTURE_2D, this.baseTexture._glTexture); gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, this.width, this.height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); } else { + this.frame.width = this.width this.frame.height = this.height; this.renderer.resize(this.width, this.height); diff --git a/examples/example 8 - Dragging/pixi.js b/examples/example 8 - Dragging/pixi.js index 825c2bd..a4bd036 100644 --- a/examples/example 8 - Dragging/pixi.js +++ b/examples/example 8 - Dragging/pixi.js @@ -4,7 +4,7 @@ * Copyright (c) 2012, Mat Groves * http://goodboydigital.com/ * - * Compiled: 2013-07-11 + * Compiled: 2013-07-24 * * Pixi.JS is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license.php @@ -1267,7 +1267,7 @@ PIXI.DisplayObjectContainer = function() } // constructor -PIXI.DisplayObjectContainer.constructor = PIXI.DisplayObjectContainer; +//PIXI.DisplayObjectContainer.constructor = PIXI.DisplayObjectContainer; PIXI.DisplayObjectContainer.prototype = Object.create( PIXI.DisplayObject.prototype ); //TODO make visible a getter setter @@ -2600,6 +2600,7 @@ PIXI.InteractionManager.prototype.update = function() { // ok so there are some functions so lets hit test it.. item.__hit = this.hitTest(item, this.mouse); + this.mouse.target = item; // ok so deal with interactions.. // loks like there was a hit! if(item.__hit) @@ -2780,14 +2781,18 @@ PIXI.InteractionManager.prototype.hitTest = function(item, interactionData) x = a11 * id * global.x + -a01 * id * global.y + (a12 * a01 - a02 * a11) * id, y = a00 * id * global.y + -a10 * id * global.x + (-a12 * a00 + a02 * a10) * id; + interactionData.target = item; + //a sprite or display object with a hit area defined if(item.hitArea && item.hitArea.contains) { if(item.hitArea.contains(x, y)) { - if(isSprite) - interactionData.target = item; + //if(isSprite) + interactionData.target = item; return true; } + + return false; } // a sprite with no hitarea defined else if(isSprite) @@ -2816,7 +2821,12 @@ PIXI.InteractionManager.prototype.hitTest = function(item, interactionData) { var tempItem = item.children[i]; var hit = this.hitTest(tempItem, interactionData); - if(hit)return true; + if(hit) + { + // hmm.. TODO SET CORRECT TARGET? + interactionData.target = item + return true; + } } return false; @@ -4554,7 +4564,7 @@ PIXI.WebGLRenderer.updateTextures = function() PIXI.WebGLRenderer.updateTexture = function(texture) { var gl = PIXI.gl; - + if(!texture._glTexture) { texture._glTexture = gl.createTexture(); @@ -5207,7 +5217,7 @@ PIXI.WebGLBatch.prototype.render = function(start, end) start = start || 0; //end = end || this.size; if(end == undefined)end = this.size; - + if(this.dirty) { this.refresh(); @@ -5764,7 +5774,7 @@ PIXI.WebGLRenderGroup.prototype.addDisplayObjectAndChildren = function(displayOb */ var previousRenderable = displayObject.first; - while(previousRenderable != this.root) + while(previousRenderable != this.root.first) { previousRenderable = previousRenderable._iPrev; if(previousRenderable.renderable && previousRenderable.__renderGroup)break; @@ -9494,7 +9504,7 @@ PIXI.RenderTexture.prototype.initWebGL = function() // create a projection matrix.. this.projection = new PIXI.Point(this.width/2 , this.height/2); - +/* this.projectionMatrix = PIXI.mat4.create(); this.projectionMatrix[5] = 2/this.height// * 0.5; @@ -9502,7 +9512,7 @@ PIXI.RenderTexture.prototype.initWebGL = function() this.projectionMatrix[0] = 2/this.width; this.projectionMatrix[12] = -1; - +*/ // set the correct render function.. this.render = this.renderWebGL; @@ -9512,19 +9522,26 @@ PIXI.RenderTexture.prototype.initWebGL = function() PIXI.RenderTexture.prototype.resize = function(width, height) { + this.width = width; this.height = height; - this.projection = new PIXI.Point(this.width/2 , this.height/2); + //this.frame.width = this.width + //this.frame.height = this.height; + if(PIXI.gl) { + this.projection.x = this.width/2 + this.projection.y = this.height/2; + var gl = PIXI.gl; gl.bindTexture(gl.TEXTURE_2D, this.baseTexture._glTexture); gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, this.width, this.height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); } else { + this.frame.width = this.width this.frame.height = this.height; this.renderer.resize(this.width, this.height); diff --git a/examples/example 9 - Tiling Texture/pixi.js b/examples/example 9 - Tiling Texture/pixi.js index 825c2bd..a4bd036 100644 --- a/examples/example 9 - Tiling Texture/pixi.js +++ b/examples/example 9 - Tiling Texture/pixi.js @@ -4,7 +4,7 @@ * Copyright (c) 2012, Mat Groves * http://goodboydigital.com/ * - * Compiled: 2013-07-11 + * Compiled: 2013-07-24 * * Pixi.JS is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license.php @@ -1267,7 +1267,7 @@ PIXI.DisplayObjectContainer = function() } // constructor -PIXI.DisplayObjectContainer.constructor = PIXI.DisplayObjectContainer; +//PIXI.DisplayObjectContainer.constructor = PIXI.DisplayObjectContainer; PIXI.DisplayObjectContainer.prototype = Object.create( PIXI.DisplayObject.prototype ); //TODO make visible a getter setter @@ -2600,6 +2600,7 @@ PIXI.InteractionManager.prototype.update = function() { // ok so there are some functions so lets hit test it.. item.__hit = this.hitTest(item, this.mouse); + this.mouse.target = item; // ok so deal with interactions.. // loks like there was a hit! if(item.__hit) @@ -2780,14 +2781,18 @@ PIXI.InteractionManager.prototype.hitTest = function(item, interactionData) x = a11 * id * global.x + -a01 * id * global.y + (a12 * a01 - a02 * a11) * id, y = a00 * id * global.y + -a10 * id * global.x + (-a12 * a00 + a02 * a10) * id; + interactionData.target = item; + //a sprite or display object with a hit area defined if(item.hitArea && item.hitArea.contains) { if(item.hitArea.contains(x, y)) { - if(isSprite) - interactionData.target = item; + //if(isSprite) + interactionData.target = item; return true; } + + return false; } // a sprite with no hitarea defined else if(isSprite) @@ -2816,7 +2821,12 @@ PIXI.InteractionManager.prototype.hitTest = function(item, interactionData) { var tempItem = item.children[i]; var hit = this.hitTest(tempItem, interactionData); - if(hit)return true; + if(hit) + { + // hmm.. TODO SET CORRECT TARGET? + interactionData.target = item + return true; + } } return false; @@ -4554,7 +4564,7 @@ PIXI.WebGLRenderer.updateTextures = function() PIXI.WebGLRenderer.updateTexture = function(texture) { var gl = PIXI.gl; - + if(!texture._glTexture) { texture._glTexture = gl.createTexture(); @@ -5207,7 +5217,7 @@ PIXI.WebGLBatch.prototype.render = function(start, end) start = start || 0; //end = end || this.size; if(end == undefined)end = this.size; - + if(this.dirty) { this.refresh(); @@ -5764,7 +5774,7 @@ PIXI.WebGLRenderGroup.prototype.addDisplayObjectAndChildren = function(displayOb */ var previousRenderable = displayObject.first; - while(previousRenderable != this.root) + while(previousRenderable != this.root.first) { previousRenderable = previousRenderable._iPrev; if(previousRenderable.renderable && previousRenderable.__renderGroup)break; @@ -9494,7 +9504,7 @@ PIXI.RenderTexture.prototype.initWebGL = function() // create a projection matrix.. this.projection = new PIXI.Point(this.width/2 , this.height/2); - +/* this.projectionMatrix = PIXI.mat4.create(); this.projectionMatrix[5] = 2/this.height// * 0.5; @@ -9502,7 +9512,7 @@ PIXI.RenderTexture.prototype.initWebGL = function() this.projectionMatrix[0] = 2/this.width; this.projectionMatrix[12] = -1; - +*/ // set the correct render function.. this.render = this.renderWebGL; @@ -9512,19 +9522,26 @@ PIXI.RenderTexture.prototype.initWebGL = function() PIXI.RenderTexture.prototype.resize = function(width, height) { + this.width = width; this.height = height; - this.projection = new PIXI.Point(this.width/2 , this.height/2); + //this.frame.width = this.width + //this.frame.height = this.height; + if(PIXI.gl) { + this.projection.x = this.width/2 + this.projection.y = this.height/2; + var gl = PIXI.gl; gl.bindTexture(gl.TEXTURE_2D, this.baseTexture._glTexture); gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, this.width, this.height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); } else { + this.frame.width = this.width this.frame.height = this.height; this.renderer.resize(this.width, this.height); diff --git a/src/pixi/InteractionManager.js b/src/pixi/InteractionManager.js index bdbb276..c90b538 100644 --- a/src/pixi/InteractionManager.js +++ b/src/pixi/InteractionManager.js @@ -186,6 +186,7 @@ PIXI.InteractionManager.prototype.update = function() { // ok so there are some functions so lets hit test it.. item.__hit = this.hitTest(item, this.mouse); + this.mouse.target = item; // ok so deal with interactions.. // loks like there was a hit! if(item.__hit) @@ -366,14 +367,18 @@ PIXI.InteractionManager.prototype.hitTest = function(item, interactionData) x = a11 * id * global.x + -a01 * id * global.y + (a12 * a01 - a02 * a11) * id, y = a00 * id * global.y + -a10 * id * global.x + (-a12 * a00 + a02 * a10) * id; + interactionData.target = item; + //a sprite or display object with a hit area defined if(item.hitArea && item.hitArea.contains) { if(item.hitArea.contains(x, y)) { - if(isSprite) - interactionData.target = item; + //if(isSprite) + interactionData.target = item; return true; } + + return false; } // a sprite with no hitarea defined else if(isSprite) @@ -402,7 +407,12 @@ PIXI.InteractionManager.prototype.hitTest = function(item, interactionData) { var tempItem = item.children[i]; var hit = this.hitTest(tempItem, interactionData); - if(hit)return true; + if(hit) + { + // hmm.. TODO SET CORRECT TARGET? + interactionData.target = item + return true; + } } return false; diff --git a/src/pixi/display/DisplayObjectContainer.js b/src/pixi/display/DisplayObjectContainer.js index 4a3a204..8a1291c 100644 --- a/src/pixi/display/DisplayObjectContainer.js +++ b/src/pixi/display/DisplayObjectContainer.js @@ -26,7 +26,7 @@ PIXI.DisplayObjectContainer = function() } // constructor -PIXI.DisplayObjectContainer.constructor = PIXI.DisplayObjectContainer; +PIXI.DisplayObjectContainer.prototype.constructor = PIXI.DisplayObjectContainer; PIXI.DisplayObjectContainer.prototype = Object.create( PIXI.DisplayObject.prototype ); //TODO make visible a getter setter diff --git a/src/pixi/renderers/webgl/WebGLBatch.js b/src/pixi/renderers/webgl/WebGLBatch.js index 1eca2fa..c8ab134 100644 --- a/src/pixi/renderers/webgl/WebGLBatch.js +++ b/src/pixi/renderers/webgl/WebGLBatch.js @@ -527,7 +527,7 @@ PIXI.WebGLBatch.prototype.render = function(start, end) start = start || 0; //end = end || this.size; if(end == undefined)end = this.size; - + if(this.dirty) { this.refresh(); diff --git a/src/pixi/renderers/webgl/WebGLRenderGroup.js b/src/pixi/renderers/webgl/WebGLRenderGroup.js index 277d893..502b025 100644 --- a/src/pixi/renderers/webgl/WebGLRenderGroup.js +++ b/src/pixi/renderers/webgl/WebGLRenderGroup.js @@ -498,7 +498,7 @@ PIXI.WebGLRenderGroup.prototype.addDisplayObjectAndChildren = function(displayOb */ var previousRenderable = displayObject.first; - while(previousRenderable != this.root) + while(previousRenderable != this.root.first) { previousRenderable = previousRenderable._iPrev; if(previousRenderable.renderable && previousRenderable.__renderGroup)break; diff --git a/src/pixi/renderers/webgl/WebGLRenderer.js b/src/pixi/renderers/webgl/WebGLRenderer.js index 5ea5adc..11a5e41 100644 --- a/src/pixi/renderers/webgl/WebGLRenderer.js +++ b/src/pixi/renderers/webgl/WebGLRenderer.js @@ -227,7 +227,7 @@ PIXI.WebGLRenderer.updateTextures = function() PIXI.WebGLRenderer.updateTexture = function(texture) { var gl = PIXI.gl; - + if(!texture._glTexture) { texture._glTexture = gl.createTexture(); diff --git a/src/pixi/textures/RenderTexture.js b/src/pixi/textures/RenderTexture.js index 5328f80..defc69a 100644 --- a/src/pixi/textures/RenderTexture.js +++ b/src/pixi/textures/RenderTexture.js @@ -92,7 +92,7 @@ PIXI.RenderTexture.prototype.initWebGL = function() // create a projection matrix.. this.projection = new PIXI.Point(this.width/2 , this.height/2); - +/* this.projectionMatrix = PIXI.mat4.create(); this.projectionMatrix[5] = 2/this.height// * 0.5; @@ -100,7 +100,7 @@ PIXI.RenderTexture.prototype.initWebGL = function() this.projectionMatrix[0] = 2/this.width; this.projectionMatrix[12] = -1; - +*/ // set the correct render function.. this.render = this.renderWebGL; @@ -110,19 +110,26 @@ PIXI.RenderTexture.prototype.initWebGL = function() PIXI.RenderTexture.prototype.resize = function(width, height) { + this.width = width; this.height = height; - this.projection = new PIXI.Point(this.width/2 , this.height/2); + //this.frame.width = this.width + //this.frame.height = this.height; + if(PIXI.gl) { + this.projection.x = this.width/2 + this.projection.y = this.height/2; + var gl = PIXI.gl; gl.bindTexture(gl.TEXTURE_2D, this.baseTexture._glTexture); gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, this.width, this.height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); } else { + this.frame.width = this.width this.frame.height = this.height; this.renderer.resize(this.width, this.height); From 7e634ecae44610b53b4cefde6fb3794301776dd2 Mon Sep 17 00:00:00 2001 From: Sergei Gorshechnikov Date: Sat, 27 Jul 2013 15:30:21 +0400 Subject: [PATCH 51/68] Fixed empty slots handling (#220); Fixed scaled slots handling (#205) --- src/pixi/extras/Spine.js | 204 ++++++++++++++++++++------------------- 1 file changed, 105 insertions(+), 99 deletions(-) diff --git a/src/pixi/extras/Spine.js b/src/pixi/extras/Spine.js index 5ee161a..a07f520 100644 --- a/src/pixi/extras/Spine.js +++ b/src/pixi/extras/Spine.js @@ -1,10 +1,10 @@ /** * @author Mat Groves http://matgroves.com/ @Doormat23 * based on pixi impact spine implementation made by Eemeli Kelokorpi (@ekelokorpi) https://github.com/ekelokorpi - * + * * Awesome JS run time provided by EsotericSoftware * https://github.com/EsotericSoftware/spine-runtimes - * + * */ /** @@ -17,48 +17,40 @@ * @constructor * @param url {String} The url of the spine anim file to be used */ -PIXI.Spine = function(url) -{ +PIXI.Spine = function (url) { PIXI.DisplayObjectContainer.call(this); - + this.spineData = PIXI.AnimCache[url]; - - if(!this.spineData) - { + + if (!this.spineData) { throw new Error("Spine data must be preloaded using PIXI.SpineLoader or PIXI.AssetLoader: " + url); - return; } - - this.count = 0; - - this.sprites = []; - + this.skeleton = new spine.Skeleton(this.spineData); this.skeleton.updateWorldTransform(); - this.stateData = new spine.AnimationStateData(this.spineData); + this.stateData = new spine.AnimationStateData(this.spineData); this.state = new spine.AnimationState(this.stateData); - - // add the sprites.. - for (var i = 0; i < this.skeleton.drawOrder.length; i++) { - - var attachmentName = this.skeleton.drawOrder[i].data.attachmentName; - - // kind of an assumtion here. that its a png - if(!PIXI.TextureCache[attachmentName]) - { - attachmentName += ".png"; - } - - - var sprite = new PIXI.Sprite(PIXI.Texture.fromFrame(attachmentName)); - sprite.anchor.x = sprite.anchor.y = 0.5; - this.addChild(sprite); - this.sprites.push(sprite); - }; -} -PIXI.Spine.prototype = Object.create( PIXI.DisplayObjectContainer.prototype ); + this.slotContainers = []; + + for (var i = 0, n = this.skeleton.drawOrder.length; i < n; i++) { + var slot = this.skeleton.drawOrder[i]; + var attachment = slot.attachment; + var slotContainer = new PIXI.DisplayObjectContainer(); + this.slotContainers.push(slotContainer); + this.addChild(slotContainer); + if (!(attachment instanceof spine.RegionAttachment)) { + continue; + } + var spriteName = attachment.rendererObject.name; + var sprite = this.createSprite(slot, attachment.rendererObject); + slot.currentSprite = sprite; + slotContainer.addChild(sprite); + } +}; + +PIXI.Spine.prototype = Object.create(PIXI.DisplayObjectContainer.prototype); PIXI.Spine.prototype.constructor = PIXI.Spine; /* @@ -67,49 +59,68 @@ PIXI.Spine.prototype.constructor = PIXI.Spine; * @method updateTransform * @private */ -PIXI.Spine.prototype.updateTransform = function() -{ - // TODO should make this time based really.. - this.state.update(1/60); +PIXI.Spine.prototype.updateTransform = function () { + this.lastTime = this.lastTime || Date.now(); + var timeDelta = (Date.now() - this.lastTime) * 0.001; + this.lastTime = Date.now(); + this.state.update(timeDelta); this.state.apply(this.skeleton); this.skeleton.updateWorldTransform(); - - for (var i = 0; i < this.skeleton.drawOrder.length; i++) - { - var slot = this.skeleton.drawOrder[i]; + var drawOrder = this.skeleton.drawOrder; + for (var i = 0, n = drawOrder.length; i < n; i++) { + var slot = drawOrder[i]; + var attachment = slot.attachment; + var slotContainer = this.slotContainers[i]; + if (!(attachment instanceof spine.RegionAttachment)) { + slotContainer.visible = false; + continue; + } - var x = slot.bone.worldX + slot.attachment.x * slot.bone.m00 + slot.attachment.y * slot.bone.m01 + slot.attachment.width * 0.5; - var y = slot.bone.worldY + slot.attachment.x * slot.bone.m10 + slot.attachment.y * slot.bone.m11 + slot.attachment.height * 0.5; - //console.log(x + ' : ' + y); - - - //console.log(slot.attachment.name) - if(slot.cacheName != slot.attachment.name) - { - var attachmentName = slot.attachment.name; - - if(!PIXI.TextureCache[attachmentName]) - { - attachmentName += ".png"; + if (attachment.rendererObject) { + if (!slot.data.attachmentName || attachment.rendererObject.name != slot.data.attachmentName) { + var spriteName = attachment.rendererObject.name; + if (slot.currentSprite !== undefined) { + slot.currentSprite.visible = false; } - - this.sprites[i].setTexture(PIXI.TextureCache[attachmentName]); - - slot.cacheName = slot.attachment.name; + slot.sprites = slot.sprites || {}; + if (slot.sprites[spriteName] !== undefined) { + slot.sprites[spriteName].visible = true; + } else { + var sprite = this.createSprite(slot, attachment.rendererObject); + slotContainer.addChild(sprite); + slot.data.attachmentName = attachment.rendererObject.name; + } + slot.currentSprite = slot.sprites[spriteName]; } - - x += -((slot.attachment.width * (slot.bone.worldScaleX + slot.attachment.scaleX - 1))>>1); - y += -((slot.attachment.height * (slot.bone.worldScaleY + slot.attachment.scaleY - 1))>>1); - - - this.sprites[i].position.x = x; - this.sprites[i].position.y = y; - this.sprites[i].rotation = (-(slot.bone.worldRotation + slot.attachment.rotation)) * (Math.PI/180); - } - + } + slotContainer.visible = true; + + var bone = slot.bone; + + slotContainer.position.x = bone.worldX + attachment.x * bone.m00 + attachment.y * bone.m01; + slotContainer.position.y = bone.worldY + attachment.x * bone.m10 + attachment.y * bone.m11; + slotContainer.scale.x = bone.worldScaleX; + slotContainer.scale.y = bone.worldScaleY; + + slotContainer.rotation = -(slot.bone.worldRotation * Math.PI / 180); + } + PIXI.DisplayObjectContainer.prototype.updateTransform.call(this); -} +}; + + +PIXI.Spine.prototype.createSprite = function (slot, descriptor) { + var name = PIXI.TextureCache[descriptor.name] ? descriptor.name : descriptor.name + ".png"; + var sprite = new PIXI.Sprite(PIXI.Texture.fromFrame(name)); + sprite.scale = descriptor.scale; + sprite.rotation = descriptor.rotation; + sprite.anchor.x = sprite.anchor.y = 0.5; + + slot.sprites = slot.sprites || {}; + slot.sprites[descriptor.name] = sprite; + return sprite; +}; /* * Awesome JS run time provided by EsotericSoftware @@ -225,7 +236,7 @@ spine.Slot.prototype = { this.g = data.g; this.b = data.b; this.a = data.a; - + var slotDatas = this.skeleton.data.slots; for (var i = 0, n = slotDatas.length; i < n; i++) { if (slotDatas[i] == data) { @@ -456,6 +467,7 @@ spine.TranslateTimeline.prototype = { var frameTime = frames[frameIndex]; var percent = 1 - (time - frameTime) / (frames[frameIndex + -3/*LAST_FRAME_TIME*/] - frameTime); percent = this.curves.getCurvePercent(frameIndex / 3 - 1, percent); + bone.x += (bone.data.x + lastFrameX + (frames[frameIndex + 1/*FRAME_X*/] - lastFrameX) * percent - bone.x) * alpha; bone.y += (bone.data.y + lastFrameY + (frames[frameIndex + 2/*FRAME_Y*/] - lastFrameY) * percent - bone.y) * alpha; } @@ -480,14 +492,12 @@ spine.ScaleTimeline.prototype = { apply: function (skeleton, time, alpha) { var frames = this.frames; if (time < frames[0]) return; // Time is before first frame. - + var bone = skeleton.bones[this.boneIndex]; if (time >= frames[frames.length - 3]) { // Time is after last frame. bone.scaleX += (bone.data.scaleX - 1 + frames[frames.length - 2] - bone.scaleX) * alpha; bone.scaleY += (bone.data.scaleY - 1 + frames[frames.length - 1] - bone.scaleY) * alpha; - - return; } @@ -525,6 +535,7 @@ spine.ColorTimeline.prototype = { apply: function (skeleton, time, alpha) { var frames = this.frames; if (time < frames[0]) return; // Time is before first frame. + var slot = skeleton.slots[this.slotIndex]; if (time >= frames[frames.length - 5]) { // Time is after last frame. @@ -574,7 +585,7 @@ spine.AttachmentTimeline = function (frameCount) { spine.AttachmentTimeline.prototype = { slotIndex: 0, getFrameCount: function () { - return this.frames.length / 2; + return this.frames.length; }, setFrame: function (frameIndex, time, attachmentName) { this.frames[frameIndex] = time; @@ -591,11 +602,6 @@ spine.AttachmentTimeline.prototype = { frameIndex = spine.binarySearch(frames, time, 1) - 1; var attachmentName = this.attachmentNames[frameIndex]; - //console.log(skeleton.slots[this.slotIndex]) - - // change the name! - // skeleton.slots[this.slotIndex].attachmentName = attachmentName; - skeleton.slots[this.slotIndex].setAttachment(!attachmentName ? null : skeleton.getAttachmentBySlotIndex(this.slotIndex, attachmentName)); } }; @@ -767,11 +773,9 @@ spine.Skeleton.prototype = { if (slot.data.name == slotName) { var attachment = null; if (attachmentName) { - attachment = this.getAttachment(i, attachmentName); if (attachment == null) throw "Attachment not found: " + attachmentName + ", for slot: " + slotName; } - slot.setAttachment(attachment); return; } @@ -853,7 +857,6 @@ spine.RegionAttachment.prototype = { offset[7/*Y4*/] = localYCos + localX2Sin; }, computeVertices: function (x, y, bone, vertices) { - x += bone.worldX; y += bone.worldY; var m00 = bone.m00; @@ -877,6 +880,7 @@ spine.AnimationStateData = function (skeletonData) { this.animationToMixTime = {}; }; spine.AnimationStateData.prototype = { + defaultMix: 0, setMixByName: function (fromName, toName, duration) { var from = this.skeletonData.findAnimation(fromName); if (!from) throw "Animation not found: " + fromName; @@ -889,7 +893,7 @@ spine.AnimationStateData.prototype = { }, getMix: function (from, to) { var time = this.animationToMixTime[from.name + ":" + to.name]; - return time ? time : 0; + return time ? time : this.defaultMix; } }; @@ -929,7 +933,7 @@ spine.AnimationState.prototype = { this.previous = null; } this.current.mix(skeleton, this.currentTime, this.currentLoop, alpha); - } else + } else this.current.apply(skeleton, this.currentTime, this.currentLoop); }, clearAnimation: function () { @@ -1075,16 +1079,9 @@ spine.SkeletonJson.prototype = { name = map["name"] || name; var type = spine.AttachmentType[map["type"] || "region"]; - - // @ekelokorpi - // var attachment = this.attachmentLoader.newAttachment(skin, type, name); - var attachment = new spine.RegionAttachment(); - - // @Doormat23 - // add the name of the attachment - attachment.name = name; - + if (type == spine.AttachmentType.region) { + var attachment = new spine.RegionAttachment(); attachment.x = (map["x"] || 0) * this.scale; attachment.y = (map["y"] || 0) * this.scale; attachment.scaleX = map["scaleX"] || 1; @@ -1093,10 +1090,19 @@ spine.SkeletonJson.prototype = { attachment.width = (map["width"] || 32) * this.scale; attachment.height = (map["height"] || 32) * this.scale; attachment.updateOffset(); + + attachment.rendererObject = {}; + attachment.rendererObject.name = name; + attachment.rendererObject.scale = {}; + attachment.rendererObject.scale.x = attachment.scaleX; + attachment.rendererObject.scale.y = attachment.scaleY; + attachment.rendererObject.rotation = -attachment.rotation * Math.PI / 180; + return attachment; } - return attachment; + throw "Unknown attachment type: " + type; }, + readAnimation: function (name, map, skeletonData) { var timelines = []; var duration = 0; @@ -1147,7 +1153,7 @@ spine.SkeletonJson.prototype = { } timelines.push(timeline); duration = Math.max(duration, timeline.frames[timeline.getFrameCount() * 3 - 3]); - + } else throw "Invalid timeline type for a bone: " + timelineName + " (" + boneName + ")"; } @@ -1190,8 +1196,8 @@ spine.SkeletonJson.prototype = { timeline.setFrame(frameIndex++, valueMap["time"], valueMap["name"]); } timelines.push(timeline); - // PIXI FIX - duration = Math.max(duration, timeline.frames[Math.floor(timeline.getFrameCount()) - 1]); + duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]); + } else throw "Invalid timeline type for a slot: " + timelineName + " (" + slotName + ")"; } From 3d935a83f61ad589fcc65bf8f9b3a7a1b832ca90 Mon Sep 17 00:00:00 2001 From: Chad Engler Date: Sun, 4 Aug 2013 00:10:40 -0700 Subject: [PATCH 52/68] Add main property to package.json, closes #244 --- package.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/package.json b/package.json index eb73c1d..b373240 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,8 @@ "url": "https://github.com/GoodBoyDigital/pixi.js.git" }, + "main": "bin/pixi.js", + "dependencies": {}, "devDependencies": { "grunt": "~0.4.x", From a50737e2e56de2855a92114a69ffd362f11df15d Mon Sep 17 00:00:00 2001 From: Chad Engler Date: Sat, 10 Aug 2013 12:42:56 -0700 Subject: [PATCH 53/68] consider points on the edge 'inside' --- src/pixi/core/Rectangle.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pixi/core/Rectangle.js b/src/pixi/core/Rectangle.js index 66fb5d6..5748417 100644 --- a/src/pixi/core/Rectangle.js +++ b/src/pixi/core/Rectangle.js @@ -68,11 +68,11 @@ PIXI.Rectangle.prototype.contains = function(x, y) return false; var x1 = this.x; - if(x > x1 && x < x1 + this.width) + if(x >= x1 && x <= x1 + this.width) { var y1 = this.y; - if(y > y1 && y < y1 + this.height) + if(y >= y1 && y <= y1 + this.height) { return true; } From 1d896845fb83c25a0a941ee11579988c2c639327 Mon Sep 17 00:00:00 2001 From: Mat Groves Date: Mon, 12 Aug 2013 21:55:14 +0100 Subject: [PATCH 54/68] fixes #234 --- src/pixi/renderers/webgl/WebGLRenderGroup.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/pixi/renderers/webgl/WebGLRenderGroup.js b/src/pixi/renderers/webgl/WebGLRenderGroup.js index 759a372..0a12de3 100644 --- a/src/pixi/renderers/webgl/WebGLRenderGroup.js +++ b/src/pixi/renderers/webgl/WebGLRenderGroup.js @@ -82,15 +82,15 @@ PIXI.WebGLRenderGroup.prototype.render = function(projection) } else if(renderable instanceof PIXI.TilingSprite) { - if(renderable.visible)this.renderTilingSprite(renderable, projection); + if(renderable.worldVisible)this.renderTilingSprite(renderable, projection); } else if(renderable instanceof PIXI.Strip) { - if(renderable.visible)this.renderStrip(renderable, projection); + if(renderable.worldVisible)this.renderStrip(renderable, projection); } else if(renderable instanceof PIXI.Graphics) { - if(renderable.visible && renderable.renderable) PIXI.WebGLGraphics.renderGraphics(renderable, projection);//, projectionMatrix); + if(renderable.worldVisible && renderable.renderable) PIXI.WebGLGraphics.renderGraphics(renderable, projection);//, projectionMatrix); } else if(renderable instanceof PIXI.FilterBlock) { @@ -304,19 +304,19 @@ PIXI.WebGLRenderGroup.prototype.renderSpecial = function(renderable, projection) { if(renderable instanceof PIXI.TilingSprite) { - if(renderable.visible)this.renderTilingSprite(renderable, projection); + if(renderable.worldVisible)this.renderTilingSprite(renderable, projection); } else if(renderable instanceof PIXI.Strip) { - if(renderable.visible)this.renderStrip(renderable, projection); + if(renderable.worldVisible)this.renderStrip(renderable, projection); } else if(renderable instanceof PIXI.CustomRenderable) { - if(renderable.visible) renderable.renderWebGL(this, projection); + if(renderable.worldVisible) renderable.renderWebGL(this, projection); } else if(renderable instanceof PIXI.Graphics) { - if(renderable.visible && renderable.renderable) PIXI.WebGLGraphics.renderGraphics(renderable, projection); + if(renderable.worldVisible && renderable.renderable) PIXI.WebGLGraphics.renderGraphics(renderable, projection); } else if(renderable instanceof PIXI.FilterBlock) { From d764a9fc20efcee02b2a947885214ce155a44cb8 Mon Sep 17 00:00:00 2001 From: Mat Groves Date: Mon, 12 Aug 2013 23:02:32 +0100 Subject: [PATCH 55/68] fixes DestroyTexture --- src/pixi/renderers/webgl/WebGLRenderer.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/pixi/renderers/webgl/WebGLRenderer.js b/src/pixi/renderers/webgl/WebGLRenderer.js index 2d6d307..0807f41 100644 --- a/src/pixi/renderers/webgl/WebGLRenderer.js +++ b/src/pixi/renderers/webgl/WebGLRenderer.js @@ -210,8 +210,9 @@ PIXI.WebGLRenderer.prototype.render = function(stage) */ PIXI.WebGLRenderer.updateTextures = function() { - for (var i=0; i < PIXI.texturesToUpdate.length; i++) this.updateTexture(PIXI.texturesToUpdate[i]); - for (var i=0; i < PIXI.texturesToDestroy.length; i++) this.destroyTexture(PIXI.texturesToDestroy[i]); + //TODO break this out into a texture manager... + for (var i=0; i < PIXI.texturesToUpdate.length; i++) PIXI.WebGLRenderer.updateTexture(PIXI.texturesToUpdate[i]); + for (var i=0; i < PIXI.texturesToDestroy.length; i++) PIXI.WebGLRenderer.destroyTexture(PIXI.texturesToDestroy[i]); PIXI.texturesToUpdate = []; PIXI.texturesToDestroy = []; } @@ -226,6 +227,7 @@ PIXI.WebGLRenderer.updateTextures = function() */ PIXI.WebGLRenderer.updateTexture = function(texture) { + //TODO break this out into a texture manager... var gl = PIXI.gl; if(!texture._glTexture) @@ -266,9 +268,10 @@ PIXI.WebGLRenderer.updateTexture = function(texture) * @param texture {Texture} The texture to update * @private */ -PIXI.WebGLRenderer.prototype.destroyTexture = function(texture) +PIXI.WebGLRenderer.destroyTexture = function(texture) { - var gl = this.gl; + //TODO break this out into a texture manager... + var gl = PIXI.gl; if(texture._glTexture) { From be1126bb5ec6da4a2ffbca141f9ffb3f2f6effc4 Mon Sep 17 00:00:00 2001 From: Mat Groves Date: Mon, 12 Aug 2013 23:03:53 +0100 Subject: [PATCH 56/68] Removed unused js inports in example 12 index --- examples/example 12 - Spine/index.html | 2 -- 1 file changed, 2 deletions(-) diff --git a/examples/example 12 - Spine/index.html b/examples/example 12 - Spine/index.html index 8b4dc17..50a5ba4 100644 --- a/examples/example 12 - Spine/index.html +++ b/examples/example 12 - Spine/index.html @@ -12,8 +12,6 @@ - - + + + + + + From 4d33d14fae9a621b5b3f7319166114360b8d9769 Mon Sep 17 00:00:00 2001 From: Mat Groves Date: Sun, 18 Aug 2013 17:40:46 +0100 Subject: [PATCH 64/68] Fixed bug when mouseUp being called instead of MouseOut --- src/pixi/InteractionManager.js | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/src/pixi/InteractionManager.js b/src/pixi/InteractionManager.js index a98e203..1b57de7 100644 --- a/src/pixi/InteractionManager.js +++ b/src/pixi/InteractionManager.js @@ -131,7 +131,7 @@ PIXI.InteractionManager.prototype.setTarget = function(target) target.view.addEventListener('mousemove', this.onMouseMove.bind(this), true); target.view.addEventListener('mousedown', this.onMouseDown.bind(this), true); document.body.addEventListener('mouseup', this.onMouseUp.bind(this), true); - target.view.addEventListener('mouseout', this.onMouseUp.bind(this), true); + target.view.addEventListener('mouseout', this.onMouseOut.bind(this), true); // aint no multi touch just yet! target.view.addEventListener("touchstart", this.onTouchStart.bind(this), true); @@ -187,7 +187,6 @@ PIXI.InteractionManager.prototype.update = function() var item = this.interactiveItems[i]; - //if(!item.visible)continue; // OPTIMISATION - only calculate every time if the mousemove function exists.. @@ -307,6 +306,26 @@ PIXI.InteractionManager.prototype.onMouseDown = function(event) } } + +PIXI.InteractionManager.prototype.onMouseOut = function(event) +{ + var length = this.interactiveItems.length; + + this.target.view.style.cursor = "default"; + + for (var i = 0; i < length; i++) + { + var item = this.interactiveItems[i]; + + if(item.__isOver) + { + this.mouse.target = item; + if(item.mouseout)item.mouseout(this.mouse); + item.__isOver = false; + } + } +} + /** * Is called when the mouse button is released on the renderer element * From c2a9798f18ad6f2bac06635c8aecddf7303ba2b7 Mon Sep 17 00:00:00 2001 From: Mat Groves Date: Sun, 18 Aug 2013 17:45:29 +0100 Subject: [PATCH 65/68] touch/mouse prevent default now to be handled by the user Examples updated to reflect change --- examples/example 8 - Dragging/index.html | 3 +++ src/pixi/InteractionManager.js | 13 +------------ 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/examples/example 8 - Dragging/index.html b/examples/example 8 - Dragging/index.html index fffb17b..bc2c6ab 100644 --- a/examples/example 8 - Dragging/index.html +++ b/examples/example 8 - Dragging/index.html @@ -61,6 +61,9 @@ // use the mousedown and touchstart bunny.mousedown = bunny.touchstart = function(data) { + // stop the default event... + data.originalEvent.preventDefault(); + // store a refference to the data // The reason for this is because of multitouch // we want to track the movement of this particular touch diff --git a/src/pixi/InteractionManager.js b/src/pixi/InteractionManager.js index 1b57de7..bd80333 100644 --- a/src/pixi/InteractionManager.js +++ b/src/pixi/InteractionManager.js @@ -39,14 +39,7 @@ PIXI.InteractionManager = function(stage) this.touchs = {}; - /** - * sets whether or not the touchStart and mouseDown interactions stop the high level browser functions like zoom and pan. - * It is true by default, Meaning the native zoom/pan functions will be disabled on mobiles - * @property preventDefault - * @type Boolean - */ - this.preventDefault = true; - + // helpers this.tempPoint = new PIXI.Point(); //this.tempMatrix = mat3.create(); @@ -268,8 +261,6 @@ PIXI.InteractionManager.prototype.onMouseMove = function(event) */ PIXI.InteractionManager.prototype.onMouseDown = function(event) { - if(this.preventDefault)event.preventDefault(); - this.mouse.originalEvent = event || window.event; //IE uses window.event // loop through inteaction tree... @@ -491,8 +482,6 @@ PIXI.InteractionManager.prototype.onTouchMove = function(event) */ PIXI.InteractionManager.prototype.onTouchStart = function(event) { - if(this.preventDefault)event.preventDefault(); - var rect = this.target.view.getBoundingClientRect(); var changedTouches = event.changedTouches; From 24a784de30baa557b8a88242c8319a542e2fbae2 Mon Sep 17 00:00:00 2001 From: Mat Groves Date: Sun, 18 Aug 2013 18:17:19 +0100 Subject: [PATCH 66/68] Code Tidy Little house cleaning on the code --- src/pixi/display/DisplayObject.js | 29 ------------ src/pixi/display/DisplayObjectContainer.js | 9 ++-- src/pixi/display/MovieClip.js | 2 + src/pixi/display/Stage.js | 32 -------------- src/pixi/renderers/canvas/CanvasGraphics.js | 4 -- src/pixi/renderers/canvas/CanvasRenderer.js | 9 +--- src/pixi/renderers/webgl/WebGLBatch.js | 16 +++---- src/pixi/renderers/webgl/WebGLGraphics.js | 2 +- src/pixi/renderers/webgl/WebGLRenderGroup.js | 46 +------------------- src/pixi/renderers/webgl/WebGLRenderer.js | 8 ---- 10 files changed, 14 insertions(+), 143 deletions(-) diff --git a/src/pixi/display/DisplayObject.js b/src/pixi/display/DisplayObject.js index 84326a3..82d5366 100644 --- a/src/pixi/display/DisplayObject.js +++ b/src/pixi/display/DisplayObject.js @@ -86,15 +86,6 @@ PIXI.DisplayObject = function() */ this.renderable = false; - /** - * [read-only] The visibility of the object based on world (parent) factors. - * - * @property worldVisible - * @type Boolean - * @readOnly - */ - this.worldVisible = false; - /** * [read-only] The display object container that contains this display object. * @@ -251,17 +242,6 @@ PIXI.DisplayObject = function() // constructor PIXI.DisplayObject.prototype.constructor = PIXI.DisplayObject; -//TODO make visible a getter setter -/* -Object.defineProperty(PIXI.DisplayObject.prototype, 'visible', { - get: function() { - return this._visible; - }, - set: function(value) { - this._visible = value; - } -});*/ - /** * [Deprecated] Indicates if the sprite will have touch and mouse interactivity. It is false by default * Instead of using this function you can now simply set the interactive property to true or false @@ -334,12 +314,10 @@ PIXI.DisplayObject.prototype.addFilter = function(mask) if(this.filter)return; this.filter = true; - // insert a filter block.. var start = new PIXI.FilterBlock(); var end = new PIXI.FilterBlock(); - start.mask = mask; end.mask = mask; @@ -349,9 +327,7 @@ PIXI.DisplayObject.prototype.addFilter = function(mask) start.open = true; /* - * * insert start - * */ var childFirst = start @@ -382,9 +358,7 @@ PIXI.DisplayObject.prototype.addFilter = function(mask) // now insert the end filter block.. /* - * * insert end filter - * */ var childFirst = end var childLast = end @@ -460,8 +434,6 @@ PIXI.DisplayObject.prototype.removeFilter = function() previousObject._iNext = nextObject; // this is always true too! -// if(this.last == lastBlock) - //{ var tempLast = lastBlock._iPrev; // need to make sure the parents last is updated too var updateLast = this; @@ -480,7 +452,6 @@ PIXI.DisplayObject.prototype.removeFilter = function() { this.__renderGroup.removeFilterBlocks(startBlock, lastBlock); } - //} } /* diff --git a/src/pixi/display/DisplayObjectContainer.js b/src/pixi/display/DisplayObjectContainer.js index 8ae41d7..01b566d 100644 --- a/src/pixi/display/DisplayObjectContainer.js +++ b/src/pixi/display/DisplayObjectContainer.js @@ -61,7 +61,7 @@ PIXI.DisplayObjectContainer.prototype.addChild = function(child) this.children.push(child); - // updae the stage refference.. + // update the stage refference.. if(this.stage) { @@ -96,7 +96,6 @@ PIXI.DisplayObjectContainer.prototype.addChild = function(child) nextObject = previousObject._iNext; // always true in this case - //this.last = child.last; // need to make sure the parents last is updated too var updateLast = this; var prevLast = previousObject; @@ -160,7 +159,7 @@ PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index) } // modify the list.. - var childFirst = child.first + var childFirst = child.first; var childLast = child.last; var nextObject; var previousObject; @@ -168,7 +167,7 @@ PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index) if(index == this.children.length) { previousObject = this.last; - var updateLast = this;//.parent; + var updateLast = this; var prevLast = this.last; while(updateLast) { @@ -297,7 +296,7 @@ PIXI.DisplayObjectContainer.prototype.removeChild = function(child) { // unlink // // modify the list.. - var childFirst = child.first + var childFirst = child.first; var childLast = child.last; var nextObject = childLast._iNext; diff --git a/src/pixi/display/MovieClip.js b/src/pixi/display/MovieClip.js index 7a77856..40a0a18 100644 --- a/src/pixi/display/MovieClip.js +++ b/src/pixi/display/MovieClip.js @@ -131,7 +131,9 @@ PIXI.MovieClip.prototype.updateTransform = function() if(!this.playing)return; this.currentFrame += this.animationSpeed; + var round = (this.currentFrame + 0.5) | 0; + if(this.loop || round < this.textures.length) { this.setTexture(this.textures[round % this.textures.length]); diff --git a/src/pixi/display/Stage.js b/src/pixi/display/Stage.js index 681c91b..c70deff 100644 --- a/src/pixi/display/Stage.js +++ b/src/pixi/display/Stage.js @@ -119,35 +119,3 @@ PIXI.Stage.prototype.getMousePosition = function() { return this.interactionManager.mouse.global; } -/* -PIXI.Stage.prototype.__addChild = function(child) -{ - if(child.interactive)this.dirty = true; - - child.stage = this; - - if(child.children) - { - for (var i=0; i < child.children.length; i++) - { - this.__addChild(child.children[i]); - }; - } - -} - - -PIXI.Stage.prototype.__removeChild = function(child) -{ - if(child.interactive)this.dirty = true; - - child.stage = undefined; - - if(child.children) - { - for(var i=0,j=child.children.length; i 0) - { - this.checkVisibility(child, child.worldVisible); - } - }; -}*/ - /** * Updates a webgl texture * diff --git a/src/pixi/renderers/webgl/WebGLRenderer.js b/src/pixi/renderers/webgl/WebGLRenderer.js index 276426b..f05c162 100644 --- a/src/pixi/renderers/webgl/WebGLRenderer.js +++ b/src/pixi/renderers/webgl/WebGLRenderer.js @@ -134,7 +134,6 @@ PIXI.WebGLRenderer.prototype.render = function(stage) { // TODO make this work // dont think this is needed any more? - //if(this.__stage)this.checkVisibility(this.__stage, false) this.__stage = stage; this.stageRenderGroup.setRenderable(stage); } @@ -151,9 +150,6 @@ PIXI.WebGLRenderer.prototype.render = function(stage) // update any textures PIXI.WebGLRenderer.updateTextures(); - // recursivly loop through all items! - //this.checkVisibility(stage, true); - // update the scene graph PIXI.visibleCount++; stage.updateTransform(); @@ -164,16 +160,12 @@ PIXI.WebGLRenderer.prototype.render = function(stage) gl.colorMask(true, true, true, this.transparent); gl.viewport(0, 0, this.width, this.height); - // set the correct matrix.. - // gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, this.projectionMatrix); - gl.bindFramebuffer(gl.FRAMEBUFFER, null); gl.clearColor(stage.backgroundColorSplit[0],stage.backgroundColorSplit[1],stage.backgroundColorSplit[2], !this.transparent); gl.clear(gl.COLOR_BUFFER_BIT); // HACK TO TEST - //PIXI.projectionMatrix = this.projectionMatrix; this.stageRenderGroup.backgroundColor = stage.backgroundColorSplit; this.stageRenderGroup.render(PIXI.projection); From bc3c8efe1022baf391fa7e230b699424916bba22 Mon Sep 17 00:00:00 2001 From: Mat Groves Date: Sun, 18 Aug 2013 19:10:25 +0100 Subject: [PATCH 67/68] Set antialising to true to Graphics example --- examples/example 13 - Graphics/index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/example 13 - Graphics/index.html b/examples/example 13 - Graphics/index.html index 3912c40..081f15d 100644 --- a/examples/example 13 - Graphics/index.html +++ b/examples/example 13 - Graphics/index.html @@ -25,8 +25,8 @@ var sprite= PIXI.Sprite.fromImage("spinObj_02.png"); //stage.addChild(sprite); // create a renderer instance - //var renderer = new PIXI.CanvasRenderer(800, 600);//PIXI.autoDetectRenderer(800, 600); - var renderer = PIXI.autoDetectRenderer(620, 380); + // the 5the parameter is the anti aliasing + var renderer = PIXI.autoDetectRenderer(620, 380, null, false, true); // set the canvas width and height to fill the screen //renderer.view.style.width = window.innerWidth + "px"; From c74c608e38d77dae3323e1c811ca2e70bd8ee18e Mon Sep 17 00:00:00 2001 From: Mat Groves Date: Sun, 18 Aug 2013 19:13:57 +0100 Subject: [PATCH 68/68] Example 3 updated --- examples/example 3 - MovieClip/index.html | 98 +++-------------------- 1 file changed, 12 insertions(+), 86 deletions(-) diff --git a/examples/example 3 - MovieClip/index.html b/examples/example 3 - MovieClip/index.html index 66d73b5..5cd0939 100755 --- a/examples/example 3 - MovieClip/index.html +++ b/examples/example 3 - MovieClip/index.html @@ -10,9 +10,6 @@ } - - -