target property added to PIXI.InteractiveData

docs updated to reflect change
This commit is contained in:
Mat Groves 2013-03-22 08:34:49 +00:00
parent 74b26670ab
commit 9838176a49
8 changed files with 105 additions and 21 deletions

View file

@ -25,7 +25,7 @@ e,b[10]*=e,b[11]*=e,b;a[0]=b[0]*c;a[1]=b[1]*c;a[2]=b[2]*c;a[3]=b[3]*c;a[4]=b[4]*
b[10];B=b[11];z=d*d*k+j;A=f*d*k+a*h;x=a*d*k-f*h;y=d*f*k-a*h;C=f*f*k+j;D=a*f*k+d*h;E=d*a*k+f*h;d=f*a*k-d*h;f=a*a*k+j;c?b!==c&&(c[12]=b[12],c[13]=b[13],c[14]=b[14],c[15]=b[15]):c=b;c[0]=e*z+n*A+t*x;c[1]=g*z+r*A+u*x;c[2]=l*z+q*A+w*x;c[3]=m*z+s*A+B*x;c[4]=e*y+n*C+t*D;c[5]=g*y+r*C+u*D;c[6]=l*y+q*C+w*D;c[7]=m*y+s*C+B*D;c[8]=e*E+n*d+t*f;c[9]=g*E+r*d+u*f;c[10]=l*E+q*d+w*f;c[11]=m*E+s*d+B*f;return c},rotateX:function(b,e,a){var c=Math.sin(e);e=Math.cos(e);var d=b[4],f=b[5],g=b[6],h=b[7],j=b[8],k=b[9],l=b[10],
m=b[11];a?b!==a&&(a[0]=b[0],a[1]=b[1],a[2]=b[2],a[3]=b[3],a[12]=b[12],a[13]=b[13],a[14]=b[14],a[15]=b[15]):a=b;a[4]=d*e+j*c;a[5]=f*e+k*c;a[6]=g*e+l*c;a[7]=h*e+m*c;a[8]=d*-c+j*e;a[9]=f*-c+k*e;a[10]=g*-c+l*e;a[11]=h*-c+m*e;return a},rotateY:function(b,e,a){var c=Math.sin(e);e=Math.cos(e);var d=b[0],f=b[1],g=b[2],h=b[3],j=b[8],k=b[9],l=b[10],m=b[11];a?b!==a&&(a[4]=b[4],a[5]=b[5],a[6]=b[6],a[7]=b[7],a[12]=b[12],a[13]=b[13],a[14]=b[14],a[15]=b[15]):a=b;a[0]=d*e+j*-c;a[1]=f*e+k*-c;a[2]=g*e+l*-c;a[3]=h*
e+m*-c;a[8]=d*c+j*e;a[9]=f*c+k*e;a[10]=g*c+l*e;a[11]=h*c+m*e;return a},rotateZ:function(b,e,a){var c=Math.sin(e);e=Math.cos(e);var d=b[0],f=b[1],g=b[2],h=b[3],j=b[4],k=b[5],l=b[6],m=b[7];a?b!==a&&(a[8]=b[8],a[9]=b[9],a[10]=b[10],a[11]=b[11],a[12]=b[12],a[13]=b[13],a[14]=b[14],a[15]=b[15]):a=b;a[0]=d*e+j*c;a[1]=f*e+k*c;a[2]=g*e+l*c;a[3]=h*e+m*c;a[4]=d*-c+j*e;a[5]=f*-c+k*e;a[6]=g*-c+l*e;a[7]=h*-c+m*e;return a},frustum:function(b,e,a,c,d,f,g){g||(g=s.create());var h=e-b,j=c-a,k=f-d;g[0]=2*d/h;g[1]=0;
g[2]=0;g[3]=0;g[4]=0;g[5]=2*d/j;g[6]=0;g[7]=0;g[8]=(e+b)/h;g[9]=(c+a)/j;g[10]=-(f+d)/k;g[11]=-1;g[12]=0;g[13]=0;g[14]=-(2*f*d)/k;g[15]=0;return g},perspective:function(b,e,a,c,d){b=a*Math.tan(b*Math.PI/360);e*=b;return s.frustum(-e,e,-b,b,a,c,d)},ortho:function(b,a,c,d,f,g,h){h||(h=s.create());var j=a-b,k=d-c,l=g-f;h[0]=2/j;h[1]=0;h[2]=0;h[3]=0;h[4]=0;h[5]=2/k;h[6]=0;h[7]=0;h[8]=0;h[9]=0;h[10]=-2/l;h[11]=0;h[12]=-(b+a)/j;h[13]=-(d+c)/k;h[14]=-(g+f)/l;h[15]=1;return h},lookAt:function(b,a,c,d){d||
g[2]=0;g[3]=0;g[4]=0;g[5]=2*d/j;g[6]=0;g[7]=0;g[8]=(e+b)/h;g[9]=(c+a)/j;g[10]=-(f+d)/k;g[11]=-1;g[12]=0;g[13]=0;g[14]=-(2*f*d)/k;g[15]=0;return g},perspective:function(b,a,c,d,f){b=c*Math.tan(b*Math.PI/360);a*=b;return s.frustum(-a,a,-b,b,c,d,f)},ortho:function(b,a,c,d,f,g,h){h||(h=s.create());var j=a-b,k=d-c,l=g-f;h[0]=2/j;h[1]=0;h[2]=0;h[3]=0;h[4]=0;h[5]=2/k;h[6]=0;h[7]=0;h[8]=0;h[9]=0;h[10]=-2/l;h[11]=0;h[12]=-(b+a)/j;h[13]=-(d+c)/k;h[14]=-(g+f)/l;h[15]=1;return h},lookAt:function(b,a,c,d){d||
(d=s.create());var f,g,h,j,k,l,m,n,r=b[0],u=b[1];b=b[2];h=c[0];j=c[1];g=c[2];m=a[0];c=a[1];f=a[2];if(r===m&&u===c&&b===f)return s.identity(d);a=r-m;c=u-c;m=b-f;n=1/Math.sqrt(a*a+c*c+m*m);a*=n;c*=n;m*=n;f=j*m-g*c;g=g*a-h*m;h=h*c-j*a;(n=Math.sqrt(f*f+g*g+h*h))?(n=1/n,f*=n,g*=n,h*=n):h=g=f=0;j=c*h-m*g;k=m*f-a*h;l=a*g-c*f;(n=Math.sqrt(j*j+k*k+l*l))?(n=1/n,j*=n,k*=n,l*=n):l=k=j=0;d[0]=f;d[1]=j;d[2]=a;d[3]=0;d[4]=g;d[5]=k;d[6]=c;d[7]=0;d[8]=h;d[9]=l;d[10]=m;d[11]=0;d[12]=-(f*r+g*u+h*b);d[13]=-(j*r+k*u+
l*b);d[14]=-(a*r+c*u+m*b);d[15]=1;return d},fromRotationTranslation:function(b,a,c){c||(c=s.create());var d=b[0],f=b[1],g=b[2],h=b[3],j=d+d,k=f+f,l=g+g;b=d*j;var m=d*k,d=d*l,n=f*k,f=f*l,g=g*l,j=h*j,k=h*k,h=h*l;c[0]=1-(n+g);c[1]=m+h;c[2]=d-k;c[3]=0;c[4]=m-h;c[5]=1-(b+g);c[6]=f+j;c[7]=0;c[8]=d+k;c[9]=f-j;c[10]=1-(b+n);c[11]=0;c[12]=a[0];c[13]=a[1];c[14]=a[2];c[15]=1;return c},str:function(b){return"["+b[0]+", "+b[1]+", "+b[2]+", "+b[3]+", "+b[4]+", "+b[5]+", "+b[6]+", "+b[7]+", "+b[8]+", "+b[9]+", "+
b[10]+", "+b[11]+", "+b[12]+", "+b[13]+", "+b[14]+", "+b[15]+"]"}},l={create:function(b){var a=new j(4);b?(a[0]=b[0],a[1]=b[1],a[2]=b[2],a[3]=b[3]):a[0]=a[1]=a[2]=a[3]=0;return a},createFrom:function(b,a,c,d){var f=new j(4);f[0]=b;f[1]=a;f[2]=c;f[3]=d;return f},set:function(b,a){a[0]=b[0];a[1]=b[1];a[2]=b[2];a[3]=b[3];return a},equal:function(b,a){return b===a||1E-6>Math.abs(b[0]-a[0])&&1E-6>Math.abs(b[1]-a[1])&&1E-6>Math.abs(b[2]-a[2])&&1E-6>Math.abs(b[3]-a[3])},identity:function(b){b||(b=l.create());
@ -110,18 +110,18 @@ PIXI.InteractionManager.prototype.setTarget=function(a){this.target=a;this.mouse
this.onTouchMove.bind(this),!0)};
PIXI.InteractionManager.prototype.hitTest=function(a){this.dirty&&(this.dirty=!1,this.interactiveItems=[],this.collectInteractiveSprite(this.stage));for(var c=this.tempPoint,f=a.global,d=this.interactiveItems.length,g=0;g<d;g++){var h=this.interactiveItems[g];if(h.visible){var j=h.worldTransform,k=j[0],r=j[1],n=j[2],y=j[3],C=j[4],j=j[5],m=1/(k*C+r*-y);c.x=C*m*f.x+-r*m*f.y+(j*r-n*C)*m;c.y=k*m*f.y+-y*m*f.x+(-j*k+n*y)*m;k=-h.width*h.anchor.x;if(c.x>k&&c.x<k+h.width&&(k=-h.height*h.anchor.y,c.y>k&&c.y<
k+h.height))return a.local.x=c.x,a.local.y=c.y,h}}return null};
PIXI.InteractionManager.prototype.onMouseMove=function(a){a.preventDefault();var c=this.target.view.getBoundingClientRect();this.mouse.global.x=(a.clientX-c.left)*(this.target.width/c.width);this.mouse.global.y=(a.clientY-c.top)*(this.target.height/c.height);a=this.hitTest(this.mouse);this.currentOver!=a&&(this.currentOver&&(this.currentOver.mouseout&&this.currentOver.mouseout(this.mouse),this.currentOver=null),this.target.view.style.cursor="default");a&&this.currentOver!=a&&(this.currentOver=a,this.target.view.style.cursor=
"pointer",a.mouseover&&a.mouseover(this.mouse))};PIXI.InteractionManager.prototype.onMouseDown=function(a){var c=this.target.view.getBoundingClientRect();this.mouse.global.x=(a.clientX-c.left)*(this.target.width/c.width);this.mouse.global.y=(a.clientY-c.top)*(this.target.height/c.height);if(a=this.hitTest(this.mouse))this.currentDown=a,a.mousedown&&a.mousedown(this.mouse)};
PIXI.InteractionManager.prototype.onMouseUp=function(){this.currentDown&&(this.currentDown.mouseup&&this.currentDown.mouseup(this.mouse),this.currentOver==this.currentDown&&this.currentDown.click&&this.currentDown.click(this.mouse),this.currentDown=null)};
PIXI.InteractionManager.prototype.onMouseMove=function(a){a.preventDefault();var c=this.target.view.getBoundingClientRect();this.mouse.global.x=(a.clientX-c.left)*(this.target.width/c.width);this.mouse.global.y=(a.clientY-c.top)*(this.target.height/c.height);a=this.hitTest(this.mouse);this.currentOver!=a&&(this.currentOver&&(this.mouse.target=this.currentOver,this.currentOver.mouseout&&this.currentOver.mouseout(this.mouse),this.currentOver=null),this.target.view.style.cursor="default");a&&this.currentOver!=
a&&(this.currentOver=a,this.target.view.style.cursor="pointer",this.mouse.target=a,a.mouseover&&a.mouseover(this.mouse))};PIXI.InteractionManager.prototype.onMouseDown=function(a){var c=this.target.view.getBoundingClientRect();this.mouse.global.x=(a.clientX-c.left)*(this.target.width/c.width);this.mouse.global.y=(a.clientY-c.top)*(this.target.height/c.height);if(a=this.hitTest(this.mouse))this.currentDown=a,this.mouse.target=a,a.mousedown&&a.mousedown(this.mouse)};
PIXI.InteractionManager.prototype.onMouseUp=function(){this.currentDown&&(this.mouse.target=this.currentDown,this.currentDown.mouseup&&this.currentDown.mouseup(this.mouse),this.currentOver==this.currentDown&&this.currentDown.click&&this.currentDown.click(this.mouse),this.currentDown=null)};
PIXI.InteractionManager.prototype.onTouchMove=function(a){a.preventDefault();var c=this.target.view.getBoundingClientRect();a=a.changedTouches;for(var f=0;f<a.length;f++){var d=a[f],g=this.touchs[d.identifier];g.global.x=(d.clientX-c.left)*(this.target.width/c.width);g.global.y=(d.clientY-c.top)*(this.target.height/c.height)}};
PIXI.InteractionManager.prototype.onTouchStart=function(a){a.preventDefault();var c=this.target.view.getBoundingClientRect();a=a.changedTouches;for(var f=0;f<a.length;f++){var d=a[f],g=this.pool.pop();g||(g=new PIXI.InteractionData);this.touchs[d.identifier]=g;g.global.x=(d.clientX-c.left)*(this.target.width/c.width);g.global.y=(d.clientY-c.top)*(this.target.height/c.height);if(d=this.hitTest(g))g.currentDown=d,d.touchstart&&d.touchstart(g)}};
PIXI.InteractionManager.prototype.onTouchStart=function(a){a.preventDefault();var c=this.target.view.getBoundingClientRect();a=a.changedTouches;for(var f=0;f<a.length;f++){var d=a[f],g=this.pool.pop();g||(g=new PIXI.InteractionData);this.touchs[d.identifier]=g;g.global.x=(d.clientX-c.left)*(this.target.width/c.width);g.global.y=(d.clientY-c.top)*(this.target.height/c.height);if(d=this.hitTest(g))g.currentDown=d,g.target=d,d.touchstart&&d.touchstart(g)}};
PIXI.InteractionManager.prototype.onTouchEnd=function(a){a.preventDefault();var c=this.target.view.getBoundingClientRect();a=a.changedTouches;for(var f=0;f<a.length;f++){var d=a[f],g=this.touchs[d.identifier];g.global.x=(d.clientX-c.left)*(this.target.width/c.width);g.global.y=(d.clientY-c.top)*(this.target.height/c.height);g.currentDown&&(g.currentDown.touchend&&g.currentDown.touchend(g),this.hitTest(g)==g.currentDown&&g.currentDown.tap&&g.currentDown.tap(g),g.currentDown=null);this.pool.push(g);
this.touchs[d.identifier]=null}};PIXI.InteractionData=function(){this.global=new PIXI.Point;this.local=new PIXI.Point};PIXI.InteractionData.constructor=PIXI.InteractionData;PIXI.BaseTextureCache={};PIXI.texturesToUpdate=[];
PIXI.BaseTexture=function(a){PIXI.EventTarget.call(this);this.height=this.width=100;this.source=a;if(this.source instanceof Image)if(this.source.complete)this.hasLoaded=!0,this.width=this.source.width,this.height=this.source.height,PIXI.texturesToUpdate.push(this);else{var c=this;this.source.onload=function(){c.hasLoaded=!0;c.width=c.source.width;c.height=c.source.height;PIXI.texturesToUpdate.push(c);c.dispatchEvent({type:"loaded",content:c})}}else this.hasLoaded=!0,this.width=this.source.width,this.height=
this.source.height,PIXI.texturesToUpdate.push(this)};PIXI.BaseTexture.constructor=PIXI.BaseTexture;PIXI.BaseTexture.prototype.fromImage=function(){};PIXI.TextureCache={};PIXI.FrameCache={};PIXI.Texture=function(a,c){PIXI.EventTarget.call(this);c||(this.noFrame=!0,c=new PIXI.Rectangle(0,0,1,1));this.trim=new PIXI.Point;this.baseTexture=a;this.frame=c;this.scope=this;if(a.hasLoaded)this.noFrame&&(c=new PIXI.Rectangle(0,0,a.width,a.height)),this.setFrame(c);else{var f=this;a.addEventListener("loaded",function(){f.onBaseTextureLoaded()})}};PIXI.Texture.constructor=PIXI.Texture;
PIXI.Texture.prototype.onBaseTextureLoaded=function(){var a=this.baseTexture;a.removeEventListener("loaded",this.onLoaded);this.noFrame&&(this.frame=new PIXI.Rectangle(0,0,a.width,a.height));this.noFrame=!1;this.width=this.frame.width;this.height=this.frame.height;this.scope.dispatchEvent({type:"update",content:this})};PIXI.Texture.prototype.setFrame=function(a){this.frame=a;this.width=a.width;this.height=a.height};
PIXI.Texture.fromImage=function(a){var c=PIXI.TextureCache[a];c||(c=PIXI.BaseTextureCache[a],c||(c=new Image,c.src=a,c=new PIXI.BaseTexture(c),PIXI.BaseTextureCache[a]=c),c=new PIXI.Texture(c),PIXI.TextureCache[a]=c);return c};PIXI.Texture.fromFrame=function(a){var c=PIXI.TextureCache[a];if(!c)throw Error("The frameId '"+a+"' does not exist in the texture cache "+this);return c};
PIXI.Texture.fromCanvas=function(a){var c=PIXI.TextureCache[a];c||(c=PIXI.BaseTextureCache[a],c||(c=new PIXI.BaseTexture(a),PIXI.BaseTextureCache[a]=c),c=new PIXI.Texture(c),PIXI.TextureCache[a]=c);return c};PIXI.Texture.addTextureToCache=function(a,c){PIXI.TextureCache[c]=a};PIXI.Texture.removeTextureFromCache=function(a){var c=PIXI.TextureCache[a];PIXI.TextureCache[a]=null;return c};PIXI.autoDetectRenderer=function(a,c,f){a||(a=800);c||(c=600);var d;try{d=!!window.WebGLRenderingContext&&!!document.createElement("canvas").getContext("experimental-webgl")}catch(g){d=!1}return d?new PIXI.WebGLRenderer(a,c,f):new PIXI.CanvasRenderer(a,c,f)};PIXI.SpriteSheetLoader=function(a){PIXI.EventTarget.call(this);this.url=a;this.baseUrl=a.replace(/[^\/]*$/,"");this.texture;this.frames={}};PIXI.SpriteSheetLoader.constructor=PIXI.SpriteSheetLoader;PIXI.SpriteSheetLoader.prototype.load=function(){this.ajaxRequest=new AjaxRequest;var a=this;this.ajaxRequest.onreadystatechange=function(){a.onLoaded()};this.ajaxRequest.open("GET",this.url,!0);this.ajaxRequest.send(null)};
PIXI.Texture.fromCanvas=function(a){var c=PIXI.TextureCache[a];c||(c=PIXI.BaseTextureCache[a],c||(c=new PIXI.BaseTexture(a),PIXI.BaseTextureCache[a]=c),c=new PIXI.Texture(c),PIXI.TextureCache[a]=c);return c};PIXI.Texture.addTextureToCache=function(a,c){PIXI.TextureCache[c]=a};PIXI.Texture.removeTextureFromCache=function(a){var c=PIXI.TextureCache[a];PIXI.TextureCache[a]=null;return c};PIXI.autoDetectRenderer=function(a,c,f){a||(a=800);c||(c=600);var d;try{d=!!window.WebGLRenderingContext&&!!document.createElement("canvas").getContext("experimental-webgl")}catch(g){d=!1}return d?new PIXI.WebGLRenderer(a,c,f):new PIXI.CanvasRenderer(a,c,f)};PIXI.SpriteSheetLoader=function(a){PIXI.EventTarget.call(this);this.url=a;this.baseUrl=a.replace(/[^\/]*$/,"");this.texture;this.frames={}};PIXI.SpriteSheetLoader.constructor=PIXI.SpriteSheetLoader;PIXI.SpriteSheetLoader.prototype.load=function(){this.ajaxRequest=new AjaxRequest;var a=this;this.ajaxRequest.onreadystatechange=function(){a.onLoaded()};this.ajaxRequest.open("GET",this.url,!0);this.ajaxRequest.overrideMimeType&&this.ajaxRequest.overrideMimeType("application/json");this.ajaxRequest.send(null)};
PIXI.SpriteSheetLoader.prototype.onLoaded=function(){if(4==this.ajaxRequest.readyState&&(200==this.ajaxRequest.status||-1==window.location.href.indexOf("http"))){var a=eval("("+this.ajaxRequest.responseText+")");this.texture=PIXI.Texture.fromImage(this.baseUrl+a.meta.image).baseTexture;var a=a.frames,c;for(c in a){var f=a[c].frame;PIXI.TextureCache[c]=new PIXI.Texture(this.texture,{x:f.x,y:f.y,width:f.w,height:f.h});a[c].trimmed&&(PIXI.TextureCache[c].realSize=a[c].spriteSourceSize,PIXI.TextureCache[c].trim.x=
0)}if(this.texture.hasLoaded)this.dispatchEvent({type:"loaded",content:this});else{var d=this;this.texture.addEventListener("loaded",function(){d.dispatchEvent({type:"loaded",content:d})})}}};PIXI.AssetLoader=function(a){PIXI.EventTarget.call(this);this.assetURLs=a;this.assets=[]};PIXI.AssetLoader.constructor=PIXI.AssetLoader;
PIXI.AssetLoader.prototype.load=function(){this.loadCount=this.assetURLs.length;for(var a=["jpeg","jpg","png","gif"],c=["json"],f=0;f<this.assetURLs.length;f++){for(var d=this.assetURLs[f],g=d.split(".").pop().toLowerCase(),h=null,j=0;j<a.length;j++)if(g==a[j]){h="img";break}if("img"!=h)for(j=0;j<c.length;j++)if(g==c[j]){h="atlas";break}if("img"==h)if(d=PIXI.Texture.fromImage(d),d.hasLoaded)this.loadCount--;else{var k=this;d.baseTexture.addEventListener("loaded",function(){k.onAssetLoaded()});this.assets.push(d)}else if("atlas"==

View file

@ -122,7 +122,7 @@
<div class="foundat">
Defined in: <a href="..&#x2F;files&#x2F;pixi_InteractionManager.js.html#l319"><code>pixi&#x2F;InteractionManager.js:319</code></a>
Defined in: <a href="..&#x2F;files&#x2F;pixi_InteractionManager.js.html#l323"><code>pixi&#x2F;InteractionManager.js:323</code></a>
</div>
@ -176,7 +176,7 @@
<a href="..&#x2F;files&#x2F;pixi_InteractionManager.js.html#l319"><code>pixi&#x2F;InteractionManager.js:319</code></a>
<a href="..&#x2F;files&#x2F;pixi_InteractionManager.js.html#l323"><code>pixi&#x2F;InteractionManager.js:323</code></a>
</p>
@ -236,6 +236,13 @@
</li>
<li class="index-item property">
<a href="#property_target">target</a>
</li>
</ul>
@ -277,7 +284,7 @@
<a href="..&#x2F;files&#x2F;pixi_InteractionManager.js.html#l325"><code>pixi&#x2F;InteractionManager.js:325</code></a>
<a href="..&#x2F;files&#x2F;pixi_InteractionManager.js.html#l329"><code>pixi&#x2F;InteractionManager.js:329</code></a>
</p>
@ -321,7 +328,7 @@
<a href="..&#x2F;files&#x2F;pixi_InteractionManager.js.html#l332"><code>pixi&#x2F;InteractionManager.js:332</code></a>
<a href="..&#x2F;files&#x2F;pixi_InteractionManager.js.html#l336"><code>pixi&#x2F;InteractionManager.js:336</code></a>
</p>
@ -339,6 +346,50 @@
</div>
<div id="property_target" class="property item">
<h3 class="name"><code>target</code></h3>
<span class="type"><a href="../classes/Sprite.html" class="crosslink">Sprite</a></span>
<div class="meta">
<p>
Defined in
<a href="..&#x2F;files&#x2F;pixi_InteractionManager.js.html#l343"><code>pixi&#x2F;InteractionManager.js:343</code></a>
</p>
</div>
<div class="description">
<p>The target Sprite that was interacted with</p>
</div>
</div>

View file

@ -464,7 +464,7 @@
"extension_for": [],
"module": "PIXI",
"file": "pixi/InteractionManager.js",
"line": 319,
"line": 323,
"is_constructor": 1
},
"MovieClip": {
@ -1457,7 +1457,7 @@
},
{
"file": "pixi/InteractionManager.js",
"line": 325,
"line": 329,
"description": "This point stores the global coords of where the touch/mouse event happened",
"itemtype": "property",
"name": "global",
@ -1466,13 +1466,22 @@
},
{
"file": "pixi/InteractionManager.js",
"line": 332,
"line": 336,
"description": "This point stores the local coords of where the touch/mouse event happened",
"itemtype": "property",
"name": "local",
"type": "Point",
"class": "InteractionData"
},
{
"file": "pixi/InteractionManager.js",
"line": 343,
"description": "The target Sprite that was interacted with",
"itemtype": "property",
"name": "target",
"type": "Sprite",
"class": "InteractionData"
},
{
"file": "pixi/MovieClip.js",
"line": 1,

View file

@ -227,6 +227,7 @@ PIXI.DisplayObject.prototype.updateTransform = function()
mat3.multiply(this.localTransform, this.parent.worldTransform, this.worldTransform);
this.worldAlpha = this.alpha * this.parent.worldAlpha;
}
</pre>
</div>

View file

@ -312,6 +312,7 @@ PIXI.InteractionManager.prototype.onMouseMove = function(event)
{
if(this.currentOver)
{
this.mouse.target = this.currentOver;
if(this.currentOver.mouseout)this.currentOver.mouseout(this.mouse);
this.currentOver = null;
}
@ -326,7 +327,7 @@ PIXI.InteractionManager.prototype.onMouseMove = function(event)
this.currentOver = item;
this.target.view.style.cursor = &quot;pointer&quot;;
this.mouse.target = item;
if(item.mouseover)item.mouseover(this.mouse);
}
}
@ -341,6 +342,7 @@ PIXI.InteractionManager.prototype.onMouseDown = function(event)
if(item)
{
this.currentDown = item;
this.mouse.target = item;
if(item.mousedown)item.mousedown(this.mouse);
}
}
@ -349,6 +351,7 @@ PIXI.InteractionManager.prototype.onMouseUp = function(event)
{
if(this.currentDown)
{
this.mouse.target = this.currentDown;
if(this.currentDown.mouseup)this.currentDown.mouseup(this.mouse);
if(this.currentOver == this.currentDown)if(this.currentDown.click)this.currentDown.click(this.mouse);
@ -398,6 +401,7 @@ PIXI.InteractionManager.prototype.onTouchStart = function(event)
if(item)
{
touchData.currentDown = item;
touchData.target = item;
if(item.touchstart)item.touchstart(touchData);
}
}
@ -455,6 +459,13 @@ PIXI.InteractionData = function()
* @type Point
*&#x2F;
this.local = new PIXI.Point();
&#x2F;**
* The target Sprite that was interacted with
* @property target
* @type Sprite
*&#x2F;
this.target;
}
&#x2F;&#x2F; constructor

View file

@ -166,6 +166,7 @@ PIXI.SpriteSheetLoader.prototype.load = function()
}
this.ajaxRequest.open(&quot;GET&quot;, this.url, true)
if (this.ajaxRequest.overrideMimeType) this.ajaxRequest.overrideMimeType(&quot;application&#x2F;json&quot;);
this.ajaxRequest.send(null)
}

