diff --git a/bin/pixi.js b/bin/pixi.js index e4c61db..a92235b 100644 --- a/bin/pixi.js +++ b/bin/pixi.js @@ -25,7 +25,7 @@ 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 @@ 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;gk&&c.xk&&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;fMath.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 @@ 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;gk&&c.xk&&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 - Defined in: pixi/InteractionManager.js:319 + Defined in: pixi/InteractionManager.js:323 @@ -176,7 +176,7 @@ - pixi/InteractionManager.js:319 + pixi/InteractionManager.js:323

@@ -238,6 +238,13 @@ +
  • + target + + + +
  • + @@ -277,7 +284,7 @@ - pixi/InteractionManager.js:325 + pixi/InteractionManager.js:329

    @@ -321,7 +328,7 @@ - pixi/InteractionManager.js:332 + pixi/InteractionManager.js:336

    @@ -342,6 +349,50 @@ +
    +

    target

    + Sprite + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/InteractionManager.js:343 + +

    + + + + +
    + +
    +

    The target Sprite that was interacted with

    +
    + + + + + + +
    + + diff --git a/bin/pixi.js b/bin/pixi.js index e4c61db..a92235b 100644 --- a/bin/pixi.js +++ b/bin/pixi.js @@ -25,7 +25,7 @@ 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 @@ 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;gk&&c.xk&&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 - Defined in: pixi/InteractionManager.js:319 + Defined in: pixi/InteractionManager.js:323 @@ -176,7 +176,7 @@ - pixi/InteractionManager.js:319 + pixi/InteractionManager.js:323

    @@ -238,6 +238,13 @@ +
  • + target + + + +
  • + @@ -277,7 +284,7 @@ - pixi/InteractionManager.js:325 + pixi/InteractionManager.js:329

    @@ -321,7 +328,7 @@ - pixi/InteractionManager.js:332 + pixi/InteractionManager.js:336

    @@ -342,6 +349,50 @@ +
    +

    target

    + Sprite + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/InteractionManager.js:343 + +

    + + + + +
    + +
    +

    The target Sprite that was interacted with

    +
    + + + + + + +
    + + diff --git a/docs/data.json b/docs/data.json index 5e94f50..4fd4435 100644 --- a/docs/data.json +++ b/docs/data.json @@ -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,7 +1466,7 @@ }, { "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", @@ -1474,6 +1474,15 @@ "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, "author": "Mat Groves http://matgroves.com/ @Doormat23", diff --git a/bin/pixi.js b/bin/pixi.js index e4c61db..a92235b 100644 --- a/bin/pixi.js +++ b/bin/pixi.js @@ -25,7 +25,7 @@ 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 @@ 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;gk&&c.xk&&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 - Defined in: pixi/InteractionManager.js:319 + Defined in: pixi/InteractionManager.js:323 @@ -176,7 +176,7 @@ - pixi/InteractionManager.js:319 + pixi/InteractionManager.js:323

    @@ -238,6 +238,13 @@ +
  • + target + + + +
  • + @@ -277,7 +284,7 @@ - pixi/InteractionManager.js:325 + pixi/InteractionManager.js:329

    @@ -321,7 +328,7 @@ - pixi/InteractionManager.js:332 + pixi/InteractionManager.js:336

    @@ -342,6 +349,50 @@ +
    +

    target

    + Sprite + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/InteractionManager.js:343 + +

    + + + + +
    + +
    +

    The target Sprite that was interacted with

    +
    + + + + + + +
    + + diff --git a/docs/data.json b/docs/data.json index 5e94f50..4fd4435 100644 --- a/docs/data.json +++ b/docs/data.json @@ -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,7 +1466,7 @@ }, { "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", @@ -1474,6 +1474,15 @@ "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, "author": "Mat Groves http://matgroves.com/ @Doormat23", diff --git a/docs/files/pixi_DisplayObject.js.html b/docs/files/pixi_DisplayObject.js.html index a1d9784..cba6a7a 100644 --- a/docs/files/pixi_DisplayObject.js.html +++ b/docs/files/pixi_DisplayObject.js.html @@ -227,6 +227,7 @@ mat3.multiply(this.localTransform, this.parent.worldTransform, this.worldTransform); this.worldAlpha = this.alpha * this.parent.worldAlpha; } + diff --git a/bin/pixi.js b/bin/pixi.js index e4c61db..a92235b 100644 --- a/bin/pixi.js +++ b/bin/pixi.js @@ -25,7 +25,7 @@ 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 @@ 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;gk&&c.xk&&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 - Defined in: pixi/InteractionManager.js:319 + Defined in: pixi/InteractionManager.js:323 @@ -176,7 +176,7 @@ - pixi/InteractionManager.js:319 + pixi/InteractionManager.js:323

    @@ -238,6 +238,13 @@ +
  • + target + + + +
  • + @@ -277,7 +284,7 @@ - pixi/InteractionManager.js:325 + pixi/InteractionManager.js:329

    @@ -321,7 +328,7 @@ - pixi/InteractionManager.js:332 + pixi/InteractionManager.js:336

    @@ -342,6 +349,50 @@ +
    +

    target

    + Sprite + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/InteractionManager.js:343 + +

    + + + + +
    + +
    +

    The target Sprite that was interacted with

    +
    + + + + + + +
    + + diff --git a/docs/data.json b/docs/data.json index 5e94f50..4fd4435 100644 --- a/docs/data.json +++ b/docs/data.json @@ -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,7 +1466,7 @@ }, { "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", @@ -1474,6 +1474,15 @@ "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, "author": "Mat Groves http://matgroves.com/ @Doormat23", diff --git a/docs/files/pixi_DisplayObject.js.html b/docs/files/pixi_DisplayObject.js.html index a1d9784..cba6a7a 100644 --- a/docs/files/pixi_DisplayObject.js.html +++ b/docs/files/pixi_DisplayObject.js.html @@ -227,6 +227,7 @@ mat3.multiply(this.localTransform, this.parent.worldTransform, this.worldTransform); this.worldAlpha = this.alpha * this.parent.worldAlpha; } + diff --git a/docs/files/pixi_InteractionManager.js.html b/docs/files/pixi_InteractionManager.js.html index ed46760..f06c112 100644 --- a/docs/files/pixi_InteractionManager.js.html +++ b/docs/files/pixi_InteractionManager.js.html @@ -312,6 +312,7 @@ { if(this.currentOver) { + this.mouse.target = this.currentOver; if(this.currentOver.mouseout)this.currentOver.mouseout(this.mouse); this.currentOver = null; } @@ -326,7 +327,7 @@ this.currentOver = item; this.target.view.style.cursor = "pointer"; - + this.mouse.target = item; if(item.mouseover)item.mouseover(this.mouse); } } @@ -341,6 +342,7 @@ if(item) { this.currentDown = item; + this.mouse.target = item; if(item.mousedown)item.mousedown(this.mouse); } } @@ -349,6 +351,7 @@ { 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 @@ if(item) { touchData.currentDown = item; + touchData.target = item; if(item.touchstart)item.touchstart(touchData); } } @@ -455,6 +459,13 @@ * @type Point */ this.local = new PIXI.Point(); + + /** + * The target Sprite that was interacted with + * @property target + * @type Sprite + */ + this.target; } // constructor diff --git a/bin/pixi.js b/bin/pixi.js index e4c61db..a92235b 100644 --- a/bin/pixi.js +++ b/bin/pixi.js @@ -25,7 +25,7 @@ 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 @@ 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;gk&&c.xk&&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 - Defined in: pixi/InteractionManager.js:319 + Defined in: pixi/InteractionManager.js:323 @@ -176,7 +176,7 @@ - pixi/InteractionManager.js:319 + pixi/InteractionManager.js:323

    @@ -238,6 +238,13 @@ +
  • + target + + + +
  • + @@ -277,7 +284,7 @@ - pixi/InteractionManager.js:325 + pixi/InteractionManager.js:329

    @@ -321,7 +328,7 @@ - pixi/InteractionManager.js:332 + pixi/InteractionManager.js:336

    @@ -342,6 +349,50 @@ +
    +

    target

    + Sprite + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/InteractionManager.js:343 + +

    + + + + +
    + +
    +

    The target Sprite that was interacted with

    +
    + + + + + + +
    + + diff --git a/docs/data.json b/docs/data.json index 5e94f50..4fd4435 100644 --- a/docs/data.json +++ b/docs/data.json @@ -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,7 +1466,7 @@ }, { "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", @@ -1474,6 +1474,15 @@ "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, "author": "Mat Groves http://matgroves.com/ @Doormat23", diff --git a/docs/files/pixi_DisplayObject.js.html b/docs/files/pixi_DisplayObject.js.html index a1d9784..cba6a7a 100644 --- a/docs/files/pixi_DisplayObject.js.html +++ b/docs/files/pixi_DisplayObject.js.html @@ -227,6 +227,7 @@ mat3.multiply(this.localTransform, this.parent.worldTransform, this.worldTransform); this.worldAlpha = this.alpha * this.parent.worldAlpha; } + diff --git a/docs/files/pixi_InteractionManager.js.html b/docs/files/pixi_InteractionManager.js.html index ed46760..f06c112 100644 --- a/docs/files/pixi_InteractionManager.js.html +++ b/docs/files/pixi_InteractionManager.js.html @@ -312,6 +312,7 @@ { if(this.currentOver) { + this.mouse.target = this.currentOver; if(this.currentOver.mouseout)this.currentOver.mouseout(this.mouse); this.currentOver = null; } @@ -326,7 +327,7 @@ this.currentOver = item; this.target.view.style.cursor = "pointer"; - + this.mouse.target = item; if(item.mouseover)item.mouseover(this.mouse); } } @@ -341,6 +342,7 @@ if(item) { this.currentDown = item; + this.mouse.target = item; if(item.mousedown)item.mousedown(this.mouse); } } @@ -349,6 +351,7 @@ { 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 @@ if(item) { touchData.currentDown = item; + touchData.target = item; if(item.touchstart)item.touchstart(touchData); } } @@ -455,6 +459,13 @@ * @type Point */ this.local = new PIXI.Point(); + + /** + * The target Sprite that was interacted with + * @property target + * @type Sprite + */ + this.target; } // constructor diff --git a/docs/files/pixi_loaders_SpriteSheetLoader.js.html b/docs/files/pixi_loaders_SpriteSheetLoader.js.html index 4563921..e632eaa 100644 --- a/docs/files/pixi_loaders_SpriteSheetLoader.js.html +++ b/docs/files/pixi_loaders_SpriteSheetLoader.js.html @@ -166,6 +166,7 @@ } this.ajaxRequest.open("GET", this.url, true) + if (this.ajaxRequest.overrideMimeType) this.ajaxRequest.overrideMimeType("application/json"); this.ajaxRequest.send(null) } diff --git a/bin/pixi.js b/bin/pixi.js index e4c61db..a92235b 100644 --- a/bin/pixi.js +++ b/bin/pixi.js @@ -25,7 +25,7 @@ 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 @@ 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;gk&&c.xk&&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 - Defined in: pixi/InteractionManager.js:319 + Defined in: pixi/InteractionManager.js:323 @@ -176,7 +176,7 @@ - pixi/InteractionManager.js:319 + pixi/InteractionManager.js:323

    @@ -238,6 +238,13 @@ +
  • + target + + + +
  • + @@ -277,7 +284,7 @@ - pixi/InteractionManager.js:325 + pixi/InteractionManager.js:329

    @@ -321,7 +328,7 @@ - pixi/InteractionManager.js:332 + pixi/InteractionManager.js:336

    @@ -342,6 +349,50 @@ +
    +

    target

    + Sprite + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/InteractionManager.js:343 + +

    + + + + +
    + +
    +

    The target Sprite that was interacted with

    +
    + + + + + + +
    + + diff --git a/docs/data.json b/docs/data.json index 5e94f50..4fd4435 100644 --- a/docs/data.json +++ b/docs/data.json @@ -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,7 +1466,7 @@ }, { "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", @@ -1474,6 +1474,15 @@ "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, "author": "Mat Groves http://matgroves.com/ @Doormat23", diff --git a/docs/files/pixi_DisplayObject.js.html b/docs/files/pixi_DisplayObject.js.html index a1d9784..cba6a7a 100644 --- a/docs/files/pixi_DisplayObject.js.html +++ b/docs/files/pixi_DisplayObject.js.html @@ -227,6 +227,7 @@ mat3.multiply(this.localTransform, this.parent.worldTransform, this.worldTransform); this.worldAlpha = this.alpha * this.parent.worldAlpha; } + diff --git a/docs/files/pixi_InteractionManager.js.html b/docs/files/pixi_InteractionManager.js.html index ed46760..f06c112 100644 --- a/docs/files/pixi_InteractionManager.js.html +++ b/docs/files/pixi_InteractionManager.js.html @@ -312,6 +312,7 @@ { if(this.currentOver) { + this.mouse.target = this.currentOver; if(this.currentOver.mouseout)this.currentOver.mouseout(this.mouse); this.currentOver = null; } @@ -326,7 +327,7 @@ this.currentOver = item; this.target.view.style.cursor = "pointer"; - + this.mouse.target = item; if(item.mouseover)item.mouseover(this.mouse); } } @@ -341,6 +342,7 @@ if(item) { this.currentDown = item; + this.mouse.target = item; if(item.mousedown)item.mousedown(this.mouse); } } @@ -349,6 +351,7 @@ { 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 @@ if(item) { touchData.currentDown = item; + touchData.target = item; if(item.touchstart)item.touchstart(touchData); } } @@ -455,6 +459,13 @@ * @type Point */ this.local = new PIXI.Point(); + + /** + * The target Sprite that was interacted with + * @property target + * @type Sprite + */ + this.target; } // constructor diff --git a/docs/files/pixi_loaders_SpriteSheetLoader.js.html b/docs/files/pixi_loaders_SpriteSheetLoader.js.html index 4563921..e632eaa 100644 --- a/docs/files/pixi_loaders_SpriteSheetLoader.js.html +++ b/docs/files/pixi_loaders_SpriteSheetLoader.js.html @@ -166,6 +166,7 @@ } this.ajaxRequest.open("GET", this.url, true) + if (this.ajaxRequest.overrideMimeType) this.ajaxRequest.overrideMimeType("application/json"); this.ajaxRequest.send(null) } diff --git a/docs/files/pixi_utils_Detector.js.html b/docs/files/pixi_utils_Detector.js.html index de02aa1..5f0af48 100644 --- a/docs/files/pixi_utils_Detector.js.html +++ b/docs/files/pixi_utils_Detector.js.html @@ -135,18 +135,18 @@ { if(!width)width = 800; if(!height)height = 600; - + // BORROWED from Mr Doob (mrdoob.com) - var webgl = ( function () { try { return !! window.WebGLRenderingContext && !! document.createElement( 'canvas' ).getContext( 'experimental-webgl' ); } catch( e ) { return false; } } )() - + var webgl = ( function () { try { return !! window.WebGLRenderingContext && !! document.createElement( 'canvas' ).getContext( 'experimental-webgl' ); } catch( e ) { return false; } } )(); + //console.log(webgl); if( webgl ) { - return new PIXI.WebGLRenderer(width, height, view) + return new PIXI.WebGLRenderer(width, height, view); } - + return new PIXI.CanvasRenderer(width, height, view); -} +}; diff --git a/bin/pixi.js b/bin/pixi.js index e4c61db..a92235b 100644 --- a/bin/pixi.js +++ b/bin/pixi.js @@ -25,7 +25,7 @@ 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 @@ 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;gk&&c.xk&&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 - Defined in: pixi/InteractionManager.js:319 + Defined in: pixi/InteractionManager.js:323 @@ -176,7 +176,7 @@ - pixi/InteractionManager.js:319 + pixi/InteractionManager.js:323

    @@ -238,6 +238,13 @@ +
  • + target + + + +
  • + @@ -277,7 +284,7 @@ - pixi/InteractionManager.js:325 + pixi/InteractionManager.js:329

    @@ -321,7 +328,7 @@ - pixi/InteractionManager.js:332 + pixi/InteractionManager.js:336

    @@ -342,6 +349,50 @@ +
    +

    target

    + Sprite + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/InteractionManager.js:343 + +

    + + + + +
    + +
    +

    The target Sprite that was interacted with

    +
    + + + + + + +
    + + diff --git a/docs/data.json b/docs/data.json index 5e94f50..4fd4435 100644 --- a/docs/data.json +++ b/docs/data.json @@ -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,7 +1466,7 @@ }, { "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", @@ -1474,6 +1474,15 @@ "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, "author": "Mat Groves http://matgroves.com/ @Doormat23", diff --git a/docs/files/pixi_DisplayObject.js.html b/docs/files/pixi_DisplayObject.js.html index a1d9784..cba6a7a 100644 --- a/docs/files/pixi_DisplayObject.js.html +++ b/docs/files/pixi_DisplayObject.js.html @@ -227,6 +227,7 @@ mat3.multiply(this.localTransform, this.parent.worldTransform, this.worldTransform); this.worldAlpha = this.alpha * this.parent.worldAlpha; } + diff --git a/docs/files/pixi_InteractionManager.js.html b/docs/files/pixi_InteractionManager.js.html index ed46760..f06c112 100644 --- a/docs/files/pixi_InteractionManager.js.html +++ b/docs/files/pixi_InteractionManager.js.html @@ -312,6 +312,7 @@ { if(this.currentOver) { + this.mouse.target = this.currentOver; if(this.currentOver.mouseout)this.currentOver.mouseout(this.mouse); this.currentOver = null; } @@ -326,7 +327,7 @@ this.currentOver = item; this.target.view.style.cursor = "pointer"; - + this.mouse.target = item; if(item.mouseover)item.mouseover(this.mouse); } } @@ -341,6 +342,7 @@ if(item) { this.currentDown = item; + this.mouse.target = item; if(item.mousedown)item.mousedown(this.mouse); } } @@ -349,6 +351,7 @@ { 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 @@ if(item) { touchData.currentDown = item; + touchData.target = item; if(item.touchstart)item.touchstart(touchData); } } @@ -455,6 +459,13 @@ * @type Point */ this.local = new PIXI.Point(); + + /** + * The target Sprite that was interacted with + * @property target + * @type Sprite + */ + this.target; } // constructor diff --git a/docs/files/pixi_loaders_SpriteSheetLoader.js.html b/docs/files/pixi_loaders_SpriteSheetLoader.js.html index 4563921..e632eaa 100644 --- a/docs/files/pixi_loaders_SpriteSheetLoader.js.html +++ b/docs/files/pixi_loaders_SpriteSheetLoader.js.html @@ -166,6 +166,7 @@ } this.ajaxRequest.open("GET", this.url, true) + if (this.ajaxRequest.overrideMimeType) this.ajaxRequest.overrideMimeType("application/json"); this.ajaxRequest.send(null) } diff --git a/docs/files/pixi_utils_Detector.js.html b/docs/files/pixi_utils_Detector.js.html index de02aa1..5f0af48 100644 --- a/docs/files/pixi_utils_Detector.js.html +++ b/docs/files/pixi_utils_Detector.js.html @@ -135,18 +135,18 @@ { if(!width)width = 800; if(!height)height = 600; - + // BORROWED from Mr Doob (mrdoob.com) - var webgl = ( function () { try { return !! window.WebGLRenderingContext && !! document.createElement( 'canvas' ).getContext( 'experimental-webgl' ); } catch( e ) { return false; } } )() - + var webgl = ( function () { try { return !! window.WebGLRenderingContext && !! document.createElement( 'canvas' ).getContext( 'experimental-webgl' ); } catch( e ) { return false; } } )(); + //console.log(webgl); if( webgl ) { - return new PIXI.WebGLRenderer(width, height, view) + return new PIXI.WebGLRenderer(width, height, view); } - + return new PIXI.CanvasRenderer(width, height, view); -} +}; diff --git a/src/pixi/InteractionManager.js b/src/pixi/InteractionManager.js index 2b2c9f0..24f9deb 100644 --- a/src/pixi/InteractionManager.js +++ b/src/pixi/InteractionManager.js @@ -192,6 +192,7 @@ { if(this.currentOver) { + this.mouse.target = this.currentOver; if(this.currentOver.mouseout)this.currentOver.mouseout(this.mouse); this.currentOver = null; } @@ -206,7 +207,7 @@ this.currentOver = item; this.target.view.style.cursor = "pointer"; - + this.mouse.target = item; if(item.mouseover)item.mouseover(this.mouse); } } @@ -221,6 +222,7 @@ if(item) { this.currentDown = item; + this.mouse.target = item; if(item.mousedown)item.mousedown(this.mouse); } } @@ -229,6 +231,7 @@ { 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 @@ if(item) { touchData.currentDown = item; + touchData.target = item; if(item.touchstart)item.touchstart(touchData); } } @@ -335,6 +339,13 @@ * @type Point */ this.local = new PIXI.Point(); + + /** + * The target Sprite that was interacted with + * @property target + * @type Sprite + */ + this.target; } // constructor