View file

@ -135,18 +135,18 @@ PIXI.autoDetectRenderer = function(width, height, view)
{
if(!width)width = 800;
if(!height)height = 600;
&#x2F;&#x2F; BORROWED from Mr Doob (mrdoob.com)
var webgl = ( function () { try { return !! window.WebGLRenderingContext &amp;&amp; !! document.createElement( &#x27;canvas&#x27; ).getContext( &#x27;experimental-webgl&#x27; ); } catch( e ) { return false; } } )()
var webgl = ( function () { try { return !! window.WebGLRenderingContext &amp;&amp; !! document.createElement( &#x27;canvas&#x27; ).getContext( &#x27;experimental-webgl&#x27; ); } catch( e ) { return false; } } )();
&#x2F;&#x2F;console.log(webgl);
if( webgl )
{
return new PIXI.WebGLRenderer(width, height, view)
return new PIXI.WebGLRenderer(width, height, view);
}
return new PIXI.CanvasRenderer(width, height, view);
}
};

View file

@ -192,6 +192,7 @@ PIXI.InteractionManager.prototype.onMouseMove = function(event)
{
if(this.currentOver)
{
this.mouse.target = this.currentOver;
if(this.currentOver.mouseout)this.currentOver.mouseout(this.mouse);
this.currentOver = null;
}
@ -206,7 +207,7 @@ PIXI.InteractionManager.prototype.onMouseMove = function(event)
this.currentOver = item;
this.target.view.style.cursor = "pointer";
this.mouse.target = item;
if(item.mouseover)item.mouseover(this.mouse);
}
}
@ -221,6 +222,7 @@ PIXI.InteractionManager.prototype.onMouseDown = function(event)
if(item)
{
this.currentDown = item;
this.mouse.target = item;
if(item.mousedown)item.mousedown(this.mouse);
}
}
@ -229,6 +231,7 @@ PIXI.InteractionManager.prototype.onMouseUp = function(event)
{
if(this.currentDown)
{
this.mouse.target = this.currentDown;
if(this.currentDown.mouseup)this.currentDown.mouseup(this.mouse);
if(this.currentOver == this.currentDown)if(this.currentDown.click)this.currentDown.click(this.mouse);
@ -278,6 +281,7 @@ PIXI.InteractionManager.prototype.onTouchStart = function(event)
if(item)
{
touchData.currentDown = item;
touchData.target = item;
if(item.touchstart)item.touchstart(touchData);
}
}
@ -335,6 +339,13 @@ PIXI.InteractionData = function()
* @type Point
*/
this.local = new PIXI.Point();
/**
* The target Sprite that was interacted with
* @property target
* @type Sprite
*/
this.target;
}
// constructor