diff --git a/build/caat-box2d-min.js b/build/caat-box2d-min.js index 1324a6d9..bfa904a8 100644 --- a/build/caat-box2d-min.js +++ b/build/caat-box2d-min.js @@ -22,11 +22,11 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -Version: 0.6 build: 29 +Version: 0.6 build: 6 Created on: -DATE: 2013-03-18 -TIME: 23:02:29 +DATE: 2013-07-01 +TIME: 04:58:33 */ diff --git a/build/caat-box2d.js b/build/caat-box2d.js index dc81886f..420e2272 100644 --- a/build/caat-box2d.js +++ b/build/caat-box2d.js @@ -21,11 +21,11 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -Version: 0.6 build: 30 +Version: 0.6 build: 5 Created on: -DATE: 2013-03-18 -TIME: 23:03:06 +DATE: 2013-07-01 +TIME: 04:58:33 */ diff --git a/build/caat-css-min.js b/build/caat-css-min.js index 5f5a776e..44a6dcd0 100644 --- a/build/caat-css-min.js +++ b/build/caat-css-min.js @@ -22,32 +22,32 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -Version: 0.6 build: 29 +Version: 0.6 build: 6 Created on: -DATE: 2013-03-18 -TIME: 23:02:29 +DATE: 2013-07-01 +TIME: 04:58:33 */ -(function(a){function b(b){for(var b=b.split("."),c=a,d=0;d NOT solved."))},removeDependency:function(a){for(var b=0;b Can't extend non-existant class: "+this.baseClass);return}}else b= -e;b.extend(this.extendWith,this.constants,this.name,this.aliases,{decorated:this.decorated});console.log("Created module: "+this.name);this.callback&&this.callback()}};var g=function(a,b){this.path=a;this.module=b;return this};g.prototype={path:null,processed:false,module:null,setProcessed:function(){this.processed=true},isProcessed:function(){return this.processed}};var h=function(){this.nodes=[];this.loadedFiles=[];this.path={};this.solveListener=[];this.orderedSolvedModules=[];this.readyListener= -[];return this};h.baseURL="";h.modulePath={};h.sortedModulePath=[];h.symbol={};h.prototype={nodes:null,loadedFiles:null,solveListener:null,readyListener:null,orderedSolvedModules:null,addSolvedListener:function(a,b){this.solveListener.push({name:a,callback:b})},solved:function(a){var b;for(b=0;b catched "+d+" on module "+a.defines+" preCreation.")}if(!a.depends)a.depends= -[];if((b=a.depends)&&!isArray(b))b=[b],a.depends=b;for(c=0;c NOT solved."))},removeDependency:function(a){for(var b=0;b Can't extend non-existant class: "+this.baseClass);return}}else b=f;b.extend(this.extendWith,this.constants,this.name,this.aliases,{decorated:this.decorated});console.log("Created module: "+this.name);this.callback&&this.callback()}};var h=function(a,b){this.path=a;this.module=b;return this};h.prototype={path:null,processed:false,module:null,setProcessed:function(){this.processed=true},isProcessed:function(){return this.processed}};var i=function(){this.nodes=[];this.loadedFiles=[]; +this.path={};this.solveListener=[];this.orderedSolvedModules=[];this.readyListener=[];return this};i.baseURL="";i.modulePath={};i.sortedModulePath=[];i.symbol={};i.prototype={nodes:null,loadedFiles:null,solveListener:null,readyListener:null,orderedSolvedModules:null,addSolvedListener:function(a,b){this.solveListener.push({name:a,callback:b})},solved:function(a){var b;for(b=0;b catched "+ +d+" on module "+a.defines+" preCreation.")}if(!a.depends)a.depends=[];if((b=a.depends)&&!isArray(b))b=[b],a.depends=b;for(c=0;c>0,b[5]>>0);return this},transformRenderingContext_Clamp:function(a){var b=this.matrix;a.transform(b[0],b[3],b[1],b[4],b[2]>>0,b[5]>>0);return this},setModelViewMatrix:function(a,b,c,d,e){var f,g,h,i,j,k;k= this.matrix;d=1;j=g=0;i=1;c=Math.cos(e);e=Math.sin(e);f=d;h=j;d=f*c+g*e;g=-f*e+g*c;j=h*c+i*e;i=-h*e+i*c;d*=this.scaleX;g*=this.scaleY;j*=this.scaleX;i*=this.scaleY;k[0]=d;k[1]=g;k[2]=a;k[3]=j;k[4]=i;k[5]=b}}}}); CAAT.Module({defines:"CAAT.Math.Matrix3",aliases:["CAAT.Matrix3"],extendsWith:function(){return{matrix:null,fmatrix:null,__init:function(){this.matrix=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];this.fmatrix=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return this},transformCoord:function(a){var b=a.x,c=a.y,d=a.z;a.x=b*this.matrix[0][0]+c*this.matrix[0][1]+d*this.matrix[0][2]+this.matrix[0][3];a.y=b*this.matrix[1][0]+c*this.matrix[1][1]+d*this.matrix[1][2]+this.matrix[1][3];a.z=b*this.matrix[2][0]+c*this.matrix[2][1]+ d*this.matrix[2][2]+this.matrix[2][3];return a},initialize:function(a,b,c,d,e,f,g,h,i){this.identity();this.matrix[0][0]=a;this.matrix[0][1]=b;this.matrix[0][2]=c;this.matrix[1][0]=d;this.matrix[1][1]=e;this.matrix[1][2]=f;this.matrix[2][0]=g;this.matrix[2][1]=h;this.matrix[2][2]=i;return this},initWithMatrix:function(a){this.matrix=a;return this},flatten:function(){var a=this.fmatrix,b=this.matrix;a[0]=b[0][0];a[1]=b[1][0];a[2]=b[2][0];a[3]=b[3][0];a[4]=b[0][1];a[5]=b[1][1];a[6]=b[2][1];a[7]=b[2][1]; a[8]=b[0][2];a[9]=b[1][2];a[10]=b[2][2];a[11]=b[3][2];a[12]=b[0][3];a[13]=b[1][3];a[14]=b[2][3];a[15]=b[3][3];return this.fmatrix},identity:function(){for(var a=0;a<4;a++)for(var b=0;b<4;b++)this.matrix[a][b]=a===b?1:0;return this},getMatrix:function(){return this.matrix},rotateXY:function(a){return this.rotate(a,0,0)},rotateXZ:function(a){return this.rotate(0,a,0)},rotateYZ:function(a){return this.rotate(0,0,a)},setRotate:function(a,b,c){this.copy(this.rotate(a,b,c));return this},rotate:function(a, b,c){var d=new CAAT.Math.Matrix3,e,f;a!==0&&(f=new CAAT.Math.Math.Matrix3,e=Math.sin(a),a=Math.cos(a),f.matrix[1][1]=a,f.matrix[1][2]=-e,f.matrix[2][1]=e,f.matrix[2][2]=a,d.multiply(f));b!==0&&(f=new CAAT.Math.Matrix3,e=Math.sin(b),a=Math.cos(b),f.matrix[0][0]=a,f.matrix[0][2]=-e,f.matrix[2][0]=e,f.matrix[2][2]=a,d.multiply(f));c!==0&&(f=new CAAT.Math.Matrix3,e=Math.sin(c),a=Math.cos(c),f.matrix[0][0]=a,f.matrix[0][1]=-e,f.matrix[1][0]=e,f.matrix[1][1]=a,d.multiply(f));return d},getClone:function(){var a= -new CAAT.Math.Matrix3;a.copy(this);return a},multiply:function(a){var b=this.getClone().matrix,c=b[0][0],d=b[0][1],e=b[0][2],f=b[0][3],g=b[1][0],h=b[1][1],i=b[1][2],j=b[1][3],k=b[2][0],m=b[2][1],o=b[2][2],b=b[2][3],n=a.matrix,a=n[0][0],p=n[0][1],q=n[0][2],r=n[0][3],t=n[1][0],s=n[1][1],u=n[1][2],v=n[1][3],w=n[2][0],x=n[2][1],y=n[2][2],z=n[2][3],A=n[3][0],B=n[3][1],C=n[3][2],n=n[3][3];this.matrix[0][0]=c*a+d*t+e*w+f*A;this.matrix[0][1]=c*p+d*s+e*x+f*B;this.matrix[0][2]=c*q+d*u+e*y+f*C;this.matrix[0][3]= -c*r+d*v+e*z+f*n;this.matrix[1][0]=g*a+h*t+i*w+j*A;this.matrix[1][1]=g*p+h*s+i*x+j*B;this.matrix[1][2]=g*q+h*u+i*y+j*C;this.matrix[1][3]=g*r+h*v+i*z+j*n;this.matrix[2][0]=k*a+m*t+o*w+b*A;this.matrix[2][1]=k*p+m*s+o*x+b*B;this.matrix[2][2]=k*q+m*u+o*y+b*C;this.matrix[2][3]=k*r+m*v+o*z+b*n;return this},premultiply:function(a){var b=this.getClone().matrix,c=b[0][0],d=b[0][1],e=b[0][2],f=b[0][3],g=b[1][0],h=b[1][1],i=b[1][2],j=b[1][3],k=b[2][0],m=b[2][1],o=b[2][2],b=b[2][3],n=a.matrix,a=n[0][0],p=n[0][1], -q=n[0][2],r=n[0][3],t=n[1][0],s=n[1][1],u=n[1][2],v=n[1][3],w=n[2][0],x=n[2][1],y=n[2][2],n=n[2][3];this.matrix[0][0]=c*a+d*t+e*w;this.matrix[0][1]=c*p+d*s+e*x;this.matrix[0][2]=c*q+d*u+e*y;this.matrix[0][3]=c*r+d*v+e*n+f;this.matrix[1][0]=g*a+h*t+i*w;this.matrix[1][1]=g*p+h*s+i*x;this.matrix[1][2]=g*q+h*u+i*y;this.matrix[1][3]=g*r+h*v+i*n+j;this.matrix[2][0]=k*a+m*t+o*w;this.matrix[2][1]=k*p+m*s+o*x;this.matrix[2][2]=k*q+m*u+o*y;this.matrix[2][3]=k*r+m*v+o*n+b;return this},setTranslate:function(a, +new CAAT.Math.Matrix3;a.copy(this);return a},multiply:function(a){var b=this.getClone().matrix,c=b[0][0],d=b[0][1],e=b[0][2],f=b[0][3],g=b[1][0],h=b[1][1],i=b[1][2],j=b[1][3],k=b[2][0],m=b[2][1],o=b[2][2],b=b[2][3],n=a.matrix,a=n[0][0],p=n[0][1],q=n[0][2],r=n[0][3],u=n[1][0],t=n[1][1],s=n[1][2],w=n[1][3],v=n[2][0],x=n[2][1],y=n[2][2],z=n[2][3],A=n[3][0],B=n[3][1],C=n[3][2],n=n[3][3];this.matrix[0][0]=c*a+d*u+e*v+f*A;this.matrix[0][1]=c*p+d*t+e*x+f*B;this.matrix[0][2]=c*q+d*s+e*y+f*C;this.matrix[0][3]= +c*r+d*w+e*z+f*n;this.matrix[1][0]=g*a+h*u+i*v+j*A;this.matrix[1][1]=g*p+h*t+i*x+j*B;this.matrix[1][2]=g*q+h*s+i*y+j*C;this.matrix[1][3]=g*r+h*w+i*z+j*n;this.matrix[2][0]=k*a+m*u+o*v+b*A;this.matrix[2][1]=k*p+m*t+o*x+b*B;this.matrix[2][2]=k*q+m*s+o*y+b*C;this.matrix[2][3]=k*r+m*w+o*z+b*n;return this},premultiply:function(a){var b=this.getClone().matrix,c=b[0][0],d=b[0][1],e=b[0][2],f=b[0][3],g=b[1][0],h=b[1][1],i=b[1][2],j=b[1][3],k=b[2][0],m=b[2][1],o=b[2][2],b=b[2][3],n=a.matrix,a=n[0][0],p=n[0][1], +q=n[0][2],r=n[0][3],u=n[1][0],t=n[1][1],s=n[1][2],w=n[1][3],v=n[2][0],x=n[2][1],y=n[2][2],n=n[2][3];this.matrix[0][0]=c*a+d*u+e*v;this.matrix[0][1]=c*p+d*t+e*x;this.matrix[0][2]=c*q+d*s+e*y;this.matrix[0][3]=c*r+d*w+e*n+f;this.matrix[1][0]=g*a+h*u+i*v;this.matrix[1][1]=g*p+h*t+i*x;this.matrix[1][2]=g*q+h*s+i*y;this.matrix[1][3]=g*r+h*w+i*n+j;this.matrix[2][0]=k*a+m*u+o*v;this.matrix[2][1]=k*p+m*t+o*x;this.matrix[2][2]=k*q+m*s+o*y;this.matrix[2][3]=k*r+m*w+o*n+b;return this},setTranslate:function(a, b,c){this.identity();this.matrix[0][3]=a;this.matrix[1][3]=b;this.matrix[2][3]=c;return this},translate:function(a,b,c){var d=new CAAT.Math.Matrix3;d.setTranslate(a,b,c);return d},setScale:function(a,b,c){this.identity();this.matrix[0][0]=a;this.matrix[1][1]=b;this.matrix[2][2]=c;return this},scale:function(a,b,c){var d=new CAAT.Math.Matrix3;d.setScale(a,b,c);return d},rotateModelView:function(a,b,c){var d=Math.sin(a),e=Math.sin(b),f=Math.sin(c),a=Math.cos(a),b=Math.cos(b),c=Math.cos(c);this.matrix[0][0]= b*a;this.matrix[0][1]=-b*d;this.matrix[0][2]=e;this.matrix[0][3]=0;this.matrix[1][0]=f*e*a+d*c;this.matrix[1][1]=c*a-f*e*d;this.matrix[1][2]=-f*b;this.matrix[1][3]=0;this.matrix[2][0]=f*d-c*e*a;this.matrix[2][1]=c*e*d+f*a;this.matrix[2][2]=c*b;this.matrix[2][3]=0;this.matrix[3][0]=0;this.matrix[3][1]=0;this.matrix[3][2]=0;this.matrix[3][3]=1;return this},copy:function(a){for(var b=0;b<4;b++)for(var c=0;c<4;c++)this.matrix[b][c]=a.matrix[b][c];return this},calculateDeterminant:function(){var a=this.matrix, b=a[0][0],c=a[0][1],d=a[0][2],e=a[0][3],f=a[1][0],g=a[1][1],h=a[1][2],i=a[1][3],j=a[2][0],k=a[2][1],m=a[2][2],o=a[2][3],n=a[3][0],p=a[3][1],q=a[3][2],a=a[3][3];return e*g*m*n+c*i*m*n+e*h*j*p+d*i*j*p+d*f*o*p+b*h*o*p+e*f*k*q+b*i*k*q+d*g*j*a+c*h*j*a+c*f*m*a+b*g*m*a+e*h*k*n-d*i*k*n-d*g*o*n-c*h*o*n-e*f*m*p-b*i*m*p-e*g*j*q-c*i*j*q-c*f*o*q-b*g*o*q-d*f*k*a-b*h*k*a},getInverse:function(){var a=this.matrix,b=a[0][0],c=a[0][1],d=a[0][2],e=a[0][3],f=a[1][0],g=a[1][1],h=a[1][2],i=a[1][3],j=a[2][0],k=a[2][1],m= @@ -92,10 +92,10 @@ CAAT.Module({defines:"CAAT.Math.Point",aliases:["CAAT.Point"],extendsWith:functi return this},multiply:function(a){this.x*=a;this.y*=a;this.z*=a;return this},rotate:function(a){var b=this.x,c=this.y;this.x=b*Math.cos(a)-Math.sin(a)*c;this.y=b*Math.sin(a)+Math.cos(a)*c;this.z=0;return this},setAngle:function(a){var b=this.getLength();this.x=Math.cos(a)*b;this.y=Math.sin(a)*b;this.z=0;return this},setLength:function(a){var b=this.getLength();b?this.multiply(a/b):this.x=this.y=this.z=a;return this},normalize:function(){var a=this.getLength();this.x/=a;this.y/=a;this.z/=a;return this}, getAngle:function(){return Math.atan2(this.y,this.x)},limit:function(a){var b=this.getLengthSquared();if(b+0.01>a*a)b=Math.sqrt(b),this.x=this.x/b*a,this.y=this.y/b*a,this.z=this.z/b*a;return this},getLength:function(){var a=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z);return a<0.0050&&a>-0.0050?1.0E-6:a},getLengthSquared:function(){var a=this.x*this.x+this.y*this.y+this.z*this.z;return a<0.0050&&a>-0.0050?0:a},getDistance:function(a){var b=this.x-a.x,c=this.y-a.y,a=this.z-a.z;return Math.sqrt(b* b+c*c+a*a)},getDistanceSquared:function(a){var b=this.x-a.x,c=this.y-a.y,a=this.z-a.z;return b*b+c*c+a*a},toString:function(){return"(CAAT.Math.Point) x:"+String(Math.round(Math.floor(this.x*10))/10)+" y:"+String(Math.round(Math.floor(this.y*10))/10)+" z:"+String(Math.round(Math.floor(this.z*10))/10)}}}}); -CAAT.Module({defines:"CAAT.Math.Rectangle",aliases:["CAAT.Rectangle"],extendsWith:function(){return{__init:function(a,b,c,d){this.setLocation(a,b);this.setDimension(c,d)},x:0,y:0,x1:0,y1:0,width:-1,height:-1,setEmpty:function(){this.height=this.width=-1;this.y1=this.x1=this.y=this.x=0;return this},setLocation:function(a,b){this.x=a;this.y=b;this.x1=this.x+this.width;this.y1=this.y+this.height;return this},setDimension:function(a,b){this.width=a;this.height=b;this.x1=this.x+this.width;this.y1=this.y+ -this.height;return this},setBounds:function(a,b,c,d){this.setLocation(a,b);this.setDimension(c,d);return this},contains:function(a,b){return a>=this.x&&a=this.y&&bthis.y1)this.y1=b;if(a>this.x1)this.x1=a;this.width=this.x1- -this.x;this.height=this.y1-this.y}},unionRectangle:function(a){this.union(a.x,a.y);this.union(a.x1,a.y);this.union(a.x,a.y1);this.union(a.x1,a.y1);return this},intersects:function(a){return a.isEmpty()||this.isEmpty()?false:a.x1<=this.x?false:a.x>=this.x1?false:a.y1<=this.y?false:a.ythis.x1?false:b+d-1=this.x&&a=this.y&&bthis.y1)this.y1= +b;if(a>this.x1)this.x1=a;this.width=this.x1-this.x;this.height=this.y1-this.y}},unionRectangle:function(a){this.union(a.x,a.y);this.union(a.x1,a.y);this.union(a.x,a.y1);this.union(a.x1,a.y1);return this},intersects:function(a){return a.isEmpty()||this.isEmpty()?false:a.x1<=this.x?false:a.x>=this.x1?false:a.y1<=this.y?false:a.ythis.x1?false:b+d-1=this.behaviorStartTime&&(a=(a-this.behaviorStartTime)%this.behaviorDuration+this.behaviorStartTime);if(a>this.behaviorStartTime+this.behaviorDuration)return this.status!==e.EXPIRED&&this.setExpired(b,a),false;if(this.status===e.NOT_STARTED)this.status=e.STARTED,this.fireBehaviorStartedEvent(b,a);return this.behaviorStartTime<=a},fireBehaviorStartedEvent:function(a,b){for(var e= -0,f=this.lifecycleListenerList.length;e=this.behaviorStartTime&&(a=(a-this.behaviorStartTime)%this.behaviorDuration+this.behaviorStartTime);if(a>this.behaviorStartTime+this.behaviorDuration)return this.status!== +e.EXPIRED&&this.setExpired(b,a),false;if(this.status===e.NOT_STARTED)this.status=e.STARTED,this.fireBehaviorStartedEvent(b,a);return this.behaviorStartTime<=a},fireBehaviorStartedEvent:function(a,b){for(var e=0,f=this.lifecycleListenerList.length;e>=0;for(var d= "@-"+a+"-keyframes "+b+" {",a=0;a<=c;a++)b=""+a/c*100+"%{opacity: "+this.calculateKeyFrameData(a/c)+"}",d+=b;d+="}";return d}}}}); -CAAT.Module({defines:"CAAT.Behavior.ContainerBehavior",depends:["CAAT.Behavior.BaseBehavior","CAAT.Behavior.GenericBehavior"],aliases:["CAAT.ContainerBehavior"],extendsClass:"CAAT.Behavior.BaseBehavior",extendsWith:function(){return{parse:function(a){if(a.behaviors&&a.behaviors.length)for(var b=0;b=d)){d=(d-c.behaviorStartTime)/c.behaviorDuration;c=c.getKeyFrameDataValues(d); -for(var f in c)e[f]=c[f]}return e},calculateKeyFrameData:function(a,b){function c(a){if(f[a])h+=f[a];else if(prevValues&&(i=prevValues[a]))h+=i,f[a]=i}var d,e,f={},g;for(d=0;d=g&&(g=(g-e.behaviorStartTime)/e.behaviorDuration,g=e.calculateKeyFrameData(g),e=e.getPropertyName(b), -typeof f[e]==="undefined"&&(f[e]=""),f[e]+=g+" "));var h="",i;c("translate");c("rotate");c("scale");d="";h&&(d="-"+b+"-transform: "+h+";");h="";c("opacity");h&&(d+=" opacity: "+h+";");d+=" -webkit-transform-origin: 0% 0%";return{rules:d,ret:f}},calculateKeyFramesData:function(a,b,c,d,e){if(this.duration===Number.MAX_VALUE)return"";typeof d==="undefined"&&(d=0.5);typeof e==="undefined"&&(e=0.5);typeof c==="undefined"&&(c=100);for(var f="@-"+a+"-keyframes "+b+" {",g,h={},b=0;b<=c;b++){g=this.interpolator.getPosition(b/ -c).y;g=this.getKeyFrameDataValues(g);var i=""+b/c*100+"%{",j=g,k=void 0;for(k in h)j[k]||(j[k]=h[k]);h="-"+a+"-transform:";if(j.x||j.y)h+="translate("+(j.x||0)+"px,"+(j.y||0)+"px)";j.angle&&(h+=" rotate("+j.angle+"rad)");if(j.scaleX!==1||j.scaleY!==1)h+=" scale("+j.scaleX+","+j.scaleY+")";h+=";";j.alpha&&(h+=" opacity: "+j.alpha+";");if(d!==0.5||e!==0.5)h+=" -"+a+"-transform-origin:"+d*100+"% "+e*100+"%;";f+=i+h+"}\n";h=g}f+="}\n";return f}}}}); +CAAT.Module({defines:"CAAT.Behavior.ContainerBehavior",depends:["CAAT.Behavior.BaseBehavior","CAAT.Behavior.GenericBehavior"],aliases:["CAAT.ContainerBehavior"],extendsClass:"CAAT.Behavior.BaseBehavior",extendsWith:function(){return{parse:function(a){if(a.behaviors&&a.behaviors.length)for(var b=0;b=d)){d=(d-c.behaviorStartTime)/c.behaviorDuration; +c=c.getKeyFrameDataValues(d);for(var f in c)e[f]=c[f]}return e},calculateKeyFrameData:function(a,b){function c(a){if(f[a])h+=f[a];else if(prevValues&&(i=prevValues[a]))h+=i,f[a]=i}var d,e,f={},g;for(d=0;d=g&&(g=(g-e.behaviorStartTime)/e.behaviorDuration,g=e.calculateKeyFrameData(g), +e=e.getPropertyName(b),typeof f[e]==="undefined"&&(f[e]=""),f[e]+=g+" "));var h="",i;c("translate");c("rotate");c("scale");d="";h&&(d="-"+b+"-transform: "+h+";");h="";c("opacity");h&&(d+=" opacity: "+h+";");d+=" -webkit-transform-origin: 0% 0%";return{rules:d,ret:f}},calculateKeyFramesData:function(a,b,c,d,e){if(this.duration===Number.MAX_VALUE)return"";typeof d==="undefined"&&(d=0.5);typeof e==="undefined"&&(e=0.5);typeof c==="undefined"&&(c=100);for(var f="@-"+a+"-keyframes "+b+" {",g,h={},b=0;b<= +c;b++){g=this.interpolator.getPosition(b/c).y;g=this.getKeyFrameDataValues(g);var i=""+b/c*100+"%{",j=g,k=void 0;for(k in h)j[k]||(j[k]=h[k]);h="-"+a+"-transform:";if(j.x||j.y)h+="translate("+(j.x||0)+"px,"+(j.y||0)+"px)";j.angle&&(h+=" rotate("+j.angle+"rad)");if(j.scaleX!==1||j.scaleY!==1)h+=" scale("+j.scaleX+","+j.scaleY+")";h+=";";j.alpha&&(h+=" opacity: "+j.alpha+";");if(d!==0.5||e!==0.5)h+=" -"+a+"-transform-origin:"+d*100+"% "+e*100+"%;";f+=i+h+"}\n";h=g}f+="}\n";return f}}}}); CAAT.Module({defines:"CAAT.Behavior.GenericBehavior",depends:["CAAT.Behavior.BaseBehavior"],aliases:["CAAT.GenericBehavior"],extendsClass:"CAAT.Behavior.BaseBehavior",extendsWith:function(){return{start:0,end:0,target:null,property:null,callback:null,setForTime:function(a,b){var c=this.start+a*(this.end-this.start);this.callback&&this.callback(c,this.target,b);this.property&&(this.target[this.property]=c)},setValues:function(a,b,c,d,e){this.start=a;this.end=b;this.target=c;this.property=d;this.callback= e;return this}}}}); CAAT.Module({defines:"CAAT.Behavior.PathBehavior",aliases:["CAAT.PathBehavior"],depends:["CAAT.Behavior.BaseBehavior","CAAT.Foundation.SpriteImage"],constants:{AUTOROTATE:{LEFT_TO_RIGHT:0,RIGHT_TO_LEFT:1,FREE:2},autorotate:{LEFT_TO_RIGHT:0,RIGHT_TO_LEFT:1,FREE:2}},extendsClass:"CAAT.Behavior.BaseBehavior",extendsWith:function(){return{parse:function(a){CAAT.Behavior.PathBehavior.superclass.parse.call(this,a);a.SVG&&this.setValues((new CAAT.PathUtil.SVGPath).parsePath(a.SVG));if(a.autoRotate)this.autoRotate=a.autoRotate}, -path:null,autoRotate:false,prevX:-1,prevY:-1,autoRotateOp:CAAT.Behavior.PathBehavior.autorotate.FREE,isOpenContour:false,setOpenContour:function(a){this.isOpenContour=a;return this},getPropertyName:function(){return"translate"},setAutoRotate:function(a,b){this.autoRotate=a;if(b!==void 0)this.autoRotateOp=b;return this},setPath:function(a){this.path=a;return this},setValues:function(a){return this.setPath(a)},setTranslation:function(){return this},calculateKeyFrameData:function(a){a=this.interpolator.getPosition(a).y; -a=this.path.getPosition(a);return"translateX("+a.x+"px) translateY("+a.y+"px)"},getKeyFrameDataValues:function(a){var a=this.interpolator.getPosition(a).y,b=this.path.getPosition(a),c={x:b.x,y:b.y};if(this.autoRotate)a=a===0?b:this.path.getPosition(a-0.0010),b=Math.atan2(b.y-a.y,b.x-a.x),c.angle=b;return c},calculateKeyFramesData:function(a,b,c){typeof c==="undefined"&&(c=100);c>>=0;for(var d,e="@-"+a+"-keyframes "+b+" {",b=0;b<=c;b++)d=""+b/c*100+"%{-"+a+"-transform:"+this.calculateKeyFrameData(b/ -c)+"}",e+=d;e+="}";return e},setForTime:function(a,b){if(!this.path)return{x:b.x,y:b.y};var c=this.path.getPosition(a,this.isOpenContour,0.0010);if(this.autoRotate){if(-1===this.prevX&&-1===this.prevY)this.prevX=c.x,this.prevY=c.y;var d=c.x-this.prevX,e=c.y-this.prevY;if(d===0&&e===0)return b.setLocation(c.x,c.y),{x:b.x,y:b.y};var f=Math.atan2(e,d),g=CAAT.Foundation.SpriteImage,h=CAAT.Behavior.PathBehavior.AUTOROTATE;this.autoRotateOp===h.LEFT_TO_RIGHT?this.prevX<=c.x?b.setImageTransformation(g.TR_NONE): -(b.setImageTransformation(g.TR_FLIP_HORIZONTAL),f+=Math.PI):this.autoRotateOp===h.RIGHT_TO_LEFT&&(this.prevX<=c.x?b.setImageTransformation(g.TR_FLIP_HORIZONTAL):(b.setImageTransformation(g.TR_NONE),f-=Math.PI));b.setRotation(f);this.prevX=c.x;this.prevY=c.y;Math.sqrt(d*d+e*e)}return this.doValueApplication?(b.setLocation(c.x,c.y),{x:b.x,y:b.y}):{x:c.x,y:c.y}},positionOnTime:function(a){return this.isBehaviorInTime(a,null)?(a=this.normalizeTime(a),this.path.getPosition(a)):{x:-1,y:-1}}}}}); +path:null,autoRotate:false,prevX:-1,prevY:-1,autoRotateOp:CAAT.Behavior.PathBehavior.autorotate.FREE,isOpenContour:false,relativeX:0,relativeY:0,setOpenContour:function(a){this.isOpenContour=a;return this},getPropertyName:function(){return"translate"},setRelativeValues:function(a,b){this.relativeX=a;this.relativeY=b;this.isRelative=true;return this},setAutoRotate:function(a,b){this.autoRotate=a;if(b!==void 0)this.autoRotateOp=b;return this},setPath:function(a){this.path=a;return this},setValues:function(a){return this.setPath(a)}, +setTranslation:function(){return this},calculateKeyFrameData:function(a){a=this.interpolator.getPosition(a).y;a=this.path.getPosition(a);return"translateX("+a.x+"px) translateY("+a.y+"px)"},getKeyFrameDataValues:function(a){var a=this.interpolator.getPosition(a).y,b=this.path.getPosition(a),c={x:b.x,y:b.y};if(this.autoRotate)a=a===0?b:this.path.getPosition(a-0.0010),b=Math.atan2(b.y-a.y,b.x-a.x),c.angle=b;return c},calculateKeyFramesData:function(a,b,c){typeof c==="undefined"&&(c=100);c>>=0;for(var d, +e="@-"+a+"-keyframes "+b+" {",b=0;b<=c;b++)d=""+b/c*100+"%{-"+a+"-transform:"+this.calculateKeyFrameData(b/c)+"}",e+=d;e+="}";return e},setForTime:function(a,b){if(!this.path)return{x:b.x,y:b.y};var c=this.path.getPosition(a,this.isOpenContour,0.0010);this.isRelative&&(c.x+=this.relativeX,c.y+=this.relativeY);if(this.autoRotate){if(-1===this.prevX&&-1===this.prevY)this.prevX=c.x,this.prevY=c.y;var d=c.x-this.prevX,e=c.y-this.prevY;if(d===0&&e===0)return b.setLocation(c.x,c.y),{x:b.x,y:b.y};var f= +Math.atan2(e,d),g=CAAT.Foundation.SpriteImage,h=CAAT.Behavior.PathBehavior.AUTOROTATE;this.autoRotateOp===h.LEFT_TO_RIGHT?this.prevX<=c.x?b.setImageTransformation(g.TR_NONE):(b.setImageTransformation(g.TR_FLIP_HORIZONTAL),f+=Math.PI):this.autoRotateOp===h.RIGHT_TO_LEFT&&(this.prevX<=c.x?b.setImageTransformation(g.TR_FLIP_HORIZONTAL):(b.setImageTransformation(g.TR_NONE),f-=Math.PI));b.setRotation(f);this.prevX=c.x;this.prevY=c.y;Math.sqrt(d*d+e*e)}return this.doValueApplication?(b.setLocation(c.x, +c.y),{x:b.x,y:b.y}):{x:c.x,y:c.y}},positionOnTime:function(a){return this.isBehaviorInTime(a,null)?(a=this.normalizeTime(a),this.path.getPosition(a)):{x:-1,y:-1}}}}}); CAAT.Module({defines:"CAAT.Behavior.RotateBehavior",extendsClass:"CAAT.Behavior.BaseBehavior",depends:["CAAT.Behavior.BaseBehavior","CAAT.Foundation.Actor"],aliases:["CAAT.RotateBehavior"],extendsWith:function(){return{__init:function(){this.__super();this.anchor=CAAT.Foundation.Actor.ANCHOR_CENTER;return this},parse:function(a){CAAT.Behavior.RotateBehavior.superclass.parse.call(this,a);this.startAngle=a.start||0;this.endAngle=a.end||0;this.anchorX=typeof a.anchorX!=="undefined"?parseInt(a.anchorX): -0.5;this.anchorY=typeof a.anchorY!=="undefined"?parseInt(a.anchorY):0.5},startAngle:0,endAngle:0,anchorX:0.5,anchorY:0.5,getPropertyName:function(){return"rotate"},setForTime:function(a,b){var c=this.startAngle+a*(this.endAngle-this.startAngle);this.doValueApplication&&b.setRotationAnchored(c,this.anchorX,this.anchorY);return c},setValues:function(a,b,c,d){this.startAngle=a;this.endAngle=b;if(typeof c!=="undefined"&&typeof d!=="undefined")this.anchorX=c,this.anchorY=d;return this},setAngles:function(a, -b){return this.setValues(a,b)},setAnchor:function(a,b,c){this.anchorX=b/a.width;this.anchorY=c/a.height;return this},calculateKeyFrameData:function(a){a=this.interpolator.getPosition(a).y;return"rotate("+(this.startAngle+a*(this.endAngle-this.startAngle))+"rad)"},getKeyFrameDataValues:function(a){a=this.interpolator.getPosition(a).y;return{angle:this.startAngle+a*(this.endAngle-this.startAngle)}},calculateKeyFramesData:function(a,b,c){typeof c==="undefined"&&(c=100);c>>=0;for(var d,e="@-"+a+"-keyframes "+ -b+" {",b=0;b<=c;b++)d=""+b/c*100+"%{-"+a+"-transform:"+this.calculateKeyFrameData(b/c)+"; -"+a+"-transform-origin:"+this.anchorX*100+"% "+this.anchorY*100+"% }\n",e+=d;e+="}\n";return e}}}}); +0.5;this.anchorY=typeof a.anchorY!=="undefined"?parseInt(a.anchorY):0.5},startAngle:0,endAngle:0,anchorX:0.5,anchorY:0.5,rotationRelative:0,setRelativeValues:function(a){this.rotationRelative=a;this.isRelative=true;return this},getPropertyName:function(){return"rotate"},setForTime:function(a,b){var c=this.startAngle+a*(this.endAngle-this.startAngle);this.isRelative&&(c+=this.rotationRelative,c>=Math.PI&&(c-=2*Math.PI),c<-2*Math.PI&&(c+=2*Math.PI));this.doValueApplication&&b.setRotationAnchored(c, +this.anchorX,this.anchorY);return c},setValues:function(a,b,c,d){this.startAngle=a;this.endAngle=b;if(typeof c!=="undefined"&&typeof d!=="undefined")this.anchorX=c,this.anchorY=d;return this},setAngles:function(a,b){return this.setValues(a,b)},setAnchor:function(a,b,c){this.anchorX=b/a.width;this.anchorY=c/a.height;return this},calculateKeyFrameData:function(a){a=this.interpolator.getPosition(a).y;return"rotate("+(this.startAngle+a*(this.endAngle-this.startAngle))+"rad)"},getKeyFrameDataValues:function(a){a= +this.interpolator.getPosition(a).y;return{angle:this.startAngle+a*(this.endAngle-this.startAngle)}},calculateKeyFramesData:function(a,b,c){typeof c==="undefined"&&(c=100);c>>=0;for(var d,e="@-"+a+"-keyframes "+b+" {",b=0;b<=c;b++)d=""+b/c*100+"%{-"+a+"-transform:"+this.calculateKeyFrameData(b/c)+"; -"+a+"-transform-origin:"+this.anchorX*100+"% "+this.anchorY*100+"% }\n",e+=d;e+="}\n";return e}}}}); CAAT.Module({defines:"CAAT.Behavior.Scale1Behavior",depends:["CAAT.Behavior.BaseBehavior","CAAT.Foundation.Actor"],aliases:["CAAT.Scale1Behavior"],constants:{AXIS:{X:0,Y:1},Axis:{X:0,Y:1}},extendsClass:"CAAT.Behavior.BaseBehavior",extendsWith:function(){return{__init:function(){this.__super();this.anchor=CAAT.Foundation.Actor.ANCHOR_CENTER;return this},startScale:1,endScale:1,anchorX:0.5,anchorY:0.5,applyOnX:true,parse:function(a){CAAT.Behavior.Scale1Behavior.superclass.parse.call(this,a);this.startScale= a.start||0;this.endScale=a.end||0;this.anchorX=typeof a.anchorX!=="undefined"?parseInt(a.anchorX):0.5;this.anchorY=typeof a.anchorY!=="undefined"?parseInt(a.anchorY):0.5;this.applyOnX=a.axis?a.axis.toLowerCase()==="x":true},applyOnAxis:function(a){this.applyOnX=a===CAAT.Behavior.Scale1Behavior.AXIS.X?false:true},getPropertyName:function(){return"scale"},setForTime:function(a,b){var c=this.startScale+a*(this.endScale-this.startScale);0===c&&(c=0.01);this.doValueApplication&&(this.applyOnX?b.setScaleAnchored(c, b.scaleY,this.anchorX,this.anchorY):b.setScaleAnchored(b.scaleX,c,this.anchorX,this.anchorY));return c},setValues:function(a,b,c,d,e){this.startScale=a;this.endScale=b;this.applyOnX=!!c;if(typeof d!=="undefined"&&typeof e!=="undefined")this.anchorX=d,this.anchorY=e;return this},setAnchor:function(a,b,c){this.anchorX=b/a.width;this.anchorY=c/a.height;return this},calculateKeyFrameData:function(a){a=this.interpolator.getPosition(a).y;a=this.startScale+a*(this.endScale-this.startScale);return this.applyOnX? @@ -157,19 +159,20 @@ CAAT.Module({defines:"CAAT.Module.Runtime.BrowserInfo",constants:function(){func {string:navigator.platform,subString:"Mac",identity:"Mac"},{string:navigator.userAgent,subString:"iPhone",identity:"iPhone/iPod"},{string:navigator.platform,subString:"Linux",identity:"Linux"}],d=a([{string:navigator.userAgent,subString:"Chrome",identity:"Chrome"},{string:navigator.userAgent,subString:"OmniWeb",versionSearch:"OmniWeb/",identity:"OmniWeb"},{string:navigator.vendor,subString:"Apple",identity:"Safari",versionSearch:"Version"},{prop:window.opera,identity:"Opera"},{string:navigator.vendor, subString:"iCab",identity:"iCab"},{string:navigator.vendor,subString:"KDE",identity:"Konqueror"},{string:navigator.userAgent,subString:"Firefox",identity:"Firefox"},{string:navigator.vendor,subString:"Camino",identity:"Camino"},{string:navigator.userAgent,subString:"Netscape",identity:"Netscape"},{string:navigator.userAgent,subString:"MSIE",identity:"Explorer",versionSearch:"MSIE"},{string:navigator.userAgent,subString:"Explorer",identity:"Explorer",versionSearch:"Explorer"},{string:navigator.userAgent, subString:"Gecko",identity:"Mozilla",versionSearch:"rv"},{string:navigator.userAgent,subString:"Mozilla",identity:"Netscape",versionSearch:"Mozilla"}])||"An unknown browser",e=b(navigator.userAgent)||b(navigator.appVersion)||"an unknown version",c=a(c)||"an unknown OS";return{browser:d,version:e,OS:c,DevicePixelRatio:window.devicePixelRatio||1}}}); -CAAT.Module({defines:"CAAT.Module.Audio.AudioManager",depends:["CAAT.Module.Runtime.BrowserInfo"],extendsWith:function(){return{__init:function(){this.browserInfo=CAAT.Module.Runtime.BrowserInfo;return this},musicChannel:null,browserInfo:null,musicEnabled:true,fxEnabled:true,audioCache:null,channels:null,workingChannels:null,loopingChannels:[],audioTypes:{mp3:"audio/mpeg;",ogg:'audio/ogg; codecs="vorbis"',wav:'audio/wav; codecs="1"',mp4:'audio/mp4; codecs="mp4a.40.2"'},initialize:function(a){this.audioCache= -[];this.channels=[];this.workingChannels=[];for(var b=0;b<=a;b++){var c=document.createElement("audio");if(null!==c){c.finished=-1;this.channels.push(c);var d=this;c.addEventListener("ended",function(a){var a=a.target,b;for(b=0;b0){var b= -this.channels.shift();b.src=a.src;b.volume=a.volume;b.play();this.workingChannels.push(b)}return a},cancelPlay:function(a){for(var b=0;this.workingChannels.length;b++){var c=this.workingChannels[b];c.caat_id===a&&(c.pause(),this.channels.push(c),this.workingChannels.splice(b,1))}return this},cancelPlayByChannel:function(a){for(var b=0;this.workingChannels.length;b++)if(this.workingChannels[b]===a){this.channels.push(a);this.workingChannels.splice(b,1);break}return this},loop:function(a){if(!this.musicEnabled)return null; -a=this.getAudio(a);if(null!==a){var b=document.createElement("audio");if(null!==b)return b.src=a.src,b.preload="auto",this.browserInfo.browser==="Firefox"?b.addEventListener("ended",function(a){a.target.currentTime=0},false):b.loop=true,b.load(),b.play(),this.loopingChannels.push(b),b}return null},endSound:function(){var a;for(a=0;a0?(a=this.channels.shift(),a.src=b.src,a.volume=b.volume,a.play(),this.workingChannels.push(a)):console.log("Can't play audio: "+a);return b},cancelPlay:function(a){for(var b=0;this.workingChannels.length;b++){var c=this.workingChannels[b];c.caat_id===a&&(c.pause(),this.channels.push(c),this.workingChannels.splice(b,1))}return this},cancelPlayByChannel:function(a){for(var b=0;this.workingChannels.length;b++)if(this.workingChannels[b]=== +a){this.channels.push(a);this.workingChannels.splice(b,1);break}return this},loop:function(a){if(!this.musicEnabled)return null;a=this.getAudio(a);if(null!==a){var b=document.createElement("audio");if(null!==b)return b.src=a.src,b.preload="auto",this.isFirefox?b.addEventListener("ended",function(a){a.target.currentTime=0},false):b.loop=true,b.load(),b.play(),this.loopingChannels.push(b),b}return null},endSound:function(){var a;for(a=0;a=g)return{r:d,g:e,b:f};a=a+(d-a)/g*h>>0;b=b+(e-b)/g*h>>0;c=c+(f-c)/g*h>>0;a>255?a=255:a<0&&(a=0);b>255?b=255:b<0&&(b=0);c>255?c=255:c<0&&(c=0);return{r:a,g:b,b:c}},makeRGBColorRamp:function(a,b,c){var d= -[],e=a.length-1;b/=e;var f,g,h,i,j,k,m,o,n,p,q,r,t,s;for(f=0;f>24&255;n=(m&16711680)>>16;p=(m&65280)>>8;m&=255;g=a[f+1];q=g>>24&255;r=(g&16711680)>>16;t=(g&65280)>>8;g&=255;q=(q-o)/b;r=(r-n)/b;t=(t-p)/b;s=(g-m)/b;for(g=0;g>0;i=n+r*g>>0;j=p+t*g>>0;k=m+s*g>>0;var u=CAAT.Module.ColorUtil.Color.RampEnumeration;switch(c){case u.RAMP_RGBA:d.push("argb("+h+","+i+","+j+","+k+")");break;case u.RAMP_RGB:d.push("rgb("+i+","+j+","+k+")");break;case u.RAMP_CHANNEL_RGB:d.push(4278190080| -i<<16|j<<8|k);break;case u.RAMP_CHANNEL_RGBA:d.push(h<<24|i<<16|j<<8|k);break;case u.RAMP_CHANNEL_RGBA_ARRAY:d.push([i,j,k,h]);break;case u.RAMP_CHANNEL_RGB_ARRAY:d.push([i,j,k])}}}return d},random:function(){for(var a="#",b=0;b<3;b++)a+="0123456789abcdef"[Math.random()*16>>0];return a}},extendsWith:{__init:function(a,b,c){this.r=a||255;this.g=b||255;this.b=c||255;return this},r:255,g:255,b:255,toHex:function(){return("000000"+((this.r<<16)+(this.g<<8)+this.b).toString(16)).slice(-6)}}}); +[],e=a.length-1;b/=e;var f,g,h,i,j,k,m,o,n,p,q,r,u,t;for(f=0;f>24&255;n=(m&16711680)>>16;p=(m&65280)>>8;m&=255;g=a[f+1];q=g>>24&255;r=(g&16711680)>>16;u=(g&65280)>>8;g&=255;q=(q-o)/b;r=(r-n)/b;u=(u-p)/b;t=(g-m)/b;for(g=0;g>0;i=n+r*g>>0;j=p+u*g>>0;k=m+t*g>>0;var s=CAAT.Module.ColorUtil.Color.RampEnumeration;switch(c){case s.RAMP_RGBA:d.push("argb("+h+","+i+","+j+","+k+")");break;case s.RAMP_RGB:d.push("rgb("+i+","+j+","+k+")");break;case s.RAMP_CHANNEL_RGB:d.push(4278190080| +i<<16|j<<8|k);break;case s.RAMP_CHANNEL_RGBA:d.push(h<<24|i<<16|j<<8|k);break;case s.RAMP_CHANNEL_RGBA_ARRAY:d.push([i,j,k,h]);break;case s.RAMP_CHANNEL_RGB_ARRAY:d.push([i,j,k])}}}return d},random:function(){for(var a="#",b=0;b<3;b++)a+="0123456789abcdef"[Math.random()*16>>0];return a}},extendsWith:{__init:function(a,b,c){this.r=a||255;this.g=b||255;this.b=c||255;return this},r:255,g:255,b:255,toHex:function(){return("000000"+((this.r<<16)+(this.g<<8)+this.b).toString(16)).slice(-6)}}}); CAAT.Module({defines:"CAAT.Module.Debug.Debug",depends:["CAAT.Event.AnimationLoop"],extendsWith:{width:0,height:0,canvas:null,ctx:null,statistics:null,framerate:null,textContainer:null,textFPS:null,textEntitiesTotal:null,textEntitiesActive:null,textDraws:null,textDrawTime:null,textRAFTime:null,textDirtyRects:null,textDiscardDR:null,frameTimeAcc:0,frameRAFAcc:0,canDebug:false,SCALE:60,debugTpl:'
CAAT Debug panel Performance Controls Draw Time: 5.46 ms. FPS: 48
RAF Time: 20.76 ms. Entities Total: 41 Entities Active: 37 Draws: 0 DirtyRects: 0 Discard DR: 0
Sound
Music
AA Bounding Boxes
Bounding Boxes
Dirty Rects
', setScale:function(a){this.scale=a;return this},initialize:function(a,b){this.width=a=window.innerWidth;this.height=b;this.framerate={refreshInterval:CAAT.FPS_REFRESH||500,frames:0,timeLastRefresh:0,fps:0,prevFps:-1,fpsMin:1E3,fpsMax:0};if(!document.getElementById("caat-debug")){var c=document.createElement("div");c.innerHTML=this.debugTpl;document.body.appendChild(c);eval(' var __x= CAAT; function initCheck( name, bool, callback ) { var elem= document.getElementById(name); if ( elem ) { elem.className= (bool) ? "checkbox_enabled" : "checkbox_disabled"; if ( callback ) { elem.addEventListener( "click", (function(elem, callback) { return function(e) { elem.__value= !elem.__value; elem.className= (elem.__value) ? "checkbox_enabled" : "checkbox_disabled"; callback(e,elem.__value); } })(elem, callback), false ); } elem.__value= bool; } } function setupTabs() { var numTabs=0; var elem; var elemContent; do { elem= document.getElementById("caat-debug-tab"+numTabs); if ( elem ) { elemContent= document.getElementById("caat-debug-tab"+numTabs+"-content"); if ( elemContent ) { elemContent.style.display= numTabs===0 ? \'block\' : \'none\'; elem.className= numTabs===0 ? "debug_tab debug_tab_selected" : "debug_tab debug_tab_not_selected"; elem.addEventListener( "click", (function(tabIndex) { return function(e) { for( var i=0; i>0)-0.5;b.moveTo(0.5,c);b.lineTo(this.width+0.5,c);b.stroke();b.strokeStyle="#aa2";b.beginPath();c=this.height-(30/this.SCALE*this.height>>0)-0.5;b.moveTo(0.5,c);b.lineTo(this.width+0.5,c);b.stroke();c=Math.min(this.height-this.framerate.fps/this.SCALE*this.height,59);if(-1===this.framerate.prevFps)this.framerate.prevFps=c|0;b.strokeStyle= "#0ff";b.beginPath();b.moveTo(this.width,(c|0)-0.5);b.lineTo(this.width,this.framerate.prevFps-0.5);b.stroke();this.framerate.prevFps=c;a=(this.height-a/this.SCALE*this.height>>0)-0.5;b.strokeStyle="#ff0";b.beginPath();b.moveTo(this.width,a);b.lineTo(this.width,a);b.stroke()}}}); -CAAT.Module({defines:"CAAT.Module.Font.Font",aliases:"CAAT.Font",depends:["CAAT.Foundation.SpriteImage"],constants:{getFontMetrics:function(a){var b;if(CAAT.CSS_TEXT_METRICS)try{return b=CAAT.Module.Font.Font.getFontMetricsCSS(a)}catch(c){}return CAAT.Module.Font.Font.getFontMetricsNoCSS(a)},getFontMetricsNoCSS:function(a){var a=/(\d+)p[x|t]/i.exec(a),b;b=a?a[1]|0:32;a=b-1;b=b+b*0.2|0;return{height:b,ascent:a,descent:b-a}},getFontMetricsCSS:function(a){function b(a){var b,c,d;d=a&&a.ownerDocument; +CAAT.Module({defines:"CAAT.Module.Font.Font",aliases:"CAAT.Font",depends:["CAAT.Foundation.SpriteImage"],constants:{getFontMetrics:function(a){var b;if(CAAT.CSS_TEXT_METRICS)try{return b=CAAT.Module.Font.Font.getFontMetricsCSS(a)}catch(c){}return CAAT.Module.Font.Font.getFontMetricsNoCSS(a)},getFontMetricsNoCSS:function(a){var a=/(\d+)p[x|t]\s*/i.exec(a),b;b=a?a[1]|0:32;a=b-1;b=b+b*0.2|0;return{height:b,ascent:a,descent:b-a}},getFontMetricsCSS:function(a){function b(a){var b,c,d;d=a&&a.ownerDocument; b=d.documentElement;a=a.getBoundingClientRect();c=document.body;d=d.nodeType===9?d.defaultView||d.parentWindow:false;return{top:a.top+(d.pageYOffset||b.scrollTop)-(b.clientTop||c.clientTop||0),left:a.left+(d.pageXOffset||b.scrollLeft)-(b.clientLeft||c.clientLeft||0)}}try{var c=document.createElement("span");c.style.font=a;c.innerHTML="Hg";var d=document.createElement("div");d.style.display="inline-block";d.style.width="1px";d.style.heigh="0px";var e=document.createElement("div");e.appendChild(c); e.appendChild(d);var f=document.body;f.appendChild(e);try{return a={},d.style.verticalAlign="baseline",a.ascent=b(d).top-b(c).top,d.style.verticalAlign="bottom",a.height=b(d).top-b(c).top,a.ascent=Math.ceil(a.ascent),a.height=Math.ceil(a.height),a.descent=a.height-a.ascent,a}finally{f.removeChild(e)}}catch(g){return null}}},extendsWith:function(){return{fontSize:10,fontSizeUnit:"px",font:"Sans-Serif",fontStyle:"",fillStyle:"#fff",strokeStyle:null,strokeSize:1,padding:0,image:null,charMap:null,height:0, ascent:0,descent:0,setPadding:function(a){this.padding=a;return this},setFontStyle:function(a){this.fontStyle=a;return this},setStrokeSize:function(a){this.strokeSize=a;return this},setFontSize:function(a){this.fontSize=a;this.fontSizeUnit="px";return this},setFont:function(a){this.font=a;return this},setFillStyle:function(a){this.fillStyle=a;return this},setStrokeStyle:function(a){this.strokeStyle=a;return this},createDefault:function(a){for(var b="",c=32;c<128;c++)b+=String.fromCharCode(c);return this.create(b, a)},create:function(a,b){b|=0;this.padding=b;var c=document.createElement("canvas"),d=c.getContext("2d");d.textBaseline="bottom";d.font=this.fontStyle+" "+this.fontSize+""+this.fontSizeUnit+" "+this.font;var e=0,f=[],g,h;for(g=0;g>0)+1)+2*b;f.push(i);e+=i}g=CAAT.Font.getFontMetrics(d.font);d=g.height;this.ascent=g.ascent;this.descent=g.descent;this.height=g.height;i=g.ascent;c.width=e;c.height=d;d=c.getContext("2d");d.textBaseline= -"alphabetic";d.font=this.fontStyle+" "+this.fontSize+""+this.fontSizeUnit+" "+this.font;d.fillStyle=this.fillStyle;d.strokeStyle=this.strokeStyle;this.charMap={};for(g=e=0;g0&&g.height>0&&b.drawImage(this.image,g.x,0,h,i,c,d,h,i),c+=h):(b.strokeStyle="#f00",b.strokeRect(c,d,10,i),c+=10)},save:function(){var a=this.image.toDataURL("image/png");document.location.href=a.replace("image/png","image/octet-stream")},drawSpriteText:function(a,b){this.spriteImage.drawSpriteText(a,b)}}}}); +"alphabetic";d.font=this.fontStyle+" "+this.fontSize+""+this.fontSizeUnit+" "+this.font;d.fillStyle=this.fillStyle;d.strokeStyle=this.strokeStyle;this.charMap={};for(g=e=0;g0&&g.height>0&&b.drawImage(this.image,g.x,0,h,i,c,d,h,i),c+=h):(b.strokeStyle="#f00",b.strokeRect(c,d,10,i),c+=10)},save:function(){var a=this.image.toDataURL("image/png");document.location.href=a.replace("image/png","image/octet-stream")},drawSpriteText:function(a,b){this.spriteImage.drawSpriteText(a,b)}}}}); CAAT.Module({defines:"CAAT.Module.CircleManager.PackedCircle",depends:["CAAT.Module.CircleManager.PackedCircle","CAAT.Math.Point"],constants:{BOUNDS_RULE_WRAP:1,BOUNDS_RULE_CONSTRAINT:2,BOUNDS_RULE_DESTROY:4,BOUNDS_RULE_IGNORE:8},extendsWith:{__init:function(){this.boundsRule=CAAT.Module.CircleManager.PackedCircle.BOUNDS_RULE_IGNORE;this.position=new CAAT.Math.Point(0,0,0);this.offset=new CAAT.Math.Point(0,0,0);this.targetPosition=new CAAT.Math.Point(0,0,0);return this},id:0,delegate:null,position:null, offset:null,targetPosition:null,targetChaseSpeed:0.02,isFixed:false,boundsRule:0,collisionMask:0,collisionGroup:0,containsPoint:function(a){return this.position.getDistanceSquared(a)this.bounds.bottom)a.position.y=this.bounds.top-e;else if(b&4&&d+f null,f=Number.MAX_VALUE,g=0;gd?e=-1:c=0;a--)this.allCircles[a]===null&&this.allCircles.splice(a,1)},initialize:function(a){if(a)for(var b in a)this[b]=a[b];return this}}}); CAAT.Module({defines:"CAAT.Module.Preloader.Preloader",extendsWith:function(){var a=function(a,c,d){this.id=a;this.path=c;this.image=new Image;this.loader=d;this.image.onload=this.onload.bind(this);this.image.onerror=this.onerror.bind(this);return this};a.prototype={id:null,path:null,image:null,loader:null,onload:function(){this.loader.__onload(this);this.image.onload=null;this.image.onerror=null},onerror:function(){this.loader.__onerror(this)},load:function(){this.image.src=this.path},clear:function(){this.loader= -null}};return{__init:function(){this.elements=[];return this},elements:null,imageCounter:0,cfinished:null,cloaded:null,cerrored:null,loadedCount:0,addElement:function(b,c){this.elements.push(new a(b,c,this));return this},clear:function(){for(var a=0;a>=0;var d=true,e=true,f=true,g=true;if(typeof c!== "undefined"){if(typeof c.top!=="undefined")d=c.top;if(typeof c.bottom!=="undefined")e=c.bottom;if(typeof c.left!=="undefined")f=c.left;if(typeof c.right!=="undefined")g=c.right}c=document.createElement("canvas");c.width=a.width;c.height=a.height;var h=c.getContext("2d");h.fillStyle="rgba(0,0,0,0)";h.fillRect(0,0,a.width,a.height);h.drawImage(a,0,0);var i=h.getImageData(0,0,a.width,a.height).data,j,a=0,k=c.height-1,m=0,o=c.width-1,n=false;if(d){for(d=0;d0?c=Math.ceil((d+b-1)/b):b=Math.ceil((d+c-1)/c) e=0,f=0,g;b>0?c=Math.ceil((d+b-1)/b):b=Math.ceil((d+c-1)/c);for(g=0;g>0)*e;var k=i+(d/h>>0)*f,m=g+e,o=k+f;g=(new CAAT.Foundation.SpriteImageHelper(g,k,m-g,o-k,j.width,j.height)).setGL(g/j.width,k/j.height,m/j.width,o/j.height);this.mapInfo[d]=g}}else for(d=0;d0&&(f-=d);var g=(this.offsetY-this.ownerActor.y)%e;g>0&&(g-=e);for(var d=((c.width-f)/d>>0)+1,e=((c.height-g)/e>>0)+1,h,i=a.ctx, -a=0;a>0,c.y-this.ownerActor.y+g+a*b.height>>0,b.width,b.height)},paintInvertedH:function(a,b,c,d){b=this.mapInfo[this.spriteIndex];a=a.ctx;a.save();a.translate((c|0)+b.width,d|0);a.scale(-1,1);a.drawImage(this.image,b.x,b.y,b.width,b.height,this.offsetX>>0,this.offsetY>>0,b.width,b.height);a.restore();return this},paintInvertedV:function(a,b,c,d){b=this.mapInfo[this.spriteIndex];a=a.ctx;a.save(); -a.translate(c|0,d+b.height|0);a.scale(1,-1);a.drawImage(this.image,b.x,b.y,b.width,b.height,this.offsetX>>0,this.offsetY>>0,b.width,b.height);a.restore();return this},paintInvertedHV:function(a,b,c,d){b=this.mapInfo[this.spriteIndex];a=a.ctx;a.save();a.translate(c|0,d+b.height|0);a.scale(1,-1);a.translate(b.width,0);a.scale(-1,1);a.drawImage(this.image,b.x,b.y,b.width,b.height,this.offsetX>>0,this.offsetY>>0,b.width,b.height);a.restore();return this},paintN:function(a,b,c,d){b=this.mapInfo[this.spriteIndex]; -a.ctx.drawImage(this.image,b.x,b.y,b.width,b.height,this.offsetX+c>>0,this.offsetY+d>>0,b.width,b.height);return this},paintAtRect:function(a,b,c,d,e,f){b=this.mapInfo[this.spriteIndex];a.ctx.drawImage(this.image,b.x,b.y,b.width,b.height,this.offsetX+c>>0,this.offsetY+d>>0,e,f);return this},paintScaledWidth:function(a,b,c,d){b=this.mapInfo[this.spriteIndex];a.ctx.drawImage(this.image,b.x,b.y,b.width,b.height,this.offsetX+c>>0,this.offsetY+d>>0,this.ownerActor.width,b.height);return this},paintChunk:function(a, -b,c,d,e,f,g){a.drawImage(this.image,d,e,f,g,b,c,f,g)},paintTile:function(a,b,c,d){b=this.mapInfo[b];a.drawImage(this.image,b.x,b.y,b.width,b.height,this.offsetX+c>>0,this.offsetY+d>>0,b.width,b.height);return this},paintScaled:function(a,b,c,d){b=this.mapInfo[this.spriteIndex];a.ctx.drawImage(this.image,b.x,b.y,b.width,b.height,this.offsetX+c>>0,this.offsetY+d>>0,this.ownerActor.width,this.ownerActor.height);return this},getCurrentSpriteImageCSSPosition:function(){var a=this.mapInfo[this.spriteIndex]; -return""+-(a.x+this.parentOffsetX-this.offsetX)+"px "+-(a.y+this.parentOffsetY-this.offsetY)+"px "+(this.ownerActor.transformation===CAAT.Foundation.SpriteImage.TR_TILE?"repeat":"no-repeat")},getNumImages:function(){return this.rows*this.columns},setUV:function(a,b){var c=this.image;if(c.__texturePage){var d=b,e=this.mapInfo[this.spriteIndex],f=e.u,g=e.v,h=e.u1,e=e.v1;if(this.offsetX||this.offsetY)f=c.__texturePage,g=-this.offsetY/f.height,h=(this.ownerActor.width-this.offsetX)/f.width,e=(this.ownerActor.height- -this.offsetY)/f.height,f=-this.offsetX/f.width+c.__u,g+=c.__v,h+=c.__u,e+=c.__v;c.inverted?(a[d++]=h,a[d++]=g,a[d++]=h,a[d++]=e,a[d++]=f,a[d++]=e,a[d++]=f,a[d++]=g):(a[d++]=f,a[d++]=g,a[d++]=h,a[d++]=g,a[d++]=h,a[d++]=e,a[d++]=f,a[d++]=e)}},setChangeFPS:function(a){this.changeFPS=a;return this},setSpriteTransformation:function(a){this.transformation=a;var b=CAAT.Foundation.SpriteImage;switch(a){case b.TR_FLIP_HORIZONTAL:this.paint=this.paintInvertedH;break;case b.TR_FLIP_VERTICAL:this.paint=this.paintInvertedV; -break;case b.TR_FLIP_ALL:this.paint=this.paintInvertedHV;break;case b.TR_FIXED_TO_SIZE:this.paint=this.paintScaled;break;case b.TR_FIXED_WIDTH_TO_SIZE:this.paint=this.paintScaledWidth;break;case b.TR_TILE:this.paint=this.paintTiled;break;default:this.paint=this.paintN}this.ownerActor.invalidate();return this},resetAnimationTime:function(){this.prevAnimationTime=-1;return this},setAnimationImageIndex:function(a){this.animationImageIndex=a;this.spriteIndex=a[0];this.prevAnimationTime=-1;return this}, -setSpriteIndex:function(a){this.spriteIndex=a;return this},setSpriteIndexAtTime:function(a){if(this.animationImageIndex.length>1){if(this.prevAnimationTime===-1)this.prevAnimationTime=a,this.spriteIndex=this.animationImageIndex[0],this.prevIndex=0;else{var b=a;b-=this.prevAnimationTime;b/=this.changeFPS;b%=this.animationImageIndex.length;b=Math.floor(b);b>0,f=0;fa&&(a=c)}this.fontHeight=a;return this.fontHeight*this.fontScale},drawText:function(a,b,c,d){var e,f,g;for(e=0;e0&&f.height>0&&b.drawImage(this.image,f.x,f.y,g,f.height,c+f.xoffset*this.fontScale,d+f.yoffset*this.fontScale,g*this.fontScale,f.height*this.fontScale),c+=f.xadvance*this.fontScale},getFontData:function(){var a=this.stringHeight()*0.8>>0; -return{height:this.stringHeight(),ascent:a,descent:this.stringHeight()-a}}}}}); +CAAT.Module({defines:"CAAT.Foundation.SpriteImage",aliases:["CAAT.SpriteImage"],depends:["CAAT.Foundation.SpriteImageHelper","CAAT.Foundation.SpriteImageAnimationHelper","CAAT.Math.Rectangle"],constants:{TR_NONE:0,TR_FLIP_HORIZONTAL:1,TR_FLIP_VERTICAL:2,TR_FLIP_ALL:3,TR_FIXED_TO_SIZE:4,TR_FIXED_WIDTH_TO_SIZE:6,TR_TILE:5},extendsWith:function(){return{__init:function(){this.paint=this.paintN;this.setAnimationImageIndex([0]);this.mapInfo={};this.animationsMap={};arguments.length===1?this.initialize.call(this, +arguments[0],1,1):arguments.length===3&&this.initialize.apply(this,arguments);return this},animationImageIndex:null,prevAnimationTime:-1,changeFPS:1E3,transformation:0,spriteIndex:0,prevIndex:0,currentAnimation:null,image:null,rows:1,columns:1,width:0,height:0,singleWidth:0,singleHeight:0,scaleX:1,scaleY:1,offsetX:0,offsetY:0,parentOffsetX:0,parentOffsetY:0,ownerActor:null,mapInfo:null,map:null,animationsMap:null,callback:null,fontScale:1,getOwnerActor:function(){return this.ownerActor},addAnimation:function(a, +b,c,d){this.animationsMap[a]=new CAAT.Foundation.SpriteImageAnimationHelper(b,c,d);return this},setAnimationEndCallback:function(a){this.callback=a},playAnimation:function(a){if(a===this.currentAnimation)return this;var b=this.animationsMap[a];if(!b)return this;this.currentAnimation=a;this.setAnimationImageIndex(b.animation);this.changeFPS=b.time;this.callback=b.onEndPlayCallback;return this},setOwner:function(a){this.ownerActor=a;return this},getRows:function(){return this.rows},getColumns:function(){return this.columns}, +getWidth:function(){return this.mapInfo[this.spriteIndex].width},getHeight:function(){return this.mapInfo[this.spriteIndex].height},getWrappedImageWidth:function(){return this.image.width},getWrappedImageHeight:function(){return this.image.height},getRef:function(){var a=new CAAT.Foundation.SpriteImage;a.image=this.image;a.rows=this.rows;a.columns=this.columns;a.width=this.width;a.height=this.height;a.singleWidth=this.singleWidth;a.singleHeight=this.singleHeight;a.mapInfo=this.mapInfo;a.offsetX=this.offsetX; +a.offsetY=this.offsetY;a.scaleX=this.scaleX;a.scaleY=this.scaleY;a.animationsMap=this.animationsMap;a.parentOffsetX=this.parentOffsetX;a.parentOffsetY=this.parentOffsetY;a.scaleFont=this.scaleFont;return a},setOffsetX:function(a){this.offsetX=a;return this},setOffsetY:function(a){this.offsetY=a;return this},setOffset:function(a,b){this.offsetX=a;this.offsetY=b;return this},initialize:function(a,b,c){a||console.log("Null image for SpriteImage.");isString(a)&&(a=CAAT.currentDirector.getImage(a));this.parentOffsetY= +this.parentOffsetX=0;this.rows=b;this.columns=c;if(a instanceof CAAT.Foundation.SpriteImage||a instanceof CAAT.SpriteImage){this.image=a.image;var d=a.mapInfo[0];this.width=d.width;this.height=d.height;this.parentOffsetX=d.x;this.parentOffsetY=d.y;this.width=a.mapInfo[0].width;this.height=a.mapInfo[0].height}else this.image=a,this.width=a.width,this.height=a.height,this.mapInfo={};this.singleWidth=Math.floor(this.width/c);this.singleHeight=Math.floor(this.height/b);var e,f,g;if(a.__texturePage){a.__du= +this.singleWidth/a.__texturePage.width;a.__dv=this.singleHeight/a.__texturePage.height;e=this.singleWidth;f=this.singleHeight;var h=this.columns;if(a.inverted)d=e,e=f,f=d,h=this.rows;for(var a=this.image.__tx,i=this.image.__ty,j=this.image.__texturePage,d=0;d>0)*e;var k=i+(d/h>>0)*f,m=g+e,o=k+f;g=(new CAAT.Foundation.SpriteImageHelper(g,k,m-g,o-k,j.width,j.height)).setGL(g/j.width,k/j.height,m/j.width,o/j.height);this.mapInfo[d]=g}}else for(d=0;d0&&(f-=d);var g=(this.offsetY-this.ownerActor.y)%e;g>0&&(g-=e);for(var d=((c.width-f)/d>>0)+1,e=((c.height-g)/e>>0)+1,h,i=a.ctx,a=0;a>0,c.y-this.ownerActor.y+g+a*b.height>>0,b.width,b.height)},paintInvertedH:function(a, +b,c,d){b=this.mapInfo[this.spriteIndex];a=a.ctx;a.save();a.translate((c|0)+b.width,d|0);a.scale(-1,1);a.drawImage(this.image,b.x,b.y,b.width,b.height,this.offsetX>>0,this.offsetY>>0,b.width,b.height);a.restore();return this},paintInvertedV:function(a,b,c,d){b=this.mapInfo[this.spriteIndex];a=a.ctx;a.save();a.translate(c|0,d+b.height|0);a.scale(1,-1);a.drawImage(this.image,b.x,b.y,b.width,b.height,this.offsetX>>0,this.offsetY>>0,b.width,b.height);a.restore();return this},paintInvertedHV:function(a, +b,c,d){b=this.mapInfo[this.spriteIndex];a=a.ctx;a.save();a.translate(c|0,d+b.height|0);a.scale(1,-1);a.translate(b.width,0);a.scale(-1,1);a.drawImage(this.image,b.x,b.y,b.width,b.height,this.offsetX>>0,this.offsetY>>0,b.width,b.height);a.restore();return this},paintN:function(a,b,c,d){b=this.mapInfo[this.spriteIndex];a.ctx.drawImage(this.image,b.x,b.y,b.width,b.height,this.offsetX+c>>0,this.offsetY+d>>0,b.width,b.height);return this},paintAtRect:function(a,b,c,d,e,f){b=this.mapInfo[this.spriteIndex]; +a.ctx.drawImage(this.image,b.x,b.y,b.width,b.height,this.offsetX+c>>0,this.offsetY+d>>0,e,f);return this},paintScaledWidth:function(a,b,c,d){b=this.mapInfo[this.spriteIndex];a.ctx.drawImage(this.image,b.x,b.y,b.width,b.height,this.offsetX+c>>0,this.offsetY+d>>0,this.ownerActor.width,b.height);return this},paintChunk:function(a,b,c,d,e,f,g){a.drawImage(this.image,d,e,f,g,b,c,f,g)},paintTile:function(a,b,c,d){b=this.mapInfo[b];a.drawImage(this.image,b.x,b.y,b.width,b.height,this.offsetX+c>>0,this.offsetY+ +d>>0,b.width,b.height);return this},paintScaled:function(a,b,c,d){b=this.mapInfo[this.spriteIndex];a.ctx.drawImage(this.image,b.x,b.y,b.width,b.height,this.offsetX+c>>0,this.offsetY+d>>0,this.ownerActor.width,this.ownerActor.height);return this},getCurrentSpriteImageCSSPosition:function(){var a=this.mapInfo[this.spriteIndex];return""+-(a.x+this.parentOffsetX-this.offsetX)+"px "+-(a.y+this.parentOffsetY-this.offsetY)+"px "+(this.ownerActor.transformation===CAAT.Foundation.SpriteImage.TR_TILE?"repeat": +"no-repeat")},getNumImages:function(){return this.rows*this.columns},setUV:function(a,b){var c=this.image;if(c.__texturePage){var d=b,e=this.mapInfo[this.spriteIndex],f=e.u,g=e.v,h=e.u1,e=e.v1;if(this.offsetX||this.offsetY)f=c.__texturePage,g=-this.offsetY/f.height,h=(this.ownerActor.width-this.offsetX)/f.width,e=(this.ownerActor.height-this.offsetY)/f.height,f=-this.offsetX/f.width+c.__u,g+=c.__v,h+=c.__u,e+=c.__v;c.inverted?(a[d++]=h,a[d++]=g,a[d++]=h,a[d++]=e,a[d++]=f,a[d++]=e,a[d++]=f,a[d++]= +g):(a[d++]=f,a[d++]=g,a[d++]=h,a[d++]=g,a[d++]=h,a[d++]=e,a[d++]=f,a[d++]=e)}},setChangeFPS:function(a){this.changeFPS=a;return this},setSpriteTransformation:function(a){this.transformation=a;var b=CAAT.Foundation.SpriteImage;switch(a){case b.TR_FLIP_HORIZONTAL:this.paint=this.paintInvertedH;break;case b.TR_FLIP_VERTICAL:this.paint=this.paintInvertedV;break;case b.TR_FLIP_ALL:this.paint=this.paintInvertedHV;break;case b.TR_FIXED_TO_SIZE:this.paint=this.paintScaled;break;case b.TR_FIXED_WIDTH_TO_SIZE:this.paint= +this.paintScaledWidth;break;case b.TR_TILE:this.paint=this.paintTiled;break;default:this.paint=this.paintN}this.ownerActor.invalidate();return this},resetAnimationTime:function(){this.prevAnimationTime=-1;return this},setAnimationImageIndex:function(a){this.animationImageIndex=a;this.spriteIndex=a[0];this.prevAnimationTime=-1;return this},setSpriteIndex:function(a){this.spriteIndex=a;return this},setSpriteIndexAtTime:function(a){if(this.animationImageIndex.length>1){if(this.prevAnimationTime===-1)this.prevAnimationTime= +a,this.spriteIndex=this.animationImageIndex[0],this.prevIndex=0;else{var b=a;b-=this.prevAnimationTime;b/=this.changeFPS;b%=this.animationImageIndex.length;b=Math.floor(b);b>0,f=0;fa&&(a=c)}this.fontHeight=a;return this.fontHeight*this.fontScale},drawText:function(a,b,c,d){var e,f,g;for(e=0;e0&&f.height>0&&b.drawImage(this.image,f.x,f.y,g,f.height,c+f.xoffset*this.fontScale,d+f.yoffset*this.fontScale,g*this.fontScale,f.height*this.fontScale),c+=f.xadvance*this.fontScale}, +getFontData:function(){var a=this.stringHeight()*0.8>>0;return{height:this.stringHeight(),ascent:a,descent:this.stringHeight()-a}}}}}); CAAT.Module({defines:"CAAT.Foundation.Actor",aliases:["CAAT.Actor"],depends:"CAAT.Event.AnimationLoop,CAAT.Foundation.SpriteImage,CAAT.Core.Constants,CAAT.Behavior.PathBehavior,CAAT.Behavior.RotateBehavior,CAAT.Behavior.ScaleBehavior,CAAT.Behavior.Scale1Behavior,CAAT.PathUtil.LinearPath,CAAT.Event.AnimationLoop".split(","),constants:{ANCHOR_CENTER:0,ANCHOR_TOP:1,ANCHOR_BOTTOM:2,ANCHOR_LEFT:3,ANCHOR_RIGHT:4,ANCHOR_TOP_LEFT:5,ANCHOR_TOP_RIGHT:6,ANCHOR_BOTTOM_LEFT:7,ANCHOR_BOTTOM_RIGHT:8,ANCHOR_CUSTOM:9, NO_CACHE:0,CACHE_SIMPLE:1,CACHE_DEEP:2},extendsWith:function(){return{__init:function(){this.behaviorList=[];this.styleCache={};this.lifecycleListenerList=[];this.scaleAnchor=this.ANCHOR_CENTER;this.behaviorList=[];this.domElement=document.createElement("div");this.domElement.style.position="absolute";this.domElement.style["-webkit-transform"]="translate3d(0,0,0)";this.domElement.style["-webkit-transition"]="all 0s linear";this.style("display","none");this.AABB=new CAAT.Rectangle;this.viewVertices= [new CAAT.Point(0,0,0),new CAAT.Point(0,0,0),new CAAT.Point(0,0,0),new CAAT.Point(0,0,0)];this.setVisible(true);this.resetTransform();this.setScale(1,1);this.setRotation(0);this.modelViewMatrix=new CAAT.Matrix;this.worldModelViewMatrix=new CAAT.Matrix;return this},lifecycleListenerList:null,behaviorList:null,x:0,y:0,width:0,height:0,preferredSize:null,minimumSize:null,start_time:0,duration:Number.MAX_VALUE,clip:false,tAnchorX:0,tAnchorY:0,scaleX:0,scaleY:0,scaleTX:0.5,scaleTY:0.5,scaleAnchor:0,rotationAngle:0, @@ -424,12 +431,12 @@ CAAT.Module({defines:"CAAT.Foundation.ActorContainer",aliases:["CAAT.ActorContai runion:new CAAT.Rectangle,layoutManager:null,layoutInvalidated:true,setLayout:function(a){this.layoutManager=a;return this},setBounds:function(a,b,c,d){CAAT.ActorContainer.superclass.setBounds.call(this,a,b,c,d);CAAT.currentDirector&&!CAAT.currentDirector.inValidation&&this.invalidateLayout();return this},__validateLayout:function(){this.__validateTree();this.layoutInvalidated=false},__validateTree:function(){if(this.layoutManager&&this.layoutManager.isInvalidated()){CAAT.currentDirector.inValidation= true;this.layoutManager.doLayout(this);for(var a=0;a=this.childrenList.length)b=this.childrenList.length;a.setParent(this);this.childrenList.splice(b,0,a);this.domElement.insertBefore(a.domElement,this.domElement.childNodes[b]);this.invalidateLayout();a.dirty=true;return this},findActorById:function(a){for(var b=this.childrenList,c=0,d=b.length;c=0;b--){var c=this.childrenList[b],d=new CAAT.Point(a.x,a.y,0),c=c.findActorAtPosition(d);if(null!==c)return c}return this},destroy:function(){for(var a=this.childrenList.length-1;a>=0;a--)this.childrenList[a].destroy();CAAT.ActorContainer.superclass.destroy.call(this);return this},getNumChildren:function(){return this.childrenList.length},getNumActiveChildren:function(){return this.activeChildren.length}, -getChildAt:function(a){return this.childrenList[a]},setZOrder:function(a,b){var c=this.findChild(a);if(-1!==c){var d=this.childrenList;if(b!==c){if(b>=d.length)d.splice(c,1),d.push(a);else{c=d.splice(c,1);if(b<0)b=0;else if(b>d.length)b=d.length;d.splice(b,0,c[0])}for(var c=0,e=d.length;c=this.childrenList.length)b=this.childrenList.length;a.setParent(this);this.childrenList.splice(b,0,a);this.domElement.insertBefore(a.domElement,this.domElement.childNodes[b]);this.invalidateLayout();a.dirty=true;return this},findActorById:function(a){for(var b=this.childrenList,c=0,d=b.length;c=0;b--){var c=this.childrenList[b],d=new CAAT.Point(a.x,a.y,0),c=c.findActorAtPosition(d);if(null!==c)return c}return this},destroy:function(){for(var a=this.childrenList.length-1;a>=0;a--)this.childrenList[a].destroy();CAAT.ActorContainer.superclass.destroy.call(this); +return this},getNumChildren:function(){return this.childrenList.length},getNumActiveChildren:function(){return this.activeChildren.length},getChildAt:function(a){return this.childrenList[a]},setZOrder:function(a,b){var c=this.findChild(a);if(-1!==c){var d=this.childrenList;if(b!==c){if(b>=d.length)d.splice(c,1),d.push(a);else{c=d.splice(c,1);if(b<0)b=0;else if(b>d.length)b=d.length;d.splice(b,0,c[0])}for(var c=0,e=d.length;c=0;)this.timerList[b].remove||this.timerList[b].checkTask(a),b--},ensureTimerTask:function(a){this.hasTimer(a)||this.timerList.push(a); return this},hasTimer:function(a){for(var b=this.timerList.length-1;b>=0;){if(this.timerList[b]===a)return true;b--}return false},createTimer:function(a,b,c,d,e){a=(new CAAT.TimerTask).create(a,b,c,d,e);a.taskId=this.timerSequence++;a.sceneTime=this.time;a.scene=this;this.timerList.push(a);return a},removeExpiredTimers:function(){var a;for(a=0;a=0;b--){var c=this.childrenList[b],d=new CAAT.Math.Point(a.x,a.y,0),c=c.findActorAtPosition(d);if(null!==c)return c}return this},resetStats:function(){this.statistics.size_total=0;this.statistics.size_active= -0;this.statistics.draws=0;this.statistics.size_discarded_by_dirty_rects=0},render:function(a){if(!this.currentScene||!this.currentScene.isPaused()){this.time+=a;for(e=0,l=this.childrenList.length;e0&&!navigator.isCocoonJS&&CAAT.DEBUG&&CAAT.DEBUG_DIRTYRECTS){f.beginPath();this.nDirtyRects=0;b=this.cDirtyRects;for(e=0;e=this.dirtyRects.length)for(b=0;b<32;b++)this.dirtyRects.push(new CAAT.Math.Rectangle);b=this.dirtyRects[this.dirtyRectsIndex];b.x=a.x;b.y=a.y;b.x1=a.x1;b.y1=a.y1;b.width=a.width;b.height=a.height;this.cDirtyRects.push(b)}},renderToContext:function(a,b){if(b.isInAnimationFrame(this.time)){a.setTransform(1,0,0,1,0,0);a.globalAlpha=1;a.globalCompositeOperation= -"source-over";a.clearRect(0,0,this.width,this.height);var c=this.ctx;this.ctx=a;a.save();var d=this.modelViewMatrix,e=this.worldModelViewMatrix;this.modelViewMatrix=this.worldModelViewMatrix=new CAAT.Math.Matrix;this.wdirty=true;b.animate(this,b.time);if(b.onRenderStart)b.onRenderStart(b.time);b.paintActor(this,b.time);if(b.onRenderEnd)b.onRenderEnd(b.time);this.worldModelViewMatrix=e;this.modelViewMatrix=d;a.restore();this.ctx=c}},addScene:function(a){a.setBounds(0,0,this.width,this.height);this.scenes.push(a); -a.setEaseListener(this);null===this.currentScene&&this.setScene(0)},getNumScenes:function(){return this.scenes.length},easeInOut:function(a,b,c,d,e,f,g,h,i,j){if(a!==this.getCurrentSceneIndex()){a=this.scenes[a];d=this.scenes[d];if(!CAAT.__CSS__&&CAAT.CACHE_SCENE_ON_CHANGE)this.renderToContext(this.transitionScene.ctx,d),d=this.transitionScene;a.setExpired(false);d.setExpired(false);a.mouseEnabled=false;d.mouseEnabled=false;a.resetTransform();d.resetTransform();a.setLocation(0,0);d.setLocation(0, -0);a.alpha=1;d.alpha=1;b===CAAT.Foundation.Scene.EASE_ROTATION?a.easeRotationIn(g,h,c,i):b===CAAT.Foundation.Scene.EASE_SCALE?a.easeScaleIn(0,g,h,c,i):a.easeTranslationIn(g,h,c,i);e===CAAT.Foundation.Scene.EASE_ROTATION?d.easeRotationOut(g,h,f,j):e===CAAT.Foundation.Scene.EASE_SCALE?d.easeScaleOut(0,g,h,f,j):d.easeTranslationOut(g,h,f,j);this.childrenList=[];d.goOut(a);a.getIn(d);this.addChild(d);this.addChild(a)}},easeInOutRandom:function(a,b,c,d){var e=Math.random(),f=Math.random(),g;e<0.33?(e= -CAAT.Foundation.Scene.EASE_ROTATION,g=(new CAAT.Behavior.Interpolator).createExponentialInOutInterpolator(4)):e<0.66?(e=CAAT.Foundation.Scene.EASE_SCALE,g=(new CAAT.Behavior.Interpolator).createElasticOutInterpolator(1.1,0.4)):(e=CAAT.Foundation.Scene.EASE_TRANSLATE,g=(new CAAT.Behavior.Interpolator).createBounceOutInterpolator());var h;f<0.33?(f=CAAT.Foundation.Scene.EASE_ROTATION,h=(new CAAT.Behavior.Interpolator).createExponentialInOutInterpolator(4)):f<0.66?(f=CAAT.Foundation.Scene.EASE_SCALE, -h=(new CAAT.Behavior.Interpolator).createExponentialOutInterpolator(4)):(f=CAAT.Foundation.Scene.EASE_TRANSLATE,h=(new CAAT.Behavior.Interpolator).createBounceOutInterpolator());this.easeInOut(a,e,Math.random()*8.99>>0,b,f,Math.random()*8.99>>0,c,d,g,h)},easeIn:function(a,b,c,d,e,f){a=this.scenes[a];b===CAAT.Foundation.Scene.EASE_ROTATION?a.easeRotationIn(c,d,e,f):b===CAAT.Foundation.Scene.EASE_SCALE?a.easeScaleIn(0,c,d,e,f):a.easeTranslationIn(c,d,e,f);this.childrenList=[];this.addChild(a);a.resetTransform(); -a.setLocation(0,0);a.alpha=1;a.mouseEnabled=false;a.setExpired(false)},setScene:function(a){a=this.scenes[a];this.childrenList=[];this.addChild(a);this.currentScene=a;a.setExpired(false);a.mouseEnabled=true;a.resetTransform();a.setLocation(0,0);a.alpha=1;a.getIn();a.activated()},switchToScene:function(a,b,c,d){var e=this.getSceneIndex(this.currentScene);d?this.easeInOutRandom(a,e,b,c):this.setScene(a)},switchToPrevScene:function(a,b,c){var d=this.getSceneIndex(this.currentScene);this.getNumScenes()<= -1||d===0||(c?this.easeInOutRandom(d-1,d,a,b):this.setScene(d-1))},switchToNextScene:function(a,b,c){var d=this.getSceneIndex(this.currentScene);this.getNumScenes()<=1||d===this.getNumScenes()-1||(c?this.easeInOutRandom(d+1,d,a,b):this.setScene(d+1))},mouseEnter:function(){},mouseExit:function(){},mouseMove:function(){},mouseDown:function(){},mouseUp:function(){},mouseDrag:function(){},easeEnd:function(a,b){b?(this.currentScene=a,this.currentScene.activated()):a.setExpired(true);a.mouseEnabled=true; -a.emptyBehaviorList()},getSceneIndex:function(a){for(var b=0;b500&&(b=500);if(this.onRenderStart)this.onRenderStart(b);this.render(b);this.debugInfo&&this.debugInfo(this.statistics);this.timeline=a;if(this.onRenderEnd)this.onRenderEnd(b);this.needsRepaint=false}},resetTimeline:function(){this.timeline=(new Date).getTime()},endLoop:function(){},setClear:function(a){this.clear=a;this.dirtyRectsEnabled= -this.clear===CAAT.Foundation.Director.CLEAR_DIRTY_RECTS?true:false;return this},getAudioManager:function(){return this.audioManager},cumulateOffset:function(a,b,c){var d=c+"Left";c+="Top";for(var e=0,f=0,g;navigator.browser!=="iOS"&&a&&a.style;)if(g=a.currentStyle?a.currentStyle.position:(g=(a.ownerDocument.defaultView||a.ownerDocument.parentWindow).getComputedStyle(a,null))?g.getPropertyValue("position"):null,/^(fixed)$/.test(g))break;else e+=a[d],f+=a[c],a=a[b];return{x:e,y:f,style:g}},getOffset:function(a){var b= -this.cumulateOffset(a,"offsetParent","offset");return b.style==="fixed"?(a=this.cumulateOffset(a,a.parentNode?"parentNode":"parentElement","scroll"),{x:b.x+a.x,y:b.y+a.y}):{x:b.x,y:b.y}},getCanvasCoord:function(a,b){var c=new CAAT.Math.Point,d=0,e=0;if(!b)b=window.event;if(b.pageX||b.pageY)d=b.pageX,e=b.pageY;else if(b.clientX||b.clientY)d=b.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,e=b.clientY+document.body.scrollTop+document.documentElement.scrollTop;var f=this.getOffset(this.canvas); -d-=f.x;e-=f.y;d*=this.SCREEN_RATIO;e*=this.SCREEN_RATIO;c.x=d;c.y=e;if(!this.modelViewMatrixI)this.modelViewMatrixI=this.modelViewMatrix.getInverse();this.modelViewMatrixI.transformCoord(c);d=c.x;e=c.y;a.set(d,e);this.screenMousePoint.set(d,e)},__mouseDownHandler:function(a){if(this.dragging&&this.lastSelectedActor)this.__mouseUpHandler(a);else{this.getCanvasCoord(this.mousePoint,a);this.isMouseDown=true;var b=this.findActorAtPosition(this.mousePoint);if(null!==b){var c=b.viewToModel(new CAAT.Math.Point(this.screenMousePoint.x, -this.screenMousePoint.y,0));b.mouseDown((new CAAT.Event.MouseEvent).init(c.x,c.y,a,b,new CAAT.Math.Point(this.screenMousePoint.x,this.screenMousePoint.y)))}this.lastSelectedActor=b}},__mouseUpHandler:function(a){this.isMouseDown=false;this.getCanvasCoord(this.mousePoint,a);var b=null,c=this.lastSelectedActor;null!==c&&(b=c.viewToModel(new CAAT.Math.Point(this.screenMousePoint.x,this.screenMousePoint.y,0)),c.actionPerformed&&c.contains(b.x,b.y)&&c.actionPerformed(a),c.mouseUp((new CAAT.Event.MouseEvent).init(b.x, -b.y,a,c,this.screenMousePoint,this.currentScene.time)));!this.dragging&&null!==c&&c.contains(b.x,b.y)&&c.mouseClick((new CAAT.Event.MouseEvent).init(b.x,b.y,a,c,this.screenMousePoint,this.currentScene.time));this.in_=this.dragging=false},__mouseMoveHandler:function(a){var b,c,d=this.currentScene?this.currentScene.time:0;if(this.isMouseDown&&null!==this.lastSelectedActor){if(b=this.lastSelectedActor,c=b.viewToModel(new CAAT.Math.Point(this.screenMousePoint.x,this.screenMousePoint.y,0)),this.dragging|| -!(Math.abs(this.prevMousePoint.x-c.x)=this.width||b.y>=this.height))this.touching=true,this.__mouseDownHandler(a)}},__touchEndHandler:function(a){if(this.touching)a.preventDefault(), -a.returnValue=false,a=a.changedTouches[0],this.getCanvasCoord(this.mousePoint,a),this.touching=false,this.__mouseUpHandler(a)},__touchMoveHandler:function(a){if(this.touching&&(a.preventDefault(),a.returnValue=false,!this.gesturing))for(var b=0;b=this.width||f.y>=this.height)){var g=this.findActorAtPosition(f);g!==null&&(f=g.viewToModel(f),this.touches[e]||(this.touches[e]={actor:g,touch:new CAAT.Event.TouchInfo(e,f.x,f.y,g)},c.push(e)))}}e={};for(b=0;b=b.width||d.y>=b.height))b.touching=true,b.__mouseDownHandler(c)}},false);window.addEventListener("mouseover",function(c){if(c.target===a&&!b.dragging){c.preventDefault();c.cancelBubble=true;c.stopPropagation&&c.stopPropagation();var d=b.mousePoint;b.getCanvasCoord(d,c);d.x<0||d.y<0||d.x>=b.width||d.y>=b.height||b.__mouseOverHandler(c)}},false);window.addEventListener("mouseout",function(c){if(c.target=== -a&&!b.dragging)c.preventDefault(),c.cancelBubble=true,c.stopPropagation&&c.stopPropagation(),b.getCanvasCoord(b.mousePoint,c),b.__mouseOutHandler(c)},false);window.addEventListener("mousemove",function(a){a.preventDefault();a.cancelBubble=true;a.stopPropagation&&a.stopPropagation();var d=b.mousePoint;b.getCanvasCoord(d,a);(b.dragging||!(d.x<0||d.y<0||d.x>=b.width||d.y>=b.height))&&b.__mouseMoveHandler(a)},false);window.addEventListener("dblclick",function(c){if(c.target===a){c.preventDefault();c.cancelBubble= -true;c.stopPropagation&&c.stopPropagation();var d=b.mousePoint;b.getCanvasCoord(d,c);d.x<0||d.y<0||d.x>=b.width||d.y>=b.height||b.__mouseDBLClickHandler(c)}},false);CAAT.TOUCH_BEHAVIOR===CAAT.TOUCH_AS_MOUSE?(a.addEventListener("touchstart",this.__touchStartHandler.bind(this),false),a.addEventListener("touchmove",this.__touchMoveHandler.bind(this),false),a.addEventListener("touchend",this.__touchEndHandler.bind(this),false),a.addEventListener("gesturestart",function(c){if(c.target===a)c.preventDefault(), -c.returnValue=false,b.__gestureStart(c.scale,c.rotation)},false),a.addEventListener("gestureend",function(c){if(c.target===a)c.preventDefault(),c.returnValue=false,b.__gestureEnd(c.scale,c.rotation)},false),a.addEventListener("gesturechange",function(c){if(c.target===a)c.preventDefault(),c.returnValue=false,b.__gestureChange(c.scale,c.rotation)},false)):CAAT.TOUCH_BEHAVIOR===CAAT.TOUCH_AS_MULTITOUCH&&(a.addEventListener("touchstart",this.__touchStartHandlerMT.bind(this),false),a.addEventListener("touchmove", -this.__touchMoveHandlerMT.bind(this),false),a.addEventListener("touchend",this.__touchEndHandlerMT.bind(this),false),a.addEventListener("touchcancel",this.__touchCancelHandleMT.bind(this),false),a.addEventListener("gesturestart",this.__touchGestureStartHandleMT.bind(this),false),a.addEventListener("gestureend",this.__touchGestureEndHandleMT.bind(this),false),a.addEventListener("gesturechange",this.__touchGestureChangeHandleMT.bind(this),false))},enableEvents:function(a){CAAT.RegisterDirector(this); -this.in_=false;this.createEventHandler(a)},createEventHandler:function(a){this.in_=false;this.addHandlers(a)}}},onCreate:function(){if(typeof CAAT.__CSS__!=="undefined")CAAT.Foundation.Director.prototype.clip=true,CAAT.Foundation.Director.prototype.glEnabled=false,CAAT.Foundation.Director.prototype.getRenderType=function(){return"CSS"},CAAT.Foundation.Director.prototype.setScaleProportional=function(a,b){var c=Math.min(a/this.referenceWidth,b/this.referenceHeight);this.setScaleAnchored(c,c,0,0);this.eventHandler.style.width= -""+this.referenceWidth+"px";this.eventHandler.style.height=""+this.referenceHeight+"px"},CAAT.Foundation.Director.prototype.setBounds=function(a,b,c,d){CAAT.Foundation.Director.superclass.setBounds.call(this,a,b,c,d);for(a=0;a=0;b--){var c=this.childrenList[b],d=new CAAT.Math.Point(a.x, +a.y,0),c=c.findActorAtPosition(d);if(null!==c)return c}return this},resetStats:function(){this.statistics.size_total=0;this.statistics.size_active=0;this.statistics.draws=0;this.statistics.size_discarded_by_dirty_rects=0},render:function(a){if(!this.currentScene||!this.currentScene.isPaused()){this.time+=a;for(e=0,l=this.childrenList.length;e0&&!navigator.isCocoonJS&&CAAT.DEBUG&&CAAT.DEBUG_DIRTYRECTS){f.beginPath();this.nDirtyRects=0;b=this.cDirtyRects;for(e=0;e=this.dirtyRects.length)for(b=0;b<32;b++)this.dirtyRects.push(new CAAT.Math.Rectangle);b=this.dirtyRects[this.dirtyRectsIndex];b.x=a.x;b.y=a.y;b.x1=a.x1;b.y1=a.y1;b.width=a.width;b.height=a.height; +this.cDirtyRects.push(b)}},renderToContext:function(a,b){if(b.isInAnimationFrame(this.time)){a.setTransform(1,0,0,1,0,0);a.globalAlpha=1;a.globalCompositeOperation="source-over";a.clearRect(0,0,this.width,this.height);var c=this.ctx;this.ctx=a;a.save();var d=this.modelViewMatrix,e=this.worldModelViewMatrix;this.modelViewMatrix=this.worldModelViewMatrix=new CAAT.Math.Matrix;this.wdirty=true;b.animate(this,b.time);if(b.onRenderStart)b.onRenderStart(b.time);b.paintActor(this,b.time);if(b.onRenderEnd)b.onRenderEnd(b.time); +this.worldModelViewMatrix=e;this.modelViewMatrix=d;a.restore();this.ctx=c}},addScene:function(a){a.setBounds(0,0,this.width,this.height);this.scenes.push(a);a.setEaseListener(this);null===this.currentScene&&this.setScene(0)},getNumScenes:function(){return this.scenes.length},easeInOut:function(a,b,c,d,e,f,g,h,i,j){if(a!==this.getCurrentSceneIndex()){a=this.scenes[a];d=this.scenes[d];if(!CAAT.__CSS__&&CAAT.CACHE_SCENE_ON_CHANGE)this.renderToContext(this.transitionScene.ctx,d),d=this.transitionScene; +a.setExpired(false);d.setExpired(false);a.mouseEnabled=false;d.mouseEnabled=false;a.resetTransform();d.resetTransform();a.setLocation(0,0);d.setLocation(0,0);a.alpha=1;d.alpha=1;b===CAAT.Foundation.Scene.EASE_ROTATION?a.easeRotationIn(g,h,c,i):b===CAAT.Foundation.Scene.EASE_SCALE?a.easeScaleIn(0,g,h,c,i):a.easeTranslationIn(g,h,c,i);e===CAAT.Foundation.Scene.EASE_ROTATION?d.easeRotationOut(g,h,f,j):e===CAAT.Foundation.Scene.EASE_SCALE?d.easeScaleOut(0,g,h,f,j):d.easeTranslationOut(g,h,f,j);this.childrenList= +[];d.goOut(a);a.getIn(d);this.addChild(d);this.addChild(a)}},easeInOutRandom:function(a,b,c,d){var e=Math.random(),f=Math.random(),g;e<0.33?(e=CAAT.Foundation.Scene.EASE_ROTATION,g=(new CAAT.Behavior.Interpolator).createExponentialInOutInterpolator(4)):e<0.66?(e=CAAT.Foundation.Scene.EASE_SCALE,g=(new CAAT.Behavior.Interpolator).createElasticOutInterpolator(1.1,0.4)):(e=CAAT.Foundation.Scene.EASE_TRANSLATE,g=(new CAAT.Behavior.Interpolator).createBounceOutInterpolator());var h;f<0.33?(f=CAAT.Foundation.Scene.EASE_ROTATION, +h=(new CAAT.Behavior.Interpolator).createExponentialInOutInterpolator(4)):f<0.66?(f=CAAT.Foundation.Scene.EASE_SCALE,h=(new CAAT.Behavior.Interpolator).createExponentialOutInterpolator(4)):(f=CAAT.Foundation.Scene.EASE_TRANSLATE,h=(new CAAT.Behavior.Interpolator).createBounceOutInterpolator());this.easeInOut(a,e,Math.random()*8.99>>0,b,f,Math.random()*8.99>>0,c,d,g,h)},easeIn:function(a,b,c,d,e,f){a=this.scenes[a];b===CAAT.Foundation.Scene.EASE_ROTATION?a.easeRotationIn(c,d,e,f):b===CAAT.Foundation.Scene.EASE_SCALE? +a.easeScaleIn(0,c,d,e,f):a.easeTranslationIn(c,d,e,f);this.childrenList=[];this.addChild(a);a.resetTransform();a.setLocation(0,0);a.alpha=1;a.mouseEnabled=false;a.setExpired(false)},setScene:function(a){a=this.scenes[a];this.childrenList=[];this.addChild(a);this.currentScene=a;a.setExpired(false);a.mouseEnabled=true;a.resetTransform();a.setLocation(0,0);a.alpha=1;a.getIn();a.activated()},switchToScene:function(a,b,c,d){var e=this.getSceneIndex(this.currentScene);d?this.easeInOutRandom(a,e,b,c):this.setScene(a)}, +switchToPrevScene:function(a,b,c){var d=this.getSceneIndex(this.currentScene);this.getNumScenes()<=1||d===0||(c?this.easeInOutRandom(d-1,d,a,b):this.setScene(d-1))},switchToNextScene:function(a,b,c){var d=this.getSceneIndex(this.currentScene);this.getNumScenes()<=1||d===this.getNumScenes()-1||(c?this.easeInOutRandom(d+1,d,a,b):this.setScene(d+1))},mouseEnter:function(){},mouseExit:function(){},mouseMove:function(){},mouseDown:function(){},mouseUp:function(){},mouseDrag:function(){},easeEnd:function(a, +b){b?(this.currentScene=a,this.currentScene.activated()):a.setExpired(true);a.mouseEnabled=true;a.emptyBehaviorList()},getSceneIndex:function(a){for(var b=0;b500&&(b=500);if(this.onRenderStart)this.onRenderStart(b);this.render(b);this.debugInfo&&this.debugInfo(this.statistics);this.timeline=a;if(this.onRenderEnd)this.onRenderEnd(b);this.needsRepaint=false}},resetTimeline:function(){this.timeline= +(new Date).getTime()},endLoop:function(){},setClear:function(a){this.clear=a;this.dirtyRectsEnabled=this.clear===CAAT.Foundation.Director.CLEAR_DIRTY_RECTS?true:false;return this},getAudioManager:function(){return this.audioManager},cumulateOffset:function(a,b,c){var d=c+"Left";c+="Top";for(var e=0,f=0,g;navigator.browser!=="iOS"&&a&&a.style;)if(g=a.currentStyle?a.currentStyle.position:(g=(a.ownerDocument.defaultView||a.ownerDocument.parentWindow).getComputedStyle(a,null))?g.getPropertyValue("position"): +null,/^(fixed)$/.test(g))break;else e+=a[d],f+=a[c],a=a[b];return{x:e,y:f,style:g}},getOffset:function(a){var b=this.cumulateOffset(a,"offsetParent","offset");return b.style==="fixed"?(a=this.cumulateOffset(a,a.parentNode?"parentNode":"parentElement","scroll"),{x:b.x+a.x,y:b.y+a.y}):{x:b.x,y:b.y}},getCanvasCoord:function(a,b){var c=new CAAT.Math.Point,d=0,e=0;if(!b)b=window.event;if(b.pageX||b.pageY)d=b.pageX,e=b.pageY;else if(b.clientX||b.clientY)d=b.clientX+document.body.scrollLeft+document.documentElement.scrollLeft, +e=b.clientY+document.body.scrollTop+document.documentElement.scrollTop;var f=this.getOffset(this.canvas);d-=f.x;e-=f.y;d*=this.SCREEN_RATIO;e*=this.SCREEN_RATIO;c.x=d;c.y=e;if(!this.modelViewMatrixI)this.modelViewMatrixI=this.modelViewMatrix.getInverse();this.modelViewMatrixI.transformCoord(c);d=c.x;e=c.y;a.set(d,e);this.screenMousePoint.set(d,e)},__mouseDownHandler:function(a){if(this.dragging&&this.lastSelectedActor)this.__mouseUpHandler(a);else{this.getCanvasCoord(this.mousePoint,a);this.isMouseDown= +true;var b=this.findActorAtPosition(this.mousePoint);if(null!==b){var c=b.viewToModel(new CAAT.Math.Point(this.screenMousePoint.x,this.screenMousePoint.y,0));b.mouseDown((new CAAT.Event.MouseEvent).init(c.x,c.y,a,b,new CAAT.Math.Point(this.screenMousePoint.x,this.screenMousePoint.y)))}this.lastSelectedActor=b}},__mouseUpHandler:function(a){this.isMouseDown=false;this.getCanvasCoord(this.mousePoint,a);var b=null,c=this.lastSelectedActor;null!==c&&(b=c.viewToModel(new CAAT.Math.Point(this.screenMousePoint.x, +this.screenMousePoint.y,0)),c.actionPerformed&&c.contains(b.x,b.y)&&c.actionPerformed(a),c.mouseUp((new CAAT.Event.MouseEvent).init(b.x,b.y,a,c,this.screenMousePoint,this.currentScene.time)));!this.dragging&&null!==c&&c.contains(b.x,b.y)&&c.mouseClick((new CAAT.Event.MouseEvent).init(b.x,b.y,a,c,this.screenMousePoint,this.currentScene.time));this.in_=this.dragging=false},__mouseMoveHandler:function(a){var b,c,d=this.currentScene?this.currentScene.time:0;if(this.isMouseDown&&null!==this.lastSelectedActor){if(b= +this.lastSelectedActor,c=b.viewToModel(new CAAT.Math.Point(this.screenMousePoint.x,this.screenMousePoint.y,0)),this.dragging||!(Math.abs(this.prevMousePoint.x-c.x)=this.width||b.y>=this.height))this.touching=true,this.__mouseDownHandler(a)}},__touchEndHandler:function(a){if(this.touching)a.preventDefault(),a.returnValue=false,a=a.changedTouches[0],this.getCanvasCoord(this.mousePoint,a),this.touching=false,this.__mouseUpHandler(a)},__touchMoveHandler:function(a){if(this.touching&&(a.preventDefault(),a.returnValue=false,!this.gesturing))for(var b=0;b=this.width||f.y>=this.height)){var g=this.findActorAtPosition(f);g!==null&&(f=g.viewToModel(f),this.touches[e]||(this.touches[e]={actor:g,touch:new CAAT.Event.TouchInfo(e,f.x,f.y,g)},c.push(e)))}}e={};for(b=0;b=b.width||d.y>=b.height))b.touching=true,b.__mouseDownHandler(c)}},false);window.addEventListener("mouseover",function(c){if(c.target===a&&!b.dragging){c.preventDefault();c.cancelBubble=true;c.stopPropagation&&c.stopPropagation();var d=b.mousePoint; +b.getCanvasCoord(d,c);d.x<0||d.y<0||d.x>=b.width||d.y>=b.height||b.__mouseOverHandler(c)}},false);window.addEventListener("mouseout",function(c){if(c.target===a&&!b.dragging)c.preventDefault(),c.cancelBubble=true,c.stopPropagation&&c.stopPropagation(),b.getCanvasCoord(b.mousePoint,c),b.__mouseOutHandler(c)},false);window.addEventListener("mousemove",function(a){a.preventDefault();a.cancelBubble=true;a.stopPropagation&&a.stopPropagation();var d=b.mousePoint;b.getCanvasCoord(d,a);(b.dragging||!(d.x< +0||d.y<0||d.x>=b.width||d.y>=b.height))&&b.__mouseMoveHandler(a)},false);window.addEventListener("dblclick",function(c){if(c.target===a){c.preventDefault();c.cancelBubble=true;c.stopPropagation&&c.stopPropagation();var d=b.mousePoint;b.getCanvasCoord(d,c);d.x<0||d.y<0||d.x>=b.width||d.y>=b.height||b.__mouseDBLClickHandler(c)}},false);CAAT.TOUCH_BEHAVIOR===CAAT.TOUCH_AS_MOUSE?(a.addEventListener("touchstart",this.__touchStartHandler.bind(this),false),a.addEventListener("touchmove",this.__touchMoveHandler.bind(this), +false),a.addEventListener("touchend",this.__touchEndHandler.bind(this),false),a.addEventListener("gesturestart",function(c){if(c.target===a)c.preventDefault(),c.returnValue=false,b.__gestureStart(c.scale,c.rotation)},false),a.addEventListener("gestureend",function(c){if(c.target===a)c.preventDefault(),c.returnValue=false,b.__gestureEnd(c.scale,c.rotation)},false),a.addEventListener("gesturechange",function(c){if(c.target===a)c.preventDefault(),c.returnValue=false,b.__gestureChange(c.scale,c.rotation)}, +false)):CAAT.TOUCH_BEHAVIOR===CAAT.TOUCH_AS_MULTITOUCH&&(a.addEventListener("touchstart",this.__touchStartHandlerMT.bind(this),false),a.addEventListener("touchmove",this.__touchMoveHandlerMT.bind(this),false),a.addEventListener("touchend",this.__touchEndHandlerMT.bind(this),false),a.addEventListener("touchcancel",this.__touchCancelHandleMT.bind(this),false),a.addEventListener("gesturestart",this.__touchGestureStartHandleMT.bind(this),false),a.addEventListener("gestureend",this.__touchGestureEndHandleMT.bind(this), +false),a.addEventListener("gesturechange",this.__touchGestureChangeHandleMT.bind(this),false))},enableEvents:function(a){CAAT.RegisterDirector(this);this.in_=false;this.createEventHandler(a)},createEventHandler:function(a){this.in_=false;this.addHandlers(a)}}},onCreate:function(){if(typeof CAAT.__CSS__!=="undefined")CAAT.Foundation.Director.prototype.clip=true,CAAT.Foundation.Director.prototype.glEnabled=false,CAAT.Foundation.Director.prototype.getRenderType=function(){return"CSS"},CAAT.Foundation.Director.prototype.setScaleProportional= +function(a,b){var c=Math.min(a/this.referenceWidth,b/this.referenceHeight);this.setScaleAnchored(c,c,0,0);this.eventHandler.style.width=""+this.referenceWidth+"px";this.eventHandler.style.height=""+this.referenceHeight+"px"},CAAT.Foundation.Director.prototype.setBounds=function(a,b,c,d){CAAT.Foundation.Director.superclass.setBounds.call(this,a,b,c,d);for(a=0;a>0)+1)*b},setFillStyle:function(a){this.fill=a},setStrokeStyle:function(a){this.stroke=a},setStrokeSize:function(a){this.strokeSize= -a},setAlignment:function(a){this.alignment=a},setFontSize:function(a){if(a!==this.fontSize)this.fontSize=a,this.__setFont()}};var b=function(){this.text="";return this};b.prototype={x:0,y:0,width:0,text:null,crcs:null,rcs:null,styles:null,images:null,lines:null,documentHeight:0,anchorStack:null,__nextLine:function(){this.x=0;this.currentLine=new f(CAAT.Module.Font.Font.getFontMetrics(this.crcs.sfont));this.lines.push(this.currentLine)},__image:function(a,b,c){var e;e=b&&c?a.getWidth():a.getWrappedImageWidth(); -this.width&&e+this.x>this.width&&this.x>0&&this.__nextLine();this.currentLine.addElementImage(new d(this.x,a,b,c,this.crcs.clone(),this.__getCurrentAnchor()));this.x+=e},__text:function(){if(this.text.length!==0){var a=this.ctx.measureText(this.text).width;this.width&&a+this.x>this.width&&this.x>0&&this.__nextLine();this.currentLine.addElement(new e(this.text,this.x,a,0,this.crcs.clone(),this.__getCurrentAnchor()));this.x+=a;this.text=""}},fchar:function(a){a===" "?(this.__text(),this.x+=this.ctx.measureText(a).width, -this.width&&this.x>this.width&&this.__nextLine()):this.text+=a},end:function(){this.text.length>0&&this.__text();for(var a=0,b=0,c=0;c>0);this.lines[c].setY(a)}this.documentHeight=a+b},getDocumentHeight:function(){return this.documentHeight},__getCurrentAnchor:function(){return this.anchorStack.length?this.anchorStack[this.anchorStack.length-1]:null},__resetAppliedStyles:function(){this.rcs= -[];this.__pushDefaultStyles()},__pushDefaultStyles:function(){this.crcs=(new a(this.ctx)).setDefault(this.styles["default"]);this.rcs.push(this.crcs)},__pushStyle:function(b){var c=this.crcs;this.crcs=new a(this.ctx);this.crcs.chain=c;this.crcs.setStyle(b);this.crcs.applyStyle();this.rcs.push(this.crcs)},__popStyle:function(){if(this.rcs.length>1)this.rcs.pop(),this.crcs=this.rcs[this.rcs.length-1],this.crcs.applyStyle()},__popAnchor:function(){this.anchorStack.length>0&&this.anchorStack.pop()},__pushAnchor:function(a){this.anchorStack.push(a)}, -start:function(a,b,c,d){this.y=this.x=0;this.width=typeof d!=="undefined"?d:0;this.ctx=a;this.lines=[];this.styles=b;this.images=c;this.anchorStack=[];this.__resetAppliedStyles();this.__nextLine()},setTag:function(a){this.__text();a=a.toLowerCase();if(a==="b")this.crcs.setBold(true);else if(a==="/b")this.crcs.setBold(false);else if(a==="i")this.crcs.setItalic(true);else if(a==="/i")this.crcs.setItalic(false);else if(a==="stroked")this.crcs.setStroked(true);else if(a==="/stroked")this.crcs.setStroked(false); -else if(a==="filled")this.crcs.setFilled(true);else if(a==="/filled")this.crcs.setFilled(false);else if(a==="tab")this.x=this.crcs.getTabPos(this.x);else if(a==="br")this.__nextLine();else if(a==="/a")this.__popAnchor();else if(a==="/style")this.rcs.length>1&&this.__popStyle();else if(a.indexOf("fillcolor")===0)a=a.split("="),this.crcs.setFillStyle(a[1]);else if(a.indexOf("strokecolor")===0)a=a.split("="),this.crcs.setStrokeStyle(a[1]);else if(a.indexOf("strokesize")===0)a=a.split("="),this.crcs.setStrokeSize(a[1]| -0);else if(a.indexOf("fontsize")===0)a=a.split("="),this.crcs.setFontSize(a[1]|0);else if(a.indexOf("style")===0)a=a.split("="),(a=this.styles[a[1]])&&this.__pushStyle(a);else if(a.indexOf("image")===0){var a=a.split("=")[1].split(","),b=a[0];if(this.images[b]){var c=0,d=0;a.length>=3&&(c=a[1]|0,d=a[2]|0);this.__image(this.images[b],c,d)}}else a.indexOf("a=")===0&&(a=a.split("="),this.__pushAnchor(a[1]))}};var c=function(a,b){this.link=a;this.style=b;return this};c.prototype={x:null,y:null,width:null, -height:null,style:null,link:null,isLink:function(){return this.link},setLink:function(a){this.link=a;return this},getLink:function(){return this.link},contains:function(){return false}};var d=function(a,b,c,e,f,m){d.superclass.constructor.call(this,m,f);this.x=a;this.image=b;this.row=c;this.column=e;this.width=b.getWidth();this.height=b.getHeight();if(this.image instanceof CAAT.SpriteImage||this.image instanceof CAAT.Foundation.SpriteImage)this.spriteIndex=c*b.columns+e,this.paint=this.paintSI;return this}; -d.prototype={image:null,row:null,column:null,spriteIndex:null,paint:function(a){this.style.image(a);a.drawImage(this.image,this.x,-this.height+1)},paintSI:function(a){this.style.image(a);this.image.setSpriteIndex(this.spriteIndex);this.image.paint({ctx:a},0,this.x,-this.height+1)},getHeight:function(){return this.image instanceof CAAT.Foundation.SpriteImage?this.image.singleHeight:this.image.height},getFontMetrics:function(){return null},contains:function(a,b){return a>=this.x&&a<=this.x+this.width&& -b>=this.y&&b=this.x&&a<=this.x+this.width&&b>=this.y&&b<=this.y+this.height},setYPosition:function(a){this.bl=a;this.y=a-this.fm.ascent}};extend(d,c);extend(e,c);var f=function(a){this.elements=[];this.defaultFontMetrics=a;return this};f.prototype={elements:null,width:0,height:0,defaultHeight:0,y:0,x:0,alignment:null,baselinePos:0,addElement:function(a){this.width=Math.max(this.width,a.x+a.width);this.height=Math.max(this.height,a.height);this.elements.push(a);this.alignment=a.style.__getProperty("alignment")}, -addElementImage:function(a){this.width=Math.max(this.width,a.x+a.width);this.height=Math.max(this.height,a.height);this.elements.push(a)},getHeight:function(){return this.height},setY:function(a){this.y=a},getY:function(){return this.y},paint:function(a){a.save();a.translate(this.x,this.y+this.baselinePos);for(var b=0;b=0.6&&this.elements.length>1){var c=a-this.width,c=c/(this.elements.length-1)|0;for(b=1;ba.ascent&&(a=e):a=e:b?d.getHeight()>d.getHeight()&& -(b=d):b=d}this.baselinePos=Math.max(a?a.ascent:this.defaultFontMetrics.ascent,b?b.getHeight():this.defaultFontMetrics.ascent);this.height=this.baselinePos+(a!=null?a.descent:this.defaultFontMetrics.descent);for(c=0;c",d+1),-1!==o&&(n=f.substr(d+1,o-d-1),n.indexOf("<")!==-1?(this.rc.fchar(p),d+=1):(this.rc.setTag(n),d=o+1))):(this.rc.fchar(p),d+=1);this.rc.end();this.lines=this.rc.lines;this.__calculateDocumentDimension(typeof b==="undefined"?0:b);this.setLinesAlignment();q.restore();this.setPreferredSize(this.documentWidth,this.documentHeight);this.invalidateLayout();this.setDocumentPosition();c&&this.cacheAsBitmap(0,c);return this}},setVerticalAlignment:function(a){this.valignment= -a;this.setDocumentPosition();return this},setHorizontalAlignment:function(a){this.halignment=a;this.setDocumentPosition();return this},setDocumentPosition:function(){var a=0,b=0;this.valignment===CAAT.Foundation.UI.Layout.LayoutManager.ALIGNMENT.CENTER?b=(this.height-this.documentHeight)/2:this.valignment===CAAT.Foundation.UI.Layout.LayoutManager.ALIGNMENT.BOTTOM&&(b=this.height-this.documentHeight);this.halignment===CAAT.Foundation.UI.Layout.LayoutManager.ALIGNMENT.CENTER?a=(this.width-this.documentWidth)/ -2:this.halignment===CAAT.Foundation.UI.Layout.LayoutManager.ALIGNMENT.RIGHT&&(a=this.width-this.documentWidth);this.documentX=a;this.documentY=b},__calculateDocumentDimension:function(a){var b,c=0;for(b=this.documentHeight=this.documentWidth=0;b=a&&d.y+d.height>=b)return d.__getElementAt(a-d.x,b-d.y)}return null},mouseExit:function(){CAAT.setCursor("default")},mouseMove:function(a){(a=this.__getDocumentElementAt(a.x,a.y))&&a.getLink()?CAAT.setCursor("pointer"):CAAT.setCursor("default")},mouseClick:function(a){this.clickCallback&&(a=this.__getDocumentElementAt(a.x,a.y),a.getLink()&&this.clickCallback(a.getLink()))},setClickCallback:function(a){this.clickCallback=a;return this}}}}); +CAAT.Module({defines:"CAAT.Foundation.UI.Label",depends:["CAAT.Foundation.Actor","CAAT.Foundation.SpriteImage","CAAT.Module.Font.Font","CAAT.Foundation.UI.Layout.LayoutManager"],aliases:["CAAT.UI.Label"],extendsClass:"CAAT.Foundation.Actor",extendsWith:function(){var a=function(a){this.ctx=a;return this};a.prototype={ctx:null,defaultFS:null,font:null,fontSize:null,fill:null,stroke:null,filled:null,stroked:null,strokeSize:null,italic:null,bold:null,alignment:null,tabSize:null,shadow:null,shadowBlur:null, +shadowColor:null,sfont:null,chain:null,setDefault:function(a){this.defaultFS=24;this.font="Arial";this.fontSize=this.defaultFS;this.fill="#000";this.stroke="#f00";this.filled=true;this.stroked=false;this.strokeSize=1;this.bold=this.italic=false;this.alignment="left";this.tabSize=75;this.shadow=false;this.shadowBlur=0;this.shadowColor="#000";for(var b in a)a.hasOwnProperty(b)&&(this[b]=a[b]);this.__setFont();return this},setStyle:function(a){if(typeof a!=="undefined")for(var b in a)this[b]=a[b];return this}, +applyStyle:function(){this.__setFont();return this},clone:function(){var b=new a(this.ctx),c;for(c in this)this.hasOwnProperty(c)&&(b[c]=this[c]);for(var d=this;d.chain;)for(c in d=d.chain,d)b[c]===null&&d.hasOwnProperty(c)&&(b[c]=d[c]);b.__setFont();return b},__getProperty:function(a){var b=this,c;do{c=b[a];if(c!==null)return c;b=b.chain}while(b);return null},image:function(a){this.__setShadow(a)},text:function(a,b,c,d){this.__setShadow(a);a.font=this.__getProperty("sfont");this.filled&&this.__fillText(a, +b,c,d);this.stroked&&this.__strokeText(a,b,c,d)},__setShadow:function(a){if(this.__getProperty("shadow"))a.shadowBlur=this.__getProperty("shadowBlur"),a.shadowColor=this.__getProperty("shadowColor")},__fillText:function(a,b,c,d){a.fillStyle=this.__getProperty("fill");a.fillText(b,c,d)},__strokeText:function(a,b,c,d){a.strokeStyle=this.__getProperty("stroke");a.lineWidth=this.__getProperty("strokeSize");a.beginPath();a.strokeText(b,c,d)},__setFont:function(){var a=this.__getProperty("italic"),b=this.__getProperty("bold"), +c=this.__getProperty("fontSize"),d=this.__getProperty("font");this.sfont=(a?"italic ":"")+(b?"bold ":"")+c+"px "+d;this.ctx.font=this.__getProperty("sfont")},setBold:function(a){if(a!=this.bold)this.bold=a,this.__setFont()},setItalic:function(a){if(a!=this.italic)this.italic=a,this.__setFont()},setStroked:function(a){this.stroked=a},setFilled:function(a){this.filled=a},getTabPos:function(a){var b=this.__getProperty("tabSize");return((a/b>>0)+1)*b},setFillStyle:function(a){this.fill=a},setStrokeStyle:function(a){this.stroke= +a},setStrokeSize:function(a){this.strokeSize=a},setAlignment:function(a){this.alignment=a},setFontSize:function(a){if(a!==this.fontSize)this.fontSize=a,this.__setFont()}};var b=function(){this.text="";return this};b.prototype={x:0,y:0,width:0,text:null,crcs:null,rcs:null,styles:null,images:null,lines:null,documentHeight:0,anchorStack:null,__nextLine:function(){this.x=0;this.currentLine=new f(CAAT.Module.Font.Font.getFontMetrics(this.crcs.sfont));this.lines.push(this.currentLine)},__image:function(a, +b,c){var e;e=typeof b!=="undefined"&&typeof c!=="undefined"?a.getWidth():a instanceof CAAT.Foundation.SpriteImage?a.getWidth():a.getWrappedImageWidth();this.width&&e+this.x>this.width&&this.x>0&&this.__nextLine();this.currentLine.addElementImage(new d(this.x,a,b,c,this.crcs.clone(),this.__getCurrentAnchor()));this.x+=e},__text:function(){if(this.text.length!==0){var a=this.ctx.measureText(this.text).width;this.width&&a+this.x>this.width&&this.x>0&&this.__nextLine();this.currentLine.addElement(new e(this.text, +this.x,a,0,this.crcs.clone(),this.__getCurrentAnchor()));this.x+=a;this.text=""}},fchar:function(a){a===" "?(this.__text(),this.x+=this.ctx.measureText(a).width,this.width&&this.x>this.width&&this.__nextLine()):this.text+=a},end:function(){this.text.length>0&&this.__text();for(var a=0,b=0,c=0;c>0);this.lines[c].setY(a)}this.documentHeight=a+b},getDocumentHeight:function(){return this.documentHeight}, +__getCurrentAnchor:function(){return this.anchorStack.length?this.anchorStack[this.anchorStack.length-1]:null},__resetAppliedStyles:function(){this.rcs=[];this.__pushDefaultStyles()},__pushDefaultStyles:function(){this.crcs=(new a(this.ctx)).setDefault(this.styles["default"]);this.rcs.push(this.crcs)},__pushStyle:function(b){var c=this.crcs;this.crcs=new a(this.ctx);this.crcs.chain=c;this.crcs.setStyle(b);this.crcs.applyStyle();this.rcs.push(this.crcs)},__popStyle:function(){if(this.rcs.length>1)this.rcs.pop(), +this.crcs=this.rcs[this.rcs.length-1],this.crcs.applyStyle()},__popAnchor:function(){this.anchorStack.length>0&&this.anchorStack.pop()},__pushAnchor:function(a){this.anchorStack.push(a)},start:function(a,b,c,d){this.y=this.x=0;this.width=typeof d!=="undefined"?d:0;this.ctx=a;this.lines=[];this.styles=b;this.images=c;this.anchorStack=[];this.__resetAppliedStyles();this.__nextLine()},setTag:function(a){this.__text();a=a.toLowerCase();if(a==="b")this.crcs.setBold(true);else if(a==="/b")this.crcs.setBold(false); +else if(a==="i")this.crcs.setItalic(true);else if(a==="/i")this.crcs.setItalic(false);else if(a==="stroked")this.crcs.setStroked(true);else if(a==="/stroked")this.crcs.setStroked(false);else if(a==="filled")this.crcs.setFilled(true);else if(a==="/filled")this.crcs.setFilled(false);else if(a==="tab")this.x=this.crcs.getTabPos(this.x);else if(a==="br")this.__nextLine();else if(a==="/a")this.__popAnchor();else if(a==="/style")this.rcs.length>1&&this.__popStyle();else if(a.indexOf("fillcolor")===0)a= +a.split("="),this.crcs.setFillStyle(a[1]);else if(a.indexOf("strokecolor")===0)a=a.split("="),this.crcs.setStrokeStyle(a[1]);else if(a.indexOf("strokesize")===0)a=a.split("="),this.crcs.setStrokeSize(a[1]|0);else if(a.indexOf("fontsize")===0)a=a.split("="),this.crcs.setFontSize(a[1]|0);else if(a.indexOf("style")===0)a=a.split("="),(a=this.styles[a[1]])&&this.__pushStyle(a);else if(a.indexOf("image")===0){var a=a.split("=")[1].split(","),b=a[0];if(this.images[b]){var c=0,d=0;a.length>=3&&(c=a[1]|0, +d=a[2]|0);this.__image(this.images[b],c,d)}else CAAT.currentDirector.getImage(b)&&this.__image(CAAT.currentDirector.getImage(b))}else a.indexOf("a=")===0&&(a=a.split("="),this.__pushAnchor(a[1]))}};var c=function(a,b){this.link=a;this.style=b;return this};c.prototype={x:null,y:null,width:null,height:null,style:null,link:null,isLink:function(){return this.link},setLink:function(a){this.link=a;return this},getLink:function(){return this.link},contains:function(){return false}};var d=function(a,b,c, +e,f,m){d.superclass.constructor.call(this,m,f);this.x=a;this.image=b;this.row=c;this.column=e;this.width=b.getWidth();this.height=b.getHeight();if(this.image instanceof CAAT.SpriteImage||this.image instanceof CAAT.Foundation.SpriteImage)this.spriteIndex=typeof c==="undefined"||typeof e==="undefined"?0:c*b.columns+e,this.paint=this.paintSI;return this};d.prototype={image:null,row:null,column:null,spriteIndex:null,paint:function(a){this.style.image(a);a.drawImage(this.image,this.x,-this.height+1)}, +paintSI:function(a){this.style.image(a);this.image.setSpriteIndex(this.spriteIndex);this.image.paint({ctx:a},0,this.x,-this.height+1)},getHeight:function(){return this.image instanceof CAAT.Foundation.SpriteImage?this.image.getHeight():this.image.height},getFontMetrics:function(){return null},contains:function(a,b){return a>=this.x&&a<=this.x+this.width&&b>=this.y&&b=this.x&&a<=this.x+this.width&&b>=this.y&&b<=this.y+this.height},setYPosition:function(a){this.bl=a;this.y=a-this.fm.ascent}}; +extend(d,c);extend(e,c);var f=function(a){this.elements=[];this.defaultFontMetrics=a;return this};f.prototype={elements:null,width:0,height:0,defaultHeight:0,y:0,x:0,alignment:null,baselinePos:0,addElement:function(a){this.width=Math.max(this.width,a.x+a.width);this.height=Math.max(this.height,a.height);this.elements.push(a);this.alignment=a.style.__getProperty("alignment")},addElementImage:function(a){this.width=Math.max(this.width,a.x+a.width);this.height=Math.max(this.height,a.height);this.elements.push(a)}, +getHeight:function(){return this.height},setY:function(a){this.y=a},getY:function(){return this.y},paint:function(a){a.save();a.translate(this.x,this.y+this.baselinePos);for(var b=0;b=0.6&&this.elements.length>1){var c=a-this.width,c=c/(this.elements.length- +1)|0;for(b=1;ba.ascent&&(a=e):a=e:b?d.getHeight()>d.getHeight()&&(b=d):b=d}this.baselinePos=Math.max(a?a.ascent:this.defaultFontMetrics.ascent,b?b.getHeight():this.defaultFontMetrics.ascent);this.height= +this.baselinePos+(a!=null?a.descent:this.defaultFontMetrics.descent);for(c=0;c", +d+1),-1!==o&&(n=f.substr(d+1,o-d-1),n.indexOf("<")!==-1?(this.rc.fchar(p),d+=1):(this.rc.setTag(n),d=o+1))):(this.rc.fchar(p),d+=1);this.rc.end();this.lines=this.rc.lines;this.__calculateDocumentDimension(typeof b==="undefined"?0:b);this.setLinesAlignment();q.restore();this.setPreferredSize(this.documentWidth,this.documentHeight);this.invalidateLayout();this.setDocumentPosition();c&&this.cacheAsBitmap(0,c);if(this.matchTextSize)this.width=this.preferredSize.width,this.height=this.preferredSize.height; +return this}},setVerticalAlignment:function(a){this.valignment=a;this.setDocumentPosition();return this},setHorizontalAlignment:function(a){this.halignment=a;this.setDocumentPosition();return this},setDocumentPosition:function(a,b){typeof a!=="undefined"&&this.setHorizontalAlignment(a);typeof b!=="undefined"&&this.setVerticalAlignment(b);var c=0,d=0;this.valignment===CAAT.Foundation.UI.Layout.LayoutManager.ALIGNMENT.CENTER?d=(this.height-this.documentHeight)/2:this.valignment===CAAT.Foundation.UI.Layout.LayoutManager.ALIGNMENT.BOTTOM&& +(d=this.height-this.documentHeight);this.halignment===CAAT.Foundation.UI.Layout.LayoutManager.ALIGNMENT.CENTER?c=(this.width-this.documentWidth)/2:this.halignment===CAAT.Foundation.UI.Layout.LayoutManager.ALIGNMENT.RIGHT&&(c=this.width-this.documentWidth);this.documentX=c;this.documentY=d},__calculateDocumentDimension:function(a){var b,c=0;for(b=this.documentHeight=this.documentWidth=0;b=a&&d.y+d.height>=b)return d.__getElementAt(a-d.x,b-d.y)}return null},mouseExit:function(){CAAT.setCursor("default")},mouseMove:function(a){(a=this.__getDocumentElementAt(a.x,a.y))&&a.getLink()?CAAT.setCursor("pointer"):CAAT.setCursor("default")},mouseClick:function(a){this.clickCallback&&(a=this.__getDocumentElementAt(a.x,a.y),a.getLink()&& +this.clickCallback(a.getLink()))},setClickCallback:function(a){this.clickCallback=a;return this}}}}); CAAT.Module({defines:"CAAT.Foundation.UI.PathActor",aliases:["CAAT.PathActor"],depends:["CAAT.Foundation.Actor"],extendsClass:"CAAT.Foundation.Actor",extendsWith:{path:null,pathBoundingRectangle:null,bOutline:false,outlineColor:"black",onUpdateCallback:null,interactive:false,getPath:function(){return this.path},setPath:function(a){this.path=a;if(a!=null)this.pathBoundingRectangle=a.getBoundingBox(),this.setInteractive(this.interactive);return this},paint:function(a,b){CAAT.Foundation.UI.PathActor.superclass.paint.call(this, a,b);if(this.path){var c=a.ctx;c.strokeStyle="#000";this.path.paint(a,this.interactive);if(this.bOutline)c.strokeStyle=this.outlineColor,c.strokeRect(this.pathBoundingRectangle.x,this.pathBoundingRectangle.y,this.pathBoundingRectangle.width,this.pathBoundingRectangle.height)}},showBoundingBox:function(a,b){if((this.bOutline=a)&&b)this.outlineColor=b;return this},setInteractive:function(a){this.interactive=a;this.path&&this.path.setInteractive(a);return this},setOnUpdateCallback:function(a){this.onUpdateCallback= a;return this},mouseDrag:function(a){this.path.drag(a.point.x,a.point.y,this.onUpdateCallback)},mouseDown:function(a){this.path.press(a.point.x,a.point.y)},mouseUp:function(){this.path.release()}}}); diff --git a/build/caat-css.js b/build/caat-css.js index e755735d..5063e80f 100644 --- a/build/caat-css.js +++ b/build/caat-css.js @@ -21,15 +21,15 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -Version: 0.6 build: 30 +Version: 0.6 build: 5 Created on: -DATE: 2013-03-18 -TIME: 23:03:06 +DATE: 2013-07-01 +TIME: 04:58:33 */ -(function(global) { +(function(global, __obj_namespace) { String.prototype.endsWith= function(suffix) { return this.indexOf(suffix, this.length - suffix.length) !== -1; @@ -62,6 +62,8 @@ TIME: 23:03:06 var Class = function () { }; + Class['__CLASS']='Class'; + // Create a new Class that inherits from this class Class.extend = function (extendingProt, constants, name, aliases, flags) { @@ -662,12 +664,16 @@ TIME: 23:03:06 function ensureNamespace( qualifiedClassName ) { var ns= qualifiedClassName.split("."); var _global= global; + var ret= null; for( var i=0; i=}, // dependencies class names - * extendsClass{string}, // class to extend from - * extensdWith{object}, // actual prototype to extend - * aliases{Array}, // other class names - * onCreation{function=} // optional callback to call after class creation. - * onPreCreation{function=} // optional callback to call after namespace class creation. + * extendsClass{string}, // class to extend from + * extensdWith{object}, // actual prototype to extend + * aliases{Array} // other class names * } * + * @name Module + * @memberof CAAT + * @static + * * @param obj {object} - * @private */ - CAAT.Module= function loadModule(obj) { + NS.Module= function loadModule(obj) { if (!obj.defines) { console.error("Bad module definition: "+obj); @@ -758,17 +771,17 @@ TIME: 23:03:06 * @memberOf CAAT * @namespace */ - CAAT.ModuleManager= {}; + NS.ModuleManager= {}; /** * Define global base position for modules structure. * @param baseURL {string} * @return {*} */ - CAAT.ModuleManager.baseURL= function(baseURL) { + NS.ModuleManager.baseURL= function(baseURL) { if ( !baseURL ) { - return CAAT.Module; + return NS.Module; } if (!baseURL.endsWith("/") ) { @@ -776,7 +789,7 @@ TIME: 23:03:06 } ModuleManager.baseURL= baseURL; - return CAAT.ModuleManager; + return NS.ModuleManager; }; /** @@ -784,7 +797,7 @@ TIME: 23:03:06 * @param module {string} * @param path {string} */ - CAAT.ModuleManager.setModulePath= function( module, path ) { + NS.ModuleManager.setModulePath= function( module, path ) { if ( !path.endsWith("/") ) { path= path + "/"; @@ -805,7 +818,7 @@ TIME: 23:03:06 return a} */ behaviors:null, // contained behaviors array + recursiveCycleBehavior : false, + conforming : false, /** + * @param conforming {bool=} conform this behavior duration to that of its children. * @inheritDoc * @private */ - __init:function () { + __init:function ( conforming ) { this.__super(); this.behaviors = []; + if ( conforming ) { + this.conforming= true; + } return this; }, @@ -4633,6 +4689,20 @@ CAAT.Module({ return null; }, + setCycle : function( cycle, recurse ) { + CAAT.Behavior.ContainerBehavior.superclass.setCycle.call(this,cycle); + + if ( recurse ) { + for( var i=0; i=Math.PI) { + angle= (angle-2*Math.PI) + } + if ( angle<-2*Math.PI) { + angle= (angle+2*Math.PI); + } + } + if (this.doValueApplication) { actor.setRotationAnchored(angle, this.anchorX, this.anchorY); } @@ -6212,9 +6333,6 @@ CAAT.Module({ */ defines:"CAAT.Module.Audio.AudioManager", - depends:[ - "CAAT.Module.Runtime.BrowserInfo" - ], extendsWith:function () { return { @@ -6223,20 +6341,17 @@ CAAT.Module({ */ __init:function () { - this.browserInfo = CAAT.Module.Runtime.BrowserInfo; + this.isFirefox= navigator.userAgent.match(/Firefox/g)!==null; return this; }, + isFirefox : false, + /** * The only background music audio channel. */ musicChannel: null, - /** - * Some browser info needed to know whether we´re in FF so we can fix the loop bug. - */ - browserInfo:null, - /** * Is music enabled ? */ @@ -6267,15 +6382,29 @@ CAAT.Module({ */ loopingChannels:[], + /** + * available formats for audio elements. + * the system will load audio files with the extensions in this preferred order. + */ + audioFormatExtensions : [ + 'ogg', + 'wav', + 'x-wav', + 'mp3' + ], + + currentAudioFormatExtension : 'ogg', + /** * Audio formats. * @dict */ audioTypes:{ // supported audio formats. Don't remember where i took them from :S - 'mp3':'audio/mpeg;', - 'ogg':'audio/ogg; codecs="vorbis"', - 'wav':'audio/wav; codecs="1"', - 'mp4':'audio/mp4; codecs="mp4a.40.2"' + 'ogg': 'audio/ogg', + 'mp3': 'audio/mpeg;', + 'wav': 'audio/wav', + 'x-wav':'audio/x-wav', + 'mp4': 'audio/mp4"' }, /** @@ -6287,7 +6416,9 @@ CAAT.Module({ * * @return this. */ - initialize:function (numChannels) { + initialize:function (numChannels ) { + + this.setAudioFormatExtensions( this.audioFormatExtensions ); this.audioCache = []; this.channels = []; @@ -6331,6 +6462,45 @@ CAAT.Module({ return this; }, + + setAudioFormatExtensions : function( formats ) { + this.audioFormatExtensions= formats; + this.__setCurrentAudioFormatExtension(); + return this; + }, + + __setCurrentAudioFormatExtension : function( ) { + + var audio= new Audio(); + + for( var i= 0, l=this.audioFormatExtensions.length; i} @@ -8617,8 +8784,10 @@ CAAT.Module( { */ loadedCount: 0, + baseURL : null, + addElement : function( id, path ) { - this.elements.push( new descriptor(id,path,this) ); + this.elements.push( new descriptor(id,this.baseURL+path,this) ); return this; }, @@ -8648,6 +8817,11 @@ CAAT.Module( { } }, + setBaseURL : function( base ) { + this.baseURL= base; + return this; + }, + load: function( onfinished, onload_one, onerror ) { this.cfinished= onfinished; @@ -8765,7 +8939,61 @@ CAAT.Module( { } }); -/** +CAAT.Module({ + + defines : "CAAT.Module.Preloader.XHR", + extendsWith : { + + /** + * + * @param callback function({string},{object}) a callback function. string will be "ok" or "error" + * @param url {string} a url + * @param asynch {bool} load synchronous or asynchronously + * @param method {string} GET or POST + */ + load : function( callback, url, asynch, method ) { + + if (typeof asynch==="undefined") { + asynch= true; + } + if (typeof method==="undefined") { + method= "GET";; + } + + var req = false; + if(window.XMLHttpRequest && !(window.ActiveXObject)) { + try { + req = new XMLHttpRequest(); + } catch(e) { + req = false; + } + } else if(window.ActiveXObject) { + try { + req = new ActiveXObject("Msxml2.XMLHTTP"); + } catch(e) { + try { + req = new ActiveXObject("Microsoft.XMLHTTP"); + } catch(e) { + req = false; + } + } + } + + if(req) { + req.open(method, url, false); + req.onreadystatechange = function(e) { + if( req.status != 200 ) + return callback("error"); + + var text= e.currentTarget ? e.currentTarget.responseText : e.target.responseText; + callback("ok", text); + } ; + req.send(); + } + } + } + +});/** * See LICENSE file. */ CAAT.Module({ @@ -12189,8 +12417,8 @@ CAAT.Module( { * @param time {number} a value between 0 and 1 both inclusive. 0 will return path's starting coordinate. * 1 will return path's end coordinate. * @param open_contour {boolean=} treat this path as an open contour. It is intended for - * open paths, and interpolators which give values above 1. see @link - * @param tangent_threshold {number=} + * open paths, and interpolators which give values above 1. see tutorial 7.1. + * @link{../../documentation/tutorials/t7-1.html} * * @return {CAAT.Foundation.Point} */ @@ -16052,7 +16280,9 @@ CAAT.Module({ this.mapInfo = {}; this.animationsMap= {}; - if ( arguments.length===3 ) { + if ( arguments.length===1 ) { + this.initialize.call(this, arguments[0], 1, 1); + } else if ( arguments.length===3 ) { this.initialize.apply(this, arguments); } return this; @@ -16350,7 +16580,6 @@ CAAT.Module({ this.width= image.mapInfo[0].width; this.height= image.mapInfo[0].height; - } else { this.image = image; this.width = image.width; @@ -16419,6 +16648,27 @@ CAAT.Module({ return this; }, + /** + * Create elements as director.getImage values. + * Create as much as elements defined in this sprite image. + * The elements will be named prefix+ + * @param prefix + */ + addElementsAsImages : function( prefix ) { + for( var i in this.mapInfo ) { + var si= new CAAT.Foundation.SpriteImage().initialize( this.image, 1, 1 ); + si.addElement(0, this.mapInfo[i]); + si.setSpriteIndex(0); + CAAT.currentDirector.addImage( prefix+i, si ); + } + }, + + copy : function( other ) { + this.initialize(other,1,1); + this.mapInfo= other.mapInfo; + return this; + }, + /** * Must be used to draw actor background and the actor should have setClip(true) so that the image tiles * properly. @@ -16845,6 +17095,39 @@ CAAT.Module({ return this.mapInfo[ index ]; }, + initializeFromGlyphDesigner : function( text ) { + for (var i = 0; i < text.length; i++) { + if (0 === text[i].indexOf("char ")) { + var str = text[i].substring(5); + var pairs = str.split(' '); + var obj = { + x: 0, + y: 0, + width: 0, + height: 0, + xadvance: 0, + xoffset: 0, + yoffset: 0 + }; + + for (var j = 0; j < pairs.length; j++) { + var pair = pairs[j]; + var pairData = pair.split("="); + var key = pairData[0]; + var value = pairData[1]; + if (value.charAt(0) === '"' && value.charAt(value.length - 1) === '"') { + value.substring(1, value.length - 1); + } + obj[ key ] = value; + } + + this.addElement(String.fromCharCode(obj.id), obj); + } + } + + return this; + }, + /** * This method takes the output generated from the tool at http://labs.hyperandroid.com/static/texture/spriter.html * and creates a map into that image. @@ -16883,6 +17166,25 @@ CAAT.Module({ return this; }, + initializeFromTexturePackerJSON : function( image, obj ) { + + for( var img in obj.frames ) { + var imgData= obj.frames[img]; + + var si_obj= { + x: imgData.frame.x, + y: imgData.frame.y, + width: imgData.spriteSourceSize.w, + height: imgData.spriteSourceSize.h, + id: '0' + }; + + var si= new CAAT.Foundation.SpriteImage().initialize( image, 1, 1 ); + si.addElement(0,si_obj); + CAAT.currentDirector.addImage( img.substring(0,img.indexOf('.')), si ); + } + }, + /** * Add one element to the spriteImage. * @param key {string|number} index or sprite identifier. @@ -19377,6 +19679,15 @@ CAAT.Module({ */ endAnimate:function (director, time) { }, + + addActorImmediately: function(child,constraint) { + return this.addChildImmediately(child,constraint); + }, + + addActor : function( child, constraint ) { + return this.addChild(child,constraint); + }, + /** * Adds an Actor to this Container. * The Actor will be added ON METHOD CALL, despite the rendering pipeline stage being executed at @@ -20260,6 +20571,7 @@ CAAT.Module({ this.browserInfo = CAAT.Module.Runtime.BrowserInfo; this.audioManager = new CAAT.Module.Audio.AudioManager().initialize(8); this.scenes = []; + this.imagesCache= []; // input related variables initialization this.mousePoint = new CAAT.Math.Point(0, 0, 0); @@ -20634,6 +20946,11 @@ CAAT.Module({ return this.audioManager.cancelPlayByChannel(audioObject); }, + setAudioFormatExtensions : function( extensions ) { + this.audioManager.setAudioFormatExtensions(extensions); + return this; + }, + setValueForKey : function( key, value ) { this.__map[key]= value; return this; @@ -20956,6 +21273,10 @@ CAAT.Module({ }, setImagesCache:function (imagesCache, tpW, tpH) { + if (!imagesCache || !imagesCache.length ) { + return this; + } + var i; if (null !== this.glTextureManager) { @@ -21019,7 +21340,8 @@ CAAT.Module({ */ addImage:function (id, image, noUpdateGL) { if (this.getImage(id)) { - for (var i = 0; i < this.imagesCache.length; i++) { +// for (var i = 0; i < this.imagesCache.length; i++) { + for( var i in this.imagesCache ) { if (this.imagesCache[i].id === id) { this.imagesCache[i].image = image; break; @@ -21927,7 +22249,8 @@ CAAT.Module({ return ret; } - for (var i = 0; i < this.imagesCache.length; i++) { + //for (var i = 0; i < this.imagesCache.length; i++) { + for( var i in this.imagesCache ) { if (this.imagesCache[i].id === sId) { return this.imagesCache[i].image; } @@ -22290,7 +22613,7 @@ CAAT.Module({ // check for mouse move threshold. if (!this.dragging) { - if (Math.abs(this.prevMousePoint.x - pos.x) < CAAT.DRAG_THRESHOLD_X || + if (Math.abs(this.prevMousePoint.x - pos.x) < CAAT.DRAG_THRESHOLD_X && Math.abs(this.prevMousePoint.y - pos.y) < CAAT.DRAG_THRESHOLD_Y) { return; } @@ -23697,7 +24020,8 @@ CAAT.Module( { depends : [ "CAAT.Foundation.Actor", "CAAT.Foundation.SpriteImage", - "CAAT.Module.Font.Font" + "CAAT.Module.Font.Font", + "CAAT.Foundation.UI.Layout.LayoutManager" ], aliases : ["CAAT.UI.Label"], extendsClass : "CAAT.Foundation.Actor", @@ -23982,10 +24306,10 @@ CAAT.Module( { var image_width; - if ( r && c ) { + if ( typeof r!=="undefined" && typeof c!=="undefined" ) { image_width= image.getWidth(); } else { - image_width= image.getWrappedImageWidth(); + image_width= ( image instanceof CAAT.Foundation.SpriteImage ) ? image.getWidth() : image.getWrappedImageWidth(); } // la imagen cabe en este sitio. @@ -24214,6 +24538,8 @@ CAAT.Module( { c= pairs[2]|0; } this.__image( this.images[image], r, c ); + } else if (CAAT.currentDirector.getImage(image) ) { + this.__image( CAAT.currentDirector.getImage(image) ); } } else if ( tag.indexOf("a=")===0 ) { pairs= tag.split("="); @@ -24285,7 +24611,12 @@ CAAT.Module( { this.height= image.getHeight(); if ( this.image instanceof CAAT.SpriteImage || this.image instanceof CAAT.Foundation.SpriteImage ) { - this.spriteIndex= r*image.columns+c; + + if ( typeof r==="undefined" || typeof c==="undefined" ) { + this.spriteIndex= 0; + } else { + this.spriteIndex= r*image.columns+c; + } this.paint= this.paintSI; } @@ -24316,7 +24647,7 @@ CAAT.Module( { }, getHeight : function() { - return this.image instanceof CAAT.Foundation.SpriteImage ? this.image.singleHeight : this.image.height; + return this.image instanceof CAAT.Foundation.SpriteImage ? this.image.getHeight() : this.image.height; }, getFontMetrics : function() { @@ -24637,6 +24968,20 @@ CAAT.Module( { */ clickCallback : null, + matchTextSize : true, + + /** + * Make the label actor the size the label document has been calculated for. + * @param match {boolean} + */ + setMatchTextSize : function( match ) { + this.matchTextSize= match; + if ( match ) { + this.width= this.preferredSize.width; + this.height= this.preferredSize.height; + } + }, + setStyle : function( name, styleData ) { this.styles[ name ]= styleData; return this; @@ -24733,6 +25078,11 @@ CAAT.Module( { this.cacheAsBitmap(0,cached); } + if ( this.matchTextSize ) { + this.width= this.preferredSize.width; + this.height= this.preferredSize.height; + } + return this; }, @@ -24748,7 +25098,15 @@ CAAT.Module( { return this; }, - setDocumentPosition : function() { + setDocumentPosition : function( halign, valign ) { + + if ( typeof halign!=="undefined" ) { + this.setHorizontalAlignment(halign); + } + if ( typeof valign!=="undefined" ) { + this.setVerticalAlignment(valign); + } + var xo=0, yo=0; if ( this.valignment===CAAT.Foundation.UI.Layout.LayoutManager.ALIGNMENT.CENTER ) { diff --git a/build/caat-min.js b/build/caat-min.js index 377fe18c..98c85f05 100644 --- a/build/caat-min.js +++ b/build/caat-min.js @@ -22,32 +22,32 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -Version: 0.6 build: 29 +Version: 0.6 build: 6 Created on: -DATE: 2013-03-18 -TIME: 23:02:29 +DATE: 2013-07-01 +TIME: 04:58:33 */ -(function(a){function b(b){for(var b=b.split("."),c=a,d=0;d NOT solved."))},removeDependency:function(a){for(var b=0;b Can't extend non-existant class: "+this.baseClass);return}}else b= -e;b.extend(this.extendWith,this.constants,this.name,this.aliases,{decorated:this.decorated});console.log("Created module: "+this.name);this.callback&&this.callback()}};var g=function(a,b){this.path=a;this.module=b;return this};g.prototype={path:null,processed:false,module:null,setProcessed:function(){this.processed=true},isProcessed:function(){return this.processed}};var h=function(){this.nodes=[];this.loadedFiles=[];this.path={};this.solveListener=[];this.orderedSolvedModules=[];this.readyListener= -[];return this};h.baseURL="";h.modulePath={};h.sortedModulePath=[];h.symbol={};h.prototype={nodes:null,loadedFiles:null,solveListener:null,readyListener:null,orderedSolvedModules:null,addSolvedListener:function(a,b){this.solveListener.push({name:a,callback:b})},solved:function(a){var b;for(b=0;b catched "+d+" on module "+a.defines+" preCreation.")}if(!a.depends)a.depends= -[];if((b=a.depends)&&!isArray(b))b=[b],a.depends=b;for(c=0;c NOT solved."))},removeDependency:function(a){for(var b=0;b Can't extend non-existant class: "+this.baseClass);return}}else b=f;b.extend(this.extendWith,this.constants,this.name,this.aliases,{decorated:this.decorated});console.log("Created module: "+this.name);this.callback&&this.callback()}};var h=function(a,b){this.path=a;this.module=b;return this};h.prototype={path:null,processed:false,module:null,setProcessed:function(){this.processed=true},isProcessed:function(){return this.processed}};var i=function(){this.nodes=[];this.loadedFiles=[]; +this.path={};this.solveListener=[];this.orderedSolvedModules=[];this.readyListener=[];return this};i.baseURL="";i.modulePath={};i.sortedModulePath=[];i.symbol={};i.prototype={nodes:null,loadedFiles:null,solveListener:null,readyListener:null,orderedSolvedModules:null,addSolvedListener:function(a,b){this.solveListener.push({name:a,callback:b})},solved:function(a){var b;for(b=0;b catched "+ +d+" on module "+a.defines+" preCreation.")}if(!a.depends)a.depends=[];if((b=a.depends)&&!isArray(b))b=[b],a.depends=b;for(c=0;c>0,b[5]>>0);return this},transformRenderingContext_Clamp:function(a){var b=this.matrix;a.transform(b[0],b[3],b[1],b[4],b[2]>>0,b[5]>>0);return this},setModelViewMatrix:function(a,b,c,d,e){var f,g,h,i,j,k;k= this.matrix;d=1;j=g=0;i=1;c=Math.cos(e);e=Math.sin(e);f=d;h=j;d=f*c+g*e;g=-f*e+g*c;j=h*c+i*e;i=-h*e+i*c;d*=this.scaleX;g*=this.scaleY;j*=this.scaleX;i*=this.scaleY;k[0]=d;k[1]=g;k[2]=a;k[3]=j;k[4]=i;k[5]=b}}}}); CAAT.Module({defines:"CAAT.Math.Matrix3",aliases:["CAAT.Matrix3"],extendsWith:function(){return{matrix:null,fmatrix:null,__init:function(){this.matrix=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];this.fmatrix=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return this},transformCoord:function(a){var b=a.x,c=a.y,d=a.z;a.x=b*this.matrix[0][0]+c*this.matrix[0][1]+d*this.matrix[0][2]+this.matrix[0][3];a.y=b*this.matrix[1][0]+c*this.matrix[1][1]+d*this.matrix[1][2]+this.matrix[1][3];a.z=b*this.matrix[2][0]+c*this.matrix[2][1]+ d*this.matrix[2][2]+this.matrix[2][3];return a},initialize:function(a,b,c,d,e,f,g,h,i){this.identity();this.matrix[0][0]=a;this.matrix[0][1]=b;this.matrix[0][2]=c;this.matrix[1][0]=d;this.matrix[1][1]=e;this.matrix[1][2]=f;this.matrix[2][0]=g;this.matrix[2][1]=h;this.matrix[2][2]=i;return this},initWithMatrix:function(a){this.matrix=a;return this},flatten:function(){var a=this.fmatrix,b=this.matrix;a[0]=b[0][0];a[1]=b[1][0];a[2]=b[2][0];a[3]=b[3][0];a[4]=b[0][1];a[5]=b[1][1];a[6]=b[2][1];a[7]=b[2][1]; a[8]=b[0][2];a[9]=b[1][2];a[10]=b[2][2];a[11]=b[3][2];a[12]=b[0][3];a[13]=b[1][3];a[14]=b[2][3];a[15]=b[3][3];return this.fmatrix},identity:function(){for(var a=0;a<4;a++)for(var b=0;b<4;b++)this.matrix[a][b]=a===b?1:0;return this},getMatrix:function(){return this.matrix},rotateXY:function(a){return this.rotate(a,0,0)},rotateXZ:function(a){return this.rotate(0,a,0)},rotateYZ:function(a){return this.rotate(0,0,a)},setRotate:function(a,b,c){this.copy(this.rotate(a,b,c));return this},rotate:function(a, b,c){var d=new CAAT.Math.Matrix3,e,f;a!==0&&(f=new CAAT.Math.Math.Matrix3,e=Math.sin(a),a=Math.cos(a),f.matrix[1][1]=a,f.matrix[1][2]=-e,f.matrix[2][1]=e,f.matrix[2][2]=a,d.multiply(f));b!==0&&(f=new CAAT.Math.Matrix3,e=Math.sin(b),a=Math.cos(b),f.matrix[0][0]=a,f.matrix[0][2]=-e,f.matrix[2][0]=e,f.matrix[2][2]=a,d.multiply(f));c!==0&&(f=new CAAT.Math.Matrix3,e=Math.sin(c),a=Math.cos(c),f.matrix[0][0]=a,f.matrix[0][1]=-e,f.matrix[1][0]=e,f.matrix[1][1]=a,d.multiply(f));return d},getClone:function(){var a= -new CAAT.Math.Matrix3;a.copy(this);return a},multiply:function(a){var b=this.getClone().matrix,c=b[0][0],d=b[0][1],e=b[0][2],f=b[0][3],g=b[1][0],h=b[1][1],i=b[1][2],j=b[1][3],k=b[2][0],m=b[2][1],o=b[2][2],b=b[2][3],n=a.matrix,a=n[0][0],p=n[0][1],q=n[0][2],r=n[0][3],t=n[1][0],s=n[1][1],u=n[1][2],v=n[1][3],w=n[2][0],x=n[2][1],y=n[2][2],z=n[2][3],A=n[3][0],B=n[3][1],C=n[3][2],n=n[3][3];this.matrix[0][0]=c*a+d*t+e*w+f*A;this.matrix[0][1]=c*p+d*s+e*x+f*B;this.matrix[0][2]=c*q+d*u+e*y+f*C;this.matrix[0][3]= -c*r+d*v+e*z+f*n;this.matrix[1][0]=g*a+h*t+i*w+j*A;this.matrix[1][1]=g*p+h*s+i*x+j*B;this.matrix[1][2]=g*q+h*u+i*y+j*C;this.matrix[1][3]=g*r+h*v+i*z+j*n;this.matrix[2][0]=k*a+m*t+o*w+b*A;this.matrix[2][1]=k*p+m*s+o*x+b*B;this.matrix[2][2]=k*q+m*u+o*y+b*C;this.matrix[2][3]=k*r+m*v+o*z+b*n;return this},premultiply:function(a){var b=this.getClone().matrix,c=b[0][0],d=b[0][1],e=b[0][2],f=b[0][3],g=b[1][0],h=b[1][1],i=b[1][2],j=b[1][3],k=b[2][0],m=b[2][1],o=b[2][2],b=b[2][3],n=a.matrix,a=n[0][0],p=n[0][1], -q=n[0][2],r=n[0][3],t=n[1][0],s=n[1][1],u=n[1][2],v=n[1][3],w=n[2][0],x=n[2][1],y=n[2][2],n=n[2][3];this.matrix[0][0]=c*a+d*t+e*w;this.matrix[0][1]=c*p+d*s+e*x;this.matrix[0][2]=c*q+d*u+e*y;this.matrix[0][3]=c*r+d*v+e*n+f;this.matrix[1][0]=g*a+h*t+i*w;this.matrix[1][1]=g*p+h*s+i*x;this.matrix[1][2]=g*q+h*u+i*y;this.matrix[1][3]=g*r+h*v+i*n+j;this.matrix[2][0]=k*a+m*t+o*w;this.matrix[2][1]=k*p+m*s+o*x;this.matrix[2][2]=k*q+m*u+o*y;this.matrix[2][3]=k*r+m*v+o*n+b;return this},setTranslate:function(a, +new CAAT.Math.Matrix3;a.copy(this);return a},multiply:function(a){var b=this.getClone().matrix,c=b[0][0],d=b[0][1],e=b[0][2],f=b[0][3],g=b[1][0],h=b[1][1],i=b[1][2],j=b[1][3],k=b[2][0],m=b[2][1],o=b[2][2],b=b[2][3],n=a.matrix,a=n[0][0],p=n[0][1],q=n[0][2],r=n[0][3],u=n[1][0],t=n[1][1],s=n[1][2],w=n[1][3],v=n[2][0],x=n[2][1],y=n[2][2],z=n[2][3],A=n[3][0],B=n[3][1],C=n[3][2],n=n[3][3];this.matrix[0][0]=c*a+d*u+e*v+f*A;this.matrix[0][1]=c*p+d*t+e*x+f*B;this.matrix[0][2]=c*q+d*s+e*y+f*C;this.matrix[0][3]= +c*r+d*w+e*z+f*n;this.matrix[1][0]=g*a+h*u+i*v+j*A;this.matrix[1][1]=g*p+h*t+i*x+j*B;this.matrix[1][2]=g*q+h*s+i*y+j*C;this.matrix[1][3]=g*r+h*w+i*z+j*n;this.matrix[2][0]=k*a+m*u+o*v+b*A;this.matrix[2][1]=k*p+m*t+o*x+b*B;this.matrix[2][2]=k*q+m*s+o*y+b*C;this.matrix[2][3]=k*r+m*w+o*z+b*n;return this},premultiply:function(a){var b=this.getClone().matrix,c=b[0][0],d=b[0][1],e=b[0][2],f=b[0][3],g=b[1][0],h=b[1][1],i=b[1][2],j=b[1][3],k=b[2][0],m=b[2][1],o=b[2][2],b=b[2][3],n=a.matrix,a=n[0][0],p=n[0][1], +q=n[0][2],r=n[0][3],u=n[1][0],t=n[1][1],s=n[1][2],w=n[1][3],v=n[2][0],x=n[2][1],y=n[2][2],n=n[2][3];this.matrix[0][0]=c*a+d*u+e*v;this.matrix[0][1]=c*p+d*t+e*x;this.matrix[0][2]=c*q+d*s+e*y;this.matrix[0][3]=c*r+d*w+e*n+f;this.matrix[1][0]=g*a+h*u+i*v;this.matrix[1][1]=g*p+h*t+i*x;this.matrix[1][2]=g*q+h*s+i*y;this.matrix[1][3]=g*r+h*w+i*n+j;this.matrix[2][0]=k*a+m*u+o*v;this.matrix[2][1]=k*p+m*t+o*x;this.matrix[2][2]=k*q+m*s+o*y;this.matrix[2][3]=k*r+m*w+o*n+b;return this},setTranslate:function(a, b,c){this.identity();this.matrix[0][3]=a;this.matrix[1][3]=b;this.matrix[2][3]=c;return this},translate:function(a,b,c){var d=new CAAT.Math.Matrix3;d.setTranslate(a,b,c);return d},setScale:function(a,b,c){this.identity();this.matrix[0][0]=a;this.matrix[1][1]=b;this.matrix[2][2]=c;return this},scale:function(a,b,c){var d=new CAAT.Math.Matrix3;d.setScale(a,b,c);return d},rotateModelView:function(a,b,c){var d=Math.sin(a),e=Math.sin(b),f=Math.sin(c),a=Math.cos(a),b=Math.cos(b),c=Math.cos(c);this.matrix[0][0]= b*a;this.matrix[0][1]=-b*d;this.matrix[0][2]=e;this.matrix[0][3]=0;this.matrix[1][0]=f*e*a+d*c;this.matrix[1][1]=c*a-f*e*d;this.matrix[1][2]=-f*b;this.matrix[1][3]=0;this.matrix[2][0]=f*d-c*e*a;this.matrix[2][1]=c*e*d+f*a;this.matrix[2][2]=c*b;this.matrix[2][3]=0;this.matrix[3][0]=0;this.matrix[3][1]=0;this.matrix[3][2]=0;this.matrix[3][3]=1;return this},copy:function(a){for(var b=0;b<4;b++)for(var c=0;c<4;c++)this.matrix[b][c]=a.matrix[b][c];return this},calculateDeterminant:function(){var a=this.matrix, b=a[0][0],c=a[0][1],d=a[0][2],e=a[0][3],f=a[1][0],g=a[1][1],h=a[1][2],i=a[1][3],j=a[2][0],k=a[2][1],m=a[2][2],o=a[2][3],n=a[3][0],p=a[3][1],q=a[3][2],a=a[3][3];return e*g*m*n+c*i*m*n+e*h*j*p+d*i*j*p+d*f*o*p+b*h*o*p+e*f*k*q+b*i*k*q+d*g*j*a+c*h*j*a+c*f*m*a+b*g*m*a+e*h*k*n-d*i*k*n-d*g*o*n-c*h*o*n-e*f*m*p-b*i*m*p-e*g*j*q-c*i*j*q-c*f*o*q-b*g*o*q-d*f*k*a-b*h*k*a},getInverse:function(){var a=this.matrix,b=a[0][0],c=a[0][1],d=a[0][2],e=a[0][3],f=a[1][0],g=a[1][1],h=a[1][2],i=a[1][3],j=a[2][0],k=a[2][1],m= @@ -92,10 +92,10 @@ CAAT.Module({defines:"CAAT.Math.Point",aliases:["CAAT.Point"],extendsWith:functi return this},multiply:function(a){this.x*=a;this.y*=a;this.z*=a;return this},rotate:function(a){var b=this.x,c=this.y;this.x=b*Math.cos(a)-Math.sin(a)*c;this.y=b*Math.sin(a)+Math.cos(a)*c;this.z=0;return this},setAngle:function(a){var b=this.getLength();this.x=Math.cos(a)*b;this.y=Math.sin(a)*b;this.z=0;return this},setLength:function(a){var b=this.getLength();b?this.multiply(a/b):this.x=this.y=this.z=a;return this},normalize:function(){var a=this.getLength();this.x/=a;this.y/=a;this.z/=a;return this}, getAngle:function(){return Math.atan2(this.y,this.x)},limit:function(a){var b=this.getLengthSquared();if(b+0.01>a*a)b=Math.sqrt(b),this.x=this.x/b*a,this.y=this.y/b*a,this.z=this.z/b*a;return this},getLength:function(){var a=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z);return a<0.0050&&a>-0.0050?1.0E-6:a},getLengthSquared:function(){var a=this.x*this.x+this.y*this.y+this.z*this.z;return a<0.0050&&a>-0.0050?0:a},getDistance:function(a){var b=this.x-a.x,c=this.y-a.y,a=this.z-a.z;return Math.sqrt(b* b+c*c+a*a)},getDistanceSquared:function(a){var b=this.x-a.x,c=this.y-a.y,a=this.z-a.z;return b*b+c*c+a*a},toString:function(){return"(CAAT.Math.Point) x:"+String(Math.round(Math.floor(this.x*10))/10)+" y:"+String(Math.round(Math.floor(this.y*10))/10)+" z:"+String(Math.round(Math.floor(this.z*10))/10)}}}}); -CAAT.Module({defines:"CAAT.Math.Rectangle",aliases:["CAAT.Rectangle"],extendsWith:function(){return{__init:function(a,b,c,d){this.setLocation(a,b);this.setDimension(c,d)},x:0,y:0,x1:0,y1:0,width:-1,height:-1,setEmpty:function(){this.height=this.width=-1;this.y1=this.x1=this.y=this.x=0;return this},setLocation:function(a,b){this.x=a;this.y=b;this.x1=this.x+this.width;this.y1=this.y+this.height;return this},setDimension:function(a,b){this.width=a;this.height=b;this.x1=this.x+this.width;this.y1=this.y+ -this.height;return this},setBounds:function(a,b,c,d){this.setLocation(a,b);this.setDimension(c,d);return this},contains:function(a,b){return a>=this.x&&a=this.y&&bthis.y1)this.y1=b;if(a>this.x1)this.x1=a;this.width=this.x1- -this.x;this.height=this.y1-this.y}},unionRectangle:function(a){this.union(a.x,a.y);this.union(a.x1,a.y);this.union(a.x,a.y1);this.union(a.x1,a.y1);return this},intersects:function(a){return a.isEmpty()||this.isEmpty()?false:a.x1<=this.x?false:a.x>=this.x1?false:a.y1<=this.y?false:a.ythis.x1?false:b+d-1=this.x&&a=this.y&&bthis.y1)this.y1= +b;if(a>this.x1)this.x1=a;this.width=this.x1-this.x;this.height=this.y1-this.y}},unionRectangle:function(a){this.union(a.x,a.y);this.union(a.x1,a.y);this.union(a.x,a.y1);this.union(a.x1,a.y1);return this},intersects:function(a){return a.isEmpty()||this.isEmpty()?false:a.x1<=this.x?false:a.x>=this.x1?false:a.y1<=this.y?false:a.ythis.x1?false:b+d-1=this.behaviorStartTime&&(a=(a-this.behaviorStartTime)%this.behaviorDuration+this.behaviorStartTime);if(a>this.behaviorStartTime+this.behaviorDuration)return this.status!==e.EXPIRED&&this.setExpired(b,a),false;if(this.status===e.NOT_STARTED)this.status=e.STARTED,this.fireBehaviorStartedEvent(b,a);return this.behaviorStartTime<=a},fireBehaviorStartedEvent:function(a,b){for(var e= -0,f=this.lifecycleListenerList.length;e=this.behaviorStartTime&&(a=(a-this.behaviorStartTime)%this.behaviorDuration+this.behaviorStartTime);if(a>this.behaviorStartTime+this.behaviorDuration)return this.status!== +e.EXPIRED&&this.setExpired(b,a),false;if(this.status===e.NOT_STARTED)this.status=e.STARTED,this.fireBehaviorStartedEvent(b,a);return this.behaviorStartTime<=a},fireBehaviorStartedEvent:function(a,b){for(var e=0,f=this.lifecycleListenerList.length;e>=0;for(var d= "@-"+a+"-keyframes "+b+" {",a=0;a<=c;a++)b=""+a/c*100+"%{opacity: "+this.calculateKeyFrameData(a/c)+"}",d+=b;d+="}";return d}}}}); -CAAT.Module({defines:"CAAT.Behavior.ContainerBehavior",depends:["CAAT.Behavior.BaseBehavior","CAAT.Behavior.GenericBehavior"],aliases:["CAAT.ContainerBehavior"],extendsClass:"CAAT.Behavior.BaseBehavior",extendsWith:function(){return{parse:function(a){if(a.behaviors&&a.behaviors.length)for(var b=0;b=d)){d=(d-c.behaviorStartTime)/c.behaviorDuration;c=c.getKeyFrameDataValues(d); -for(var f in c)e[f]=c[f]}return e},calculateKeyFrameData:function(a,b){function c(a){if(f[a])h+=f[a];else if(prevValues&&(i=prevValues[a]))h+=i,f[a]=i}var d,e,f={},g;for(d=0;d=g&&(g=(g-e.behaviorStartTime)/e.behaviorDuration,g=e.calculateKeyFrameData(g),e=e.getPropertyName(b), -typeof f[e]==="undefined"&&(f[e]=""),f[e]+=g+" "));var h="",i;c("translate");c("rotate");c("scale");d="";h&&(d="-"+b+"-transform: "+h+";");h="";c("opacity");h&&(d+=" opacity: "+h+";");d+=" -webkit-transform-origin: 0% 0%";return{rules:d,ret:f}},calculateKeyFramesData:function(a,b,c,d,e){if(this.duration===Number.MAX_VALUE)return"";typeof d==="undefined"&&(d=0.5);typeof e==="undefined"&&(e=0.5);typeof c==="undefined"&&(c=100);for(var f="@-"+a+"-keyframes "+b+" {",g,h={},b=0;b<=c;b++){g=this.interpolator.getPosition(b/ -c).y;g=this.getKeyFrameDataValues(g);var i=""+b/c*100+"%{",j=g,k=void 0;for(k in h)j[k]||(j[k]=h[k]);h="-"+a+"-transform:";if(j.x||j.y)h+="translate("+(j.x||0)+"px,"+(j.y||0)+"px)";j.angle&&(h+=" rotate("+j.angle+"rad)");if(j.scaleX!==1||j.scaleY!==1)h+=" scale("+j.scaleX+","+j.scaleY+")";h+=";";j.alpha&&(h+=" opacity: "+j.alpha+";");if(d!==0.5||e!==0.5)h+=" -"+a+"-transform-origin:"+d*100+"% "+e*100+"%;";f+=i+h+"}\n";h=g}f+="}\n";return f}}}}); +CAAT.Module({defines:"CAAT.Behavior.ContainerBehavior",depends:["CAAT.Behavior.BaseBehavior","CAAT.Behavior.GenericBehavior"],aliases:["CAAT.ContainerBehavior"],extendsClass:"CAAT.Behavior.BaseBehavior",extendsWith:function(){return{parse:function(a){if(a.behaviors&&a.behaviors.length)for(var b=0;b=d)){d=(d-c.behaviorStartTime)/c.behaviorDuration; +c=c.getKeyFrameDataValues(d);for(var f in c)e[f]=c[f]}return e},calculateKeyFrameData:function(a,b){function c(a){if(f[a])h+=f[a];else if(prevValues&&(i=prevValues[a]))h+=i,f[a]=i}var d,e,f={},g;for(d=0;d=g&&(g=(g-e.behaviorStartTime)/e.behaviorDuration,g=e.calculateKeyFrameData(g), +e=e.getPropertyName(b),typeof f[e]==="undefined"&&(f[e]=""),f[e]+=g+" "));var h="",i;c("translate");c("rotate");c("scale");d="";h&&(d="-"+b+"-transform: "+h+";");h="";c("opacity");h&&(d+=" opacity: "+h+";");d+=" -webkit-transform-origin: 0% 0%";return{rules:d,ret:f}},calculateKeyFramesData:function(a,b,c,d,e){if(this.duration===Number.MAX_VALUE)return"";typeof d==="undefined"&&(d=0.5);typeof e==="undefined"&&(e=0.5);typeof c==="undefined"&&(c=100);for(var f="@-"+a+"-keyframes "+b+" {",g,h={},b=0;b<= +c;b++){g=this.interpolator.getPosition(b/c).y;g=this.getKeyFrameDataValues(g);var i=""+b/c*100+"%{",j=g,k=void 0;for(k in h)j[k]||(j[k]=h[k]);h="-"+a+"-transform:";if(j.x||j.y)h+="translate("+(j.x||0)+"px,"+(j.y||0)+"px)";j.angle&&(h+=" rotate("+j.angle+"rad)");if(j.scaleX!==1||j.scaleY!==1)h+=" scale("+j.scaleX+","+j.scaleY+")";h+=";";j.alpha&&(h+=" opacity: "+j.alpha+";");if(d!==0.5||e!==0.5)h+=" -"+a+"-transform-origin:"+d*100+"% "+e*100+"%;";f+=i+h+"}\n";h=g}f+="}\n";return f}}}}); CAAT.Module({defines:"CAAT.Behavior.GenericBehavior",depends:["CAAT.Behavior.BaseBehavior"],aliases:["CAAT.GenericBehavior"],extendsClass:"CAAT.Behavior.BaseBehavior",extendsWith:function(){return{start:0,end:0,target:null,property:null,callback:null,setForTime:function(a,b){var c=this.start+a*(this.end-this.start);this.callback&&this.callback(c,this.target,b);this.property&&(this.target[this.property]=c)},setValues:function(a,b,c,d,e){this.start=a;this.end=b;this.target=c;this.property=d;this.callback= e;return this}}}}); CAAT.Module({defines:"CAAT.Behavior.PathBehavior",aliases:["CAAT.PathBehavior"],depends:["CAAT.Behavior.BaseBehavior","CAAT.Foundation.SpriteImage"],constants:{AUTOROTATE:{LEFT_TO_RIGHT:0,RIGHT_TO_LEFT:1,FREE:2},autorotate:{LEFT_TO_RIGHT:0,RIGHT_TO_LEFT:1,FREE:2}},extendsClass:"CAAT.Behavior.BaseBehavior",extendsWith:function(){return{parse:function(a){CAAT.Behavior.PathBehavior.superclass.parse.call(this,a);a.SVG&&this.setValues((new CAAT.PathUtil.SVGPath).parsePath(a.SVG));if(a.autoRotate)this.autoRotate=a.autoRotate}, -path:null,autoRotate:false,prevX:-1,prevY:-1,autoRotateOp:CAAT.Behavior.PathBehavior.autorotate.FREE,isOpenContour:false,setOpenContour:function(a){this.isOpenContour=a;return this},getPropertyName:function(){return"translate"},setAutoRotate:function(a,b){this.autoRotate=a;if(b!==void 0)this.autoRotateOp=b;return this},setPath:function(a){this.path=a;return this},setValues:function(a){return this.setPath(a)},setTranslation:function(){return this},calculateKeyFrameData:function(a){a=this.interpolator.getPosition(a).y; -a=this.path.getPosition(a);return"translateX("+a.x+"px) translateY("+a.y+"px)"},getKeyFrameDataValues:function(a){var a=this.interpolator.getPosition(a).y,b=this.path.getPosition(a),c={x:b.x,y:b.y};if(this.autoRotate)a=a===0?b:this.path.getPosition(a-0.0010),b=Math.atan2(b.y-a.y,b.x-a.x),c.angle=b;return c},calculateKeyFramesData:function(a,b,c){typeof c==="undefined"&&(c=100);c>>=0;for(var d,e="@-"+a+"-keyframes "+b+" {",b=0;b<=c;b++)d=""+b/c*100+"%{-"+a+"-transform:"+this.calculateKeyFrameData(b/ -c)+"}",e+=d;e+="}";return e},setForTime:function(a,b){if(!this.path)return{x:b.x,y:b.y};var c=this.path.getPosition(a,this.isOpenContour,0.0010);if(this.autoRotate){if(-1===this.prevX&&-1===this.prevY)this.prevX=c.x,this.prevY=c.y;var d=c.x-this.prevX,e=c.y-this.prevY;if(d===0&&e===0)return b.setLocation(c.x,c.y),{x:b.x,y:b.y};var f=Math.atan2(e,d),g=CAAT.Foundation.SpriteImage,h=CAAT.Behavior.PathBehavior.AUTOROTATE;this.autoRotateOp===h.LEFT_TO_RIGHT?this.prevX<=c.x?b.setImageTransformation(g.TR_NONE): -(b.setImageTransformation(g.TR_FLIP_HORIZONTAL),f+=Math.PI):this.autoRotateOp===h.RIGHT_TO_LEFT&&(this.prevX<=c.x?b.setImageTransformation(g.TR_FLIP_HORIZONTAL):(b.setImageTransformation(g.TR_NONE),f-=Math.PI));b.setRotation(f);this.prevX=c.x;this.prevY=c.y;Math.sqrt(d*d+e*e)}return this.doValueApplication?(b.setLocation(c.x,c.y),{x:b.x,y:b.y}):{x:c.x,y:c.y}},positionOnTime:function(a){return this.isBehaviorInTime(a,null)?(a=this.normalizeTime(a),this.path.getPosition(a)):{x:-1,y:-1}}}}}); +path:null,autoRotate:false,prevX:-1,prevY:-1,autoRotateOp:CAAT.Behavior.PathBehavior.autorotate.FREE,isOpenContour:false,relativeX:0,relativeY:0,setOpenContour:function(a){this.isOpenContour=a;return this},getPropertyName:function(){return"translate"},setRelativeValues:function(a,b){this.relativeX=a;this.relativeY=b;this.isRelative=true;return this},setAutoRotate:function(a,b){this.autoRotate=a;if(b!==void 0)this.autoRotateOp=b;return this},setPath:function(a){this.path=a;return this},setValues:function(a){return this.setPath(a)}, +setTranslation:function(){return this},calculateKeyFrameData:function(a){a=this.interpolator.getPosition(a).y;a=this.path.getPosition(a);return"translateX("+a.x+"px) translateY("+a.y+"px)"},getKeyFrameDataValues:function(a){var a=this.interpolator.getPosition(a).y,b=this.path.getPosition(a),c={x:b.x,y:b.y};if(this.autoRotate)a=a===0?b:this.path.getPosition(a-0.0010),b=Math.atan2(b.y-a.y,b.x-a.x),c.angle=b;return c},calculateKeyFramesData:function(a,b,c){typeof c==="undefined"&&(c=100);c>>=0;for(var d, +e="@-"+a+"-keyframes "+b+" {",b=0;b<=c;b++)d=""+b/c*100+"%{-"+a+"-transform:"+this.calculateKeyFrameData(b/c)+"}",e+=d;e+="}";return e},setForTime:function(a,b){if(!this.path)return{x:b.x,y:b.y};var c=this.path.getPosition(a,this.isOpenContour,0.0010);this.isRelative&&(c.x+=this.relativeX,c.y+=this.relativeY);if(this.autoRotate){if(-1===this.prevX&&-1===this.prevY)this.prevX=c.x,this.prevY=c.y;var d=c.x-this.prevX,e=c.y-this.prevY;if(d===0&&e===0)return b.setLocation(c.x,c.y),{x:b.x,y:b.y};var f= +Math.atan2(e,d),g=CAAT.Foundation.SpriteImage,h=CAAT.Behavior.PathBehavior.AUTOROTATE;this.autoRotateOp===h.LEFT_TO_RIGHT?this.prevX<=c.x?b.setImageTransformation(g.TR_NONE):(b.setImageTransformation(g.TR_FLIP_HORIZONTAL),f+=Math.PI):this.autoRotateOp===h.RIGHT_TO_LEFT&&(this.prevX<=c.x?b.setImageTransformation(g.TR_FLIP_HORIZONTAL):(b.setImageTransformation(g.TR_NONE),f-=Math.PI));b.setRotation(f);this.prevX=c.x;this.prevY=c.y;Math.sqrt(d*d+e*e)}return this.doValueApplication?(b.setLocation(c.x, +c.y),{x:b.x,y:b.y}):{x:c.x,y:c.y}},positionOnTime:function(a){return this.isBehaviorInTime(a,null)?(a=this.normalizeTime(a),this.path.getPosition(a)):{x:-1,y:-1}}}}}); CAAT.Module({defines:"CAAT.Behavior.RotateBehavior",extendsClass:"CAAT.Behavior.BaseBehavior",depends:["CAAT.Behavior.BaseBehavior","CAAT.Foundation.Actor"],aliases:["CAAT.RotateBehavior"],extendsWith:function(){return{__init:function(){this.__super();this.anchor=CAAT.Foundation.Actor.ANCHOR_CENTER;return this},parse:function(a){CAAT.Behavior.RotateBehavior.superclass.parse.call(this,a);this.startAngle=a.start||0;this.endAngle=a.end||0;this.anchorX=typeof a.anchorX!=="undefined"?parseInt(a.anchorX): -0.5;this.anchorY=typeof a.anchorY!=="undefined"?parseInt(a.anchorY):0.5},startAngle:0,endAngle:0,anchorX:0.5,anchorY:0.5,getPropertyName:function(){return"rotate"},setForTime:function(a,b){var c=this.startAngle+a*(this.endAngle-this.startAngle);this.doValueApplication&&b.setRotationAnchored(c,this.anchorX,this.anchorY);return c},setValues:function(a,b,c,d){this.startAngle=a;this.endAngle=b;if(typeof c!=="undefined"&&typeof d!=="undefined")this.anchorX=c,this.anchorY=d;return this},setAngles:function(a, -b){return this.setValues(a,b)},setAnchor:function(a,b,c){this.anchorX=b/a.width;this.anchorY=c/a.height;return this},calculateKeyFrameData:function(a){a=this.interpolator.getPosition(a).y;return"rotate("+(this.startAngle+a*(this.endAngle-this.startAngle))+"rad)"},getKeyFrameDataValues:function(a){a=this.interpolator.getPosition(a).y;return{angle:this.startAngle+a*(this.endAngle-this.startAngle)}},calculateKeyFramesData:function(a,b,c){typeof c==="undefined"&&(c=100);c>>=0;for(var d,e="@-"+a+"-keyframes "+ -b+" {",b=0;b<=c;b++)d=""+b/c*100+"%{-"+a+"-transform:"+this.calculateKeyFrameData(b/c)+"; -"+a+"-transform-origin:"+this.anchorX*100+"% "+this.anchorY*100+"% }\n",e+=d;e+="}\n";return e}}}}); +0.5;this.anchorY=typeof a.anchorY!=="undefined"?parseInt(a.anchorY):0.5},startAngle:0,endAngle:0,anchorX:0.5,anchorY:0.5,rotationRelative:0,setRelativeValues:function(a){this.rotationRelative=a;this.isRelative=true;return this},getPropertyName:function(){return"rotate"},setForTime:function(a,b){var c=this.startAngle+a*(this.endAngle-this.startAngle);this.isRelative&&(c+=this.rotationRelative,c>=Math.PI&&(c-=2*Math.PI),c<-2*Math.PI&&(c+=2*Math.PI));this.doValueApplication&&b.setRotationAnchored(c, +this.anchorX,this.anchorY);return c},setValues:function(a,b,c,d){this.startAngle=a;this.endAngle=b;if(typeof c!=="undefined"&&typeof d!=="undefined")this.anchorX=c,this.anchorY=d;return this},setAngles:function(a,b){return this.setValues(a,b)},setAnchor:function(a,b,c){this.anchorX=b/a.width;this.anchorY=c/a.height;return this},calculateKeyFrameData:function(a){a=this.interpolator.getPosition(a).y;return"rotate("+(this.startAngle+a*(this.endAngle-this.startAngle))+"rad)"},getKeyFrameDataValues:function(a){a= +this.interpolator.getPosition(a).y;return{angle:this.startAngle+a*(this.endAngle-this.startAngle)}},calculateKeyFramesData:function(a,b,c){typeof c==="undefined"&&(c=100);c>>=0;for(var d,e="@-"+a+"-keyframes "+b+" {",b=0;b<=c;b++)d=""+b/c*100+"%{-"+a+"-transform:"+this.calculateKeyFrameData(b/c)+"; -"+a+"-transform-origin:"+this.anchorX*100+"% "+this.anchorY*100+"% }\n",e+=d;e+="}\n";return e}}}}); CAAT.Module({defines:"CAAT.Behavior.Scale1Behavior",depends:["CAAT.Behavior.BaseBehavior","CAAT.Foundation.Actor"],aliases:["CAAT.Scale1Behavior"],constants:{AXIS:{X:0,Y:1},Axis:{X:0,Y:1}},extendsClass:"CAAT.Behavior.BaseBehavior",extendsWith:function(){return{__init:function(){this.__super();this.anchor=CAAT.Foundation.Actor.ANCHOR_CENTER;return this},startScale:1,endScale:1,anchorX:0.5,anchorY:0.5,applyOnX:true,parse:function(a){CAAT.Behavior.Scale1Behavior.superclass.parse.call(this,a);this.startScale= a.start||0;this.endScale=a.end||0;this.anchorX=typeof a.anchorX!=="undefined"?parseInt(a.anchorX):0.5;this.anchorY=typeof a.anchorY!=="undefined"?parseInt(a.anchorY):0.5;this.applyOnX=a.axis?a.axis.toLowerCase()==="x":true},applyOnAxis:function(a){this.applyOnX=a===CAAT.Behavior.Scale1Behavior.AXIS.X?false:true},getPropertyName:function(){return"scale"},setForTime:function(a,b){var c=this.startScale+a*(this.endScale-this.startScale);0===c&&(c=0.01);this.doValueApplication&&(this.applyOnX?b.setScaleAnchored(c, b.scaleY,this.anchorX,this.anchorY):b.setScaleAnchored(b.scaleX,c,this.anchorX,this.anchorY));return c},setValues:function(a,b,c,d,e){this.startScale=a;this.endScale=b;this.applyOnX=!!c;if(typeof d!=="undefined"&&typeof e!=="undefined")this.anchorX=d,this.anchorY=e;return this},setAnchor:function(a,b,c){this.anchorX=b/a.width;this.anchorY=c/a.height;return this},calculateKeyFrameData:function(a){a=this.interpolator.getPosition(a).y;a=this.startScale+a*(this.endScale-this.startScale);return this.applyOnX? @@ -157,19 +159,20 @@ CAAT.Module({defines:"CAAT.Module.Runtime.BrowserInfo",constants:function(){func {string:navigator.platform,subString:"Mac",identity:"Mac"},{string:navigator.userAgent,subString:"iPhone",identity:"iPhone/iPod"},{string:navigator.platform,subString:"Linux",identity:"Linux"}],d=a([{string:navigator.userAgent,subString:"Chrome",identity:"Chrome"},{string:navigator.userAgent,subString:"OmniWeb",versionSearch:"OmniWeb/",identity:"OmniWeb"},{string:navigator.vendor,subString:"Apple",identity:"Safari",versionSearch:"Version"},{prop:window.opera,identity:"Opera"},{string:navigator.vendor, subString:"iCab",identity:"iCab"},{string:navigator.vendor,subString:"KDE",identity:"Konqueror"},{string:navigator.userAgent,subString:"Firefox",identity:"Firefox"},{string:navigator.vendor,subString:"Camino",identity:"Camino"},{string:navigator.userAgent,subString:"Netscape",identity:"Netscape"},{string:navigator.userAgent,subString:"MSIE",identity:"Explorer",versionSearch:"MSIE"},{string:navigator.userAgent,subString:"Explorer",identity:"Explorer",versionSearch:"Explorer"},{string:navigator.userAgent, subString:"Gecko",identity:"Mozilla",versionSearch:"rv"},{string:navigator.userAgent,subString:"Mozilla",identity:"Netscape",versionSearch:"Mozilla"}])||"An unknown browser",e=b(navigator.userAgent)||b(navigator.appVersion)||"an unknown version",c=a(c)||"an unknown OS";return{browser:d,version:e,OS:c,DevicePixelRatio:window.devicePixelRatio||1}}}); -CAAT.Module({defines:"CAAT.Module.Audio.AudioManager",depends:["CAAT.Module.Runtime.BrowserInfo"],extendsWith:function(){return{__init:function(){this.browserInfo=CAAT.Module.Runtime.BrowserInfo;return this},musicChannel:null,browserInfo:null,musicEnabled:true,fxEnabled:true,audioCache:null,channels:null,workingChannels:null,loopingChannels:[],audioTypes:{mp3:"audio/mpeg;",ogg:'audio/ogg; codecs="vorbis"',wav:'audio/wav; codecs="1"',mp4:'audio/mp4; codecs="mp4a.40.2"'},initialize:function(a){this.audioCache= -[];this.channels=[];this.workingChannels=[];for(var b=0;b<=a;b++){var c=document.createElement("audio");if(null!==c){c.finished=-1;this.channels.push(c);var d=this;c.addEventListener("ended",function(a){var a=a.target,b;for(b=0;b0){var b= -this.channels.shift();b.src=a.src;b.volume=a.volume;b.play();this.workingChannels.push(b)}return a},cancelPlay:function(a){for(var b=0;this.workingChannels.length;b++){var c=this.workingChannels[b];c.caat_id===a&&(c.pause(),this.channels.push(c),this.workingChannels.splice(b,1))}return this},cancelPlayByChannel:function(a){for(var b=0;this.workingChannels.length;b++)if(this.workingChannels[b]===a){this.channels.push(a);this.workingChannels.splice(b,1);break}return this},loop:function(a){if(!this.musicEnabled)return null; -a=this.getAudio(a);if(null!==a){var b=document.createElement("audio");if(null!==b)return b.src=a.src,b.preload="auto",this.browserInfo.browser==="Firefox"?b.addEventListener("ended",function(a){a.target.currentTime=0},false):b.loop=true,b.load(),b.play(),this.loopingChannels.push(b),b}return null},endSound:function(){var a;for(a=0;a0?(a=this.channels.shift(),a.src=b.src,a.volume=b.volume,a.play(),this.workingChannels.push(a)):console.log("Can't play audio: "+a);return b},cancelPlay:function(a){for(var b=0;this.workingChannels.length;b++){var c=this.workingChannels[b];c.caat_id===a&&(c.pause(),this.channels.push(c),this.workingChannels.splice(b,1))}return this},cancelPlayByChannel:function(a){for(var b=0;this.workingChannels.length;b++)if(this.workingChannels[b]=== +a){this.channels.push(a);this.workingChannels.splice(b,1);break}return this},loop:function(a){if(!this.musicEnabled)return null;a=this.getAudio(a);if(null!==a){var b=document.createElement("audio");if(null!==b)return b.src=a.src,b.preload="auto",this.isFirefox?b.addEventListener("ended",function(a){a.target.currentTime=0},false):b.loop=true,b.load(),b.play(),this.loopingChannels.push(b),b}return null},endSound:function(){var a;for(a=0;a=g)return{r:d,g:e,b:f};a=a+(d-a)/g*h>>0;b=b+(e-b)/g*h>>0;c=c+(f-c)/g*h>>0;a>255?a=255:a<0&&(a=0);b>255?b=255:b<0&&(b=0);c>255?c=255:c<0&&(c=0);return{r:a,g:b,b:c}},makeRGBColorRamp:function(a,b,c){var d= -[],e=a.length-1;b/=e;var f,g,h,i,j,k,m,o,n,p,q,r,t,s;for(f=0;f>24&255;n=(m&16711680)>>16;p=(m&65280)>>8;m&=255;g=a[f+1];q=g>>24&255;r=(g&16711680)>>16;t=(g&65280)>>8;g&=255;q=(q-o)/b;r=(r-n)/b;t=(t-p)/b;s=(g-m)/b;for(g=0;g>0;i=n+r*g>>0;j=p+t*g>>0;k=m+s*g>>0;var u=CAAT.Module.ColorUtil.Color.RampEnumeration;switch(c){case u.RAMP_RGBA:d.push("argb("+h+","+i+","+j+","+k+")");break;case u.RAMP_RGB:d.push("rgb("+i+","+j+","+k+")");break;case u.RAMP_CHANNEL_RGB:d.push(4278190080| -i<<16|j<<8|k);break;case u.RAMP_CHANNEL_RGBA:d.push(h<<24|i<<16|j<<8|k);break;case u.RAMP_CHANNEL_RGBA_ARRAY:d.push([i,j,k,h]);break;case u.RAMP_CHANNEL_RGB_ARRAY:d.push([i,j,k])}}}return d},random:function(){for(var a="#",b=0;b<3;b++)a+="0123456789abcdef"[Math.random()*16>>0];return a}},extendsWith:{__init:function(a,b,c){this.r=a||255;this.g=b||255;this.b=c||255;return this},r:255,g:255,b:255,toHex:function(){return("000000"+((this.r<<16)+(this.g<<8)+this.b).toString(16)).slice(-6)}}}); +[],e=a.length-1;b/=e;var f,g,h,i,j,k,m,o,n,p,q,r,u,t;for(f=0;f>24&255;n=(m&16711680)>>16;p=(m&65280)>>8;m&=255;g=a[f+1];q=g>>24&255;r=(g&16711680)>>16;u=(g&65280)>>8;g&=255;q=(q-o)/b;r=(r-n)/b;u=(u-p)/b;t=(g-m)/b;for(g=0;g>0;i=n+r*g>>0;j=p+u*g>>0;k=m+t*g>>0;var s=CAAT.Module.ColorUtil.Color.RampEnumeration;switch(c){case s.RAMP_RGBA:d.push("argb("+h+","+i+","+j+","+k+")");break;case s.RAMP_RGB:d.push("rgb("+i+","+j+","+k+")");break;case s.RAMP_CHANNEL_RGB:d.push(4278190080| +i<<16|j<<8|k);break;case s.RAMP_CHANNEL_RGBA:d.push(h<<24|i<<16|j<<8|k);break;case s.RAMP_CHANNEL_RGBA_ARRAY:d.push([i,j,k,h]);break;case s.RAMP_CHANNEL_RGB_ARRAY:d.push([i,j,k])}}}return d},random:function(){for(var a="#",b=0;b<3;b++)a+="0123456789abcdef"[Math.random()*16>>0];return a}},extendsWith:{__init:function(a,b,c){this.r=a||255;this.g=b||255;this.b=c||255;return this},r:255,g:255,b:255,toHex:function(){return("000000"+((this.r<<16)+(this.g<<8)+this.b).toString(16)).slice(-6)}}}); CAAT.Module({defines:"CAAT.Module.Debug.Debug",depends:["CAAT.Event.AnimationLoop"],extendsWith:{width:0,height:0,canvas:null,ctx:null,statistics:null,framerate:null,textContainer:null,textFPS:null,textEntitiesTotal:null,textEntitiesActive:null,textDraws:null,textDrawTime:null,textRAFTime:null,textDirtyRects:null,textDiscardDR:null,frameTimeAcc:0,frameRAFAcc:0,canDebug:false,SCALE:60,debugTpl:'
CAAT Debug panel Performance Controls Draw Time: 5.46 ms. FPS: 48
RAF Time: 20.76 ms. Entities Total: 41 Entities Active: 37 Draws: 0 DirtyRects: 0 Discard DR: 0
Sound
Music
AA Bounding Boxes
Bounding Boxes
Dirty Rects
', setScale:function(a){this.scale=a;return this},initialize:function(a,b){this.width=a=window.innerWidth;this.height=b;this.framerate={refreshInterval:CAAT.FPS_REFRESH||500,frames:0,timeLastRefresh:0,fps:0,prevFps:-1,fpsMin:1E3,fpsMax:0};if(!document.getElementById("caat-debug")){var c=document.createElement("div");c.innerHTML=this.debugTpl;document.body.appendChild(c);eval(' var __x= CAAT; function initCheck( name, bool, callback ) { var elem= document.getElementById(name); if ( elem ) { elem.className= (bool) ? "checkbox_enabled" : "checkbox_disabled"; if ( callback ) { elem.addEventListener( "click", (function(elem, callback) { return function(e) { elem.__value= !elem.__value; elem.className= (elem.__value) ? "checkbox_enabled" : "checkbox_disabled"; callback(e,elem.__value); } })(elem, callback), false ); } elem.__value= bool; } } function setupTabs() { var numTabs=0; var elem; var elemContent; do { elem= document.getElementById("caat-debug-tab"+numTabs); if ( elem ) { elemContent= document.getElementById("caat-debug-tab"+numTabs+"-content"); if ( elemContent ) { elemContent.style.display= numTabs===0 ? \'block\' : \'none\'; elem.className= numTabs===0 ? "debug_tab debug_tab_selected" : "debug_tab debug_tab_not_selected"; elem.addEventListener( "click", (function(tabIndex) { return function(e) { for( var i=0; i>0)-0.5;b.moveTo(0.5,c);b.lineTo(this.width+0.5,c);b.stroke();b.strokeStyle="#aa2";b.beginPath();c=this.height-(30/this.SCALE*this.height>>0)-0.5;b.moveTo(0.5,c);b.lineTo(this.width+0.5,c);b.stroke();c=Math.min(this.height-this.framerate.fps/this.SCALE*this.height,59);if(-1===this.framerate.prevFps)this.framerate.prevFps=c|0;b.strokeStyle= "#0ff";b.beginPath();b.moveTo(this.width,(c|0)-0.5);b.lineTo(this.width,this.framerate.prevFps-0.5);b.stroke();this.framerate.prevFps=c;a=(this.height-a/this.SCALE*this.height>>0)-0.5;b.strokeStyle="#ff0";b.beginPath();b.moveTo(this.width,a);b.lineTo(this.width,a);b.stroke()}}}); -CAAT.Module({defines:"CAAT.Module.Font.Font",aliases:"CAAT.Font",depends:["CAAT.Foundation.SpriteImage"],constants:{getFontMetrics:function(a){var b;if(CAAT.CSS_TEXT_METRICS)try{return b=CAAT.Module.Font.Font.getFontMetricsCSS(a)}catch(c){}return CAAT.Module.Font.Font.getFontMetricsNoCSS(a)},getFontMetricsNoCSS:function(a){var a=/(\d+)p[x|t]/i.exec(a),b;b=a?a[1]|0:32;a=b-1;b=b+b*0.2|0;return{height:b,ascent:a,descent:b-a}},getFontMetricsCSS:function(a){function b(a){var b,c,d;d=a&&a.ownerDocument; +CAAT.Module({defines:"CAAT.Module.Font.Font",aliases:"CAAT.Font",depends:["CAAT.Foundation.SpriteImage"],constants:{getFontMetrics:function(a){var b;if(CAAT.CSS_TEXT_METRICS)try{return b=CAAT.Module.Font.Font.getFontMetricsCSS(a)}catch(c){}return CAAT.Module.Font.Font.getFontMetricsNoCSS(a)},getFontMetricsNoCSS:function(a){var a=/(\d+)p[x|t]\s*/i.exec(a),b;b=a?a[1]|0:32;a=b-1;b=b+b*0.2|0;return{height:b,ascent:a,descent:b-a}},getFontMetricsCSS:function(a){function b(a){var b,c,d;d=a&&a.ownerDocument; b=d.documentElement;a=a.getBoundingClientRect();c=document.body;d=d.nodeType===9?d.defaultView||d.parentWindow:false;return{top:a.top+(d.pageYOffset||b.scrollTop)-(b.clientTop||c.clientTop||0),left:a.left+(d.pageXOffset||b.scrollLeft)-(b.clientLeft||c.clientLeft||0)}}try{var c=document.createElement("span");c.style.font=a;c.innerHTML="Hg";var d=document.createElement("div");d.style.display="inline-block";d.style.width="1px";d.style.heigh="0px";var e=document.createElement("div");e.appendChild(c); e.appendChild(d);var f=document.body;f.appendChild(e);try{return a={},d.style.verticalAlign="baseline",a.ascent=b(d).top-b(c).top,d.style.verticalAlign="bottom",a.height=b(d).top-b(c).top,a.ascent=Math.ceil(a.ascent),a.height=Math.ceil(a.height),a.descent=a.height-a.ascent,a}finally{f.removeChild(e)}}catch(g){return null}}},extendsWith:function(){return{fontSize:10,fontSizeUnit:"px",font:"Sans-Serif",fontStyle:"",fillStyle:"#fff",strokeStyle:null,strokeSize:1,padding:0,image:null,charMap:null,height:0, ascent:0,descent:0,setPadding:function(a){this.padding=a;return this},setFontStyle:function(a){this.fontStyle=a;return this},setStrokeSize:function(a){this.strokeSize=a;return this},setFontSize:function(a){this.fontSize=a;this.fontSizeUnit="px";return this},setFont:function(a){this.font=a;return this},setFillStyle:function(a){this.fillStyle=a;return this},setStrokeStyle:function(a){this.strokeStyle=a;return this},createDefault:function(a){for(var b="",c=32;c<128;c++)b+=String.fromCharCode(c);return this.create(b, a)},create:function(a,b){b|=0;this.padding=b;var c=document.createElement("canvas"),d=c.getContext("2d");d.textBaseline="bottom";d.font=this.fontStyle+" "+this.fontSize+""+this.fontSizeUnit+" "+this.font;var e=0,f=[],g,h;for(g=0;g>0)+1)+2*b;f.push(i);e+=i}g=CAAT.Font.getFontMetrics(d.font);d=g.height;this.ascent=g.ascent;this.descent=g.descent;this.height=g.height;i=g.ascent;c.width=e;c.height=d;d=c.getContext("2d");d.textBaseline= -"alphabetic";d.font=this.fontStyle+" "+this.fontSize+""+this.fontSizeUnit+" "+this.font;d.fillStyle=this.fillStyle;d.strokeStyle=this.strokeStyle;this.charMap={};for(g=e=0;g0&&g.height>0&&b.drawImage(this.image,g.x,0,h,i,c,d,h,i),c+=h):(b.strokeStyle="#f00",b.strokeRect(c,d,10,i),c+=10)},save:function(){var a=this.image.toDataURL("image/png");document.location.href=a.replace("image/png","image/octet-stream")},drawSpriteText:function(a,b){this.spriteImage.drawSpriteText(a,b)}}}}); +"alphabetic";d.font=this.fontStyle+" "+this.fontSize+""+this.fontSizeUnit+" "+this.font;d.fillStyle=this.fillStyle;d.strokeStyle=this.strokeStyle;this.charMap={};for(g=e=0;g0&&g.height>0&&b.drawImage(this.image,g.x,0,h,i,c,d,h,i),c+=h):(b.strokeStyle="#f00",b.strokeRect(c,d,10,i),c+=10)},save:function(){var a=this.image.toDataURL("image/png");document.location.href=a.replace("image/png","image/octet-stream")},drawSpriteText:function(a,b){this.spriteImage.drawSpriteText(a,b)}}}}); CAAT.Module({defines:"CAAT.Module.CircleManager.PackedCircle",depends:["CAAT.Module.CircleManager.PackedCircle","CAAT.Math.Point"],constants:{BOUNDS_RULE_WRAP:1,BOUNDS_RULE_CONSTRAINT:2,BOUNDS_RULE_DESTROY:4,BOUNDS_RULE_IGNORE:8},extendsWith:{__init:function(){this.boundsRule=CAAT.Module.CircleManager.PackedCircle.BOUNDS_RULE_IGNORE;this.position=new CAAT.Math.Point(0,0,0);this.offset=new CAAT.Math.Point(0,0,0);this.targetPosition=new CAAT.Math.Point(0,0,0);return this},id:0,delegate:null,position:null, offset:null,targetPosition:null,targetChaseSpeed:0.02,isFixed:false,boundsRule:0,collisionMask:0,collisionGroup:0,containsPoint:function(a){return this.position.getDistanceSquared(a)this.bounds.bottom)a.position.y=this.bounds.top-e;else if(b&4&&d+f null,f=Number.MAX_VALUE,g=0;gd?e=-1:c=0;a--)this.allCircles[a]===null&&this.allCircles.splice(a,1)},initialize:function(a){if(a)for(var b in a)this[b]=a[b];return this}}}); CAAT.Module({defines:"CAAT.Module.Preloader.Preloader",extendsWith:function(){var a=function(a,c,d){this.id=a;this.path=c;this.image=new Image;this.loader=d;this.image.onload=this.onload.bind(this);this.image.onerror=this.onerror.bind(this);return this};a.prototype={id:null,path:null,image:null,loader:null,onload:function(){this.loader.__onload(this);this.image.onload=null;this.image.onerror=null},onerror:function(){this.loader.__onerror(this)},load:function(){this.image.src=this.path},clear:function(){this.loader= -null}};return{__init:function(){this.elements=[];return this},elements:null,imageCounter:0,cfinished:null,cloaded:null,cerrored:null,loadedCount:0,addElement:function(b,c){this.elements.push(new a(b,c,this));return this},clear:function(){for(var a=0;a>=0;var d=true,e=true,f=true,g=true;if(typeof c!== "undefined"){if(typeof c.top!=="undefined")d=c.top;if(typeof c.bottom!=="undefined")e=c.bottom;if(typeof c.left!=="undefined")f=c.left;if(typeof c.right!=="undefined")g=c.right}c=document.createElement("canvas");c.width=a.width;c.height=a.height;var h=c.getContext("2d");h.fillStyle="rgba(0,0,0,0)";h.fillRect(0,0,a.width,a.height);h.drawImage(a,0,0);var i=h.getImageData(0,0,a.width,a.height).data,j,a=0,k=c.height-1,m=0,o=c.width-1,n=false;if(d){for(d=0;d0?c=Math.ceil((d+b-1)/b):b=Math.ceil((d+c-1)/c) e=0,f=0,g;b>0?c=Math.ceil((d+b-1)/b):b=Math.ceil((d+c-1)/c);for(g=0;g>0)*e;var k=i+(d/h>>0)*f,m=g+e,o=k+f;g=(new CAAT.Foundation.SpriteImageHelper(g,k,m-g,o-k,j.width,j.height)).setGL(g/j.width,k/j.height,m/j.width,o/j.height);this.mapInfo[d]=g}}else for(d=0;d0&&(f-=d);var g=(this.offsetY-this.ownerActor.y)%e;g>0&&(g-=e);for(var d=((c.width-f)/d>>0)+1,e=((c.height-g)/e>>0)+1,h,i=a.ctx, -a=0;a>0,c.y-this.ownerActor.y+g+a*b.height>>0,b.width,b.height)},paintInvertedH:function(a,b,c,d){b=this.mapInfo[this.spriteIndex];a=a.ctx;a.save();a.translate((c|0)+b.width,d|0);a.scale(-1,1);a.drawImage(this.image,b.x,b.y,b.width,b.height,this.offsetX>>0,this.offsetY>>0,b.width,b.height);a.restore();return this},paintInvertedV:function(a,b,c,d){b=this.mapInfo[this.spriteIndex];a=a.ctx;a.save(); -a.translate(c|0,d+b.height|0);a.scale(1,-1);a.drawImage(this.image,b.x,b.y,b.width,b.height,this.offsetX>>0,this.offsetY>>0,b.width,b.height);a.restore();return this},paintInvertedHV:function(a,b,c,d){b=this.mapInfo[this.spriteIndex];a=a.ctx;a.save();a.translate(c|0,d+b.height|0);a.scale(1,-1);a.translate(b.width,0);a.scale(-1,1);a.drawImage(this.image,b.x,b.y,b.width,b.height,this.offsetX>>0,this.offsetY>>0,b.width,b.height);a.restore();return this},paintN:function(a,b,c,d){b=this.mapInfo[this.spriteIndex]; -a.ctx.drawImage(this.image,b.x,b.y,b.width,b.height,this.offsetX+c>>0,this.offsetY+d>>0,b.width,b.height);return this},paintAtRect:function(a,b,c,d,e,f){b=this.mapInfo[this.spriteIndex];a.ctx.drawImage(this.image,b.x,b.y,b.width,b.height,this.offsetX+c>>0,this.offsetY+d>>0,e,f);return this},paintScaledWidth:function(a,b,c,d){b=this.mapInfo[this.spriteIndex];a.ctx.drawImage(this.image,b.x,b.y,b.width,b.height,this.offsetX+c>>0,this.offsetY+d>>0,this.ownerActor.width,b.height);return this},paintChunk:function(a, -b,c,d,e,f,g){a.drawImage(this.image,d,e,f,g,b,c,f,g)},paintTile:function(a,b,c,d){b=this.mapInfo[b];a.drawImage(this.image,b.x,b.y,b.width,b.height,this.offsetX+c>>0,this.offsetY+d>>0,b.width,b.height);return this},paintScaled:function(a,b,c,d){b=this.mapInfo[this.spriteIndex];a.ctx.drawImage(this.image,b.x,b.y,b.width,b.height,this.offsetX+c>>0,this.offsetY+d>>0,this.ownerActor.width,this.ownerActor.height);return this},getCurrentSpriteImageCSSPosition:function(){var a=this.mapInfo[this.spriteIndex]; -return""+-(a.x+this.parentOffsetX-this.offsetX)+"px "+-(a.y+this.parentOffsetY-this.offsetY)+"px "+(this.ownerActor.transformation===CAAT.Foundation.SpriteImage.TR_TILE?"repeat":"no-repeat")},getNumImages:function(){return this.rows*this.columns},setUV:function(a,b){var c=this.image;if(c.__texturePage){var d=b,e=this.mapInfo[this.spriteIndex],f=e.u,g=e.v,h=e.u1,e=e.v1;if(this.offsetX||this.offsetY)f=c.__texturePage,g=-this.offsetY/f.height,h=(this.ownerActor.width-this.offsetX)/f.width,e=(this.ownerActor.height- -this.offsetY)/f.height,f=-this.offsetX/f.width+c.__u,g+=c.__v,h+=c.__u,e+=c.__v;c.inverted?(a[d++]=h,a[d++]=g,a[d++]=h,a[d++]=e,a[d++]=f,a[d++]=e,a[d++]=f,a[d++]=g):(a[d++]=f,a[d++]=g,a[d++]=h,a[d++]=g,a[d++]=h,a[d++]=e,a[d++]=f,a[d++]=e)}},setChangeFPS:function(a){this.changeFPS=a;return this},setSpriteTransformation:function(a){this.transformation=a;var b=CAAT.Foundation.SpriteImage;switch(a){case b.TR_FLIP_HORIZONTAL:this.paint=this.paintInvertedH;break;case b.TR_FLIP_VERTICAL:this.paint=this.paintInvertedV; -break;case b.TR_FLIP_ALL:this.paint=this.paintInvertedHV;break;case b.TR_FIXED_TO_SIZE:this.paint=this.paintScaled;break;case b.TR_FIXED_WIDTH_TO_SIZE:this.paint=this.paintScaledWidth;break;case b.TR_TILE:this.paint=this.paintTiled;break;default:this.paint=this.paintN}this.ownerActor.invalidate();return this},resetAnimationTime:function(){this.prevAnimationTime=-1;return this},setAnimationImageIndex:function(a){this.animationImageIndex=a;this.spriteIndex=a[0];this.prevAnimationTime=-1;return this}, -setSpriteIndex:function(a){this.spriteIndex=a;return this},setSpriteIndexAtTime:function(a){if(this.animationImageIndex.length>1){if(this.prevAnimationTime===-1)this.prevAnimationTime=a,this.spriteIndex=this.animationImageIndex[0],this.prevIndex=0;else{var b=a;b-=this.prevAnimationTime;b/=this.changeFPS;b%=this.animationImageIndex.length;b=Math.floor(b);b>0,f=0;fa&&(a=c)}this.fontHeight=a;return this.fontHeight*this.fontScale},drawText:function(a,b,c,d){var e,f,g;for(e=0;e0&&f.height>0&&b.drawImage(this.image,f.x,f.y,g,f.height,c+f.xoffset*this.fontScale,d+f.yoffset*this.fontScale,g*this.fontScale,f.height*this.fontScale),c+=f.xadvance*this.fontScale},getFontData:function(){var a=this.stringHeight()*0.8>>0; -return{height:this.stringHeight(),ascent:a,descent:this.stringHeight()-a}}}}}); -CAAT.Module({defines:"CAAT.Foundation.Actor",aliases:["CAAT.Actor"],depends:"CAAT.Event.AnimationLoop,CAAT.Foundation.SpriteImage,CAAT.Core.Constants,CAAT.Behavior.PathBehavior,CAAT.Behavior.RotateBehavior,CAAT.Behavior.ScaleBehavior,CAAT.Behavior.Scale1Behavior,CAAT.PathUtil.LinearPath,CAAT.Event.AnimationLoop".split(","),constants:{ANCHOR_CENTER:0,ANCHOR_TOP:1,ANCHOR_BOTTOM:2,ANCHOR_LEFT:3,ANCHOR_RIGHT:4,ANCHOR_TOP_LEFT:5,ANCHOR_TOP_RIGHT:6,ANCHOR_BOTTOM_LEFT:7,ANCHOR_BOTTOM_RIGHT:8,ANCHOR_CUSTOM:9, -CACHE_NONE:0,CACHE_SIMPLE:1,CACHE_DEEP:2},extendsWith:function(){var a=0;return{__init:function(){this.behaviorList=[];this.lifecycleListenerList=[];this.AABB=new CAAT.Math.Rectangle;this.viewVertices=[new CAAT.Math.Point(0,0,0),new CAAT.Math.Point(0,0,0),new CAAT.Math.Point(0,0,0),new CAAT.Math.Point(0,0,0)];this.scaleAnchor=CAAT.Foundation.Actor.ANCHOR_CENTER;this.modelViewMatrix=new CAAT.Math.Matrix;this.worldModelViewMatrix=new CAAT.Math.Matrix;this.resetTransform();this.setScale(1,1);this.setRotation(0); -this.id=a++;return this},__super:null,lifecycleListenerList:null,behaviorList:null,parent:null,x:0,y:0,width:0,height:0,preferredSize:null,minimumSize:null,start_time:0,duration:Number.MAX_VALUE,clip:false,clipPath:null,tAnchorX:0,tAnchorY:0,scaleX:1,scaleY:1,scaleTX:0.5,scaleTY:0.5,scaleAnchor:0,rotationAngle:0,rotationY:0.5,rotationX:0.5,alpha:1,isGlobalAlpha:false,frameAlpha:1,expired:false,discardable:false,pointed:false,mouseEnabled:true,visible:true,fillStyle:null,strokeStyle:null,time:0,AABB:null, -viewVertices:null,inFrame:false,dirty:true,wdirty:true,oldX:-1,oldY:-1,modelViewMatrix:null,worldModelViewMatrix:null,modelViewMatrixI:null,worldModelViewMatrixI:null,glEnabled:false,backgroundImage:null,id:null,size_active:1,size_total:1,__d_ax:-1,__d_ay:-1,gestureEnabled:false,invalid:true,cached:0,preventLayout:false,isAA:true,setPreventLayout:function(a){this.preventLayout=a;return this},invalidateLayout:function(){this.parent&&!this.parent.layoutInvalidated&&this.parent.invalidateLayout();return this}, -__validateLayout:function(){},setPreferredSize:function(a,c){if(!this.preferredSize)this.preferredSize=new CAAT.Math.Dimension;this.preferredSize.width=a;this.preferredSize.height=c;return this},getPreferredSize:function(){return this.preferredSize?this.preferredSize:this.getMinimumSize()},setMinimumSize:function(a,c){if(!this.minimumSize)this.minimumSize=new CAAT.Math.Dimension;this.minimumSize.width=a;this.minimumSize.height=c;return this},getMinimumSize:function(){return this.minimumSize?this.minimumSize: -new CAAT.Math.Dimension(this.width,this.height)},create:function(){return this},moveTo:function(a,c,d,e,f,g){if(!(a===this.x&&c===this.y)){var h=this.getBehavior("__moveTo");h||(h=(new CAAT.Behavior.PathBehavior).setId("__moveTo").setValues(new CAAT.PathUtil.LinearPath),this.addBehavior(h));h.path.setInitialPosition(this.x,this.y).setFinalPosition(a,c);h.setDelayTime(e?e:0,d);f&&h.setInterpolator(f);if(g)h.lifecycleListenerList=[],h.addListener({behaviorExpired:function(a,b,c){g(a,b,c)}});return this}}, -rotateTo:function(a,c,d,e,f,g){if(a!==this.rotationAngle){var h=this.getBehavior("__rotateTo");h||(h=(new CAAT.Behavior.RotateBehavior).setId("__rotateTo").setValues(0,0,0.5,0.5),this.addBehavior(h));h.setValues(this.rotationAngle,a,e,f).setDelayTime(d?d:0,c);g&&h.setInterpolator(g);return this}},scaleTo:function(a,c,d,e,f,g,h){if(!(this.scaleX===a&&this.scaleY===c)){var i=this.getBehavior("__scaleTo");i||(i=(new CAAT.Behavior.ScaleBehavior).setId("__scaleTo").setValues(1,1,1,1,0.5,0.5),this.addBehavior(i)); -i.setValues(this.scaleX,a,this.scaleY,c,f,g).setDelayTime(e?e:0,d);h&&i.setInterpolator(h);return this}},scaleXTo:function(a,c,d,e,f,g){return this.__scale1To(CAAT.Behavior.Scale1Behavior.AXIS_X,a,c,d,e,f,g)},scaleYTo:function(a,c,d,e,f,g){return this.__scale1To(CAAT.Behavior.Scale1Behavior.AXIS_Y,a,c,d,e,f,g)},__scale1To:function(a,c,d,e,f,g,h){if(!(a===CAAT.Behavior.Scale1Behavior.AXIS_X&&c===this.scaleX||a===CAAT.Behavior.Scale1Behavior.AXIS_Y&&c===this.scaleY)){var i=this.getBehavior("__scaleXTo"); -i||(i=(new CAAT.Behavior.Scale1Behavior).setId("__scaleXTo").setValues(1,1,a===CAAT.Behavior.Scale1Behavior.AXIS_X,0.5,0.5),this.addBehavior(i));i.setValues(a?this.scaleX:this.scaleY,c,f,g).setDelayTime(e?e:0,d);h&&i.setInterpolator(h);return this}},touchStart:function(){},touchMove:function(){},touchEnd:function(){},gestureStart:function(){},gestureChange:function(a,c,d){this.gestureEnabled&&(this.setRotation(a),this.setScale(c,d));return this},gestureEnd:function(){},isVisible:function(){return this.visible}, -invalidate:function(){this.invalid=true;return this},setGestureEnabled:function(a){this.gestureEnabled=!!a;return this},isGestureEnabled:function(){return this.gestureEnabled},getId:function(){return this.id},setId:function(a){this.id=a;return this},setParent:function(a){this.parent=a;return this},setBackgroundImage:function(a,c){if(a){a=a instanceof CAAT.Foundation.SpriteImage?a.getRef():isString(a)?(new CAAT.Foundation.SpriteImage).initialize(CAAT.currentDirector.getImage(a),1,1):(new CAAT.Foundation.SpriteImage).initialize(a, -1,1);a.setOwner(this);this.backgroundImage=a;if(typeof c==="undefined"||c)this.width=a.getWidth(),this.height=a.getHeight();this.glEnabled=true;this.invalidate()}else this.backgroundImage=null;return this},setSpriteIndex:function(a){this.backgroundImage&&(this.backgroundImage.setSpriteIndex(a),this.invalidate());return this},setBackgroundImageOffset:function(a,c){this.backgroundImage&&this.backgroundImage.setOffset(a,c);return this},setAnimationImageIndex:function(a){this.backgroundImage&&(this.backgroundImage.resetAnimationTime(), -this.backgroundImage.setAnimationImageIndex(a),this.invalidate());return this},addAnimation:function(a,c,d,e){this.backgroundImage&&this.backgroundImage.addAnimation(a,c,d,e);return this},playAnimation:function(a){this.backgroundImage&&this.backgroundImage.playAnimation(a);return this},setAnimationEndCallback:function(a){this.backgroundImage&&this.backgroundImage.setAnimationEndCallback(a);return this},resetAnimationTime:function(){this.backgroundImage&&(this.backgroundImage.resetAnimationTime(), -this.invalidate());return this},setChangeFPS:function(a){this.backgroundImage&&this.backgroundImage.setChangeFPS(a);return this},setImageTransformation:function(a){this.backgroundImage&&this.backgroundImage.setSpriteTransformation(a);return this},centerOn:function(a,c){this.setPosition(a-this.width/2,c-this.height/2);return this},centerAt:function(a,c){this.setPosition(a-this.width*(0.5-this.tAnchorX),c-this.height*(0.5-this.tAnchorY));return this},getTextureGLPage:function(){return this.backgroundImage.image.__texturePage}, +CAAT.Module({defines:"CAAT.Foundation.SpriteImage",aliases:["CAAT.SpriteImage"],depends:["CAAT.Foundation.SpriteImageHelper","CAAT.Foundation.SpriteImageAnimationHelper","CAAT.Math.Rectangle"],constants:{TR_NONE:0,TR_FLIP_HORIZONTAL:1,TR_FLIP_VERTICAL:2,TR_FLIP_ALL:3,TR_FIXED_TO_SIZE:4,TR_FIXED_WIDTH_TO_SIZE:6,TR_TILE:5},extendsWith:function(){return{__init:function(){this.paint=this.paintN;this.setAnimationImageIndex([0]);this.mapInfo={};this.animationsMap={};arguments.length===1?this.initialize.call(this, +arguments[0],1,1):arguments.length===3&&this.initialize.apply(this,arguments);return this},animationImageIndex:null,prevAnimationTime:-1,changeFPS:1E3,transformation:0,spriteIndex:0,prevIndex:0,currentAnimation:null,image:null,rows:1,columns:1,width:0,height:0,singleWidth:0,singleHeight:0,scaleX:1,scaleY:1,offsetX:0,offsetY:0,parentOffsetX:0,parentOffsetY:0,ownerActor:null,mapInfo:null,map:null,animationsMap:null,callback:null,fontScale:1,getOwnerActor:function(){return this.ownerActor},addAnimation:function(a, +b,c,d){this.animationsMap[a]=new CAAT.Foundation.SpriteImageAnimationHelper(b,c,d);return this},setAnimationEndCallback:function(a){this.callback=a},playAnimation:function(a){if(a===this.currentAnimation)return this;var b=this.animationsMap[a];if(!b)return this;this.currentAnimation=a;this.setAnimationImageIndex(b.animation);this.changeFPS=b.time;this.callback=b.onEndPlayCallback;return this},setOwner:function(a){this.ownerActor=a;return this},getRows:function(){return this.rows},getColumns:function(){return this.columns}, +getWidth:function(){return this.mapInfo[this.spriteIndex].width},getHeight:function(){return this.mapInfo[this.spriteIndex].height},getWrappedImageWidth:function(){return this.image.width},getWrappedImageHeight:function(){return this.image.height},getRef:function(){var a=new CAAT.Foundation.SpriteImage;a.image=this.image;a.rows=this.rows;a.columns=this.columns;a.width=this.width;a.height=this.height;a.singleWidth=this.singleWidth;a.singleHeight=this.singleHeight;a.mapInfo=this.mapInfo;a.offsetX=this.offsetX; +a.offsetY=this.offsetY;a.scaleX=this.scaleX;a.scaleY=this.scaleY;a.animationsMap=this.animationsMap;a.parentOffsetX=this.parentOffsetX;a.parentOffsetY=this.parentOffsetY;a.scaleFont=this.scaleFont;return a},setOffsetX:function(a){this.offsetX=a;return this},setOffsetY:function(a){this.offsetY=a;return this},setOffset:function(a,b){this.offsetX=a;this.offsetY=b;return this},initialize:function(a,b,c){a||console.log("Null image for SpriteImage.");isString(a)&&(a=CAAT.currentDirector.getImage(a));this.parentOffsetY= +this.parentOffsetX=0;this.rows=b;this.columns=c;if(a instanceof CAAT.Foundation.SpriteImage||a instanceof CAAT.SpriteImage){this.image=a.image;var d=a.mapInfo[0];this.width=d.width;this.height=d.height;this.parentOffsetX=d.x;this.parentOffsetY=d.y;this.width=a.mapInfo[0].width;this.height=a.mapInfo[0].height}else this.image=a,this.width=a.width,this.height=a.height,this.mapInfo={};this.singleWidth=Math.floor(this.width/c);this.singleHeight=Math.floor(this.height/b);var e,f,g;if(a.__texturePage){a.__du= +this.singleWidth/a.__texturePage.width;a.__dv=this.singleHeight/a.__texturePage.height;e=this.singleWidth;f=this.singleHeight;var h=this.columns;if(a.inverted)d=e,e=f,f=d,h=this.rows;for(var a=this.image.__tx,i=this.image.__ty,j=this.image.__texturePage,d=0;d>0)*e;var k=i+(d/h>>0)*f,m=g+e,o=k+f;g=(new CAAT.Foundation.SpriteImageHelper(g,k,m-g,o-k,j.width,j.height)).setGL(g/j.width,k/j.height,m/j.width,o/j.height);this.mapInfo[d]=g}}else for(d=0;d0&&(f-=d);var g=(this.offsetY-this.ownerActor.y)%e;g>0&&(g-=e);for(var d=((c.width-f)/d>>0)+1,e=((c.height-g)/e>>0)+1,h,i=a.ctx,a=0;a>0,c.y-this.ownerActor.y+g+a*b.height>>0,b.width,b.height)},paintInvertedH:function(a, +b,c,d){b=this.mapInfo[this.spriteIndex];a=a.ctx;a.save();a.translate((c|0)+b.width,d|0);a.scale(-1,1);a.drawImage(this.image,b.x,b.y,b.width,b.height,this.offsetX>>0,this.offsetY>>0,b.width,b.height);a.restore();return this},paintInvertedV:function(a,b,c,d){b=this.mapInfo[this.spriteIndex];a=a.ctx;a.save();a.translate(c|0,d+b.height|0);a.scale(1,-1);a.drawImage(this.image,b.x,b.y,b.width,b.height,this.offsetX>>0,this.offsetY>>0,b.width,b.height);a.restore();return this},paintInvertedHV:function(a, +b,c,d){b=this.mapInfo[this.spriteIndex];a=a.ctx;a.save();a.translate(c|0,d+b.height|0);a.scale(1,-1);a.translate(b.width,0);a.scale(-1,1);a.drawImage(this.image,b.x,b.y,b.width,b.height,this.offsetX>>0,this.offsetY>>0,b.width,b.height);a.restore();return this},paintN:function(a,b,c,d){b=this.mapInfo[this.spriteIndex];a.ctx.drawImage(this.image,b.x,b.y,b.width,b.height,this.offsetX+c>>0,this.offsetY+d>>0,b.width,b.height);return this},paintAtRect:function(a,b,c,d,e,f){b=this.mapInfo[this.spriteIndex]; +a.ctx.drawImage(this.image,b.x,b.y,b.width,b.height,this.offsetX+c>>0,this.offsetY+d>>0,e,f);return this},paintScaledWidth:function(a,b,c,d){b=this.mapInfo[this.spriteIndex];a.ctx.drawImage(this.image,b.x,b.y,b.width,b.height,this.offsetX+c>>0,this.offsetY+d>>0,this.ownerActor.width,b.height);return this},paintChunk:function(a,b,c,d,e,f,g){a.drawImage(this.image,d,e,f,g,b,c,f,g)},paintTile:function(a,b,c,d){b=this.mapInfo[b];a.drawImage(this.image,b.x,b.y,b.width,b.height,this.offsetX+c>>0,this.offsetY+ +d>>0,b.width,b.height);return this},paintScaled:function(a,b,c,d){b=this.mapInfo[this.spriteIndex];a.ctx.drawImage(this.image,b.x,b.y,b.width,b.height,this.offsetX+c>>0,this.offsetY+d>>0,this.ownerActor.width,this.ownerActor.height);return this},getCurrentSpriteImageCSSPosition:function(){var a=this.mapInfo[this.spriteIndex];return""+-(a.x+this.parentOffsetX-this.offsetX)+"px "+-(a.y+this.parentOffsetY-this.offsetY)+"px "+(this.ownerActor.transformation===CAAT.Foundation.SpriteImage.TR_TILE?"repeat": +"no-repeat")},getNumImages:function(){return this.rows*this.columns},setUV:function(a,b){var c=this.image;if(c.__texturePage){var d=b,e=this.mapInfo[this.spriteIndex],f=e.u,g=e.v,h=e.u1,e=e.v1;if(this.offsetX||this.offsetY)f=c.__texturePage,g=-this.offsetY/f.height,h=(this.ownerActor.width-this.offsetX)/f.width,e=(this.ownerActor.height-this.offsetY)/f.height,f=-this.offsetX/f.width+c.__u,g+=c.__v,h+=c.__u,e+=c.__v;c.inverted?(a[d++]=h,a[d++]=g,a[d++]=h,a[d++]=e,a[d++]=f,a[d++]=e,a[d++]=f,a[d++]= +g):(a[d++]=f,a[d++]=g,a[d++]=h,a[d++]=g,a[d++]=h,a[d++]=e,a[d++]=f,a[d++]=e)}},setChangeFPS:function(a){this.changeFPS=a;return this},setSpriteTransformation:function(a){this.transformation=a;var b=CAAT.Foundation.SpriteImage;switch(a){case b.TR_FLIP_HORIZONTAL:this.paint=this.paintInvertedH;break;case b.TR_FLIP_VERTICAL:this.paint=this.paintInvertedV;break;case b.TR_FLIP_ALL:this.paint=this.paintInvertedHV;break;case b.TR_FIXED_TO_SIZE:this.paint=this.paintScaled;break;case b.TR_FIXED_WIDTH_TO_SIZE:this.paint= +this.paintScaledWidth;break;case b.TR_TILE:this.paint=this.paintTiled;break;default:this.paint=this.paintN}this.ownerActor.invalidate();return this},resetAnimationTime:function(){this.prevAnimationTime=-1;return this},setAnimationImageIndex:function(a){this.animationImageIndex=a;this.spriteIndex=a[0];this.prevAnimationTime=-1;return this},setSpriteIndex:function(a){this.spriteIndex=a;return this},setSpriteIndexAtTime:function(a){if(this.animationImageIndex.length>1){if(this.prevAnimationTime===-1)this.prevAnimationTime= +a,this.spriteIndex=this.animationImageIndex[0],this.prevIndex=0;else{var b=a;b-=this.prevAnimationTime;b/=this.changeFPS;b%=this.animationImageIndex.length;b=Math.floor(b);b>0,f=0;fa&&(a=c)}this.fontHeight=a;return this.fontHeight*this.fontScale},drawText:function(a,b,c,d){var e,f,g;for(e=0;e0&&f.height>0&&b.drawImage(this.image,f.x,f.y,g,f.height,c+f.xoffset*this.fontScale,d+f.yoffset*this.fontScale,g*this.fontScale,f.height*this.fontScale),c+=f.xadvance*this.fontScale}, +getFontData:function(){var a=this.stringHeight()*0.8>>0;return{height:this.stringHeight(),ascent:a,descent:this.stringHeight()-a}}}}}); +CAAT.Module({defines:"CAAT.Foundation.Actor",aliases:["CAAT.Actor"],depends:"CAAT.Math.Dimension,CAAT.Event.AnimationLoop,CAAT.Foundation.SpriteImage,CAAT.Core.Constants,CAAT.Behavior.PathBehavior,CAAT.Behavior.RotateBehavior,CAAT.Behavior.ScaleBehavior,CAAT.Behavior.Scale1Behavior,CAAT.PathUtil.LinearPath,CAAT.Event.AnimationLoop".split(","),constants:{ANCHOR_CENTER:0,ANCHOR_TOP:1,ANCHOR_BOTTOM:2,ANCHOR_LEFT:3,ANCHOR_RIGHT:4,ANCHOR_TOP_LEFT:5,ANCHOR_TOP_RIGHT:6,ANCHOR_BOTTOM_LEFT:7,ANCHOR_BOTTOM_RIGHT:8, +ANCHOR_CUSTOM:9,CACHE_NONE:0,CACHE_SIMPLE:1,CACHE_DEEP:2},extendsWith:function(){var a=0;return{__init:function(){this.behaviorList=[];this.lifecycleListenerList=[];this.AABB=new CAAT.Math.Rectangle;this.viewVertices=[new CAAT.Math.Point(0,0,0),new CAAT.Math.Point(0,0,0),new CAAT.Math.Point(0,0,0),new CAAT.Math.Point(0,0,0)];this.scaleAnchor=CAAT.Foundation.Actor.ANCHOR_CENTER;this.modelViewMatrix=new CAAT.Math.Matrix;this.worldModelViewMatrix=new CAAT.Math.Matrix;this.resetTransform();this.setScale(1, +1);this.setRotation(0);this.id=a++;return this},__super:null,lifecycleListenerList:null,behaviorList:null,parent:null,x:0,y:0,width:0,height:0,preferredSize:null,minimumSize:null,start_time:0,duration:Number.MAX_VALUE,clip:false,clipPath:null,tAnchorX:0,tAnchorY:0,scaleX:1,scaleY:1,scaleTX:0.5,scaleTY:0.5,scaleAnchor:0,rotationAngle:0,rotationY:0.5,rotationX:0.5,alpha:1,isGlobalAlpha:false,frameAlpha:1,expired:false,discardable:false,pointed:false,mouseEnabled:true,visible:true,fillStyle:null,strokeStyle:null, +time:0,AABB:null,viewVertices:null,inFrame:false,dirty:true,wdirty:true,oldX:-1,oldY:-1,modelViewMatrix:null,worldModelViewMatrix:null,modelViewMatrixI:null,worldModelViewMatrixI:null,glEnabled:false,backgroundImage:null,id:null,size_active:1,size_total:1,__d_ax:-1,__d_ay:-1,gestureEnabled:false,invalid:true,cached:0,preventLayout:false,isAA:true,isCachedActor:false,setCachedActor:function(a){this.isCachedActor=a;return this},setPreventLayout:function(a){this.preventLayout=a;return this},invalidateLayout:function(){this.parent&& +!this.parent.layoutInvalidated&&this.parent.invalidateLayout();return this},__validateLayout:function(){},setPreferredSize:function(a,c){if(!this.preferredSize)this.preferredSize=new CAAT.Math.Dimension;this.preferredSize.width=a;this.preferredSize.height=c;return this},getPreferredSize:function(){return this.preferredSize?this.preferredSize:this.getMinimumSize()},setMinimumSize:function(a,c){if(!this.minimumSize)this.minimumSize=new CAAT.Math.Dimension;this.minimumSize.width=a;this.minimumSize.height= +c;return this},getMinimumSize:function(){return this.minimumSize?this.minimumSize:new CAAT.Math.Dimension(this.width,this.height)},create:function(){return this},moveTo:function(a,c,d,e,f,g){if(!(a===this.x&&c===this.y)){var h=this.getBehavior("__moveTo");h||(h=(new CAAT.Behavior.PathBehavior).setId("__moveTo").setValues(new CAAT.PathUtil.LinearPath),this.addBehavior(h));h.path.setInitialPosition(this.x,this.y).setFinalPosition(a,c);h.setDelayTime(e?e:0,d);f&&h.setInterpolator(f);if(g)h.lifecycleListenerList= +[],h.addListener({behaviorExpired:function(a,b,c){g(a,b,c)}});return this}},rotateTo:function(a,c,d,e,f,g){if(a!==this.rotationAngle){var h=this.getBehavior("__rotateTo");h||(h=(new CAAT.Behavior.RotateBehavior).setId("__rotateTo").setValues(0,0,0.5,0.5),this.addBehavior(h));h.setValues(this.rotationAngle,a,e,f).setDelayTime(d?d:0,c);g&&h.setInterpolator(g);return this}},scaleTo:function(a,c,d,e,f,g,h){if(!(this.scaleX===a&&this.scaleY===c)){var i=this.getBehavior("__scaleTo");i||(i=(new CAAT.Behavior.ScaleBehavior).setId("__scaleTo").setValues(1, +1,1,1,0.5,0.5),this.addBehavior(i));i.setValues(this.scaleX,a,this.scaleY,c,f,g).setDelayTime(e?e:0,d);h&&i.setInterpolator(h);return this}},scaleXTo:function(a,c,d,e,f,g){return this.__scale1To(CAAT.Behavior.Scale1Behavior.AXIS_X,a,c,d,e,f,g)},scaleYTo:function(a,c,d,e,f,g){return this.__scale1To(CAAT.Behavior.Scale1Behavior.AXIS_Y,a,c,d,e,f,g)},__scale1To:function(a,c,d,e,f,g,h){if(!(a===CAAT.Behavior.Scale1Behavior.AXIS_X&&c===this.scaleX||a===CAAT.Behavior.Scale1Behavior.AXIS_Y&&c===this.scaleY)){var i= +this.getBehavior("__scaleXTo");i||(i=(new CAAT.Behavior.Scale1Behavior).setId("__scaleXTo").setValues(1,1,a===CAAT.Behavior.Scale1Behavior.AXIS_X,0.5,0.5),this.addBehavior(i));i.setValues(a?this.scaleX:this.scaleY,c,f,g).setDelayTime(e?e:0,d);h&&i.setInterpolator(h);return this}},touchStart:function(){},touchMove:function(){},touchEnd:function(){},gestureStart:function(){},gestureChange:function(a,c,d){this.gestureEnabled&&(this.setRotation(a),this.setScale(c,d));return this},gestureEnd:function(){}, +isVisible:function(){return this.visible},invalidate:function(){this.invalid=true;return this},setGestureEnabled:function(a){this.gestureEnabled=!!a;return this},isGestureEnabled:function(){return this.gestureEnabled},getId:function(){return this.id},setId:function(a){this.id=a;return this},setParent:function(a){this.parent=a;return this},setBackgroundImage:function(a,c){if(a){a=a instanceof CAAT.Foundation.SpriteImage?a.getRef():isString(a)?(new CAAT.Foundation.SpriteImage).initialize(CAAT.currentDirector.getImage(a), +1,1):(new CAAT.Foundation.SpriteImage).initialize(a,1,1);a.setOwner(this);this.backgroundImage=a;if(typeof c==="undefined"||c)this.width=a.getWidth(),this.height=a.getHeight();this.glEnabled=true;this.invalidate()}else this.backgroundImage=null;return this},setSpriteIndex:function(a){this.backgroundImage&&(this.backgroundImage.setSpriteIndex(a),this.invalidate());return this},setBackgroundImageOffset:function(a,c){this.backgroundImage&&this.backgroundImage.setOffset(a,c);return this},setAnimationImageIndex:function(a){this.backgroundImage&& +(this.backgroundImage.resetAnimationTime(),this.backgroundImage.setAnimationImageIndex(a),this.invalidate());return this},addAnimation:function(a,c,d,e){this.backgroundImage&&this.backgroundImage.addAnimation(a,c,d,e);return this},playAnimation:function(a){this.backgroundImage&&this.backgroundImage.playAnimation(a);return this},setAnimationEndCallback:function(a){this.backgroundImage&&this.backgroundImage.setAnimationEndCallback(a);return this},resetAnimationTime:function(){this.backgroundImage&& +(this.backgroundImage.resetAnimationTime(),this.invalidate());return this},setChangeFPS:function(a){this.backgroundImage&&this.backgroundImage.setChangeFPS(a);return this},setImageTransformation:function(a){this.backgroundImage&&this.backgroundImage.setSpriteTransformation(a);return this},centerOn:function(a,c){this.setPosition(a-this.width/2,c-this.height/2);return this},centerAt:function(a,c){this.setPosition(a-this.width*(0.5-this.tAnchorX),c-this.height*(0.5-this.tAnchorY));return this},getTextureGLPage:function(){return this.backgroundImage.image.__texturePage}, setVisible:function(a){this.invalidate();CAAT.currentDirector&&CAAT.currentDirector.dirtyRectsEnabled&&!a&&this.visible&&CAAT.currentDirector.scheduleDirtyRect(this.AABB);if(a&&!this.visible)this.dirty=true;this.visible=a;return this},setOutOfFrameTime:function(){this.setFrameTime(-1,0);return this},addListener:function(a){this.lifecycleListenerList.push(a);return this},removeListener:function(a){for(var c=this.lifecycleListenerList.length;c--;)if(this.lifecycleListenerList[c]===a){this.lifecycleListenerList.splice(c, 1);break}},setGlobalAlpha:function(a){this.isGlobalAlpha=a;return this},fireEvent:function(a,c){for(var d=0;d=this.start_time+ this.duration?(this.expired||this.setExpired(a),false):this.start_time<=a&&a=0&&c>=0&&af)f=d.x;if(d.yh)h=d.y;d=c[1];if(d.xf)f=d.x;if(d.yh)h=d.y;d=c[2];if(d.xf)f=d.x;if(d.yh)h=d.y;d=c[3];if(d.xf)f=d.x;if(d.yh)h=d.y;a.x=e;a.y=g;a.x1=f;a.y1=h;a.width=f-e;a.height=h-g;return this},paintActor:function(a,c){if(!this.visible||!a.inDirtyRect(this))return true;var d=a.ctx;this.frameAlpha=this.parent?this.parent.frameAlpha*this.alpha:1;d.globalAlpha=this.frameAlpha;a.modelViewMatrix.transformRenderingContextSet(d); -this.worldModelViewMatrix.transformRenderingContext(d);this.clip&&(d.beginPath(),this.clipPath?this.clipPath.applyAsPath(a):d.rect(0,0,this.width,this.height),d.clip());this.paint(a,c);return true},__paintActor:function(a,c){if(!this.visible)return true;var d=a.ctx;this.frameAlpha=this.alpha;var e=this.worldModelViewMatrix.matrix;d.setTransform(e[0],e[3],e[1],e[4],e[2],e[5],this.frameAlpha);this.paint(a,c);return true},paintActorGL:function(a){this.frameAlpha=this.parent.frameAlpha*this.alpha;if(this.glEnabled&& -this.visible)if(this.glNeedsFlush(a)){a.glFlush();this.glSetShader(a);if(!this.__uv)this.__uv=new Float32Array(8);if(!this.__vv)this.__vv=new Float32Array(12);this.setGLCoords(this.__vv,0);this.setUV(this.__uv,0);a.glRender(this.__vv,12,this.__uv)}else{var c=a.coordsIndex;this.setGLCoords(a.coords,c);a.coordsIndex=c+12;this.setUV(a.uv,a.uvIndex);a.uvIndex+=8}},setGLCoords:function(a,c){var d=this.viewVertices;a[c++]=d[0].x;a[c++]=d[0].y;a[c++]=0;a[c++]=d[1].x;a[c++]=d[1].y;a[c++]=0;a[c++]=d[2].x; -a[c++]=d[2].y;a[c++]=0;a[c++]=d[3].x;a[c++]=d[3].y;a[c]=0},setUV:function(a,c){this.backgroundImage.setUV(a,c)},glNeedsFlush:function(a){return this.getTextureGLPage()!==a.currentTexturePage?true:this.frameAlpha!==a.currentOpacity?true:false},glSetShader:function(a){var c=this.getTextureGLPage();c!==a.currentTexturePage&&a.setGLTexturePage(c);this.frameAlpha!==a.currentOpacity&&a.setGLCurrentOpacity(this.frameAlpha)},endAnimate:function(){return this},initialize:function(a){if(a)for(var c in a)this[c]= -a[c];return this},setClip:function(a,c){this.clip=a;this.clipPath=c;return this},isCached:function(){return this.cached},stopCacheAsBitmap:function(){if(this.cached)this.backgroundImage=null,this.cached=CAAT.Foundation.Actor.CACHE_NONE},cacheAsBitmap:function(a,c){if(this.width<=0||this.height<=0)return this;var a=a||0,d=document.createElement("canvas");d.width=this.width;d.height=this.height;var e=d.getContext("2d");CAAT.Foundation.Actor.prototype.animate.call(this,CAAT.currentDirector,a);var e= -{ctx:e,modelViewMatrix:new CAAT.Math.Matrix,worldModelViewMatrix:new CAAT.Math.Matrix,dirtyRectsEnabled:false,inDirtyRect:function(){return true},AABB:new CAAT.Math.Rectangle(0,0,this.width,this.height)},f=this.modelViewMatrix,g=this.worldModelViewMatrix;this.modelViewMatrix=new CAAT.Math.Matrix;this.worldModelViewMatrix=new CAAT.Math.Matrix;this.cached=CAAT.Foundation.Actor.CACHE_NONE;if(typeof c==="undefined")c=CAAT.Foundation.Actor.CACHE_SIMPLE;c===CAAT.Foundation.Actor.CACHE_DEEP?(this.animate(e, -a),this.paintActor(e,a)):this instanceof CAAT.Foundation.ActorContainer||this instanceof CAAT.ActorContainer?CAAT.Foundation.ActorContainer.superclass.paintActor.call(this,e,a):(this.animate(e,a),this.paintActor(e,a));this.setBackgroundImage(d);this.cached=c;this.modelViewMatrix=f;this.worldModelViewMatrix=g;return this},resetAsButton:function(){this.actionPerformed=null;this.mouseEnter=function(){};this.mouseExit=function(){};this.mouseDown=function(){};this.mouseUp=function(){};this.mouseClick= -function(){};this.mouseDrag=function(){};return this},setAsButton:function(a,c,d,e,f,g){this.setBackgroundImage(a,true);this.iNormal=c||0;this.iOver=d||this.iNormal;this.iPress=e||this.iNormal;this.iDisabled=f||this.iNormal;this.fnOnClick=g;this.enabled=true;this.setSpriteIndex(c);this.setEnabled=function(a){this.enabled=a;this.setSpriteIndex(this.enabled?this.iNormal:this.iDisabled);return this};this.actionPerformed=function(){this.enabled&&this.fnOnClick&&this.fnOnClick(this)};this.mouseEnter=function(){this.enabled&& -(this.dragging?this.setSpriteIndex(this.iPress):this.setSpriteIndex(this.iOver),CAAT.setCursor("pointer"))};this.mouseExit=function(){this.enabled&&(this.setSpriteIndex(this.iNormal),CAAT.setCursor("default"))};this.mouseDown=function(){this.enabled&&this.setSpriteIndex(this.iPress)};this.mouseUp=function(){if(this.enabled)this.setSpriteIndex(this.iNormal),this.dragging=false};this.mouseClick=function(){};this.mouseDrag=function(){if(this.enabled)this.dragging=true};this.setButtonImageIndex=function(a, -b,c,d){this.iNormal=a||0;this.iOver=b||this.iNormal;this.iPress=c||this.iNormal;this.iDisabled=d||this.iNormal;this.setSpriteIndex(this.iNormal);return this};return this},findActorById:function(a){return this.id===a?this:null}}}}); +this.behaviorList,d=0;df)f=d.x;if(d.yh)h=d.y;d=c[1];if(d.xf)f=d.x;if(d.yh)h=d.y;d=c[2];if(d.xf)f=d.x;if(d.yh)h=d.y;d=c[3];if(d.xf)f=d.x;if(d.yh)h=d.y;a.x=e;a.y=g;a.x1=f;a.y1=h;a.width=f-e;a.height=h-g;return this},paintActor:function(a,c){if(!this.visible||!a.inDirtyRect(this))return true;var d=a.ctx;this.frameAlpha=this.parent?this.parent.frameAlpha*this.alpha: +1;d.globalAlpha=this.frameAlpha;a.modelViewMatrix.transformRenderingContextSet(d);this.worldModelViewMatrix.transformRenderingContext(d);this.clip&&(d.beginPath(),this.clipPath?this.clipPath.applyAsPath(a):d.rect(0,0,this.width,this.height),d.clip());this.paint(a,c);return true},__paintActor:function(a,c){if(!this.visible)return true;var d=a.ctx;this.frameAlpha=this.alpha;var e=this.worldModelViewMatrix.matrix;d.setTransform(e[0],e[3],e[1],e[4],e[2],e[5],this.frameAlpha);this.paint(a,c);return true}, +paintActorGL:function(a){this.frameAlpha=this.parent.frameAlpha*this.alpha;if(this.glEnabled&&this.visible)if(this.glNeedsFlush(a)){a.glFlush();this.glSetShader(a);if(!this.__uv)this.__uv=new Float32Array(8);if(!this.__vv)this.__vv=new Float32Array(12);this.setGLCoords(this.__vv,0);this.setUV(this.__uv,0);a.glRender(this.__vv,12,this.__uv)}else{var c=a.coordsIndex;this.setGLCoords(a.coords,c);a.coordsIndex=c+12;this.setUV(a.uv,a.uvIndex);a.uvIndex+=8}},setGLCoords:function(a,c){var d=this.viewVertices; +a[c++]=d[0].x;a[c++]=d[0].y;a[c++]=0;a[c++]=d[1].x;a[c++]=d[1].y;a[c++]=0;a[c++]=d[2].x;a[c++]=d[2].y;a[c++]=0;a[c++]=d[3].x;a[c++]=d[3].y;a[c]=0},setUV:function(a,c){this.backgroundImage.setUV(a,c)},glNeedsFlush:function(a){return this.getTextureGLPage()!==a.currentTexturePage?true:this.frameAlpha!==a.currentOpacity?true:false},glSetShader:function(a){var c=this.getTextureGLPage();c!==a.currentTexturePage&&a.setGLTexturePage(c);this.frameAlpha!==a.currentOpacity&&a.setGLCurrentOpacity(this.frameAlpha)}, +endAnimate:function(){return this},initialize:function(a){if(a)for(var c in a)this[c]=a[c];return this},setClip:function(a,c){this.clip=a;this.clipPath=c;return this},isCached:function(){return this.cached},stopCacheAsBitmap:function(){if(this.cached)this.backgroundImage=null,this.cached=CAAT.Foundation.Actor.CACHE_NONE},cacheAsBitmap:function(a,c){if(this.width<=0||this.height<=0)return this;var a=a||0,d=document.createElement("canvas");d.width=this.width;d.height=this.height;var e=d.getContext("2d"); +CAAT.Foundation.Actor.prototype.animate.call(this,CAAT.currentDirector,a);var e={ctx:e,modelViewMatrix:new CAAT.Math.Matrix,worldModelViewMatrix:new CAAT.Math.Matrix,dirtyRectsEnabled:false,inDirtyRect:function(){return true},AABB:new CAAT.Math.Rectangle(0,0,this.width,this.height)},f=this.modelViewMatrix,g=this.worldModelViewMatrix;this.modelViewMatrix=new CAAT.Math.Matrix;this.worldModelViewMatrix=new CAAT.Math.Matrix;this.cached=CAAT.Foundation.Actor.CACHE_NONE;if(typeof c==="undefined")c=CAAT.Foundation.Actor.CACHE_SIMPLE; +c===CAAT.Foundation.Actor.CACHE_DEEP?(this.animate(e,a),this.paintActor(e,a)):this instanceof CAAT.Foundation.ActorContainer||this instanceof CAAT.ActorContainer?CAAT.Foundation.ActorContainer.superclass.paintActor.call(this,e,a):(this.animate(e,a),this.paintActor(e,a));this.setBackgroundImage(d);this.cached=c;this.modelViewMatrix=f;this.worldModelViewMatrix=g;return this},resetAsButton:function(){this.actionPerformed=null;this.mouseEnter=function(){};this.mouseExit=function(){};this.mouseDown=function(){}; +this.mouseUp=function(){};this.mouseClick=function(){};this.mouseDrag=function(){};return this},setAsButton:function(a,c,d,e,f,g){this.setBackgroundImage(a,true);this.iNormal=c||0;this.iOver=d||this.iNormal;this.iPress=e||this.iNormal;this.iDisabled=f||this.iNormal;this.fnOnClick=g;this.enabled=true;this.setSpriteIndex(c);this.setEnabled=function(a){this.enabled=a;this.setSpriteIndex(this.enabled?this.iNormal:this.iDisabled);return this};this.actionPerformed=function(){this.enabled&&this.fnOnClick&& +this.fnOnClick(this)};this.mouseEnter=function(){this.enabled&&(this.dragging?this.setSpriteIndex(this.iPress):this.setSpriteIndex(this.iOver),CAAT.setCursor("pointer"))};this.mouseExit=function(){this.enabled&&(this.setSpriteIndex(this.iNormal),CAAT.setCursor("default"))};this.mouseDown=function(){this.enabled&&this.setSpriteIndex(this.iPress)};this.mouseUp=function(){if(this.enabled)this.setSpriteIndex(this.iNormal),this.dragging=false};this.mouseClick=function(){};this.mouseDrag=function(){if(this.enabled)this.dragging= +true};this.setButtonImageIndex=function(a,b,c,d){this.iNormal=a||0;this.iOver=b||this.iNormal;this.iPress=c||this.iNormal;this.iDisabled=d||this.iNormal;this.setSpriteIndex(this.iNormal);return this};return this},findActorById:function(a){return this.id===a?this:null}}}}); CAAT.Module({defines:"CAAT.Foundation.ActorContainer",aliases:["CAAT.ActorContainer"],depends:["CAAT.Foundation.Actor","CAAT.Math.Point","CAAT.Math.Rectangle"],constants:{ADDHINT:{CONFORM:1},AddHint:{CONFORM:1}},extendsClass:"CAAT.Foundation.Actor",extendsWith:function(){var a=CAAT.Foundation.Actor.CACHE_DEEP,b=CAAT.Foundation.ActorContainer.superclass,c=b.drawScreenBoundingBox,d=b.paintActor,e=b.paintActorGL,f=b.animate,g=b.findActorAtPosition,h=b.destroy;return{__init:function(a){this.__super(); this.childrenList=[];this.activeChildren=[];this.pendingChildrenList=[];if(typeof a!=="undefined")this.addHint=a,this.boundingBox=new CAAT.Math.Rectangle;return this},childrenList:null,activeChildren:null,pendingChildrenList:null,addHint:0,boundingBox:null,runion:new CAAT.Math.Rectangle,layoutManager:null,layoutInvalidated:true,setLayout:function(a){this.layoutManager=a;return this},setBounds:function(a,b,c,d){CAAT.Foundation.ActorContainer.superclass.setBounds.call(this,a,b,c,d);CAAT.currentDirector&& !CAAT.currentDirector.inValidation&&this.invalidateLayout();return this},__validateLayout:function(){this.__validateTree();this.layoutInvalidated=false},__validateTree:function(){if(this.layoutManager&&this.layoutManager.isInvalidated()){CAAT.currentDirector.inValidation=true;this.layoutManager.doLayout(this);for(var a=0;a=this.childrenList.length)b=this.childrenList.length;a.parent=this;a.dirty=true;this.childrenList.splice(b, -0,a);this.invalidateLayout();return this},findActorById:function(a){if(CAAT.Foundation.ActorContainer.superclass.findActorById.call(this,a))return this;for(var b=this.childrenList,c=0,d=b.length;c=0&&a=0;b--){var c=this.childrenList[b],d=new CAAT.Math.Point(a.x,a.y,0),c=c.findActorAtPosition(d);if(null!==c)return c}return this},destroy:function(){for(var a=this.childrenList,b=a.length-1;b>=0;b--)a[b].destroy();h.call(this);return this}, -getNumChildren:function(){return this.childrenList.length},getNumActiveChildren:function(){return this.activeChildren.length},getChildAt:function(a){return this.childrenList[a]},setZOrder:function(a,b){var c=this.findChild(a);if(-1!==c){var d=this.childrenList;if(b!==c){if(b>=d.length)d.splice(c,1),d.push(a);else{c=d.splice(c,1);if(b<0)b=0;else if(b>d.length)b=d.length;d.splice(b,0,c[0])}this.invalidateLayout()}}}}}}); +this.parent?this.parent.frameAlpha:1;for(var g=0,f=this.activeChildren.length;g=this.childrenList.length)b=this.childrenList.length;a.parent=this;a.dirty=true;this.childrenList.splice(b,0,a);this.invalidateLayout();return this},findActorById:function(a){if(CAAT.Foundation.ActorContainer.superclass.findActorById.call(this,a))return this;for(var b=this.childrenList,c=0,d=b.length;c=0&&a=0;b--){var c=this.childrenList[b],d=new CAAT.Math.Point(a.x,a.y,0),c=c.findActorAtPosition(d);if(null!==c)return c}return this}, +destroy:function(){for(var a=this.childrenList,b=a.length-1;b>=0;b--)a[b].destroy();h.call(this);return this},getNumChildren:function(){return this.childrenList.length},getNumActiveChildren:function(){return this.activeChildren.length},getChildAt:function(a){return this.childrenList[a]},setZOrder:function(a,b){var c=this.findChild(a);if(-1!==c){var d=this.childrenList;if(b!==c){if(b>=d.length)d.splice(c,1),d.push(a);else{c=d.splice(c,1);if(b<0)b=0;else if(b>d.length)b=d.length;d.splice(b,0,c[0])}this.invalidateLayout()}}}}}}); CAAT.Module({defines:"CAAT.Foundation.Scene",depends:"CAAT.Math.Point,CAAT.Math.Matrix,CAAT.PathUtil.Path,CAAT.Behavior.GenericBehavior,CAAT.Behavior.ContainerBehavior,CAAT.Behavior.ScaleBehavior,CAAT.Behavior.AlphaBehavior,CAAT.Behavior.RotateBehavior,CAAT.Behavior.PathBehavior,CAAT.Foundation.ActorContainer,CAAT.Foundation.Timer.TimerManager".split(","),aliases:["CAAT.Scene"],extendsClass:"CAAT.Foundation.ActorContainer",constants:{EASE_ROTATION:1,EASE_SCALE:2,EASE_TRANSLATE:3},extendsWith:function(){return{__init:function(){this.__super(); this.timerManager=new CAAT.TimerManager;this.fillStyle=null;this.isGlobalAlpha=true;return this},easeContainerBehaviour:null,easeContainerBehaviourListener:null,easeIn:false,paused:false,timerManager:null,isPaused:function(){return this.paused},setPaused:function(a){this.paused=a},createTimer:function(a,b,c,d,e){return this.timerManager.createTimer(a,b,c,d,e,this)},setTimeout:function(a,b,c,d){return this.timerManager.createTimer(this.time,a,b,c,d,this)},createAlphaBehaviour:function(a,b){var c=new CAAT.Behavior.AlphaBehavior; c.setFrameTime(0,a);c.startAlpha=b?0:1;c.endAlpha=b?1:0;this.easeContainerBehaviour.addBehavior(c)},easeTranslationIn:function(a,b,c,d){this.easeTranslation(a,b,c,true,d)},easeTranslationOut:function(a,b,c,d){this.easeTranslation(a,b,c,false,d)},easeTranslation:function(a,b,c,d,e){this.easeContainerBehaviour=new CAAT.Behavior.ContainerBehavior;this.easeIn=d;var f=new CAAT.Behavior.PathBehavior;e&&f.setInterpolator(e);f.setFrameTime(0,a);c<1?c=1:c>4&&(c=4);switch(c){case CAAT.Foundation.Actor.ANCHOR_TOP:d? @@ -456,74 +463,75 @@ behaviorExpired:function(){this.easeContainerBehaviourListener.easeEnd(this,this f[c].contains(d.x,d.y)))return f[c]}}d.set(a.x,a.y);return CAAT.Foundation.Scene.superclass.findActorAtPosition.call(this,d)},enableInputList:function(a){this.inputList=[];for(var b=0;b=this.inputList.length&&(b=this.inputList.length-1);b=this.inputList[b];typeof c==="undefined"||c>=b.length?b.push(a):c<=0?b.unshift(a):b.splice(c,0,a);return this},emptyInputList:function(a){a<0?a=0:a>=this.inputList.length&& (a=this.inputList.length-1);this.inputList[a]=[];return this},removeActorFromInputList:function(a,b){if(typeof b==="undefined"){var c,d;for(c=0;c=this.inputList.length&&(b=this.inputList.length-1);e=this.inputList[b];for(d=0;d=0;b--){var c=this.childrenList[b],d=new CAAT.Math.Point(a.x,a.y,0),c=c.findActorAtPosition(d);if(null!==c)return c}return this},resetStats:function(){this.statistics.size_total=0;this.statistics.size_active= -0;this.statistics.draws=0;this.statistics.size_discarded_by_dirty_rects=0},render:function(a){if(!this.currentScene||!this.currentScene.isPaused()){this.time+=a;for(e=0,l=this.childrenList.length;e0&&!navigator.isCocoonJS&&CAAT.DEBUG&&CAAT.DEBUG_DIRTYRECTS){f.beginPath();this.nDirtyRects=0;b=this.cDirtyRects;for(e=0;e=this.dirtyRects.length)for(b=0;b<32;b++)this.dirtyRects.push(new CAAT.Math.Rectangle);b=this.dirtyRects[this.dirtyRectsIndex];b.x=a.x;b.y=a.y;b.x1=a.x1;b.y1=a.y1;b.width=a.width;b.height=a.height;this.cDirtyRects.push(b)}},renderToContext:function(a,b){if(b.isInAnimationFrame(this.time)){a.setTransform(1,0,0,1,0,0);a.globalAlpha=1;a.globalCompositeOperation= -"source-over";a.clearRect(0,0,this.width,this.height);var c=this.ctx;this.ctx=a;a.save();var d=this.modelViewMatrix,e=this.worldModelViewMatrix;this.modelViewMatrix=this.worldModelViewMatrix=new CAAT.Math.Matrix;this.wdirty=true;b.animate(this,b.time);if(b.onRenderStart)b.onRenderStart(b.time);b.paintActor(this,b.time);if(b.onRenderEnd)b.onRenderEnd(b.time);this.worldModelViewMatrix=e;this.modelViewMatrix=d;a.restore();this.ctx=c}},addScene:function(a){a.setBounds(0,0,this.width,this.height);this.scenes.push(a); -a.setEaseListener(this);null===this.currentScene&&this.setScene(0)},getNumScenes:function(){return this.scenes.length},easeInOut:function(a,b,c,d,e,f,g,h,i,j){if(a!==this.getCurrentSceneIndex()){a=this.scenes[a];d=this.scenes[d];if(!CAAT.__CSS__&&CAAT.CACHE_SCENE_ON_CHANGE)this.renderToContext(this.transitionScene.ctx,d),d=this.transitionScene;a.setExpired(false);d.setExpired(false);a.mouseEnabled=false;d.mouseEnabled=false;a.resetTransform();d.resetTransform();a.setLocation(0,0);d.setLocation(0, -0);a.alpha=1;d.alpha=1;b===CAAT.Foundation.Scene.EASE_ROTATION?a.easeRotationIn(g,h,c,i):b===CAAT.Foundation.Scene.EASE_SCALE?a.easeScaleIn(0,g,h,c,i):a.easeTranslationIn(g,h,c,i);e===CAAT.Foundation.Scene.EASE_ROTATION?d.easeRotationOut(g,h,f,j):e===CAAT.Foundation.Scene.EASE_SCALE?d.easeScaleOut(0,g,h,f,j):d.easeTranslationOut(g,h,f,j);this.childrenList=[];d.goOut(a);a.getIn(d);this.addChild(d);this.addChild(a)}},easeInOutRandom:function(a,b,c,d){var e=Math.random(),f=Math.random(),g;e<0.33?(e= -CAAT.Foundation.Scene.EASE_ROTATION,g=(new CAAT.Behavior.Interpolator).createExponentialInOutInterpolator(4)):e<0.66?(e=CAAT.Foundation.Scene.EASE_SCALE,g=(new CAAT.Behavior.Interpolator).createElasticOutInterpolator(1.1,0.4)):(e=CAAT.Foundation.Scene.EASE_TRANSLATE,g=(new CAAT.Behavior.Interpolator).createBounceOutInterpolator());var h;f<0.33?(f=CAAT.Foundation.Scene.EASE_ROTATION,h=(new CAAT.Behavior.Interpolator).createExponentialInOutInterpolator(4)):f<0.66?(f=CAAT.Foundation.Scene.EASE_SCALE, -h=(new CAAT.Behavior.Interpolator).createExponentialOutInterpolator(4)):(f=CAAT.Foundation.Scene.EASE_TRANSLATE,h=(new CAAT.Behavior.Interpolator).createBounceOutInterpolator());this.easeInOut(a,e,Math.random()*8.99>>0,b,f,Math.random()*8.99>>0,c,d,g,h)},easeIn:function(a,b,c,d,e,f){a=this.scenes[a];b===CAAT.Foundation.Scene.EASE_ROTATION?a.easeRotationIn(c,d,e,f):b===CAAT.Foundation.Scene.EASE_SCALE?a.easeScaleIn(0,c,d,e,f):a.easeTranslationIn(c,d,e,f);this.childrenList=[];this.addChild(a);a.resetTransform(); -a.setLocation(0,0);a.alpha=1;a.mouseEnabled=false;a.setExpired(false)},setScene:function(a){a=this.scenes[a];this.childrenList=[];this.addChild(a);this.currentScene=a;a.setExpired(false);a.mouseEnabled=true;a.resetTransform();a.setLocation(0,0);a.alpha=1;a.getIn();a.activated()},switchToScene:function(a,b,c,d){var e=this.getSceneIndex(this.currentScene);d?this.easeInOutRandom(a,e,b,c):this.setScene(a)},switchToPrevScene:function(a,b,c){var d=this.getSceneIndex(this.currentScene);this.getNumScenes()<= -1||d===0||(c?this.easeInOutRandom(d-1,d,a,b):this.setScene(d-1))},switchToNextScene:function(a,b,c){var d=this.getSceneIndex(this.currentScene);this.getNumScenes()<=1||d===this.getNumScenes()-1||(c?this.easeInOutRandom(d+1,d,a,b):this.setScene(d+1))},mouseEnter:function(){},mouseExit:function(){},mouseMove:function(){},mouseDown:function(){},mouseUp:function(){},mouseDrag:function(){},easeEnd:function(a,b){b?(this.currentScene=a,this.currentScene.activated()):a.setExpired(true);a.mouseEnabled=true; -a.emptyBehaviorList()},getSceneIndex:function(a){for(var b=0;b500&&(b=500);if(this.onRenderStart)this.onRenderStart(b);this.render(b);this.debugInfo&&this.debugInfo(this.statistics);this.timeline=a;if(this.onRenderEnd)this.onRenderEnd(b);this.needsRepaint=false}},resetTimeline:function(){this.timeline=(new Date).getTime()},endLoop:function(){},setClear:function(a){this.clear=a;this.dirtyRectsEnabled= -this.clear===CAAT.Foundation.Director.CLEAR_DIRTY_RECTS?true:false;return this},getAudioManager:function(){return this.audioManager},cumulateOffset:function(a,b,c){var d=c+"Left";c+="Top";for(var e=0,f=0,g;navigator.browser!=="iOS"&&a&&a.style;)if(g=a.currentStyle?a.currentStyle.position:(g=(a.ownerDocument.defaultView||a.ownerDocument.parentWindow).getComputedStyle(a,null))?g.getPropertyValue("position"):null,/^(fixed)$/.test(g))break;else e+=a[d],f+=a[c],a=a[b];return{x:e,y:f,style:g}},getOffset:function(a){var b= -this.cumulateOffset(a,"offsetParent","offset");return b.style==="fixed"?(a=this.cumulateOffset(a,a.parentNode?"parentNode":"parentElement","scroll"),{x:b.x+a.x,y:b.y+a.y}):{x:b.x,y:b.y}},getCanvasCoord:function(a,b){var c=new CAAT.Math.Point,d=0,e=0;if(!b)b=window.event;if(b.pageX||b.pageY)d=b.pageX,e=b.pageY;else if(b.clientX||b.clientY)d=b.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,e=b.clientY+document.body.scrollTop+document.documentElement.scrollTop;var f=this.getOffset(this.canvas); -d-=f.x;e-=f.y;d*=this.SCREEN_RATIO;e*=this.SCREEN_RATIO;c.x=d;c.y=e;if(!this.modelViewMatrixI)this.modelViewMatrixI=this.modelViewMatrix.getInverse();this.modelViewMatrixI.transformCoord(c);d=c.x;e=c.y;a.set(d,e);this.screenMousePoint.set(d,e)},__mouseDownHandler:function(a){if(this.dragging&&this.lastSelectedActor)this.__mouseUpHandler(a);else{this.getCanvasCoord(this.mousePoint,a);this.isMouseDown=true;var b=this.findActorAtPosition(this.mousePoint);if(null!==b){var c=b.viewToModel(new CAAT.Math.Point(this.screenMousePoint.x, -this.screenMousePoint.y,0));b.mouseDown((new CAAT.Event.MouseEvent).init(c.x,c.y,a,b,new CAAT.Math.Point(this.screenMousePoint.x,this.screenMousePoint.y)))}this.lastSelectedActor=b}},__mouseUpHandler:function(a){this.isMouseDown=false;this.getCanvasCoord(this.mousePoint,a);var b=null,c=this.lastSelectedActor;null!==c&&(b=c.viewToModel(new CAAT.Math.Point(this.screenMousePoint.x,this.screenMousePoint.y,0)),c.actionPerformed&&c.contains(b.x,b.y)&&c.actionPerformed(a),c.mouseUp((new CAAT.Event.MouseEvent).init(b.x, -b.y,a,c,this.screenMousePoint,this.currentScene.time)));!this.dragging&&null!==c&&c.contains(b.x,b.y)&&c.mouseClick((new CAAT.Event.MouseEvent).init(b.x,b.y,a,c,this.screenMousePoint,this.currentScene.time));this.in_=this.dragging=false},__mouseMoveHandler:function(a){var b,c,d=this.currentScene?this.currentScene.time:0;if(this.isMouseDown&&null!==this.lastSelectedActor){if(b=this.lastSelectedActor,c=b.viewToModel(new CAAT.Math.Point(this.screenMousePoint.x,this.screenMousePoint.y,0)),this.dragging|| -!(Math.abs(this.prevMousePoint.x-c.x)=this.width||b.y>=this.height))this.touching=true,this.__mouseDownHandler(a)}},__touchEndHandler:function(a){if(this.touching)a.preventDefault(), -a.returnValue=false,a=a.changedTouches[0],this.getCanvasCoord(this.mousePoint,a),this.touching=false,this.__mouseUpHandler(a)},__touchMoveHandler:function(a){if(this.touching&&(a.preventDefault(),a.returnValue=false,!this.gesturing))for(var b=0;b=this.width||f.y>=this.height)){var g=this.findActorAtPosition(f);g!==null&&(f=g.viewToModel(f),this.touches[e]||(this.touches[e]={actor:g,touch:new CAAT.Event.TouchInfo(e,f.x,f.y,g)},c.push(e)))}}e={};for(b=0;b=b.width||d.y>=b.height))b.touching=true,b.__mouseDownHandler(c)}},false);window.addEventListener("mouseover",function(c){if(c.target===a&&!b.dragging){c.preventDefault();c.cancelBubble=true;c.stopPropagation&&c.stopPropagation();var d=b.mousePoint;b.getCanvasCoord(d,c);d.x<0||d.y<0||d.x>=b.width||d.y>=b.height||b.__mouseOverHandler(c)}},false);window.addEventListener("mouseout",function(c){if(c.target=== -a&&!b.dragging)c.preventDefault(),c.cancelBubble=true,c.stopPropagation&&c.stopPropagation(),b.getCanvasCoord(b.mousePoint,c),b.__mouseOutHandler(c)},false);window.addEventListener("mousemove",function(a){a.preventDefault();a.cancelBubble=true;a.stopPropagation&&a.stopPropagation();var d=b.mousePoint;b.getCanvasCoord(d,a);(b.dragging||!(d.x<0||d.y<0||d.x>=b.width||d.y>=b.height))&&b.__mouseMoveHandler(a)},false);window.addEventListener("dblclick",function(c){if(c.target===a){c.preventDefault();c.cancelBubble= -true;c.stopPropagation&&c.stopPropagation();var d=b.mousePoint;b.getCanvasCoord(d,c);d.x<0||d.y<0||d.x>=b.width||d.y>=b.height||b.__mouseDBLClickHandler(c)}},false);CAAT.TOUCH_BEHAVIOR===CAAT.TOUCH_AS_MOUSE?(a.addEventListener("touchstart",this.__touchStartHandler.bind(this),false),a.addEventListener("touchmove",this.__touchMoveHandler.bind(this),false),a.addEventListener("touchend",this.__touchEndHandler.bind(this),false),a.addEventListener("gesturestart",function(c){if(c.target===a)c.preventDefault(), -c.returnValue=false,b.__gestureStart(c.scale,c.rotation)},false),a.addEventListener("gestureend",function(c){if(c.target===a)c.preventDefault(),c.returnValue=false,b.__gestureEnd(c.scale,c.rotation)},false),a.addEventListener("gesturechange",function(c){if(c.target===a)c.preventDefault(),c.returnValue=false,b.__gestureChange(c.scale,c.rotation)},false)):CAAT.TOUCH_BEHAVIOR===CAAT.TOUCH_AS_MULTITOUCH&&(a.addEventListener("touchstart",this.__touchStartHandlerMT.bind(this),false),a.addEventListener("touchmove", -this.__touchMoveHandlerMT.bind(this),false),a.addEventListener("touchend",this.__touchEndHandlerMT.bind(this),false),a.addEventListener("touchcancel",this.__touchCancelHandleMT.bind(this),false),a.addEventListener("gesturestart",this.__touchGestureStartHandleMT.bind(this),false),a.addEventListener("gestureend",this.__touchGestureEndHandleMT.bind(this),false),a.addEventListener("gesturechange",this.__touchGestureChangeHandleMT.bind(this),false))},enableEvents:function(a){CAAT.RegisterDirector(this); -this.in_=false;this.createEventHandler(a)},createEventHandler:function(a){this.in_=false;this.addHandlers(a)}}},onCreate:function(){if(typeof CAAT.__CSS__!=="undefined")CAAT.Foundation.Director.prototype.clip=true,CAAT.Foundation.Director.prototype.glEnabled=false,CAAT.Foundation.Director.prototype.getRenderType=function(){return"CSS"},CAAT.Foundation.Director.prototype.setScaleProportional=function(a,b){var c=Math.min(a/this.referenceWidth,b/this.referenceHeight);this.setScaleAnchored(c,c,0,0);this.eventHandler.style.width= -""+this.referenceWidth+"px";this.eventHandler.style.height=""+this.referenceHeight+"px"},CAAT.Foundation.Director.prototype.setBounds=function(a,b,c,d){CAAT.Foundation.Director.superclass.setBounds.call(this,a,b,c,d);for(a=0;a=0;b--){var c=this.childrenList[b],d=new CAAT.Math.Point(a.x, +a.y,0),c=c.findActorAtPosition(d);if(null!==c)return c}return this},resetStats:function(){this.statistics.size_total=0;this.statistics.size_active=0;this.statistics.draws=0;this.statistics.size_discarded_by_dirty_rects=0},render:function(a){if(!this.currentScene||!this.currentScene.isPaused()){this.time+=a;for(e=0,l=this.childrenList.length;e0&&!navigator.isCocoonJS&&CAAT.DEBUG&&CAAT.DEBUG_DIRTYRECTS){f.beginPath();this.nDirtyRects=0;b=this.cDirtyRects;for(e=0;e=this.dirtyRects.length)for(b=0;b<32;b++)this.dirtyRects.push(new CAAT.Math.Rectangle);b=this.dirtyRects[this.dirtyRectsIndex];b.x=a.x;b.y=a.y;b.x1=a.x1;b.y1=a.y1;b.width=a.width;b.height=a.height; +this.cDirtyRects.push(b)}},renderToContext:function(a,b){if(b.isInAnimationFrame(this.time)){a.setTransform(1,0,0,1,0,0);a.globalAlpha=1;a.globalCompositeOperation="source-over";a.clearRect(0,0,this.width,this.height);var c=this.ctx;this.ctx=a;a.save();var d=this.modelViewMatrix,e=this.worldModelViewMatrix;this.modelViewMatrix=this.worldModelViewMatrix=new CAAT.Math.Matrix;this.wdirty=true;b.animate(this,b.time);if(b.onRenderStart)b.onRenderStart(b.time);b.paintActor(this,b.time);if(b.onRenderEnd)b.onRenderEnd(b.time); +this.worldModelViewMatrix=e;this.modelViewMatrix=d;a.restore();this.ctx=c}},addScene:function(a){a.setBounds(0,0,this.width,this.height);this.scenes.push(a);a.setEaseListener(this);null===this.currentScene&&this.setScene(0)},getNumScenes:function(){return this.scenes.length},easeInOut:function(a,b,c,d,e,f,g,h,i,j){if(a!==this.getCurrentSceneIndex()){a=this.scenes[a];d=this.scenes[d];if(!CAAT.__CSS__&&CAAT.CACHE_SCENE_ON_CHANGE)this.renderToContext(this.transitionScene.ctx,d),d=this.transitionScene; +a.setExpired(false);d.setExpired(false);a.mouseEnabled=false;d.mouseEnabled=false;a.resetTransform();d.resetTransform();a.setLocation(0,0);d.setLocation(0,0);a.alpha=1;d.alpha=1;b===CAAT.Foundation.Scene.EASE_ROTATION?a.easeRotationIn(g,h,c,i):b===CAAT.Foundation.Scene.EASE_SCALE?a.easeScaleIn(0,g,h,c,i):a.easeTranslationIn(g,h,c,i);e===CAAT.Foundation.Scene.EASE_ROTATION?d.easeRotationOut(g,h,f,j):e===CAAT.Foundation.Scene.EASE_SCALE?d.easeScaleOut(0,g,h,f,j):d.easeTranslationOut(g,h,f,j);this.childrenList= +[];d.goOut(a);a.getIn(d);this.addChild(d);this.addChild(a)}},easeInOutRandom:function(a,b,c,d){var e=Math.random(),f=Math.random(),g;e<0.33?(e=CAAT.Foundation.Scene.EASE_ROTATION,g=(new CAAT.Behavior.Interpolator).createExponentialInOutInterpolator(4)):e<0.66?(e=CAAT.Foundation.Scene.EASE_SCALE,g=(new CAAT.Behavior.Interpolator).createElasticOutInterpolator(1.1,0.4)):(e=CAAT.Foundation.Scene.EASE_TRANSLATE,g=(new CAAT.Behavior.Interpolator).createBounceOutInterpolator());var h;f<0.33?(f=CAAT.Foundation.Scene.EASE_ROTATION, +h=(new CAAT.Behavior.Interpolator).createExponentialInOutInterpolator(4)):f<0.66?(f=CAAT.Foundation.Scene.EASE_SCALE,h=(new CAAT.Behavior.Interpolator).createExponentialOutInterpolator(4)):(f=CAAT.Foundation.Scene.EASE_TRANSLATE,h=(new CAAT.Behavior.Interpolator).createBounceOutInterpolator());this.easeInOut(a,e,Math.random()*8.99>>0,b,f,Math.random()*8.99>>0,c,d,g,h)},easeIn:function(a,b,c,d,e,f){a=this.scenes[a];b===CAAT.Foundation.Scene.EASE_ROTATION?a.easeRotationIn(c,d,e,f):b===CAAT.Foundation.Scene.EASE_SCALE? +a.easeScaleIn(0,c,d,e,f):a.easeTranslationIn(c,d,e,f);this.childrenList=[];this.addChild(a);a.resetTransform();a.setLocation(0,0);a.alpha=1;a.mouseEnabled=false;a.setExpired(false)},setScene:function(a){a=this.scenes[a];this.childrenList=[];this.addChild(a);this.currentScene=a;a.setExpired(false);a.mouseEnabled=true;a.resetTransform();a.setLocation(0,0);a.alpha=1;a.getIn();a.activated()},switchToScene:function(a,b,c,d){var e=this.getSceneIndex(this.currentScene);d?this.easeInOutRandom(a,e,b,c):this.setScene(a)}, +switchToPrevScene:function(a,b,c){var d=this.getSceneIndex(this.currentScene);this.getNumScenes()<=1||d===0||(c?this.easeInOutRandom(d-1,d,a,b):this.setScene(d-1))},switchToNextScene:function(a,b,c){var d=this.getSceneIndex(this.currentScene);this.getNumScenes()<=1||d===this.getNumScenes()-1||(c?this.easeInOutRandom(d+1,d,a,b):this.setScene(d+1))},mouseEnter:function(){},mouseExit:function(){},mouseMove:function(){},mouseDown:function(){},mouseUp:function(){},mouseDrag:function(){},easeEnd:function(a, +b){b?(this.currentScene=a,this.currentScene.activated()):a.setExpired(true);a.mouseEnabled=true;a.emptyBehaviorList()},getSceneIndex:function(a){for(var b=0;b500&&(b=500);if(this.onRenderStart)this.onRenderStart(b);this.render(b);this.debugInfo&&this.debugInfo(this.statistics);this.timeline=a;if(this.onRenderEnd)this.onRenderEnd(b);this.needsRepaint=false}},resetTimeline:function(){this.timeline= +(new Date).getTime()},endLoop:function(){},setClear:function(a){this.clear=a;this.dirtyRectsEnabled=this.clear===CAAT.Foundation.Director.CLEAR_DIRTY_RECTS?true:false;return this},getAudioManager:function(){return this.audioManager},cumulateOffset:function(a,b,c){var d=c+"Left";c+="Top";for(var e=0,f=0,g;navigator.browser!=="iOS"&&a&&a.style;)if(g=a.currentStyle?a.currentStyle.position:(g=(a.ownerDocument.defaultView||a.ownerDocument.parentWindow).getComputedStyle(a,null))?g.getPropertyValue("position"): +null,/^(fixed)$/.test(g))break;else e+=a[d],f+=a[c],a=a[b];return{x:e,y:f,style:g}},getOffset:function(a){var b=this.cumulateOffset(a,"offsetParent","offset");return b.style==="fixed"?(a=this.cumulateOffset(a,a.parentNode?"parentNode":"parentElement","scroll"),{x:b.x+a.x,y:b.y+a.y}):{x:b.x,y:b.y}},getCanvasCoord:function(a,b){var c=new CAAT.Math.Point,d=0,e=0;if(!b)b=window.event;if(b.pageX||b.pageY)d=b.pageX,e=b.pageY;else if(b.clientX||b.clientY)d=b.clientX+document.body.scrollLeft+document.documentElement.scrollLeft, +e=b.clientY+document.body.scrollTop+document.documentElement.scrollTop;var f=this.getOffset(this.canvas);d-=f.x;e-=f.y;d*=this.SCREEN_RATIO;e*=this.SCREEN_RATIO;c.x=d;c.y=e;if(!this.modelViewMatrixI)this.modelViewMatrixI=this.modelViewMatrix.getInverse();this.modelViewMatrixI.transformCoord(c);d=c.x;e=c.y;a.set(d,e);this.screenMousePoint.set(d,e)},__mouseDownHandler:function(a){if(this.dragging&&this.lastSelectedActor)this.__mouseUpHandler(a);else{this.getCanvasCoord(this.mousePoint,a);this.isMouseDown= +true;var b=this.findActorAtPosition(this.mousePoint);if(null!==b){var c=b.viewToModel(new CAAT.Math.Point(this.screenMousePoint.x,this.screenMousePoint.y,0));b.mouseDown((new CAAT.Event.MouseEvent).init(c.x,c.y,a,b,new CAAT.Math.Point(this.screenMousePoint.x,this.screenMousePoint.y)))}this.lastSelectedActor=b}},__mouseUpHandler:function(a){this.isMouseDown=false;this.getCanvasCoord(this.mousePoint,a);var b=null,c=this.lastSelectedActor;null!==c&&(b=c.viewToModel(new CAAT.Math.Point(this.screenMousePoint.x, +this.screenMousePoint.y,0)),c.actionPerformed&&c.contains(b.x,b.y)&&c.actionPerformed(a),c.mouseUp((new CAAT.Event.MouseEvent).init(b.x,b.y,a,c,this.screenMousePoint,this.currentScene.time)));!this.dragging&&null!==c&&c.contains(b.x,b.y)&&c.mouseClick((new CAAT.Event.MouseEvent).init(b.x,b.y,a,c,this.screenMousePoint,this.currentScene.time));this.in_=this.dragging=false},__mouseMoveHandler:function(a){var b,c,d=this.currentScene?this.currentScene.time:0;if(this.isMouseDown&&null!==this.lastSelectedActor){if(b= +this.lastSelectedActor,c=b.viewToModel(new CAAT.Math.Point(this.screenMousePoint.x,this.screenMousePoint.y,0)),this.dragging||!(Math.abs(this.prevMousePoint.x-c.x)=this.width||b.y>=this.height))this.touching=true,this.__mouseDownHandler(a)}},__touchEndHandler:function(a){if(this.touching)a.preventDefault(),a.returnValue=false,a=a.changedTouches[0],this.getCanvasCoord(this.mousePoint,a),this.touching=false,this.__mouseUpHandler(a)},__touchMoveHandler:function(a){if(this.touching&&(a.preventDefault(),a.returnValue=false,!this.gesturing))for(var b=0;b=this.width||f.y>=this.height)){var g=this.findActorAtPosition(f);g!==null&&(f=g.viewToModel(f),this.touches[e]||(this.touches[e]={actor:g,touch:new CAAT.Event.TouchInfo(e,f.x,f.y,g)},c.push(e)))}}e={};for(b=0;b=b.width||d.y>=b.height))b.touching=true,b.__mouseDownHandler(c)}},false);window.addEventListener("mouseover",function(c){if(c.target===a&&!b.dragging){c.preventDefault();c.cancelBubble=true;c.stopPropagation&&c.stopPropagation();var d=b.mousePoint; +b.getCanvasCoord(d,c);d.x<0||d.y<0||d.x>=b.width||d.y>=b.height||b.__mouseOverHandler(c)}},false);window.addEventListener("mouseout",function(c){if(c.target===a&&!b.dragging)c.preventDefault(),c.cancelBubble=true,c.stopPropagation&&c.stopPropagation(),b.getCanvasCoord(b.mousePoint,c),b.__mouseOutHandler(c)},false);window.addEventListener("mousemove",function(a){a.preventDefault();a.cancelBubble=true;a.stopPropagation&&a.stopPropagation();var d=b.mousePoint;b.getCanvasCoord(d,a);(b.dragging||!(d.x< +0||d.y<0||d.x>=b.width||d.y>=b.height))&&b.__mouseMoveHandler(a)},false);window.addEventListener("dblclick",function(c){if(c.target===a){c.preventDefault();c.cancelBubble=true;c.stopPropagation&&c.stopPropagation();var d=b.mousePoint;b.getCanvasCoord(d,c);d.x<0||d.y<0||d.x>=b.width||d.y>=b.height||b.__mouseDBLClickHandler(c)}},false);CAAT.TOUCH_BEHAVIOR===CAAT.TOUCH_AS_MOUSE?(a.addEventListener("touchstart",this.__touchStartHandler.bind(this),false),a.addEventListener("touchmove",this.__touchMoveHandler.bind(this), +false),a.addEventListener("touchend",this.__touchEndHandler.bind(this),false),a.addEventListener("gesturestart",function(c){if(c.target===a)c.preventDefault(),c.returnValue=false,b.__gestureStart(c.scale,c.rotation)},false),a.addEventListener("gestureend",function(c){if(c.target===a)c.preventDefault(),c.returnValue=false,b.__gestureEnd(c.scale,c.rotation)},false),a.addEventListener("gesturechange",function(c){if(c.target===a)c.preventDefault(),c.returnValue=false,b.__gestureChange(c.scale,c.rotation)}, +false)):CAAT.TOUCH_BEHAVIOR===CAAT.TOUCH_AS_MULTITOUCH&&(a.addEventListener("touchstart",this.__touchStartHandlerMT.bind(this),false),a.addEventListener("touchmove",this.__touchMoveHandlerMT.bind(this),false),a.addEventListener("touchend",this.__touchEndHandlerMT.bind(this),false),a.addEventListener("touchcancel",this.__touchCancelHandleMT.bind(this),false),a.addEventListener("gesturestart",this.__touchGestureStartHandleMT.bind(this),false),a.addEventListener("gestureend",this.__touchGestureEndHandleMT.bind(this), +false),a.addEventListener("gesturechange",this.__touchGestureChangeHandleMT.bind(this),false))},enableEvents:function(a){CAAT.RegisterDirector(this);this.in_=false;this.createEventHandler(a)},createEventHandler:function(a){this.in_=false;this.addHandlers(a)}}},onCreate:function(){if(typeof CAAT.__CSS__!=="undefined")CAAT.Foundation.Director.prototype.clip=true,CAAT.Foundation.Director.prototype.glEnabled=false,CAAT.Foundation.Director.prototype.getRenderType=function(){return"CSS"},CAAT.Foundation.Director.prototype.setScaleProportional= +function(a,b){var c=Math.min(a/this.referenceWidth,b/this.referenceHeight);this.setScaleAnchored(c,c,0,0);this.eventHandler.style.width=""+this.referenceWidth+"px";this.eventHandler.style.height=""+this.referenceHeight+"px"},CAAT.Foundation.Director.prototype.setBounds=function(a,b,c,d){CAAT.Foundation.Director.superclass.setBounds.call(this,a,b,c,d);for(a=0;a>0)+1)*b},setFillStyle:function(a){this.fill=a},setStrokeStyle:function(a){this.stroke=a},setStrokeSize:function(a){this.strokeSize= -a},setAlignment:function(a){this.alignment=a},setFontSize:function(a){if(a!==this.fontSize)this.fontSize=a,this.__setFont()}};var b=function(){this.text="";return this};b.prototype={x:0,y:0,width:0,text:null,crcs:null,rcs:null,styles:null,images:null,lines:null,documentHeight:0,anchorStack:null,__nextLine:function(){this.x=0;this.currentLine=new f(CAAT.Module.Font.Font.getFontMetrics(this.crcs.sfont));this.lines.push(this.currentLine)},__image:function(a,b,c){var e;e=b&&c?a.getWidth():a.getWrappedImageWidth(); -this.width&&e+this.x>this.width&&this.x>0&&this.__nextLine();this.currentLine.addElementImage(new d(this.x,a,b,c,this.crcs.clone(),this.__getCurrentAnchor()));this.x+=e},__text:function(){if(this.text.length!==0){var a=this.ctx.measureText(this.text).width;this.width&&a+this.x>this.width&&this.x>0&&this.__nextLine();this.currentLine.addElement(new e(this.text,this.x,a,0,this.crcs.clone(),this.__getCurrentAnchor()));this.x+=a;this.text=""}},fchar:function(a){a===" "?(this.__text(),this.x+=this.ctx.measureText(a).width, -this.width&&this.x>this.width&&this.__nextLine()):this.text+=a},end:function(){this.text.length>0&&this.__text();for(var a=0,b=0,c=0;c>0);this.lines[c].setY(a)}this.documentHeight=a+b},getDocumentHeight:function(){return this.documentHeight},__getCurrentAnchor:function(){return this.anchorStack.length?this.anchorStack[this.anchorStack.length-1]:null},__resetAppliedStyles:function(){this.rcs= -[];this.__pushDefaultStyles()},__pushDefaultStyles:function(){this.crcs=(new a(this.ctx)).setDefault(this.styles["default"]);this.rcs.push(this.crcs)},__pushStyle:function(b){var c=this.crcs;this.crcs=new a(this.ctx);this.crcs.chain=c;this.crcs.setStyle(b);this.crcs.applyStyle();this.rcs.push(this.crcs)},__popStyle:function(){if(this.rcs.length>1)this.rcs.pop(),this.crcs=this.rcs[this.rcs.length-1],this.crcs.applyStyle()},__popAnchor:function(){this.anchorStack.length>0&&this.anchorStack.pop()},__pushAnchor:function(a){this.anchorStack.push(a)}, -start:function(a,b,c,d){this.y=this.x=0;this.width=typeof d!=="undefined"?d:0;this.ctx=a;this.lines=[];this.styles=b;this.images=c;this.anchorStack=[];this.__resetAppliedStyles();this.__nextLine()},setTag:function(a){this.__text();a=a.toLowerCase();if(a==="b")this.crcs.setBold(true);else if(a==="/b")this.crcs.setBold(false);else if(a==="i")this.crcs.setItalic(true);else if(a==="/i")this.crcs.setItalic(false);else if(a==="stroked")this.crcs.setStroked(true);else if(a==="/stroked")this.crcs.setStroked(false); -else if(a==="filled")this.crcs.setFilled(true);else if(a==="/filled")this.crcs.setFilled(false);else if(a==="tab")this.x=this.crcs.getTabPos(this.x);else if(a==="br")this.__nextLine();else if(a==="/a")this.__popAnchor();else if(a==="/style")this.rcs.length>1&&this.__popStyle();else if(a.indexOf("fillcolor")===0)a=a.split("="),this.crcs.setFillStyle(a[1]);else if(a.indexOf("strokecolor")===0)a=a.split("="),this.crcs.setStrokeStyle(a[1]);else if(a.indexOf("strokesize")===0)a=a.split("="),this.crcs.setStrokeSize(a[1]| -0);else if(a.indexOf("fontsize")===0)a=a.split("="),this.crcs.setFontSize(a[1]|0);else if(a.indexOf("style")===0)a=a.split("="),(a=this.styles[a[1]])&&this.__pushStyle(a);else if(a.indexOf("image")===0){var a=a.split("=")[1].split(","),b=a[0];if(this.images[b]){var c=0,d=0;a.length>=3&&(c=a[1]|0,d=a[2]|0);this.__image(this.images[b],c,d)}}else a.indexOf("a=")===0&&(a=a.split("="),this.__pushAnchor(a[1]))}};var c=function(a,b){this.link=a;this.style=b;return this};c.prototype={x:null,y:null,width:null, -height:null,style:null,link:null,isLink:function(){return this.link},setLink:function(a){this.link=a;return this},getLink:function(){return this.link},contains:function(){return false}};var d=function(a,b,c,e,f,m){d.superclass.constructor.call(this,m,f);this.x=a;this.image=b;this.row=c;this.column=e;this.width=b.getWidth();this.height=b.getHeight();if(this.image instanceof CAAT.SpriteImage||this.image instanceof CAAT.Foundation.SpriteImage)this.spriteIndex=c*b.columns+e,this.paint=this.paintSI;return this}; -d.prototype={image:null,row:null,column:null,spriteIndex:null,paint:function(a){this.style.image(a);a.drawImage(this.image,this.x,-this.height+1)},paintSI:function(a){this.style.image(a);this.image.setSpriteIndex(this.spriteIndex);this.image.paint({ctx:a},0,this.x,-this.height+1)},getHeight:function(){return this.image instanceof CAAT.Foundation.SpriteImage?this.image.singleHeight:this.image.height},getFontMetrics:function(){return null},contains:function(a,b){return a>=this.x&&a<=this.x+this.width&& -b>=this.y&&b=this.x&&a<=this.x+this.width&&b>=this.y&&b<=this.y+this.height},setYPosition:function(a){this.bl=a;this.y=a-this.fm.ascent}};extend(d,c);extend(e,c);var f=function(a){this.elements=[];this.defaultFontMetrics=a;return this};f.prototype={elements:null,width:0,height:0,defaultHeight:0,y:0,x:0,alignment:null,baselinePos:0,addElement:function(a){this.width=Math.max(this.width,a.x+a.width);this.height=Math.max(this.height,a.height);this.elements.push(a);this.alignment=a.style.__getProperty("alignment")}, -addElementImage:function(a){this.width=Math.max(this.width,a.x+a.width);this.height=Math.max(this.height,a.height);this.elements.push(a)},getHeight:function(){return this.height},setY:function(a){this.y=a},getY:function(){return this.y},paint:function(a){a.save();a.translate(this.x,this.y+this.baselinePos);for(var b=0;b=0.6&&this.elements.length>1){var c=a-this.width,c=c/(this.elements.length-1)|0;for(b=1;ba.ascent&&(a=e):a=e:b?d.getHeight()>d.getHeight()&& -(b=d):b=d}this.baselinePos=Math.max(a?a.ascent:this.defaultFontMetrics.ascent,b?b.getHeight():this.defaultFontMetrics.ascent);this.height=this.baselinePos+(a!=null?a.descent:this.defaultFontMetrics.descent);for(c=0;c",d+1),-1!==o&&(n=f.substr(d+1,o-d-1),n.indexOf("<")!==-1?(this.rc.fchar(p),d+=1):(this.rc.setTag(n),d=o+1))):(this.rc.fchar(p),d+=1);this.rc.end();this.lines=this.rc.lines;this.__calculateDocumentDimension(typeof b==="undefined"?0:b);this.setLinesAlignment();q.restore();this.setPreferredSize(this.documentWidth,this.documentHeight);this.invalidateLayout();this.setDocumentPosition();c&&this.cacheAsBitmap(0,c);return this}},setVerticalAlignment:function(a){this.valignment= -a;this.setDocumentPosition();return this},setHorizontalAlignment:function(a){this.halignment=a;this.setDocumentPosition();return this},setDocumentPosition:function(){var a=0,b=0;this.valignment===CAAT.Foundation.UI.Layout.LayoutManager.ALIGNMENT.CENTER?b=(this.height-this.documentHeight)/2:this.valignment===CAAT.Foundation.UI.Layout.LayoutManager.ALIGNMENT.BOTTOM&&(b=this.height-this.documentHeight);this.halignment===CAAT.Foundation.UI.Layout.LayoutManager.ALIGNMENT.CENTER?a=(this.width-this.documentWidth)/ -2:this.halignment===CAAT.Foundation.UI.Layout.LayoutManager.ALIGNMENT.RIGHT&&(a=this.width-this.documentWidth);this.documentX=a;this.documentY=b},__calculateDocumentDimension:function(a){var b,c=0;for(b=this.documentHeight=this.documentWidth=0;b=a&&d.y+d.height>=b)return d.__getElementAt(a-d.x,b-d.y)}return null},mouseExit:function(){CAAT.setCursor("default")},mouseMove:function(a){(a=this.__getDocumentElementAt(a.x,a.y))&&a.getLink()?CAAT.setCursor("pointer"):CAAT.setCursor("default")},mouseClick:function(a){this.clickCallback&&(a=this.__getDocumentElementAt(a.x,a.y),a.getLink()&&this.clickCallback(a.getLink()))},setClickCallback:function(a){this.clickCallback=a;return this}}}}); +CAAT.Module({defines:"CAAT.Foundation.UI.Label",depends:["CAAT.Foundation.Actor","CAAT.Foundation.SpriteImage","CAAT.Module.Font.Font","CAAT.Foundation.UI.Layout.LayoutManager"],aliases:["CAAT.UI.Label"],extendsClass:"CAAT.Foundation.Actor",extendsWith:function(){var a=function(a){this.ctx=a;return this};a.prototype={ctx:null,defaultFS:null,font:null,fontSize:null,fill:null,stroke:null,filled:null,stroked:null,strokeSize:null,italic:null,bold:null,alignment:null,tabSize:null,shadow:null,shadowBlur:null, +shadowColor:null,sfont:null,chain:null,setDefault:function(a){this.defaultFS=24;this.font="Arial";this.fontSize=this.defaultFS;this.fill="#000";this.stroke="#f00";this.filled=true;this.stroked=false;this.strokeSize=1;this.bold=this.italic=false;this.alignment="left";this.tabSize=75;this.shadow=false;this.shadowBlur=0;this.shadowColor="#000";for(var b in a)a.hasOwnProperty(b)&&(this[b]=a[b]);this.__setFont();return this},setStyle:function(a){if(typeof a!=="undefined")for(var b in a)this[b]=a[b];return this}, +applyStyle:function(){this.__setFont();return this},clone:function(){var b=new a(this.ctx),c;for(c in this)this.hasOwnProperty(c)&&(b[c]=this[c]);for(var d=this;d.chain;)for(c in d=d.chain,d)b[c]===null&&d.hasOwnProperty(c)&&(b[c]=d[c]);b.__setFont();return b},__getProperty:function(a){var b=this,c;do{c=b[a];if(c!==null)return c;b=b.chain}while(b);return null},image:function(a){this.__setShadow(a)},text:function(a,b,c,d){this.__setShadow(a);a.font=this.__getProperty("sfont");this.filled&&this.__fillText(a, +b,c,d);this.stroked&&this.__strokeText(a,b,c,d)},__setShadow:function(a){if(this.__getProperty("shadow"))a.shadowBlur=this.__getProperty("shadowBlur"),a.shadowColor=this.__getProperty("shadowColor")},__fillText:function(a,b,c,d){a.fillStyle=this.__getProperty("fill");a.fillText(b,c,d)},__strokeText:function(a,b,c,d){a.strokeStyle=this.__getProperty("stroke");a.lineWidth=this.__getProperty("strokeSize");a.beginPath();a.strokeText(b,c,d)},__setFont:function(){var a=this.__getProperty("italic"),b=this.__getProperty("bold"), +c=this.__getProperty("fontSize"),d=this.__getProperty("font");this.sfont=(a?"italic ":"")+(b?"bold ":"")+c+"px "+d;this.ctx.font=this.__getProperty("sfont")},setBold:function(a){if(a!=this.bold)this.bold=a,this.__setFont()},setItalic:function(a){if(a!=this.italic)this.italic=a,this.__setFont()},setStroked:function(a){this.stroked=a},setFilled:function(a){this.filled=a},getTabPos:function(a){var b=this.__getProperty("tabSize");return((a/b>>0)+1)*b},setFillStyle:function(a){this.fill=a},setStrokeStyle:function(a){this.stroke= +a},setStrokeSize:function(a){this.strokeSize=a},setAlignment:function(a){this.alignment=a},setFontSize:function(a){if(a!==this.fontSize)this.fontSize=a,this.__setFont()}};var b=function(){this.text="";return this};b.prototype={x:0,y:0,width:0,text:null,crcs:null,rcs:null,styles:null,images:null,lines:null,documentHeight:0,anchorStack:null,__nextLine:function(){this.x=0;this.currentLine=new f(CAAT.Module.Font.Font.getFontMetrics(this.crcs.sfont));this.lines.push(this.currentLine)},__image:function(a, +b,c){var e;e=typeof b!=="undefined"&&typeof c!=="undefined"?a.getWidth():a instanceof CAAT.Foundation.SpriteImage?a.getWidth():a.getWrappedImageWidth();this.width&&e+this.x>this.width&&this.x>0&&this.__nextLine();this.currentLine.addElementImage(new d(this.x,a,b,c,this.crcs.clone(),this.__getCurrentAnchor()));this.x+=e},__text:function(){if(this.text.length!==0){var a=this.ctx.measureText(this.text).width;this.width&&a+this.x>this.width&&this.x>0&&this.__nextLine();this.currentLine.addElement(new e(this.text, +this.x,a,0,this.crcs.clone(),this.__getCurrentAnchor()));this.x+=a;this.text=""}},fchar:function(a){a===" "?(this.__text(),this.x+=this.ctx.measureText(a).width,this.width&&this.x>this.width&&this.__nextLine()):this.text+=a},end:function(){this.text.length>0&&this.__text();for(var a=0,b=0,c=0;c>0);this.lines[c].setY(a)}this.documentHeight=a+b},getDocumentHeight:function(){return this.documentHeight}, +__getCurrentAnchor:function(){return this.anchorStack.length?this.anchorStack[this.anchorStack.length-1]:null},__resetAppliedStyles:function(){this.rcs=[];this.__pushDefaultStyles()},__pushDefaultStyles:function(){this.crcs=(new a(this.ctx)).setDefault(this.styles["default"]);this.rcs.push(this.crcs)},__pushStyle:function(b){var c=this.crcs;this.crcs=new a(this.ctx);this.crcs.chain=c;this.crcs.setStyle(b);this.crcs.applyStyle();this.rcs.push(this.crcs)},__popStyle:function(){if(this.rcs.length>1)this.rcs.pop(), +this.crcs=this.rcs[this.rcs.length-1],this.crcs.applyStyle()},__popAnchor:function(){this.anchorStack.length>0&&this.anchorStack.pop()},__pushAnchor:function(a){this.anchorStack.push(a)},start:function(a,b,c,d){this.y=this.x=0;this.width=typeof d!=="undefined"?d:0;this.ctx=a;this.lines=[];this.styles=b;this.images=c;this.anchorStack=[];this.__resetAppliedStyles();this.__nextLine()},setTag:function(a){this.__text();a=a.toLowerCase();if(a==="b")this.crcs.setBold(true);else if(a==="/b")this.crcs.setBold(false); +else if(a==="i")this.crcs.setItalic(true);else if(a==="/i")this.crcs.setItalic(false);else if(a==="stroked")this.crcs.setStroked(true);else if(a==="/stroked")this.crcs.setStroked(false);else if(a==="filled")this.crcs.setFilled(true);else if(a==="/filled")this.crcs.setFilled(false);else if(a==="tab")this.x=this.crcs.getTabPos(this.x);else if(a==="br")this.__nextLine();else if(a==="/a")this.__popAnchor();else if(a==="/style")this.rcs.length>1&&this.__popStyle();else if(a.indexOf("fillcolor")===0)a= +a.split("="),this.crcs.setFillStyle(a[1]);else if(a.indexOf("strokecolor")===0)a=a.split("="),this.crcs.setStrokeStyle(a[1]);else if(a.indexOf("strokesize")===0)a=a.split("="),this.crcs.setStrokeSize(a[1]|0);else if(a.indexOf("fontsize")===0)a=a.split("="),this.crcs.setFontSize(a[1]|0);else if(a.indexOf("style")===0)a=a.split("="),(a=this.styles[a[1]])&&this.__pushStyle(a);else if(a.indexOf("image")===0){var a=a.split("=")[1].split(","),b=a[0];if(this.images[b]){var c=0,d=0;a.length>=3&&(c=a[1]|0, +d=a[2]|0);this.__image(this.images[b],c,d)}else CAAT.currentDirector.getImage(b)&&this.__image(CAAT.currentDirector.getImage(b))}else a.indexOf("a=")===0&&(a=a.split("="),this.__pushAnchor(a[1]))}};var c=function(a,b){this.link=a;this.style=b;return this};c.prototype={x:null,y:null,width:null,height:null,style:null,link:null,isLink:function(){return this.link},setLink:function(a){this.link=a;return this},getLink:function(){return this.link},contains:function(){return false}};var d=function(a,b,c, +e,f,m){d.superclass.constructor.call(this,m,f);this.x=a;this.image=b;this.row=c;this.column=e;this.width=b.getWidth();this.height=b.getHeight();if(this.image instanceof CAAT.SpriteImage||this.image instanceof CAAT.Foundation.SpriteImage)this.spriteIndex=typeof c==="undefined"||typeof e==="undefined"?0:c*b.columns+e,this.paint=this.paintSI;return this};d.prototype={image:null,row:null,column:null,spriteIndex:null,paint:function(a){this.style.image(a);a.drawImage(this.image,this.x,-this.height+1)}, +paintSI:function(a){this.style.image(a);this.image.setSpriteIndex(this.spriteIndex);this.image.paint({ctx:a},0,this.x,-this.height+1)},getHeight:function(){return this.image instanceof CAAT.Foundation.SpriteImage?this.image.getHeight():this.image.height},getFontMetrics:function(){return null},contains:function(a,b){return a>=this.x&&a<=this.x+this.width&&b>=this.y&&b=this.x&&a<=this.x+this.width&&b>=this.y&&b<=this.y+this.height},setYPosition:function(a){this.bl=a;this.y=a-this.fm.ascent}}; +extend(d,c);extend(e,c);var f=function(a){this.elements=[];this.defaultFontMetrics=a;return this};f.prototype={elements:null,width:0,height:0,defaultHeight:0,y:0,x:0,alignment:null,baselinePos:0,addElement:function(a){this.width=Math.max(this.width,a.x+a.width);this.height=Math.max(this.height,a.height);this.elements.push(a);this.alignment=a.style.__getProperty("alignment")},addElementImage:function(a){this.width=Math.max(this.width,a.x+a.width);this.height=Math.max(this.height,a.height);this.elements.push(a)}, +getHeight:function(){return this.height},setY:function(a){this.y=a},getY:function(){return this.y},paint:function(a){a.save();a.translate(this.x,this.y+this.baselinePos);for(var b=0;b=0.6&&this.elements.length>1){var c=a-this.width,c=c/(this.elements.length- +1)|0;for(b=1;ba.ascent&&(a=e):a=e:b?d.getHeight()>d.getHeight()&&(b=d):b=d}this.baselinePos=Math.max(a?a.ascent:this.defaultFontMetrics.ascent,b?b.getHeight():this.defaultFontMetrics.ascent);this.height= +this.baselinePos+(a!=null?a.descent:this.defaultFontMetrics.descent);for(c=0;c", +d+1),-1!==o&&(n=f.substr(d+1,o-d-1),n.indexOf("<")!==-1?(this.rc.fchar(p),d+=1):(this.rc.setTag(n),d=o+1))):(this.rc.fchar(p),d+=1);this.rc.end();this.lines=this.rc.lines;this.__calculateDocumentDimension(typeof b==="undefined"?0:b);this.setLinesAlignment();q.restore();this.setPreferredSize(this.documentWidth,this.documentHeight);this.invalidateLayout();this.setDocumentPosition();c&&this.cacheAsBitmap(0,c);if(this.matchTextSize)this.width=this.preferredSize.width,this.height=this.preferredSize.height; +return this}},setVerticalAlignment:function(a){this.valignment=a;this.setDocumentPosition();return this},setHorizontalAlignment:function(a){this.halignment=a;this.setDocumentPosition();return this},setDocumentPosition:function(a,b){typeof a!=="undefined"&&this.setHorizontalAlignment(a);typeof b!=="undefined"&&this.setVerticalAlignment(b);var c=0,d=0;this.valignment===CAAT.Foundation.UI.Layout.LayoutManager.ALIGNMENT.CENTER?d=(this.height-this.documentHeight)/2:this.valignment===CAAT.Foundation.UI.Layout.LayoutManager.ALIGNMENT.BOTTOM&& +(d=this.height-this.documentHeight);this.halignment===CAAT.Foundation.UI.Layout.LayoutManager.ALIGNMENT.CENTER?c=(this.width-this.documentWidth)/2:this.halignment===CAAT.Foundation.UI.Layout.LayoutManager.ALIGNMENT.RIGHT&&(c=this.width-this.documentWidth);this.documentX=c;this.documentY=d},__calculateDocumentDimension:function(a){var b,c=0;for(b=this.documentHeight=this.documentWidth=0;b=a&&d.y+d.height>=b)return d.__getElementAt(a-d.x,b-d.y)}return null},mouseExit:function(){CAAT.setCursor("default")},mouseMove:function(a){(a=this.__getDocumentElementAt(a.x,a.y))&&a.getLink()?CAAT.setCursor("pointer"):CAAT.setCursor("default")},mouseClick:function(a){this.clickCallback&&(a=this.__getDocumentElementAt(a.x,a.y),a.getLink()&& +this.clickCallback(a.getLink()))},setClickCallback:function(a){this.clickCallback=a;return this}}}}); CAAT.Module({defines:"CAAT.Foundation.UI.PathActor",aliases:["CAAT.PathActor"],depends:["CAAT.Foundation.Actor"],extendsClass:"CAAT.Foundation.Actor",extendsWith:{path:null,pathBoundingRectangle:null,bOutline:false,outlineColor:"black",onUpdateCallback:null,interactive:false,getPath:function(){return this.path},setPath:function(a){this.path=a;if(a!=null)this.pathBoundingRectangle=a.getBoundingBox(),this.setInteractive(this.interactive);return this},paint:function(a,b){CAAT.Foundation.UI.PathActor.superclass.paint.call(this, a,b);if(this.path){var c=a.ctx;c.strokeStyle="#000";this.path.paint(a,this.interactive);if(this.bOutline)c.strokeStyle=this.outlineColor,c.strokeRect(this.pathBoundingRectangle.x,this.pathBoundingRectangle.y,this.pathBoundingRectangle.width,this.pathBoundingRectangle.height)}},showBoundingBox:function(a,b){if((this.bOutline=a)&&b)this.outlineColor=b;return this},setInteractive:function(a){this.interactive=a;this.path&&this.path.setInteractive(a);return this},setOnUpdateCallback:function(a){this.onUpdateCallback= a;return this},mouseDrag:function(a){this.path.drag(a.point.x,a.point.y,this.onUpdateCallback)},mouseDown:function(a){this.path.press(a.point.x,a.point.y)},mouseUp:function(){this.path.release()}}}); diff --git a/build/caat.js b/build/caat.js index 2c2ad9fd..fb8ec8d3 100644 --- a/build/caat.js +++ b/build/caat.js @@ -21,15 +21,15 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -Version: 0.6 build: 30 +Version: 0.6 build: 5 Created on: -DATE: 2013-03-18 -TIME: 23:03:05 +DATE: 2013-07-01 +TIME: 04:58:32 */ -(function(global) { +(function(global, __obj_namespace) { String.prototype.endsWith= function(suffix) { return this.indexOf(suffix, this.length - suffix.length) !== -1; @@ -62,6 +62,8 @@ TIME: 23:03:05 var Class = function () { }; + Class['__CLASS']='Class'; + // Create a new Class that inherits from this class Class.extend = function (extendingProt, constants, name, aliases, flags) { @@ -662,12 +664,16 @@ TIME: 23:03:05 function ensureNamespace( qualifiedClassName ) { var ns= qualifiedClassName.split("."); var _global= global; + var ret= null; for( var i=0; i=}, // dependencies class names - * extendsClass{string}, // class to extend from - * extensdWith{object}, // actual prototype to extend - * aliases{Array}, // other class names - * onCreation{function=} // optional callback to call after class creation. - * onPreCreation{function=} // optional callback to call after namespace class creation. + * extendsClass{string}, // class to extend from + * extensdWith{object}, // actual prototype to extend + * aliases{Array} // other class names * } * + * @name Module + * @memberof CAAT + * @static + * * @param obj {object} - * @private */ - CAAT.Module= function loadModule(obj) { + NS.Module= function loadModule(obj) { if (!obj.defines) { console.error("Bad module definition: "+obj); @@ -758,17 +771,17 @@ TIME: 23:03:05 * @memberOf CAAT * @namespace */ - CAAT.ModuleManager= {}; + NS.ModuleManager= {}; /** * Define global base position for modules structure. * @param baseURL {string} * @return {*} */ - CAAT.ModuleManager.baseURL= function(baseURL) { + NS.ModuleManager.baseURL= function(baseURL) { if ( !baseURL ) { - return CAAT.Module; + return NS.Module; } if (!baseURL.endsWith("/") ) { @@ -776,7 +789,7 @@ TIME: 23:03:05 } ModuleManager.baseURL= baseURL; - return CAAT.ModuleManager; + return NS.ModuleManager; }; /** @@ -784,7 +797,7 @@ TIME: 23:03:05 * @param module {string} * @param path {string} */ - CAAT.ModuleManager.setModulePath= function( module, path ) { + NS.ModuleManager.setModulePath= function( module, path ) { if ( !path.endsWith("/") ) { path= path + "/"; @@ -805,7 +818,7 @@ TIME: 23:03:05 return a} */ behaviors:null, // contained behaviors array + recursiveCycleBehavior : false, + conforming : false, /** + * @param conforming {bool=} conform this behavior duration to that of its children. * @inheritDoc * @private */ - __init:function () { + __init:function ( conforming ) { this.__super(); this.behaviors = []; + if ( conforming ) { + this.conforming= true; + } return this; }, @@ -4632,6 +4688,20 @@ CAAT.Module({ return null; }, + setCycle : function( cycle, recurse ) { + CAAT.Behavior.ContainerBehavior.superclass.setCycle.call(this,cycle); + + if ( recurse ) { + for( var i=0; i=Math.PI) { + angle= (angle-2*Math.PI) + } + if ( angle<-2*Math.PI) { + angle= (angle+2*Math.PI); + } + } + if (this.doValueApplication) { actor.setRotationAnchored(angle, this.anchorX, this.anchorY); } @@ -6211,9 +6332,6 @@ CAAT.Module({ */ defines:"CAAT.Module.Audio.AudioManager", - depends:[ - "CAAT.Module.Runtime.BrowserInfo" - ], extendsWith:function () { return { @@ -6222,20 +6340,17 @@ CAAT.Module({ */ __init:function () { - this.browserInfo = CAAT.Module.Runtime.BrowserInfo; + this.isFirefox= navigator.userAgent.match(/Firefox/g)!==null; return this; }, + isFirefox : false, + /** * The only background music audio channel. */ musicChannel: null, - /** - * Some browser info needed to know whether we´re in FF so we can fix the loop bug. - */ - browserInfo:null, - /** * Is music enabled ? */ @@ -6266,15 +6381,29 @@ CAAT.Module({ */ loopingChannels:[], + /** + * available formats for audio elements. + * the system will load audio files with the extensions in this preferred order. + */ + audioFormatExtensions : [ + 'ogg', + 'wav', + 'x-wav', + 'mp3' + ], + + currentAudioFormatExtension : 'ogg', + /** * Audio formats. * @dict */ audioTypes:{ // supported audio formats. Don't remember where i took them from :S - 'mp3':'audio/mpeg;', - 'ogg':'audio/ogg; codecs="vorbis"', - 'wav':'audio/wav; codecs="1"', - 'mp4':'audio/mp4; codecs="mp4a.40.2"' + 'ogg': 'audio/ogg', + 'mp3': 'audio/mpeg;', + 'wav': 'audio/wav', + 'x-wav':'audio/x-wav', + 'mp4': 'audio/mp4"' }, /** @@ -6286,7 +6415,9 @@ CAAT.Module({ * * @return this. */ - initialize:function (numChannels) { + initialize:function (numChannels ) { + + this.setAudioFormatExtensions( this.audioFormatExtensions ); this.audioCache = []; this.channels = []; @@ -6330,6 +6461,45 @@ CAAT.Module({ return this; }, + + setAudioFormatExtensions : function( formats ) { + this.audioFormatExtensions= formats; + this.__setCurrentAudioFormatExtension(); + return this; + }, + + __setCurrentAudioFormatExtension : function( ) { + + var audio= new Audio(); + + for( var i= 0, l=this.audioFormatExtensions.length; i} @@ -8616,8 +8783,10 @@ CAAT.Module( { */ loadedCount: 0, + baseURL : null, + addElement : function( id, path ) { - this.elements.push( new descriptor(id,path,this) ); + this.elements.push( new descriptor(id,this.baseURL+path,this) ); return this; }, @@ -8647,6 +8816,11 @@ CAAT.Module( { } }, + setBaseURL : function( base ) { + this.baseURL= base; + return this; + }, + load: function( onfinished, onload_one, onerror ) { this.cfinished= onfinished; @@ -8764,7 +8938,61 @@ CAAT.Module( { } }); -/** +CAAT.Module({ + + defines : "CAAT.Module.Preloader.XHR", + extendsWith : { + + /** + * + * @param callback function({string},{object}) a callback function. string will be "ok" or "error" + * @param url {string} a url + * @param asynch {bool} load synchronous or asynchronously + * @param method {string} GET or POST + */ + load : function( callback, url, asynch, method ) { + + if (typeof asynch==="undefined") { + asynch= true; + } + if (typeof method==="undefined") { + method= "GET";; + } + + var req = false; + if(window.XMLHttpRequest && !(window.ActiveXObject)) { + try { + req = new XMLHttpRequest(); + } catch(e) { + req = false; + } + } else if(window.ActiveXObject) { + try { + req = new ActiveXObject("Msxml2.XMLHTTP"); + } catch(e) { + try { + req = new ActiveXObject("Microsoft.XMLHTTP"); + } catch(e) { + req = false; + } + } + } + + if(req) { + req.open(method, url, false); + req.onreadystatechange = function(e) { + if( req.status != 200 ) + return callback("error"); + + var text= e.currentTarget ? e.currentTarget.responseText : e.target.responseText; + callback("ok", text); + } ; + req.send(); + } + } + } + +});/** * See LICENSE file. */ CAAT.Module({ @@ -12365,8 +12593,8 @@ CAAT.Module( { * @param time {number} a value between 0 and 1 both inclusive. 0 will return path's starting coordinate. * 1 will return path's end coordinate. * @param open_contour {boolean=} treat this path as an open contour. It is intended for - * open paths, and interpolators which give values above 1. see @link - * @param tangent_threshold {number=} + * open paths, and interpolators which give values above 1. see tutorial 7.1. + * @link{../../documentation/tutorials/t7-1.html} * * @return {CAAT.Foundation.Point} */ @@ -16228,7 +16456,9 @@ CAAT.Module({ this.mapInfo = {}; this.animationsMap= {}; - if ( arguments.length===3 ) { + if ( arguments.length===1 ) { + this.initialize.call(this, arguments[0], 1, 1); + } else if ( arguments.length===3 ) { this.initialize.apply(this, arguments); } return this; @@ -16526,7 +16756,6 @@ CAAT.Module({ this.width= image.mapInfo[0].width; this.height= image.mapInfo[0].height; - } else { this.image = image; this.width = image.width; @@ -16595,6 +16824,27 @@ CAAT.Module({ return this; }, + /** + * Create elements as director.getImage values. + * Create as much as elements defined in this sprite image. + * The elements will be named prefix+ + * @param prefix + */ + addElementsAsImages : function( prefix ) { + for( var i in this.mapInfo ) { + var si= new CAAT.Foundation.SpriteImage().initialize( this.image, 1, 1 ); + si.addElement(0, this.mapInfo[i]); + si.setSpriteIndex(0); + CAAT.currentDirector.addImage( prefix+i, si ); + } + }, + + copy : function( other ) { + this.initialize(other,1,1); + this.mapInfo= other.mapInfo; + return this; + }, + /** * Must be used to draw actor background and the actor should have setClip(true) so that the image tiles * properly. @@ -17021,6 +17271,39 @@ CAAT.Module({ return this.mapInfo[ index ]; }, + initializeFromGlyphDesigner : function( text ) { + for (var i = 0; i < text.length; i++) { + if (0 === text[i].indexOf("char ")) { + var str = text[i].substring(5); + var pairs = str.split(' '); + var obj = { + x: 0, + y: 0, + width: 0, + height: 0, + xadvance: 0, + xoffset: 0, + yoffset: 0 + }; + + for (var j = 0; j < pairs.length; j++) { + var pair = pairs[j]; + var pairData = pair.split("="); + var key = pairData[0]; + var value = pairData[1]; + if (value.charAt(0) === '"' && value.charAt(value.length - 1) === '"') { + value.substring(1, value.length - 1); + } + obj[ key ] = value; + } + + this.addElement(String.fromCharCode(obj.id), obj); + } + } + + return this; + }, + /** * This method takes the output generated from the tool at http://labs.hyperandroid.com/static/texture/spriter.html * and creates a map into that image. @@ -17059,6 +17342,25 @@ CAAT.Module({ return this; }, + initializeFromTexturePackerJSON : function( image, obj ) { + + for( var img in obj.frames ) { + var imgData= obj.frames[img]; + + var si_obj= { + x: imgData.frame.x, + y: imgData.frame.y, + width: imgData.spriteSourceSize.w, + height: imgData.spriteSourceSize.h, + id: '0' + }; + + var si= new CAAT.Foundation.SpriteImage().initialize( image, 1, 1 ); + si.addElement(0,si_obj); + CAAT.currentDirector.addImage( img.substring(0,img.indexOf('.')), si ); + } + }, + /** * Add one element to the spriteImage. * @param key {string|number} index or sprite identifier. @@ -17321,6 +17623,7 @@ CAAT.Module({ defines:"CAAT.Foundation.Actor", aliases: [ "CAAT.Actor" ], depends: [ + "CAAT.Math.Dimension", "CAAT.Event.AnimationLoop", "CAAT.Foundation.SpriteImage", "CAAT.Core.Constants", @@ -17740,6 +18043,17 @@ CAAT.Module({ */ isAA:true, + /** + * if this actor is cached, when destroy is called, it does not call 'clean' method, which clears some + * internal properties. + */ + isCachedActor : false, + + setCachedActor : function(cached) { + this.isCachedActor= cached; + return this; + }, + /** * Make this actor not be laid out. */ @@ -18783,12 +19097,19 @@ CAAT.Module({ this.parent.removeChild(this); } + this.fireEvent('destroyed', time); + if ( !this.isCachedActor ) { + this.clean(); + } + + }, + + clean : function() { this.backgroundImage= null; this.emptyBehaviorList(); - this.fireEvent('destroyed', time); this.lifecycleListenerList= []; - }, + /** * Transform a point or array of points in model space to view space. * @@ -20104,6 +20425,10 @@ CAAT.Module({ } } + if (this.postPaint) { + this.postPaint( director, time ); + } + ctx.restore(); return true; @@ -20245,6 +20570,15 @@ CAAT.Module({ addChildImmediately:function (child, constraint) { return this.addChild(child, constraint); }, + + addActorImmediately: function(child,constraint) { + return this.addChildImmediately(child,constraint); + }, + + addActor : function( child, constraint ) { + return this.addChild(child,constraint); + }, + /** * Adds an Actor to this ActorContainer. * The Actor will be added to the container AFTER frame animation, and not on method call time. @@ -21214,6 +21548,7 @@ CAAT.Module({ this.browserInfo = CAAT.Module.Runtime.BrowserInfo; this.audioManager = new CAAT.Module.Audio.AudioManager().initialize(8); this.scenes = []; + this.imagesCache= []; // input related variables initialization this.mousePoint = new CAAT.Math.Point(0, 0, 0); @@ -21588,6 +21923,11 @@ CAAT.Module({ return this.audioManager.cancelPlayByChannel(audioObject); }, + setAudioFormatExtensions : function( extensions ) { + this.audioManager.setAudioFormatExtensions(extensions); + return this; + }, + setValueForKey : function( key, value ) { this.__map[key]= value; return this; @@ -21910,6 +22250,10 @@ CAAT.Module({ }, setImagesCache:function (imagesCache, tpW, tpH) { + if (!imagesCache || !imagesCache.length ) { + return this; + } + var i; if (null !== this.glTextureManager) { @@ -21973,7 +22317,8 @@ CAAT.Module({ */ addImage:function (id, image, noUpdateGL) { if (this.getImage(id)) { - for (var i = 0; i < this.imagesCache.length; i++) { +// for (var i = 0; i < this.imagesCache.length; i++) { + for( var i in this.imagesCache ) { if (this.imagesCache[i].id === id) { this.imagesCache[i].image = image; break; @@ -22881,7 +23226,8 @@ CAAT.Module({ return ret; } - for (var i = 0; i < this.imagesCache.length; i++) { + //for (var i = 0; i < this.imagesCache.length; i++) { + for( var i in this.imagesCache ) { if (this.imagesCache[i].id === sId) { return this.imagesCache[i].image; } @@ -23244,7 +23590,7 @@ CAAT.Module({ // check for mouse move threshold. if (!this.dragging) { - if (Math.abs(this.prevMousePoint.x - pos.x) < CAAT.DRAG_THRESHOLD_X || + if (Math.abs(this.prevMousePoint.x - pos.x) < CAAT.DRAG_THRESHOLD_X && Math.abs(this.prevMousePoint.y - pos.y) < CAAT.DRAG_THRESHOLD_Y) { return; } @@ -24651,7 +24997,8 @@ CAAT.Module( { depends : [ "CAAT.Foundation.Actor", "CAAT.Foundation.SpriteImage", - "CAAT.Module.Font.Font" + "CAAT.Module.Font.Font", + "CAAT.Foundation.UI.Layout.LayoutManager" ], aliases : ["CAAT.UI.Label"], extendsClass : "CAAT.Foundation.Actor", @@ -24936,10 +25283,10 @@ CAAT.Module( { var image_width; - if ( r && c ) { + if ( typeof r!=="undefined" && typeof c!=="undefined" ) { image_width= image.getWidth(); } else { - image_width= image.getWrappedImageWidth(); + image_width= ( image instanceof CAAT.Foundation.SpriteImage ) ? image.getWidth() : image.getWrappedImageWidth(); } // la imagen cabe en este sitio. @@ -25168,6 +25515,8 @@ CAAT.Module( { c= pairs[2]|0; } this.__image( this.images[image], r, c ); + } else if (CAAT.currentDirector.getImage(image) ) { + this.__image( CAAT.currentDirector.getImage(image) ); } } else if ( tag.indexOf("a=")===0 ) { pairs= tag.split("="); @@ -25239,7 +25588,12 @@ CAAT.Module( { this.height= image.getHeight(); if ( this.image instanceof CAAT.SpriteImage || this.image instanceof CAAT.Foundation.SpriteImage ) { - this.spriteIndex= r*image.columns+c; + + if ( typeof r==="undefined" || typeof c==="undefined" ) { + this.spriteIndex= 0; + } else { + this.spriteIndex= r*image.columns+c; + } this.paint= this.paintSI; } @@ -25270,7 +25624,7 @@ CAAT.Module( { }, getHeight : function() { - return this.image instanceof CAAT.Foundation.SpriteImage ? this.image.singleHeight : this.image.height; + return this.image instanceof CAAT.Foundation.SpriteImage ? this.image.getHeight() : this.image.height; }, getFontMetrics : function() { @@ -25591,6 +25945,20 @@ CAAT.Module( { */ clickCallback : null, + matchTextSize : true, + + /** + * Make the label actor the size the label document has been calculated for. + * @param match {boolean} + */ + setMatchTextSize : function( match ) { + this.matchTextSize= match; + if ( match ) { + this.width= this.preferredSize.width; + this.height= this.preferredSize.height; + } + }, + setStyle : function( name, styleData ) { this.styles[ name ]= styleData; return this; @@ -25687,6 +26055,11 @@ CAAT.Module( { this.cacheAsBitmap(0,cached); } + if ( this.matchTextSize ) { + this.width= this.preferredSize.width; + this.height= this.preferredSize.height; + } + return this; }, @@ -25702,7 +26075,15 @@ CAAT.Module( { return this; }, - setDocumentPosition : function() { + setDocumentPosition : function( halign, valign ) { + + if ( typeof halign!=="undefined" ) { + this.setHorizontalAlignment(halign); + } + if ( typeof valign!=="undefined" ) { + this.setVerticalAlignment(valign); + } + var xo=0, yo=0; if ( this.valignment===CAAT.Foundation.UI.Layout.LayoutManager.ALIGNMENT.CENTER ) { diff --git a/changelog b/changelog index 52afbaec..45dfd371 100644 --- a/changelog +++ b/changelog @@ -1,3 +1,40 @@ + + +* 07/01/2013 0.7 Build 6 * +--------------------------- + +* Added functionality to AudioManager. The method director.setAudioFormatExtensions which proxies to audioManager.setAudioFormatExtensions + sets a default audio object extension set. By default is [ 'ogg', 'mp3', 'wav', 'x-wav', 'mp4' ]. This means CAAT by default + will try to find ogg files, then mp3, etc. It is not important whether the audio files add to director.addAudio have extension + or not. CAAT will add the first suitable extension to be played from the supplied or default audioFormatExtension array. +* Added __CLASS attribute to Class function. Now all objects are identified. +* Fixed Director dynamic scale behavior. +* Enhanced Skeletal animation support (Spine). +* Fixed. Font error which prevented fonts to draw on screen. +* Added. Method SpriteImage.addElementsAsImages which turns all subelements, either a grid defined by rows and columns or a JSON map + into available images for director.getImage calls. +* Fixed. Label object made tags to be incorrectly set in the document. +* Fixed. Label now accepts images set by calling Label.setImage or images with names matching director.getImage calls. +* Added demo35: Label usage. +* Added demo36: Sprite maps. +* Added. Method SpriteImage.initializeFromTexturePackerJSON which adds map sub-images as valid director.getImage values. + +* 04/07/2013 0.6 Build 52 * +--------------------------- + +* Changed. Some functions from Matrix objects to Matrix class. +* Added. Modification to CAAT.Math.Rectangle . if no parameters in constructor is set to empty. +* Fixed. CAAT.Foundation.UI.Label dependencies. +* Fixed. CAAT.Foundation.Actor dependencies. +* Added. Capture skeletal animation on-the-fly to an spriteSheet. + + +* 04/02/2013 0.6 Build 49 * +--------------------------- + +* Added. Skeletal animation based on Spine (by @EsotericSoft) format. + + * 03/18/2013 0.6 Build 30 * --------------------------- diff --git a/documentation/demos/demo-resources/img/font.txt b/documentation/demos/demo-resources/img/font.txt new file mode 100755 index 00000000..32f59f2a --- /dev/null +++ b/documentation/demos/demo-resources/img/font.txt @@ -0,0 +1,453 @@ +info face="LeagueGothic" size=123 bold=0 italic=0 charset="" unicode=0 stretchH=100 smooth=1 aa=1 padding=0,0,0,0 spacing=2,2 +common lineHeight=145 base=114 scaleW=1024 scaleH=1024 pages=1 packed=0 +page id=0 file="ibasketfont.png" +chars count=169 +char id=124 x=2 y=2 width=22 height=144 xoffset=5 yoffset=1 xadvance=21 page=0 chnl=0 letter="|" +char id=125 x=26 y=2 width=43 height=130 xoffset=3 yoffset=11 xadvance=41 page=0 chnl=0 letter="}" +char id=123 x=71 y=2 width=43 height=130 xoffset=4 yoffset=11 xadvance=41 page=0 chnl=0 letter="{" +char id=197 x=116 y=2 width=50 height=126 xoffset=1 yoffset=-12 xadvance=46 page=0 chnl=0 letter="Å" +char id=199 x=168 y=2 width=44 height=126 xoffset=4 yoffset=11 xadvance=43 page=0 chnl=0 letter="Ç" +char id=255 x=214 y=2 width=42 height=126 xoffset=1 yoffset=12 xadvance=38 page=0 chnl=0 letter="ÿ" +char id=253 x=258 y=2 width=42 height=125 xoffset=1 yoffset=13 xadvance=38 page=0 chnl=0 letter="ý" +char id=254 x=302 y=2 width=42 height=125 xoffset=5 yoffset=12 xadvance=41 page=0 chnl=0 letter="þ" +char id=41 x=346 y=2 width=37 height=125 xoffset=2 yoffset=7 xadvance=34 page=0 chnl=0 letter=")" +char id=40 x=385 y=2 width=35 height=125 xoffset=4 yoffset=7 xadvance=34 page=0 chnl=0 letter="(" +char id=106 x=422 y=2 width=30 height=125 xoffset=-3 yoffset=12 xadvance=22 page=0 chnl=0 letter="j" +char id=92 x=454 y=2 width=52 height=124 xoffset=0 yoffset=1 xadvance=48 page=0 chnl=0 letter="\" +char id=220 x=508 y=2 width=46 height=123 xoffset=5 yoffset=-8 xadvance=45 page=0 chnl=0 letter="Ü" +char id=214 x=556 y=2 width=45 height=123 xoffset=4 yoffset=-8 xadvance=44 page=0 chnl=0 letter="Ö" +char id=196 x=603 y=2 width=49 height=122 xoffset=1 yoffset=-8 xadvance=46 page=0 chnl=0 letter="Ä" +char id=217 x=654 y=2 width=46 height=122 xoffset=5 yoffset=-7 xadvance=45 page=0 chnl=0 letter="Ù" +char id=218 x=702 y=2 width=46 height=122 xoffset=5 yoffset=-7 xadvance=45 page=0 chnl=0 letter="Ú" +char id=219 x=750 y=2 width=46 height=122 xoffset=5 yoffset=-7 xadvance=45 page=0 chnl=0 letter="Û" +char id=36 x=798 y=2 width=45 height=122 xoffset=2 yoffset=5 xadvance=42 page=0 chnl=0 letter="$" +char id=210 x=845 y=2 width=45 height=122 xoffset=4 yoffset=-7 xadvance=44 page=0 chnl=0 letter="Ò" +char id=211 x=892 y=2 width=45 height=122 xoffset=4 yoffset=-7 xadvance=44 page=0 chnl=0 letter="Ó" +char id=212 x=939 y=2 width=45 height=122 xoffset=4 yoffset=-7 xadvance=44 page=0 chnl=0 letter="Ô" +char id=213 x=2 y=148 width=45 height=122 xoffset=4 yoffset=-7 xadvance=44 page=0 chnl=0 letter="Õ" +char id=203 x=49 y=148 width=36 height=122 xoffset=5 yoffset=-8 xadvance=38 page=0 chnl=0 letter="Ë" +char id=207 x=87 y=148 width=34 height=122 xoffset=-3 yoffset=-8 xadvance=22 page=0 chnl=0 letter="Ï" +char id=195 x=123 y=148 width=50 height=121 xoffset=1 yoffset=-7 xadvance=46 page=0 chnl=0 letter="Ã" +char id=209 x=175 y=148 width=49 height=121 xoffset=5 yoffset=-7 xadvance=49 page=0 chnl=0 letter="Ñ" +char id=192 x=226 y=148 width=49 height=121 xoffset=1 yoffset=-7 xadvance=46 page=0 chnl=0 letter="À" +char id=193 x=277 y=148 width=49 height=121 xoffset=1 yoffset=-7 xadvance=46 page=0 chnl=0 letter="Á" +char id=194 x=328 y=148 width=49 height=121 xoffset=1 yoffset=-7 xadvance=46 page=0 chnl=0 letter="Â" +char id=221 x=379 y=148 width=47 height=121 xoffset=1 yoffset=-7 xadvance=42 page=0 chnl=0 letter="Ý" +char id=200 x=428 y=148 width=36 height=121 xoffset=5 yoffset=-7 xadvance=38 page=0 chnl=0 letter="È" +char id=201 x=466 y=148 width=36 height=121 xoffset=5 yoffset=-7 xadvance=38 page=0 chnl=0 letter="É" +char id=202 x=504 y=148 width=36 height=121 xoffset=5 yoffset=-7 xadvance=38 page=0 chnl=0 letter="Ê" +char id=206 x=542 y=148 width=36 height=121 xoffset=-4 yoffset=-7 xadvance=22 page=0 chnl=0 letter="Î" +char id=204 x=580 y=148 width=25 height=121 xoffset=-0 yoffset=-7 xadvance=24 page=0 chnl=0 letter="Ì" +char id=205 x=607 y=148 width=25 height=121 xoffset=5 yoffset=-7 xadvance=24 page=0 chnl=0 letter="Í" +char id=91 x=634 y=148 width=29 height=115 xoffset=5 yoffset=12 xadvance=32 page=0 chnl=0 letter="[" +char id=93 x=665 y=148 width=29 height=115 xoffset=3 yoffset=12 xadvance=32 page=0 chnl=0 letter="]" +char id=162 x=696 y=148 width=40 height=113 xoffset=4 yoffset=8 xadvance=38 page=0 chnl=0 letter="¢" +char id=126 x=738 y=148 width=76 height=112 xoffset=7 yoffset=2 xadvance=77 page=0 chnl=0 letter="~" +char id=47 x=816 y=148 width=48 height=111 xoffset=0 yoffset=12 xadvance=43 page=0 chnl=0 letter="/" +char id=81 x=866 y=148 width=45 height=110 xoffset=4 yoffset=11 xadvance=44 page=0 chnl=0 letter="Q" +char id=229 x=913 y=148 width=44 height=106 xoffset=3 yoffset=9 xadvance=41 page=0 chnl=0 letter="å" +char id=169 x=2 y=272 width=101 height=104 xoffset=3 yoffset=11 xadvance=99 page=0 chnl=0 letter="©" +char id=174 x=105 y=272 width=101 height=104 xoffset=3 yoffset=11 xadvance=99 page=0 chnl=0 letter="®" +char id=37 x=208 y=272 width=62 height=104 xoffset=3 yoffset=11 xadvance=60 page=0 chnl=0 letter="%" +char id=163 x=272 y=272 width=54 height=104 xoffset=0 yoffset=11 xadvance=49 page=0 chnl=0 letter="£" +char id=64 x=328 y=272 width=54 height=104 xoffset=4 yoffset=11 xadvance=52 page=0 chnl=0 letter="@" +char id=38 x=384 y=272 width=54 height=104 xoffset=3 yoffset=11 xadvance=51 page=0 chnl=0 letter="&" +char id=103 x=440 y=272 width=47 height=104 xoffset=1 yoffset=34 xadvance=42 page=0 chnl=0 letter="g" +char id=71 x=489 y=272 width=46 height=104 xoffset=4 yoffset=11 xadvance=44 page=0 chnl=0 letter="G" +char id=216 x=537 y=272 width=45 height=104 xoffset=4 yoffset=11 xadvance=44 page=0 chnl=0 letter="Ø" +char id=83 x=584 y=272 width=45 height=104 xoffset=2 yoffset=11 xadvance=42 page=0 chnl=0 letter="S" +char id=79 x=631 y=272 width=45 height=104 xoffset=4 yoffset=11 xadvance=44 page=0 chnl=0 letter="O" +char id=48 x=678 y=272 width=45 height=104 xoffset=4 yoffset=11 xadvance=44 page=0 chnl=0 letter="0" +char id=67 x=725 y=272 width=44 height=104 xoffset=4 yoffset=11 xadvance=43 page=0 chnl=0 letter="C" +char id=51 x=771 y=272 width=44 height=104 xoffset=3 yoffset=11 xadvance=41 page=0 chnl=0 letter="3" +char id=56 x=817 y=272 width=44 height=104 xoffset=3 yoffset=11 xadvance=42 page=0 chnl=0 letter="8" +char id=57 x=863 y=272 width=44 height=104 xoffset=3 yoffset=11 xadvance=42 page=0 chnl=0 letter="9" +char id=54 x=909 y=272 width=44 height=104 xoffset=4 yoffset=11 xadvance=42 page=0 chnl=0 letter="6" +char id=240 x=955 y=272 width=41 height=104 xoffset=5 yoffset=11 xadvance=40 page=0 chnl=0 letter="ð" +char id=50 x=2 y=378 width=46 height=103 xoffset=3 yoffset=11 xadvance=44 page=0 chnl=0 letter="2" +char id=85 x=50 y=378 width=46 height=103 xoffset=5 yoffset=12 xadvance=45 page=0 chnl=0 letter="U" +char id=223 x=98 y=378 width=46 height=103 xoffset=4 yoffset=11 xadvance=44 page=0 chnl=0 letter="ß" +char id=228 x=146 y=378 width=44 height=103 xoffset=3 yoffset=12 xadvance=41 page=0 chnl=0 letter="ä" +char id=53 x=192 y=378 width=43 height=103 xoffset=4 yoffset=12 xadvance=42 page=0 chnl=0 letter="5" +char id=100 x=237 y=378 width=42 height=103 xoffset=4 yoffset=12 xadvance=41 page=0 chnl=0 letter="d" +char id=113 x=281 y=378 width=42 height=103 xoffset=4 yoffset=34 xadvance=41 page=0 chnl=0 letter="q" +char id=252 x=325 y=378 width=42 height=103 xoffset=5 yoffset=12 xadvance=41 page=0 chnl=0 letter="ü" +char id=121 x=369 y=378 width=42 height=103 xoffset=1 yoffset=35 xadvance=38 page=0 chnl=0 letter="y" +char id=98 x=413 y=378 width=42 height=103 xoffset=5 yoffset=12 xadvance=41 page=0 chnl=0 letter="b" +char id=112 x=457 y=378 width=42 height=103 xoffset=5 yoffset=34 xadvance=41 page=0 chnl=0 letter="p" +char id=235 x=501 y=378 width=41 height=103 xoffset=4 yoffset=12 xadvance=40 page=0 chnl=0 letter="ë" +char id=246 x=544 y=378 width=41 height=103 xoffset=4 yoffset=12 xadvance=39 page=0 chnl=0 letter="ö" +char id=231 x=587 y=378 width=40 height=103 xoffset=4 yoffset=34 xadvance=39 page=0 chnl=0 letter="ç" +char id=74 x=629 y=378 width=30 height=103 xoffset=1 yoffset=12 xadvance=25 page=0 chnl=0 letter="J" +char id=35 x=661 y=378 width=74 height=102 xoffset=3 yoffset=12 xadvance=74 page=0 chnl=0 letter="#" +char id=198 x=737 y=378 width=68 height=102 xoffset=1 yoffset=12 xadvance=66 page=0 chnl=0 letter="Æ" +char id=87 x=807 y=378 width=66 height=102 xoffset=1 yoffset=12 xadvance=62 page=0 chnl=0 letter="W" +char id=77 x=875 y=378 width=55 height=102 xoffset=5 yoffset=12 xadvance=60 page=0 chnl=0 letter="M" +char id=208 x=932 y=378 width=50 height=102 xoffset=1 yoffset=12 xadvance=46 page=0 chnl=0 letter="Ð" +char id=78 x=2 y=483 width=49 height=102 xoffset=5 yoffset=12 xadvance=49 page=0 chnl=0 letter="N" +char id=65 x=53 y=483 width=49 height=102 xoffset=1 yoffset=12 xadvance=46 page=0 chnl=0 letter="A" +char id=88 x=104 y=483 width=48 height=102 xoffset=1 yoffset=12 xadvance=44 page=0 chnl=0 letter="X" +char id=72 x=154 y=483 width=47 height=102 xoffset=5 yoffset=12 xadvance=47 page=0 chnl=0 letter="H" +char id=75 x=203 y=483 width=47 height=102 xoffset=5 yoffset=12 xadvance=46 page=0 chnl=0 letter="K" +char id=89 x=252 y=483 width=47 height=102 xoffset=1 yoffset=12 xadvance=42 page=0 chnl=0 letter="Y" +char id=68 x=301 y=483 width=46 height=102 xoffset=5 yoffset=12 xadvance=46 page=0 chnl=0 letter="D" +char id=86 x=349 y=483 width=46 height=102 xoffset=1 yoffset=12 xadvance=43 page=0 chnl=0 letter="V" +char id=165 x=397 y=483 width=46 height=102 xoffset=1 yoffset=12 xadvance=43 page=0 chnl=0 letter="¥" +char id=66 x=445 y=483 width=45 height=102 xoffset=5 yoffset=12 xadvance=45 page=0 chnl=0 letter="B" +char id=82 x=492 y=483 width=45 height=102 xoffset=5 yoffset=12 xadvance=44 page=0 chnl=0 letter="R" +char id=227 x=539 y=483 width=44 height=102 xoffset=3 yoffset=13 xadvance=41 page=0 chnl=0 letter="ã" +char id=52 x=585 y=483 width=44 height=102 xoffset=1 yoffset=12 xadvance=41 page=0 chnl=0 letter="4" +char id=222 x=631 y=483 width=44 height=102 xoffset=5 yoffset=12 xadvance=44 page=0 chnl=0 letter="Þ" +char id=80 x=677 y=483 width=44 height=102 xoffset=5 yoffset=12 xadvance=43 page=0 chnl=0 letter="P" +char id=84 x=723 y=483 width=44 height=102 xoffset=0 yoffset=12 xadvance=39 page=0 chnl=0 letter="T" +char id=224 x=769 y=483 width=44 height=102 xoffset=3 yoffset=13 xadvance=41 page=0 chnl=0 letter="à" +char id=225 x=815 y=483 width=44 height=102 xoffset=3 yoffset=13 xadvance=41 page=0 chnl=0 letter="á" +char id=226 x=861 y=483 width=44 height=102 xoffset=3 yoffset=13 xadvance=41 page=0 chnl=0 letter="â" +char id=63 x=907 y=483 width=43 height=102 xoffset=1 yoffset=12 xadvance=39 page=0 chnl=0 letter="?" +char id=191 x=952 y=483 width=42 height=102 xoffset=2 yoffset=36 xadvance=39 page=0 chnl=0 letter="¿" +char id=249 x=2 y=587 width=42 height=102 xoffset=5 yoffset=13 xadvance=41 page=0 chnl=0 letter="ù" +char id=250 x=46 y=587 width=42 height=102 xoffset=5 yoffset=13 xadvance=41 page=0 chnl=0 letter="ú" +char id=251 x=90 y=587 width=42 height=102 xoffset=5 yoffset=13 xadvance=41 page=0 chnl=0 letter="û" +char id=104 x=134 y=587 width=42 height=102 xoffset=5 yoffset=12 xadvance=41 page=0 chnl=0 letter="h" +char id=245 x=178 y=587 width=41 height=102 xoffset=4 yoffset=13 xadvance=39 page=0 chnl=0 letter="õ" +char id=232 x=221 y=587 width=41 height=102 xoffset=4 yoffset=13 xadvance=40 page=0 chnl=0 letter="è" +char id=233 x=264 y=587 width=41 height=102 xoffset=4 yoffset=13 xadvance=40 page=0 chnl=0 letter="é" +char id=234 x=307 y=587 width=41 height=102 xoffset=4 yoffset=13 xadvance=40 page=0 chnl=0 letter="ê" +char id=242 x=350 y=587 width=41 height=102 xoffset=4 yoffset=13 xadvance=39 page=0 chnl=0 letter="ò" +char id=243 x=393 y=587 width=41 height=102 xoffset=4 yoffset=13 xadvance=39 page=0 chnl=0 letter="ó" +char id=244 x=436 y=587 width=41 height=102 xoffset=4 yoffset=13 xadvance=39 page=0 chnl=0 letter="ô" +char id=90 x=479 y=587 width=41 height=102 xoffset=1 yoffset=12 xadvance=38 page=0 chnl=0 letter="Z" +char id=107 x=522 y=587 width=39 height=102 xoffset=5 yoffset=12 xadvance=38 page=0 chnl=0 letter="k" +char id=55 x=563 y=587 width=39 height=102 xoffset=0 yoffset=12 xadvance=35 page=0 chnl=0 letter="7" +char id=70 x=604 y=587 width=38 height=102 xoffset=5 yoffset=12 xadvance=37 page=0 chnl=0 letter="F" +char id=76 x=644 y=587 width=36 height=102 xoffset=5 yoffset=12 xadvance=36 page=0 chnl=0 letter="L" +char id=69 x=682 y=587 width=36 height=102 xoffset=5 yoffset=12 xadvance=38 page=0 chnl=0 letter="E" +char id=239 x=720 y=587 width=34 height=102 xoffset=-3 yoffset=12 xadvance=22 page=0 chnl=0 letter="ï" +char id=102 x=756 y=587 width=33 height=102 xoffset=1 yoffset=12 xadvance=29 page=0 chnl=0 letter="f" +char id=49 x=791 y=587 width=33 height=102 xoffset=1 yoffset=12 xadvance=29 page=0 chnl=0 letter="1" +char id=108 x=826 y=587 width=23 height=102 xoffset=5 yoffset=12 xadvance=22 page=0 chnl=0 letter="l" +char id=33 x=851 y=587 width=20 height=102 xoffset=4 yoffset=12 xadvance=23 page=0 chnl=0 letter="!" +char id=161 x=873 y=587 width=20 height=102 xoffset=4 yoffset=35 xadvance=23 page=0 chnl=0 letter="¡" +char id=73 x=895 y=587 width=19 height=102 xoffset=5 yoffset=12 xadvance=23 page=0 chnl=0 letter="I" +char id=105 x=916 y=587 width=18 height=102 xoffset=5 yoffset=12 xadvance=22 page=0 chnl=0 letter="i" +char id=241 x=936 y=587 width=42 height=101 xoffset=5 yoffset=13 xadvance=41 page=0 chnl=0 letter="ñ" +char id=238 x=980 y=587 width=36 height=101 xoffset=-4 yoffset=13 xadvance=22 page=0 chnl=0 letter="î" +char id=236 x=2 y=691 width=25 height=101 xoffset=-2 yoffset=13 xadvance=22 page=0 chnl=0 letter="ì" +char id=237 x=29 y=691 width=25 height=101 xoffset=5 yoffset=13 xadvance=22 page=0 chnl=0 letter="í" +char id=116 x=56 y=691 width=34 height=96 xoffset=1 yoffset=19 xadvance=30 page=0 chnl=0 letter="t" +char id=59 x=92 y=691 width=18 height=95 xoffset=4 yoffset=35 xadvance=22 page=0 chnl=0 letter=";" +char id=248 x=112 y=691 width=41 height=88 xoffset=4 yoffset=31 xadvance=39 page=0 chnl=0 letter="ø" +char id=230 x=155 y=691 width=62 height=81 xoffset=3 yoffset=34 xadvance=59 page=0 chnl=0 letter="æ" +char id=97 x=219 y=691 width=44 height=81 xoffset=3 yoffset=34 xadvance=41 page=0 chnl=0 letter="a" +char id=101 x=265 y=691 width=41 height=81 xoffset=4 yoffset=34 xadvance=40 page=0 chnl=0 letter="e" +char id=111 x=308 y=691 width=41 height=81 xoffset=4 yoffset=34 xadvance=39 page=0 chnl=0 letter="o" +char id=115 x=351 y=691 width=41 height=81 xoffset=2 yoffset=34 xadvance=38 page=0 chnl=0 letter="s" +char id=99 x=394 y=691 width=40 height=81 xoffset=4 yoffset=34 xadvance=39 page=0 chnl=0 letter="c" +char id=109 x=436 y=691 width=62 height=80 xoffset=5 yoffset=34 xadvance=61 page=0 chnl=0 letter="m" +char id=117 x=500 y=691 width=42 height=80 xoffset=5 yoffset=35 xadvance=41 page=0 chnl=0 letter="u" +char id=110 x=544 y=691 width=42 height=80 xoffset=5 yoffset=34 xadvance=41 page=0 chnl=0 letter="n" +char id=114 x=588 y=691 width=31 height=80 xoffset=5 yoffset=34 xadvance=30 page=0 chnl=0 letter="r" +char id=119 x=621 y=691 width=57 height=79 xoffset=1 yoffset=35 xadvance=54 page=0 chnl=0 letter="w" +char id=120 x=680 y=691 width=41 height=79 xoffset=1 yoffset=35 xadvance=37 page=0 chnl=0 letter="x" +char id=118 x=723 y=691 width=40 height=79 xoffset=1 yoffset=35 xadvance=36 page=0 chnl=0 letter="v" +char id=122 x=765 y=691 width=36 height=79 xoffset=1 yoffset=35 xadvance=32 page=0 chnl=0 letter="z" +char id=58 x=803 y=691 width=18 height=79 xoffset=4 yoffset=35 xadvance=22 page=0 chnl=0 letter=":" +char id=60 x=823 y=691 width=60 height=78 xoffset=4 yoffset=26 xadvance=64 page=0 chnl=0 letter="<" +char id=62 x=885 y=691 width=60 height=78 xoffset=4 yoffset=26 xadvance=64 page=0 chnl=0 letter=">" +char id=43 x=947 y=691 width=60 height=63 xoffset=4 yoffset=33 xadvance=64 page=0 chnl=0 letter="+" +char id=94 x=2 y=794 width=65 height=53 xoffset=3 yoffset=12 xadvance=66 page=0 chnl=0 letter="^" +char id=61 x=69 y=794 width=60 height=45 xoffset=4 yoffset=40 xadvance=64 page=0 chnl=0 letter="=" +char id=34 x=131 y=794 width=18 height=45 xoffset=3 yoffset=12 xadvance=20 page=0 chnl=0 letter=""" +char id=42 x=151 y=794 width=37 height=42 xoffset=4 yoffset=12 xadvance=41 page=0 chnl=0 letter="*" +char id=39 x=190 y=794 width=18 height=41 xoffset=3 yoffset=12 xadvance=19 page=0 chnl=0 letter="'" +char id=44 x=210 y=794 width=18 height=41 xoffset=3 yoffset=89 xadvance=19 page=0 chnl=0 letter="," +char id=184 x=230 y=794 width=16 height=28 xoffset=26 yoffset=109 xadvance=62 page=0 chnl=0 letter="¸" +char id=46 x=248 y=794 width=18 height=25 xoffset=3 yoffset=89 xadvance=19 page=0 chnl=0 letter="." +char id=183 x=268 y=794 width=18 height=25 xoffset=0 yoffset=50 xadvance=13 page=0 chnl=0 letter="·" +char id=168 x=288 y=794 width=34 height=24 xoffset=16 yoffset=12 xadvance=62 page=0 chnl=0 letter="¨" +char id=96 x=324 y=794 width=25 height=23 xoffset=18 yoffset=13 xadvance=62 page=0 chnl=0 letter="`" +char id=180 x=351 y=794 width=25 height=23 xoffset=25 yoffset=13 xadvance=62 page=0 chnl=0 letter="´" +char id=45 x=378 y=794 width=23 height=23 xoffset=4 yoffset=64 xadvance=27 page=0 chnl=0 letter="-" +char id=95 x=403 y=794 width=69 height=22 xoffset=4 yoffset=112 xadvance=73 page=0 chnl=0 letter="_" +char id=175 x=474 y=794 width=29 height=21 xoffset=19 yoffset=14 xadvance=62 page=0 chnl=0 letter="¯" +char id=32 x=611 y=794 width=0 height=0 xoffset=19 yoffset=114 xadvance=19 page=0 chnl=0 letter="space" +kernings count=279 +kerning first=40 second=84 amount=-3 +kerning first=40 second=70 amount=-3 +kerning first=162 second=127 amount=-2 +kerning first=162 second=128 amount=-2 +kerning first=162 second=129 amount=-2 +kerning first=162 second=130 amount=-2 +kerning first=162 second=131 amount=-2 +kerning first=162 second=132 amount=-2 +kerning first=162 second=134 amount=-2 +kerning first=162 second=135 amount=-2 +kerning first=162 second=136 amount=-2 +kerning first=162 second=137 amount=-2 +kerning first=162 second=138 amount=-2 +kerning first=162 second=139 amount=-2 +kerning first=162 second=140 amount=-2 +kerning first=162 second=141 amount=-2 +kerning first=162 second=142 amount=-2 +kerning first=162 second=143 amount=-2 +kerning first=162 second=144 amount=-2 +kerning first=162 second=145 amount=-2 +kerning first=162 second=146 amount=-2 +kerning first=162 second=147 amount=-2 +kerning first=162 second=148 amount=-2 +kerning first=162 second=149 amount=-2 +kerning first=162 second=150 amount=-2 +kerning first=162 second=151 amount=-2 +kerning first=162 second=152 amount=-2 +kerning first=162 second=153 amount=-2 +kerning first=162 second=154 amount=-2 +kerning first=162 second=156 amount=-2 +kerning first=162 second=157 amount=-2 +kerning first=162 second=158 amount=-2 +kerning first=162 second=159 amount=-2 +kerning first=162 second=164 amount=-2 +kerning first=162 second=166 amount=-2 +kerning first=162 second=167 amount=-2 +kerning first=162 second=170 amount=-2 +kerning first=162 second=171 amount=-2 +kerning first=162 second=172 amount=-2 +kerning first=162 second=173 amount=-2 +kerning first=162 second=176 amount=-2 +kerning first=162 second=177 amount=-2 +kerning first=162 second=178 amount=-2 +kerning first=162 second=179 amount=-2 +kerning first=162 second=181 amount=-2 +kerning first=162 second=182 amount=-2 +kerning first=162 second=185 amount=-2 +kerning first=162 second=186 amount=-2 +kerning first=162 second=187 amount=-2 +kerning first=162 second=188 amount=-2 +kerning first=162 second=189 amount=-2 +kerning first=162 second=190 amount=-2 +kerning first=162 second=215 amount=-2 +kerning first=162 second=247 amount=-2 +kerning first=47 second=84 amount=-1 +kerning first=169 second=84 amount=-2 +kerning first=169 second=70 amount=-3 +kerning first=37 second=127 amount=-1 +kerning first=37 second=128 amount=-1 +kerning first=37 second=129 amount=-1 +kerning first=37 second=130 amount=-1 +kerning first=37 second=131 amount=-1 +kerning first=37 second=132 amount=-1 +kerning first=37 second=134 amount=-1 +kerning first=37 second=135 amount=-1 +kerning first=37 second=136 amount=-1 +kerning first=37 second=137 amount=-1 +kerning first=37 second=138 amount=-1 +kerning first=37 second=139 amount=-1 +kerning first=37 second=140 amount=-1 +kerning first=37 second=141 amount=-1 +kerning first=37 second=142 amount=-1 +kerning first=37 second=143 amount=-1 +kerning first=37 second=144 amount=-1 +kerning first=37 second=145 amount=-1 +kerning first=37 second=146 amount=-1 +kerning first=37 second=147 amount=-1 +kerning first=37 second=148 amount=-1 +kerning first=37 second=149 amount=-1 +kerning first=37 second=150 amount=-1 +kerning first=37 second=151 amount=-1 +kerning first=37 second=152 amount=-1 +kerning first=37 second=153 amount=-1 +kerning first=37 second=154 amount=-1 +kerning first=37 second=156 amount=-1 +kerning first=37 second=157 amount=-1 +kerning first=37 second=158 amount=-1 +kerning first=37 second=159 amount=-1 +kerning first=37 second=164 amount=-1 +kerning first=37 second=166 amount=-1 +kerning first=37 second=167 amount=-1 +kerning first=37 second=170 amount=-1 +kerning first=37 second=171 amount=-1 +kerning first=37 second=172 amount=-1 +kerning first=37 second=173 amount=-1 +kerning first=37 second=176 amount=-1 +kerning first=37 second=177 amount=-1 +kerning first=37 second=178 amount=-1 +kerning first=37 second=179 amount=-1 +kerning first=37 second=181 amount=-1 +kerning first=37 second=182 amount=-1 +kerning first=37 second=185 amount=-1 +kerning first=37 second=186 amount=-1 +kerning first=37 second=187 amount=-1 +kerning first=37 second=188 amount=-1 +kerning first=37 second=189 amount=-1 +kerning first=37 second=190 amount=-1 +kerning first=37 second=215 amount=-1 +kerning first=37 second=247 amount=-1 +kerning first=103 second=111 amount=-1 +kerning first=103 second=44 amount=1 +kerning first=79 second=84 amount=-1 +kerning first=50 second=68 amount=-2 +kerning first=50 second=70 amount=1 +kerning first=121 second=97 amount=-1 +kerning first=198 second=76 amount=-1 +kerning first=65 second=83 amount=-1 +kerning first=65 second=121 amount=-1 +kerning first=65 second=89 amount=-3 +kerning first=65 second=86 amount=-3 +kerning first=65 second=84 amount=-3 +kerning first=72 second=85 amount=-3 +kerning first=72 second=246 amount=-5 +kerning first=72 second=234 amount=-3 +kerning first=72 second=244 amount=-5 +kerning first=72 second=180 amount=-3 +kerning first=75 second=127 amount=-1 +kerning first=75 second=128 amount=-1 +kerning first=75 second=129 amount=-1 +kerning first=75 second=130 amount=-1 +kerning first=75 second=131 amount=-1 +kerning first=75 second=132 amount=-1 +kerning first=75 second=134 amount=-1 +kerning first=75 second=135 amount=-1 +kerning first=75 second=136 amount=-1 +kerning first=75 second=137 amount=-1 +kerning first=75 second=138 amount=-1 +kerning first=75 second=139 amount=-1 +kerning first=75 second=140 amount=-1 +kerning first=75 second=141 amount=-1 +kerning first=75 second=142 amount=-1 +kerning first=75 second=143 amount=-1 +kerning first=75 second=144 amount=-1 +kerning first=75 second=145 amount=-1 +kerning first=75 second=146 amount=-1 +kerning first=75 second=147 amount=-1 +kerning first=75 second=148 amount=-1 +kerning first=75 second=149 amount=-1 +kerning first=75 second=150 amount=-1 +kerning first=75 second=151 amount=-1 +kerning first=75 second=152 amount=-1 +kerning first=75 second=153 amount=-1 +kerning first=75 second=154 amount=-1 +kerning first=75 second=156 amount=-1 +kerning first=75 second=157 amount=-1 +kerning first=75 second=158 amount=-1 +kerning first=75 second=159 amount=-1 +kerning first=75 second=164 amount=-1 +kerning first=75 second=166 amount=-1 +kerning first=75 second=167 amount=-1 +kerning first=75 second=170 amount=-1 +kerning first=75 second=171 amount=-1 +kerning first=75 second=172 amount=-1 +kerning first=75 second=173 amount=-1 +kerning first=75 second=176 amount=-1 +kerning first=75 second=177 amount=-1 +kerning first=75 second=178 amount=-1 +kerning first=75 second=179 amount=-1 +kerning first=75 second=181 amount=-1 +kerning first=75 second=182 amount=-1 +kerning first=75 second=185 amount=-1 +kerning first=75 second=186 amount=-1 +kerning first=75 second=187 amount=-1 +kerning first=75 second=188 amount=-1 +kerning first=75 second=189 amount=-1 +kerning first=75 second=190 amount=-1 +kerning first=75 second=215 amount=-1 +kerning first=75 second=247 amount=-1 +kerning first=89 second=100 amount=-3 +kerning first=89 second=65 amount=-3 +kerning first=89 second=97 amount=-5 +kerning first=89 second=111 amount=-5 +kerning first=86 second=65 amount=-3 +kerning first=86 second=97 amount=-2 +kerning first=86 second=111 amount=-2 +kerning first=86 second=110 amount=-1 +kerning first=52 second=51 amount=1 +kerning first=52 second=56 amount=1 +kerning first=80 second=200 amount=-2 +kerning first=80 second=111 amount=-1 +kerning first=84 second=121 amount=-1 +kerning first=84 second=65 amount=-3 +kerning first=84 second=84 amount=1 +kerning first=84 second=97 amount=-4 +kerning first=84 second=111 amount=-3 +kerning first=84 second=110 amount=-3 +kerning first=84 second=120 amount=-2 +kerning first=107 second=111 amount=-1 +kerning first=55 second=52 amount=-1 +kerning first=55 second=49 amount=1 +kerning first=70 second=38 amount=-1 +kerning first=70 second=97 amount=-1 +kerning first=70 second=111 amount=-1 +kerning first=76 second=65 amount=1 +kerning first=76 second=89 amount=-2 +kerning first=102 second=102 amount=-1 +kerning first=73 second=84 amount=-1 +kerning first=105 second=115 amount=-1 +kerning first=116 second=116 amount=-1 +kerning first=116 second=122 amount=1 +kerning first=97 second=102 amount=-1 +kerning first=97 second=116 amount=-1 +kerning first=111 second=121 amount=-1 +kerning first=111 second=102 amount=-1 +kerning first=111 second=116 amount=-1 +kerning first=111 second=97 amount=-1 +kerning first=115 second=116 amount=-1 +kerning first=117 second=121 amount=-1 +kerning first=117 second=116 amount=-1 +kerning first=110 second=116 amount=-1 +kerning first=110 second=97 amount=-1 +kerning first=110 second=115 amount=-1 +kerning first=114 second=97 amount=-1 +kerning first=114 second=115 amount=-1 +kerning first=42 second=84 amount=-3 +kerning first=96 second=84 amount=-2 +kerning first=96 second=127 amount=-4 +kerning first=96 second=128 amount=-4 +kerning first=96 second=129 amount=-4 +kerning first=96 second=130 amount=-4 +kerning first=96 second=131 amount=-4 +kerning first=96 second=132 amount=-4 +kerning first=96 second=134 amount=-4 +kerning first=96 second=135 amount=-4 +kerning first=96 second=136 amount=-4 +kerning first=96 second=137 amount=-4 +kerning first=96 second=138 amount=-4 +kerning first=96 second=139 amount=-4 +kerning first=96 second=140 amount=-4 +kerning first=96 second=141 amount=-4 +kerning first=96 second=142 amount=-4 +kerning first=96 second=143 amount=-4 +kerning first=96 second=144 amount=-4 +kerning first=96 second=145 amount=-4 +kerning first=96 second=146 amount=-4 +kerning first=96 second=147 amount=-4 +kerning first=96 second=148 amount=-4 +kerning first=96 second=149 amount=-4 +kerning first=96 second=150 amount=-4 +kerning first=96 second=151 amount=-4 +kerning first=96 second=152 amount=-4 +kerning first=96 second=153 amount=-4 +kerning first=96 second=154 amount=-4 +kerning first=96 second=156 amount=-4 +kerning first=96 second=157 amount=-4 +kerning first=96 second=158 amount=-4 +kerning first=96 second=159 amount=-4 +kerning first=96 second=164 amount=-4 +kerning first=96 second=166 amount=-4 +kerning first=96 second=167 amount=-4 +kerning first=96 second=170 amount=-4 +kerning first=96 second=171 amount=-4 +kerning first=96 second=172 amount=-4 +kerning first=96 second=173 amount=-4 +kerning first=96 second=176 amount=-4 +kerning first=96 second=177 amount=-4 +kerning first=96 second=178 amount=-4 +kerning first=96 second=179 amount=-4 +kerning first=96 second=181 amount=-4 +kerning first=96 second=182 amount=-4 +kerning first=96 second=185 amount=-4 +kerning first=96 second=186 amount=-4 +kerning first=96 second=187 amount=-4 +kerning first=96 second=188 amount=-4 +kerning first=96 second=189 amount=-4 +kerning first=96 second=190 amount=-4 +kerning first=96 second=215 amount=-4 +kerning first=96 second=247 amount=-4 +kerning first=45 second=55 amount=-2 diff --git a/documentation/demos/demo-resources/img/map.json b/documentation/demos/demo-resources/img/map.json new file mode 100644 index 00000000..97343e8e --- /dev/null +++ b/documentation/demos/demo-resources/img/map.json @@ -0,0 +1,60 @@ +{"frames": { + +"font.png": +{ + "frame": {"x":2,"y":2,"w":1014,"h":844}, + "rotated": false, + "trimmed": true, + "spriteSourceSize": {"x":2,"y":1,"w":1014,"h":844}, + "sourceSize": {"w":1024,"h":1024} +}, +"info.png": +{ + "frame": {"x":433,"y":848,"w":126,"h":86}, + "rotated": false, + "trimmed": false, + "spriteSourceSize": {"x":0,"y":0,"w":126,"h":86}, + "sourceSize": {"w":126,"h":86} +}, +"level.png": +{ + "frame": {"x":561,"y":848,"w":170,"h":77}, + "rotated": false, + "trimmed": true, + "spriteSourceSize": {"x":0,"y":0,"w":170,"h":77}, + "sourceSize": {"w":170,"h":81} +}, +"madewith.png": +{ + "frame": {"x":433,"y":936,"w":159,"h":83}, + "rotated": false, + "trimmed": false, + "spriteSourceSize": {"x":0,"y":0,"w":159,"h":83}, + "sourceSize": {"w":159,"h":83} +}, +"nube1.png": +{ + "frame": {"x":234,"y":848,"w":197,"h":137}, + "rotated": false, + "trimmed": false, + "spriteSourceSize": {"x":0,"y":0,"w":197,"h":137}, + "sourceSize": {"w":197,"h":137} +}, +"nube2.png": +{ + "frame": {"x":2,"y":848,"w":230,"h":150}, + "rotated": false, + "trimmed": false, + "spriteSourceSize": {"x":0,"y":0,"w":230,"h":150}, + "sourceSize": {"w":230,"h":150} +}}, +"meta": { + "app": "http://www.codeandweb.com/texturepacker ", + "version": "1.0", + "image": "map.png", + "format": "RGBA8888", + "size": {"w":1024,"h":1024}, + "scale": "1", + "smartupdate": "$TexturePacker:SmartUpdate:642f35ed72fb5b2d7903ed79e8dab930$" +} +} diff --git a/documentation/demos/demo-resources/img/map.png b/documentation/demos/demo-resources/img/map.png new file mode 100644 index 00000000..b69485b0 Binary files /dev/null and b/documentation/demos/demo-resources/img/map.png differ diff --git a/documentation/demos/demo29/layout2.html b/documentation/demos/demo29/layout2.html index f4d9b843..ff70e903 100644 --- a/documentation/demos/demo29/layout2.html +++ b/documentation/demos/demo29/layout2.html @@ -172,6 +172,7 @@

Automatic layout capabilities

function load() { CAAT.ModuleManager. + debug(true). baseURL("../../../src/"). setModulePath("CAAT.Core", "Core"). setModulePath("CAAT.Math", "Math"). @@ -261,6 +262,7 @@

Automatic layout capabilities

setClickCallback( function(id) { alert("Clicked: "+id); }). + setPreferredSize( pw, ph). setClip(true); return label; diff --git a/documentation/demos/demo32/svgpath.html b/documentation/demos/demo32/svgpath.html index 02cee94c..5baed556 100644 --- a/documentation/demos/demo32/svgpath.html +++ b/documentation/demos/demo32/svgpath.html @@ -23,7 +23,7 @@
-

Path Segments

+

SVG Parser

diff --git a/documentation/demos/demo33/keyframing.html b/documentation/demos/demo33/keyframing.html index 9e5451ec..a5b2b6da 100644 --- a/documentation/demos/demo33/keyframing.html +++ b/documentation/demos/demo33/keyframing.html @@ -36,7 +36,7 @@
-

Path Segments

+

On-the-fly CSS3 Keyframing

ABCD
diff --git a/documentation/demos/demo34/dragon/L_front_leg.png b/documentation/demos/demo34/dragon/L_front_leg.png new file mode 100755 index 00000000..4a8b204d Binary files /dev/null and b/documentation/demos/demo34/dragon/L_front_leg.png differ diff --git a/documentation/demos/demo34/dragon/L_front_thigh.png b/documentation/demos/demo34/dragon/L_front_thigh.png new file mode 100755 index 00000000..5b691a87 Binary files /dev/null and b/documentation/demos/demo34/dragon/L_front_thigh.png differ diff --git a/documentation/demos/demo34/dragon/L_rear_leg.png b/documentation/demos/demo34/dragon/L_rear_leg.png new file mode 100755 index 00000000..fc00ab6e Binary files /dev/null and b/documentation/demos/demo34/dragon/L_rear_leg.png differ diff --git a/documentation/demos/demo34/dragon/L_rear_thigh.png b/documentation/demos/demo34/dragon/L_rear_thigh.png new file mode 100755 index 00000000..4c363aa3 Binary files /dev/null and b/documentation/demos/demo34/dragon/L_rear_thigh.png differ diff --git a/documentation/demos/demo34/dragon/L_wing01.png b/documentation/demos/demo34/dragon/L_wing01.png new file mode 100755 index 00000000..3a12127e Binary files /dev/null and b/documentation/demos/demo34/dragon/L_wing01.png differ diff --git a/documentation/demos/demo34/dragon/L_wing02.png b/documentation/demos/demo34/dragon/L_wing02.png new file mode 100755 index 00000000..831d7ca9 Binary files /dev/null and b/documentation/demos/demo34/dragon/L_wing02.png differ diff --git a/documentation/demos/demo34/dragon/L_wing03.png b/documentation/demos/demo34/dragon/L_wing03.png new file mode 100755 index 00000000..702c43f7 Binary files /dev/null and b/documentation/demos/demo34/dragon/L_wing03.png differ diff --git a/documentation/demos/demo34/dragon/L_wing04.png b/documentation/demos/demo34/dragon/L_wing04.png new file mode 100755 index 00000000..5cba4670 Binary files /dev/null and b/documentation/demos/demo34/dragon/L_wing04.png differ diff --git a/documentation/demos/demo34/dragon/L_wing05.png b/documentation/demos/demo34/dragon/L_wing05.png new file mode 100755 index 00000000..d8d18c2a Binary files /dev/null and b/documentation/demos/demo34/dragon/L_wing05.png differ diff --git a/documentation/demos/demo34/dragon/L_wing06.png b/documentation/demos/demo34/dragon/L_wing06.png new file mode 100755 index 00000000..788c70b3 Binary files /dev/null and b/documentation/demos/demo34/dragon/L_wing06.png differ diff --git a/documentation/demos/demo34/dragon/L_wing07.png b/documentation/demos/demo34/dragon/L_wing07.png new file mode 100755 index 00000000..c055793f Binary files /dev/null and b/documentation/demos/demo34/dragon/L_wing07.png differ diff --git a/documentation/demos/demo34/dragon/L_wing08.png b/documentation/demos/demo34/dragon/L_wing08.png new file mode 100755 index 00000000..dc16d008 Binary files /dev/null and b/documentation/demos/demo34/dragon/L_wing08.png differ diff --git a/documentation/demos/demo34/dragon/L_wing09.png b/documentation/demos/demo34/dragon/L_wing09.png new file mode 100755 index 00000000..97e91580 Binary files /dev/null and b/documentation/demos/demo34/dragon/L_wing09.png differ diff --git a/documentation/demos/demo34/dragon/R_front_leg.png b/documentation/demos/demo34/dragon/R_front_leg.png new file mode 100755 index 00000000..bcc28eec Binary files /dev/null and b/documentation/demos/demo34/dragon/R_front_leg.png differ diff --git a/documentation/demos/demo34/dragon/R_front_thigh.png b/documentation/demos/demo34/dragon/R_front_thigh.png new file mode 100755 index 00000000..fbf13cfe Binary files /dev/null and b/documentation/demos/demo34/dragon/R_front_thigh.png differ diff --git a/documentation/demos/demo34/dragon/R_rear_leg.png b/documentation/demos/demo34/dragon/R_rear_leg.png new file mode 100755 index 00000000..c2cc5e72 Binary files /dev/null and b/documentation/demos/demo34/dragon/R_rear_leg.png differ diff --git a/documentation/demos/demo34/dragon/R_rear_thigh.png b/documentation/demos/demo34/dragon/R_rear_thigh.png new file mode 100755 index 00000000..ade9cde6 Binary files /dev/null and b/documentation/demos/demo34/dragon/R_rear_thigh.png differ diff --git a/documentation/demos/demo34/dragon/R_wing01.png b/documentation/demos/demo34/dragon/R_wing01.png new file mode 100755 index 00000000..873bf075 Binary files /dev/null and b/documentation/demos/demo34/dragon/R_wing01.png differ diff --git a/documentation/demos/demo34/dragon/R_wing02.png b/documentation/demos/demo34/dragon/R_wing02.png new file mode 100755 index 00000000..60dd1894 Binary files /dev/null and b/documentation/demos/demo34/dragon/R_wing02.png differ diff --git a/documentation/demos/demo34/dragon/R_wing03.png b/documentation/demos/demo34/dragon/R_wing03.png new file mode 100755 index 00000000..1cf2e1c7 Binary files /dev/null and b/documentation/demos/demo34/dragon/R_wing03.png differ diff --git a/documentation/demos/demo34/dragon/R_wing04.png b/documentation/demos/demo34/dragon/R_wing04.png new file mode 100755 index 00000000..316aa4e6 Binary files /dev/null and b/documentation/demos/demo34/dragon/R_wing04.png differ diff --git a/documentation/demos/demo34/dragon/R_wing05.png b/documentation/demos/demo34/dragon/R_wing05.png new file mode 100755 index 00000000..73fdb42e Binary files /dev/null and b/documentation/demos/demo34/dragon/R_wing05.png differ diff --git a/documentation/demos/demo34/dragon/R_wing06.png b/documentation/demos/demo34/dragon/R_wing06.png new file mode 100755 index 00000000..931ca659 Binary files /dev/null and b/documentation/demos/demo34/dragon/R_wing06.png differ diff --git a/documentation/demos/demo34/dragon/R_wing07.png b/documentation/demos/demo34/dragon/R_wing07.png new file mode 100755 index 00000000..3d7af824 Binary files /dev/null and b/documentation/demos/demo34/dragon/R_wing07.png differ diff --git a/documentation/demos/demo34/dragon/R_wing08.png b/documentation/demos/demo34/dragon/R_wing08.png new file mode 100755 index 00000000..f6d28d38 Binary files /dev/null and b/documentation/demos/demo34/dragon/R_wing08.png differ diff --git a/documentation/demos/demo34/dragon/R_wing09.png b/documentation/demos/demo34/dragon/R_wing09.png new file mode 100755 index 00000000..f97a8765 Binary files /dev/null and b/documentation/demos/demo34/dragon/R_wing09.png differ diff --git a/documentation/demos/demo34/dragon/back.png b/documentation/demos/demo34/dragon/back.png new file mode 100755 index 00000000..05531bc5 Binary files /dev/null and b/documentation/demos/demo34/dragon/back.png differ diff --git a/documentation/demos/demo34/dragon/chest.png b/documentation/demos/demo34/dragon/chest.png new file mode 100755 index 00000000..6e3ba44e Binary files /dev/null and b/documentation/demos/demo34/dragon/chest.png differ diff --git a/documentation/demos/demo34/dragon/chin.png b/documentation/demos/demo34/dragon/chin.png new file mode 100755 index 00000000..68c76488 Binary files /dev/null and b/documentation/demos/demo34/dragon/chin.png differ diff --git a/documentation/demos/demo34/dragon/dragon-flying.json b/documentation/demos/demo34/dragon/dragon-flying.json new file mode 100644 index 00000000..68aff275 --- /dev/null +++ b/documentation/demos/demo34/dragon/dragon-flying.json @@ -0,0 +1,1833 @@ +{ + "bones": { + "back": { + "rotate": [ + { + "time": 0, + "angle": 0 + }, + { + "time": 0.1666, + "angle": 17.39 + }, + { + "time": 0.5, + "angle": 0 + }, + { + "time": 0.8333, + "angle": 7 + }, + { + "time": 1, + "angle": 0 + } + ], + "translate": [ + { + "time": 0, + "x": 0, + "y": 0, + "curve": "stepped" + }, + { + "time": 0.5, + "x": 0, + "y": 0, + "curve": "stepped" + }, + { + "time": 1, + "x": 0, + "y": 0 + } + ], + "scale": [ + { + "time": 0, + "x": 1, + "y": 1, + "curve": "stepped" + }, + { + "time": 0.5, + "x": 1, + "y": 1, + "curve": "stepped" + }, + { + "time": 1, + "x": 1, + "y": 1 + } + ] + }, + "neck": { + "rotate": [ + { + "time": 0, + "angle": 0 + }, + { + "time": 0.1666, + "angle": -8.18 + }, + { + "time": 0.3333, + "angle": -23.16 + }, + { + "time": 0.5, + "angle": -18.01 + }, + { + "time": 1, + "angle": 0 + } + ], + "translate": [ + { + "time": 0, + "x": 0, + "y": 0, + "curve": "stepped" + }, + { + "time": 0.5, + "x": 0, + "y": 0, + "curve": "stepped" + }, + { + "time": 1, + "x": 0, + "y": 0 + } + ], + "scale": [ + { + "time": 0, + "x": 1, + "y": 1, + "curve": "stepped" + }, + { + "time": 0.5, + "x": 1, + "y": 1, + "curve": "stepped" + }, + { + "time": 1, + "x": 1, + "y": 1 + } + ] + }, + "chest": { + "rotate": [ + { + "time": 0, + "angle": 0, + "curve": "stepped" + }, + { + "time": 0.5, + "angle": 0, + "curve": "stepped" + }, + { + "time": 1, + "angle": 0 + } + ], + "translate": [ + { + "time": 0, + "x": 0, + "y": 0, + "curve": "stepped" + }, + { + "time": 0.5, + "x": 0, + "y": 0, + "curve": "stepped" + }, + { + "time": 1, + "x": 0, + "y": 0 + } + ], + "scale": [ + { + "time": 0, + "x": 1, + "y": 1, + "curve": "stepped" + }, + { + "time": 0.5, + "x": 1, + "y": 1, + "curve": "stepped" + }, + { + "time": 1, + "x": 1, + "y": 1 + } + ] + }, + "tail1": { + "rotate": [ + { + "time": 0, + "angle": 0 + }, + { + "time": 0.1666, + "angle": -2.42 + }, + { + "time": 0.3333, + "angle": -26.2 + }, + { + "time": 0.5, + "angle": -29.65 + }, + { + "time": 0.6666, + "angle": -23.15 + }, + { + "time": 0.8333, + "angle": -55.46 + }, + { + "time": 1, + "angle": 0 + } + ], + "translate": [ + { + "time": 0, + "x": 0, + "y": 0, + "curve": "stepped" + }, + { + "time": 0.5, + "x": 0, + "y": 0, + "curve": "stepped" + }, + { + "time": 1, + "x": 0, + "y": 0 + } + ], + "scale": [ + { + "time": 0, + "x": 1, + "y": 1, + "curve": "stepped" + }, + { + "time": 0.5, + "x": 1, + "y": 1, + "curve": "stepped" + }, + { + "time": 1, + "x": 1, + "y": 1 + } + ] + }, + "R_rear_thigh": { + "rotate": [ + { + "time": 0, + "angle": 0, + "curve": "stepped" + }, + { + "time": 0.5, + "angle": 0, + "curve": "stepped" + }, + { + "time": 1, + "angle": 0 + } + ], + "translate": [ + { + "time": 0, + "x": 0, + "y": 0, + "curve": "stepped" + }, + { + "time": 0.5, + "x": 0, + "y": 0, + "curve": "stepped" + }, + { + "time": 1, + "x": 0, + "y": 0 + } + ], + "scale": [ + { + "time": 0, + "x": 1, + "y": 1, + "curve": "stepped" + }, + { + "time": 0.5, + "x": 1, + "y": 1, + "curve": "stepped" + }, + { + "time": 1, + "x": 1, + "y": 1 + } + ] + }, + "tail2": { + "rotate": [ + { + "time": 0, + "angle": 0 + }, + { + "time": 0.1666, + "angle": -1.12 + }, + { + "time": 0.3333, + "angle": 10.48 + }, + { + "time": 0.5, + "angle": 7.89 + }, + { + "time": 0.8333, + "angle": -10.38 + }, + { + "time": 1, + "angle": 0 + } + ], + "translate": [ + { + "time": 0, + "x": 0, + "y": 0, + "curve": "stepped" + }, + { + "time": 0.5, + "x": 0, + "y": 0, + "curve": "stepped" + }, + { + "time": 1, + "x": 0, + "y": 0 + } + ], + "scale": [ + { + "time": 0, + "x": 1, + "y": 1, + "curve": "stepped" + }, + { + "time": 0.5, + "x": 1, + "y": 1, + "curve": "stepped" + }, + { + "time": 1, + "x": 1, + "y": 1 + } + ] + }, + "tail3": { + "rotate": [ + { + "time": 0, + "angle": 0 + }, + { + "time": 0.1666, + "angle": 8.24 + }, + { + "time": 0.3333, + "angle": 15.21 + }, + { + "time": 0.5, + "angle": 14.84 + }, + { + "time": 0.8333, + "angle": -18.9 + }, + { + "time": 1, + "angle": 0 + } + ], + "translate": [ + { + "time": 0, + "x": 0, + "y": 0, + "curve": "stepped" + }, + { + "time": 0.5, + "x": 0, + "y": 0, + "curve": "stepped" + }, + { + "time": 1, + "x": 0, + "y": 0 + } + ], + "scale": [ + { + "time": 0, + "x": 1, + "y": 1, + "curve": "stepped" + }, + { + "time": 0.5, + "x": 1, + "y": 1, + "curve": "stepped" + }, + { + "time": 1, + "x": 1, + "y": 1 + } + ] + }, + "tail4": { + "rotate": [ + { + "time": 0, + "angle": 0 + }, + { + "time": 0.1666, + "angle": 17.46 + }, + { + "time": 0.3333, + "angle": 22.15 + }, + { + "time": 0.5, + "angle": 22.76 + }, + { + "time": 0.8333, + "angle": -4.37 + }, + { + "time": 1, + "angle": 0 + } + ], + "translate": [ + { + "time": 0, + "x": 0, + "y": 0, + "curve": "stepped" + }, + { + "time": 0.5, + "x": 0, + "y": 0, + "curve": "stepped" + }, + { + "time": 1, + "x": 0, + "y": 0 + } + ], + "scale": [ + { + "time": 0, + "x": 1, + "y": 1, + "curve": "stepped" + }, + { + "time": 0.5, + "x": 1, + "y": 1, + "curve": "stepped" + }, + { + "time": 1, + "x": 1, + "y": 1 + } + ] + }, + "tail5": { + "rotate": [ + { + "time": 0, + "angle": 0 + }, + { + "time": 0.1666, + "angle": 7.4 + }, + { + "time": 0.3333, + "angle": 28.5 + }, + { + "time": 0.5, + "angle": 21.33 + }, + { + "time": 0.8333, + "angle": -1.27 + }, + { + "time": 1, + "angle": 0 + } + ], + "translate": [ + { + "time": 0, + "x": 0, + "y": 0, + "curve": "stepped" + }, + { + "time": 0.5, + "x": 0, + "y": 0, + "curve": "stepped" + }, + { + "time": 1, + "x": 0, + "y": 0 + } + ], + "scale": [ + { + "time": 0, + "x": 1, + "y": 1, + "curve": "stepped" + }, + { + "time": 0.5, + "x": 1, + "y": 1, + "curve": "stepped" + }, + { + "time": 1, + "x": 1, + "y": 1 + } + ] + }, + "tail6": { + "rotate": [ + { + "time": 0, + "angle": 0 + }, + { + "time": 0.1666, + "angle": 45.99 + }, + { + "time": 0.4, + "angle": 43.53 + }, + { + "time": 0.5, + "angle": 61.79 + }, + { + "time": 0.8333, + "angle": 13.28 + }, + { + "time": 1, + "angle": 0 + } + ], + "translate": [ + { + "time": 0, + "x": 0, + "y": 0, + "curve": "stepped" + }, + { + "time": 0.5, + "x": 0, + "y": 0, + "curve": "stepped" + }, + { + "time": 1, + "x": 0, + "y": 0 + } + ], + "scale": [ + { + "time": 0, + "x": 1, + "y": 1, + "curve": "stepped" + }, + { + "time": 0.5, + "x": 1, + "y": 1, + "curve": "stepped" + }, + { + "time": 1, + "x": 1, + "y": 1 + } + ] + }, + "R_rear_leg": { + "rotate": [ + { + "time": 0, + "angle": 0 + }, + { + "time": 0.1666, + "angle": -14.21 + }, + { + "time": 0.5, + "angle": 47.17 + }, + { + "time": 1, + "angle": 0 + } + ], + "translate": [ + { + "time": 0, + "x": 0, + "y": 0, + "curve": "stepped" + }, + { + "time": 0.5, + "x": 0, + "y": 0, + "curve": "stepped" + }, + { + "time": 1, + "x": 0, + "y": 0 + } + ], + "scale": [ + { + "time": 0, + "x": 1, + "y": 1, + "curve": "stepped" + }, + { + "time": 0.5, + "x": 1, + "y": 1, + "curve": "stepped" + }, + { + "time": 1, + "x": 1, + "y": 1 + } + ] + }, + "R_rear_toe3": { + "rotate": [ + { + "time": 0, + "angle": 0 + }, + { + "time": 0.5, + "angle": -36.06 + }, + { + "time": 1, + "angle": 0 + } + ], + "translate": [ + { + "time": 0, + "x": 0, + "y": 0, + "curve": "stepped" + }, + { + "time": 0.5, + "x": 0, + "y": 0, + "curve": "stepped" + }, + { + "time": 1, + "x": 0, + "y": 0 + } + ], + "scale": [ + { + "time": 0, + "x": 1, + "y": 1, + "curve": "stepped" + }, + { + "time": 0.5, + "x": 1, + "y": 1, + "curve": "stepped" + }, + { + "time": 1, + "x": 1, + "y": 1 + } + ] + }, + "R_rear_toe2": { + "rotate": [ + { + "time": 0, + "angle": 0 + }, + { + "time": 0.5, + "angle": -20.32 + }, + { + "time": 1, + "angle": 0 + } + ], + "translate": [ + { + "time": 0, + "x": 0, + "y": 0, + "curve": "stepped" + }, + { + "time": 0.5, + "x": 0, + "y": 0, + "curve": "stepped" + }, + { + "time": 1, + "x": 0, + "y": 0 + } + ], + "scale": [ + { + "time": 0, + "x": 1, + "y": 1, + "curve": "stepped" + }, + { + "time": 0.5, + "x": 1, + "y": 1, + "curve": "stepped" + }, + { + "time": 1, + "x": 1, + "y": 1 + } + ] + }, + "R_rear_toe1": { + "rotate": [ + { + "time": 0, + "angle": 0 + }, + { + "time": 0.5, + "angle": -18.71 + }, + { + "time": 1, + "angle": 0 + } + ], + "translate": [ + { + "time": 0, + "x": 0, + "y": 0, + "curve": "stepped" + }, + { + "time": 0.5, + "x": 0, + "y": 0, + "curve": "stepped" + }, + { + "time": 1, + "x": 0, + "y": 0 + } + ], + "scale": [ + { + "time": 0, + "x": 1, + "y": 1, + "curve": "stepped" + }, + { + "time": 0.5, + "x": 1, + "y": 1, + "curve": "stepped" + }, + { + "time": 1, + "x": 1, + "y": 1 + } + ] + }, + "head": { + "rotate": [ + { + "time": 0, + "angle": 0, + "curve": [0.408, 1.36, 0.675, 1.43] + }, + { + "time": 0.5, + "angle": 1.03 + }, + { + "time": 1, + "angle": 0 + } + ], + "translate": [ + { + "time": 0, + "x": 0, + "y": 0, + "curve": "stepped" + }, + { + "time": 0.5, + "x": 0, + "y": 0, + "curve": "stepped" + }, + { + "time": 1, + "x": 0, + "y": 0 + } + ], + "scale": [ + { + "time": 0, + "x": 1, + "y": 1, + "curve": "stepped" + }, + { + "time": 0.5, + "x": 1, + "y": 1, + "curve": "stepped" + }, + { + "time": 1, + "x": 1, + "y": 1 + } + ] + }, + "chin": { + "rotate": [ + { + "time": 0, + "angle": 0, + "curve": [0.416, 1.15, 0.494, 1.27] + }, + { + "time": 0.3333, + "angle": -5.15 + }, + { + "time": 0.5, + "angle": 9.79 + }, + { + "time": 0.6666, + "angle": 18.94 + }, + { + "time": 1, + "angle": 0 + } + ], + "translate": [ + { + "time": 0, + "x": 0, + "y": 0, + "curve": "stepped" + }, + { + "time": 0.5, + "x": 0, + "y": 0, + "curve": "stepped" + }, + { + "time": 1, + "x": 0, + "y": 0 + } + ], + "scale": [ + { + "time": 0, + "x": 1, + "y": 1, + "curve": "stepped" + }, + { + "time": 0.5, + "x": 1, + "y": 1, + "curve": "stepped" + }, + { + "time": 1, + "x": 1, + "y": 1 + } + ] + }, + "L_front_thigh": { + "rotate": [ + { + "time": 0, + "angle": 0 + }, + { + "time": 0.1666, + "angle": -19.18 + }, + { + "time": 0.3333, + "angle": -32.02 + }, + { + "time": 0.5, + "angle": -19.62 + }, + { + "time": 1, + "angle": 0 + } + ], + "translate": [ + { + "time": 0, + "x": 0, + "y": 0, + "curve": "stepped" + }, + { + "time": 0.5, + "x": 0, + "y": 0, + "curve": "stepped" + }, + { + "time": 1, + "x": 0, + "y": 0 + } + ], + "scale": [ + { + "time": 0, + "x": 1, + "y": 1, + "curve": "stepped" + }, + { + "time": 0.5, + "x": 1, + "y": 1, + "curve": "stepped" + }, + { + "time": 1, + "x": 1, + "y": 1 + } + ] + }, + "R_front_thigh": { + "rotate": [ + { + "time": 0, + "angle": 0 + }, + { + "time": 0.1666, + "angle": -12.96 + }, + { + "time": 0.5, + "angle": 16.2 + }, + { + "time": 1, + "angle": 0 + } + ], + "translate": [ + { + "time": 0, + "x": 0, + "y": 0, + "curve": "stepped" + }, + { + "time": 0.5, + "x": 0, + "y": 0, + "curve": "stepped" + }, + { + "time": 1, + "x": 0, + "y": 0 + } + ], + "scale": [ + { + "time": 0, + "x": 1, + "y": 1, + "curve": "stepped" + }, + { + "time": 0.5, + "x": 1, + "y": 1, + "curve": "stepped" + }, + { + "time": 1, + "x": 1, + "y": 1 + } + ] + }, + "L_front_leg": { + "rotate": [ + { + "time": 0, + "angle": 0 + }, + { + "time": 0.1666, + "angle": 37.77 + }, + { + "time": 0.5, + "angle": 0, + "curve": "stepped" + }, + { + "time": 1, + "angle": 0 + } + ], + "translate": [ + { + "time": 0, + "x": 0, + "y": 0, + "curve": "stepped" + }, + { + "time": 0.5, + "x": 0, + "y": 0, + "curve": "stepped" + }, + { + "time": 1, + "x": 0, + "y": 0 + } + ], + "scale": [ + { + "time": 0, + "x": 1, + "y": 1, + "curve": "stepped" + }, + { + "time": 0.5, + "x": 1, + "y": 1, + "curve": "stepped" + }, + { + "time": 1, + "x": 1, + "y": 1 + } + ] + }, + "L_front_toe1": { + "rotate": [ + { + "time": 0, + "angle": 0 + }, + { + "time": 0.1666, + "angle": -16.08 + }, + { + "time": 0.5, + "angle": 0, + "curve": "stepped" + }, + { + "time": 1, + "angle": 0 + } + ], + "translate": [ + { + "time": 0, + "x": 0, + "y": 0, + "curve": "stepped" + }, + { + "time": 0.5, + "x": 0, + "y": 0, + "curve": "stepped" + }, + { + "time": 1, + "x": 0, + "y": 0 + } + ], + "scale": [ + { + "time": 0, + "x": 1, + "y": 1, + "curve": "stepped" + }, + { + "time": 0.5, + "x": 1, + "y": 1, + "curve": "stepped" + }, + { + "time": 1, + "x": 1, + "y": 1 + } + ] + }, + "L_front_toe2": { + "rotate": [ + { + "time": 0, + "angle": 0, + "curve": "stepped" + }, + { + "time": 0.5, + "angle": 0, + "curve": "stepped" + }, + { + "time": 1, + "angle": 0 + } + ], + "translate": [ + { + "time": 0, + "x": 0, + "y": 0, + "curve": "stepped" + }, + { + "time": 0.5, + "x": 0, + "y": 0, + "curve": "stepped" + }, + { + "time": 1, + "x": 0, + "y": 0 + } + ], + "scale": [ + { + "time": 0, + "x": 1, + "y": 1 + }, + { + "time": 0.5, + "x": 1.33, + "y": 1.029 + }, + { + "time": 1, + "x": 1, + "y": 1 + } + ] + }, + "L_front_toe4": { + "rotate": [ + { + "time": 0, + "angle": 0 + }, + { + "time": 0.5, + "angle": 26.51 + }, + { + "time": 1, + "angle": 0 + } + ], + "translate": [ + { + "time": 0, + "x": 0, + "y": 0, + "curve": "stepped" + }, + { + "time": 0.5, + "x": 0, + "y": 0, + "curve": "stepped" + }, + { + "time": 1, + "x": 0, + "y": 0 + } + ], + "scale": [ + { + "time": 0, + "x": 1, + "y": 1 + }, + { + "time": 0.5, + "x": 1.239, + "y": 0.993 + }, + { + "time": 1, + "x": 1, + "y": 1 + } + ] + }, + "L_front_toe3": { + "rotate": [ + { + "time": 0, + "angle": 0 + }, + { + "time": 0.5, + "angle": 16.99 + }, + { + "time": 1, + "angle": 0 + } + ], + "translate": [ + { + "time": 0, + "x": 0, + "y": 0, + "curve": "stepped" + }, + { + "time": 0.5, + "x": 0, + "y": 0, + "curve": "stepped" + }, + { + "time": 1, + "x": 0, + "y": 0 + } + ], + "scale": [ + { + "time": 0, + "x": 1, + "y": 1 + }, + { + "time": 0.5, + "x": 1.402, + "y": 1.007 + }, + { + "time": 1, + "x": 1, + "y": 1 + } + ] + }, + "R_front_leg": { + "rotate": [ + { + "time": 0, + "angle": 0 + }, + { + "time": 0.1666, + "angle": 26.07 + }, + { + "time": 0.5, + "angle": -21.6 + }, + { + "time": 1, + "angle": 0 + } + ], + "translate": [ + { + "time": 0, + "x": 0, + "y": 0, + "curve": "stepped" + }, + { + "time": 0.5, + "x": 0, + "y": 0, + "curve": "stepped" + }, + { + "time": 1, + "x": 0, + "y": 0 + } + ], + "scale": [ + { + "time": 0, + "x": 1, + "y": 1, + "curve": "stepped" + }, + { + "time": 0.5, + "x": 1, + "y": 1, + "curve": "stepped" + }, + { + "time": 1, + "x": 1, + "y": 1 + } + ] + }, + "R_front_toe1": { + "rotate": [ + { + "time": 0, + "angle": 0 + }, + { + "time": 0.1666, + "angle": 29.23 + }, + { + "time": 0.5, + "angle": 34.83 + }, + { + "time": 1, + "angle": 0 + } + ], + "translate": [ + { + "time": 0, + "x": 0, + "y": 0, + "curve": "stepped" + }, + { + "time": 0.5, + "x": 0, + "y": 0, + "curve": "stepped" + }, + { + "time": 1, + "x": 0, + "y": 0 + } + ], + "scale": [ + { + "time": 0, + "x": 1, + "y": 1 + }, + { + "time": 0.5, + "x": 1.412, + "y": 1 + }, + { + "time": 1, + "x": 1, + "y": 1 + } + ] + }, + "R_front_toe2": { + "rotate": [ + { + "time": 0, + "angle": 0 + }, + { + "time": 0.1666, + "angle": 24.89 + }, + { + "time": 0.5, + "angle": 23.16 + }, + { + "time": 1, + "angle": 0 + } + ], + "translate": [ + { + "time": 0, + "x": 0, + "y": 0, + "curve": "stepped" + }, + { + "time": 0.5, + "x": 0, + "y": 0, + "curve": "stepped" + }, + { + "time": 1, + "x": 0, + "y": 0 + } + ], + "scale": [ + { + "time": 0, + "x": 1, + "y": 1 + }, + { + "time": 0.5, + "x": 1.407, + "y": 1.057 + }, + { + "time": 1, + "x": 1, + "y": 1 + } + ] + }, + "R_front_toe3": { + "rotate": [ + { + "time": 0, + "angle": 0 + }, + { + "time": 0.1666, + "angle": 11.01 + }, + { + "time": 0.5, + "angle": 0, + "curve": "stepped" + }, + { + "time": 1, + "angle": 0 + } + ], + "translate": [ + { + "time": 0, + "x": 0, + "y": 0, + "curve": "stepped" + }, + { + "time": 0.5, + "x": 0, + "y": 0, + "curve": "stepped" + }, + { + "time": 1, + "x": 0, + "y": 0 + } + ], + "scale": [ + { + "time": 0, + "x": 1, + "y": 1 + }, + { + "time": 0.5, + "x": 1.329, + "y": 1.181 + }, + { + "time": 1, + "x": 1, + "y": 1 + } + ] + }, + "L_rear_leg": { + "rotate": [ + { + "time": 0, + "angle": 0 + }, + { + "time": 0.3666, + "angle": 25.19 + }, + { + "time": 0.6666, + "angle": -15.65 + }, + { + "time": 1, + "angle": 0 + } + ], + "translate": [ + { + "time": 0, + "x": 0, + "y": 0 + } + ], + "scale": [ + { + "time": 0, + "x": 1, + "y": 1 + } + ] + }, + "COG": { + "rotate": [ + { + "time": 0, + "angle": 0, + "curve": [0.456, 0.2, 0.422, 1.06] + }, + { + "time": 0.3333, + "angle": 23.93 + }, + { + "time": 0.6666, + "angle": 337.8, + "curve": [0.41, 0, 0.887, 0.75] + }, + { + "time": 1, + "angle": 0 + } + ], + "translate": [ + { + "time": 0, + "x": 0, + "y": 0, + "curve": [0.33, 1, 0.816, 1.33] + }, + { + "time": 0.5, + "x": 0, + "y": 113.01, + "curve": [0.396, 0, 0.709, 2.03] + }, + { + "time": 1, + "x": 0, + "y": 0 + } + ] + } +}, + "slots": { + "R_wing": { + "attachment": [ + { + "time": 0, + "name": "R_wing01" + }, + { + "time": 0.0666, + "name": "R_wing02" + }, + { + "time": 0.1333, + "name": "R_wing03" + }, + { + "time": 0.2, + "name": "R_wing04" + }, + { + "time": 0.2666, + "name": "R_wing05" + }, + { + "time": 0.3333, + "name": "R_wing06" + }, + { + "time": 0.4, + "name": "R_wing07" + }, + { + "time": 0.4666, + "name": "R_wing08" + }, + { + "time": 0.5333, + "name": "R_wing09" + }, + { + "time": 0.6, + "name": "R_wing01" + }, + { + "time": 0.7333, + "name": "R_wing02" + }, + { + "time": 0.7666, + "name": "R_wing02" + }, + { + "time": 0.8, + "name": "R_wing03" + }, + { + "time": 0.8333, + "name": "R_wing04" + }, + { + "time": 0.8666, + "name": "R_wing05" + }, + { + "time": 0.9, + "name": "R_wing06" + }, + { + "time": 0.9333, + "name": "R_wing07" + }, + { + "time": 0.9666, + "name": "R_wing08" + }, + { + "time": 1, + "name": "R_wing09" + } + ] + }, + "L_wing": { + "attachment": [ + { + "time": 0, + "name": "L_wing01" + }, + { + "time": 0.0666, + "name": "L_wing02" + }, + { + "time": 0.1333, + "name": "L_wing03" + }, + { + "time": 0.2, + "name": "L_wing04" + }, + { + "time": 0.2666, + "name": "L_wing05" + }, + { + "time": 0.3333, + "name": "L_wing06" + }, + { + "time": 0.4, + "name": "L_wing07" + }, + { + "time": 0.4666, + "name": "L_wing08" + }, + { + "time": 0.5333, + "name": "L_wing09" + }, + { + "time": 0.6, + "name": "L_wing01" + }, + { + "time": 0.7333, + "name": "L_wing02" + }, + { + "time": 0.8, + "name": "L_wing03" + }, + { + "time": 0.8333, + "name": "L_wing04" + }, + { + "time": 0.8666, + "name": "L_wing05" + }, + { + "time": 0.9, + "name": "L_wing06" + }, + { + "time": 0.9333, + "name": "L_wing07" + }, + { + "time": 0.9666, + "name": "L_wing08" + }, + { + "time": 1, + "name": "L_wing09" + } + ] + } +}} \ No newline at end of file diff --git a/documentation/demos/demo34/dragon/dragon-skeleton.json b/documentation/demos/demo34/dragon/dragon-skeleton.json new file mode 100644 index 00000000..0d3adfbc --- /dev/null +++ b/documentation/demos/demo34/dragon/dragon-skeleton.json @@ -0,0 +1,813 @@ +{"bones": [ + { + "name": "root", + "y": -176.12 + }, + { + "name": "COG", + "parent": "root", + "y": 176.12 + }, + { + "name": "neck", + "parent": "COG", + "length": 41.36, + "x": 64.75, + "y": 11.98, + "rotation": 39.05 + }, + { + "name": "back", + "parent": "COG", + "length": 115.37, + "x": 16.03, + "y": 27.94, + "rotation": 151.83 + }, + { + "name": "chest", + "parent": "COG", + "length": 31.24, + "x": 52.52, + "y": 15.34, + "rotation": 161.7 + }, + { + "name": "head", + "parent": "neck", + "length": 188.83, + "x": 69.96, + "y": 2.49, + "rotation": 8.06 + }, + { + "name": "chin", + "parent": "neck", + "length": 153.15, + "x": 64.62, + "y": -6.99, + "rotation": -69.07 + }, + { + "name": "R_wing", + "parent": "head", + "length": 359.5, + "x": -74.68, + "y": 20.9, + "rotation": 83.21 + }, + { + "name": "tail1", + "parent": "back", + "length": 65.65, + "x": 115.37, + "y": -0.19, + "rotation": 44.31 + }, + { + "name": "R_rear_thigh", + "parent": "back", + "length": 123.46, + "x": 65.31, + "y": 59.89, + "rotation": 104.87 + }, + { + "name": "tail2", + "parent": "tail1", + "length": 54.5, + "x": 65.65, + "y": 0.22, + "rotation": 12 + }, + { + "name": "tail3", + "parent": "tail2", + "length": 41.78, + "x": 54.5, + "y": 0.37, + "rotation": 1.8 + }, + { + "name": "tail4", + "parent": "tail3", + "length": 34.19, + "x": 41.78, + "y": 0.16, + "rotation": -1.8 + }, + { + "name": "tail5", + "parent": "tail4", + "length": 32.32, + "x": 34.19, + "y": -0.19, + "rotation": -3.15 + }, + { + "name": "tail6", + "parent": "tail5", + "length": 80.08, + "x": 32.32, + "y": -0.23, + "rotation": -29.55 + }, + { + "name": "L_rear_thigh", + "parent": "R_rear_thigh", + "length": 88.05, + "x": -8.59, + "y": 30.18, + "rotation": 28.35 + }, + { + "name": "R_rear_leg", + "parent": "R_rear_thigh", + "length": 91.06, + "x": 123.46, + "y": -0.26, + "rotation": -129.04 + }, + { + "name": "L_rear_leg", + "parent": "L_rear_thigh", + "length": 103.74, + "x": 96.04, + "y": -0.97, + "rotation": -122.41 + }, + { + "name": "R_rear_toe3", + "parent": "R_rear_leg", + "length": 103.45, + "x": 91.06, + "y": -0.35, + "rotation": 112.26 + }, + { + "name": "R_rear_toe2", + "parent": "R_rear_leg", + "length": 99.29, + "x": 89.6, + "y": 1.52, + "rotation": 125.32 + }, + { + "name": "R_rear_toe1", + "parent": "R_rear_leg", + "length": 94.99, + "x": 90.06, + "y": 2.12, + "rotation": 141.98 + }, + { + "name": "L_wing", + "parent": "chest", + "length": 301.12, + "x": -7.24, + "y": -24.65, + "rotation": -75.51 + }, + { + "name": "L_front_thigh", + "parent": "chest", + "length": 67.42, + "x": -45.58, + "y": 7.92, + "rotation": 138.94 + }, + { + "name": "R_front_thigh", + "parent": "chest", + "length": 81.63, + "x": -10.89, + "y": 28.25, + "rotation": 67.96 + }, + { + "name": "L_front_leg", + "parent": "L_front_thigh", + "length": 51.57, + "x": 67.42, + "y": 0.02, + "rotation": 43.36 + }, + { + "name": "L_front_toe1", + "parent": "L_front_leg", + "length": 51.44, + "x": 45.53, + "y": 2.43, + "rotation": -98 + }, + { + "name": "L_front_toe2", + "parent": "L_front_leg", + "length": 61.97, + "x": 51.57, + "y": -0.12, + "rotation": -55.26 + }, + { + "name": "L_front_toe4", + "parent": "L_front_leg", + "length": 53.47, + "x": 50.6, + "y": 7.08, + "scaleX": 1.134, + "rotation": 19.42 + }, + { + "name": "L_front_toe3", + "parent": "L_front_leg", + "length": 45.65, + "x": 54.19, + "y": 0.6, + "scaleX": 1.134, + "rotation": -11.13 + }, + { + "name": "R_front_leg", + "parent": "R_front_thigh", + "length": 66.52, + "x": 83.04, + "y": -0.3, + "rotation": 92.7 + }, + { + "name": "R_front_toe1", + "parent": "R_front_leg", + "length": 46.65, + "x": 70.03, + "y": 5.31, + "rotation": 8.59 + }, + { + "name": "R_front_toe2", + "parent": "R_front_leg", + "length": 53.66, + "x": 66.52, + "y": 0.33, + "rotation": -35.02 + }, + { + "name": "R_front_toe3", + "parent": "R_front_leg", + "length": 58.38, + "x": 62.1, + "y": -0.79, + "rotation": -74.67 + } +], + "slots": [ + { + "name": "L_rear_leg", + "bone": "L_rear_leg", + "attachment": "L_rear_leg" + }, + { + "name": "L_rear_thigh", + "bone": "L_rear_thigh", + "attachment": "L_rear_thigh" + }, + { + "name": "L_wing", + "bone": "L_wing", + "attachment": "L_wing01" + }, + { + "name": "tail6", + "bone": "tail6", + "attachment": "tail06" + }, + { + "name": "tail5", + "bone": "tail5", + "attachment": "tail05" + }, + { + "name": "tail4", + "bone": "tail4", + "attachment": "tail04" + }, + { + "name": "tail3", + "bone": "tail3", + "attachment": "tail03" + }, + { + "name": "tail2", + "bone": "tail2", + "attachment": "tail02" + }, + { + "name": "tail1", + "bone": "tail1", + "attachment": "tail01" + }, + { + "name": "back", + "bone": "back", + "attachment": "back" + }, + { + "name": "L_front_thigh", + "bone": "L_front_thigh", + "attachment": "L_front_thigh" + }, + { + "name": "L_front_leg", + "bone": "L_front_leg", + "attachment": "L_front_leg" + }, + { + "name": "L_front_toe1", + "bone": "L_front_toe1", + "attachment": "front_toeA" + }, + { + "name": "L_front_toe4", + "bone": "L_front_toe4", + "attachment": "front_toeB" + }, + { + "name": "L_front_toe3", + "bone": "L_front_toe3", + "attachment": "front_toeB" + }, + { + "name": "L_front_toe2", + "bone": "L_front_toe2", + "attachment": "front_toeB" + }, + { + "name": "chest", + "bone": "chest", + "attachment": "chest" + }, + { + "name": "R_rear_toe1", + "bone": "R_rear_toe1", + "attachment": "rear-toe" + }, + { + "name": "R_rear_toe2", + "bone": "R_rear_toe2", + "attachment": "rear-toe" + }, + { + "name": "R_rear_toe3", + "bone": "R_rear_toe3", + "attachment": "rear-toe" + }, + { + "name": "R_rear_leg", + "bone": "R_rear_leg", + "attachment": "R_rear_leg" + }, + { + "name": "R_rear_thigh", + "bone": "R_rear_thigh", + "attachment": "R_rear_thigh" + }, + { + "name": "R_front_toe1", + "bone": "R_front_toe1", + "attachment": "front_toeB" + }, + { + "name": "R_front_thigh", + "bone": "R_front_thigh", + "attachment": "R_front_thigh" + }, + { + "name": "R_front_leg", + "bone": "R_front_leg", + "attachment": "R_front_leg" + }, + { + "name": "R_front_toe2", + "bone": "R_front_toe2", + "attachment": "front_toeB" + }, + { + "name": "R_front_toe3", + "bone": "R_front_toe3", + "attachment": "front_toeB" + }, + { + "name": "chin", + "bone": "chin", + "attachment": "chin" + }, + { + "name": "R_wing", + "bone": "R_wing", + "attachment": "R_wing01" + }, + { + "name": "head", + "bone": "head", + "attachment": "head" + }, + { + "name": "logo", + "bone": "root", + "attachment": "logo" + } +], "skins": { + "default": { + "L_rear_leg": { + "L_rear_leg": { + "x": 67.29, + "y": 12.62, + "rotation": -162.65, + "width": 206, + "height": 177 + } + }, + "L_rear_thigh": { + "L_rear_thigh": { + "x": 56.03, + "y": 27.38, + "rotation": 74.93, + "width": 91, + "height": 149 + } + }, + "L_wing": { + "L_wing01": { + "x": 129.21, + "y": -45.49, + "rotation": -83.7, + "width": 191, + "height": 256 + }, + "L_wing02": { + "x": 126.37, + "y": -31.69, + "rotation": -86.18, + "width": 179, + "height": 269 + }, + "L_wing03": { + "x": 110.26, + "y": -90.89, + "rotation": -86.18, + "width": 186, + "height": 207 + }, + "L_wing04": { + "x": -61.61, + "y": -83.26, + "rotation": -86.18, + "width": 188, + "height": 135 + }, + "L_wing05": { + "x": -90.01, + "y": -78.14, + "rotation": -86.18, + "width": 218, + "height": 213 + }, + "L_wing06": { + "x": -143.76, + "y": -83.71, + "rotation": -86.18, + "width": 192, + "height": 331 + }, + "L_wing07": { + "x": -133.04, + "y": -33.89, + "rotation": -86.18, + "width": 159, + "height": 255 + }, + "L_wing08": { + "x": 50.15, + "y": -15.71, + "rotation": -86.18, + "width": 164, + "height": 181 + }, + "L_wing09": { + "x": 85.94, + "y": -11.32, + "rotation": -86.18, + "width": 204, + "height": 167 + } + }, + "tail6": { + "tail06": { + "x": 28.02, + "y": -16.83, + "rotation": -175.44, + "width": 95, + "height": 68 + } + }, + "tail5": { + "tail05": { + "x": 15.05, + "y": -3.57, + "rotation": 155, + "width": 52, + "height": 59 + } + }, + "tail4": { + "tail04": { + "x": 15.34, + "y": -2.17, + "rotation": 151.84, + "width": 56, + "height": 71 + } + }, + "tail3": { + "tail03": { + "x": 16.94, + "y": -2, + "rotation": 150.04, + "width": 73, + "height": 92 + } + }, + "tail2": { + "tail02": { + "x": 18.11, + "y": -1.75, + "rotation": 151.84, + "width": 95, + "height": 120 + } + }, + "tail1": { + "tail01": { + "x": 22.59, + "y": -4.5, + "rotation": 163.85, + "width": 120, + "height": 153 + } + }, + "back": { + "back": { + "x": 35.84, + "y": 19.99, + "rotation": -151.83, + "width": 190, + "height": 185 + } + }, + "L_front_thigh": { + "L_front_thigh": { + "x": 27.66, + "y": -11.58, + "rotation": 58.66, + "width": 84, + "height": 72 + } + }, + "L_front_leg": { + "L_front_leg": { + "x": 14.68, + "y": 0.48, + "rotation": 15.99, + "width": 84, + "height": 57 + } + }, + "L_front_toe1": { + "front_toeA": { + "x": 31.92, + "y": 0.61, + "rotation": 109.55, + "width": 29, + "height": 50 + } + }, + "L_front_toe4": { + "front_toeB": { + "x": 23.21, + "y": -11.68, + "scaleX": 0.881, + "rotation": 79.89, + "width": 56, + "height": 57 + } + }, + "L_front_toe3": { + "front_toeB": { + "x": 18.21, + "y": -7.21, + "scaleX": 0.881, + "scaleY": 0.94, + "rotation": 99.71, + "width": 56, + "height": 57 + } + }, + "L_front_toe2": { + "front_toeB": { + "x": 26.83, + "y": -4.94, + "rotation": 109.51, + "width": 56, + "height": 57 + } + }, + "chest": { + "chest": { + "x": -14.6, + "y": 24.78, + "rotation": -161.7, + "width": 136, + "height": 122 + } + }, + "R_rear_toe1": { + "rear-toe": { + "x": 54.75, + "y": -5.72, + "rotation": 134.79, + "width": 109, + "height": 77 + } + }, + "R_rear_toe2": { + "rear-toe": { + "x": 57.02, + "y": -7.22, + "rotation": 134.42, + "width": 109, + "height": 77 + } + }, + "R_rear_toe3": { + "rear-toe": { + "x": 47.46, + "y": -7.64, + "rotation": 134.34, + "width": 109, + "height": 77 + } + }, + "R_rear_leg": { + "R_rear_leg": { + "x": 60.87, + "y": -5.72, + "rotation": -127.66, + "width": 116, + "height": 100 + } + }, + "R_rear_thigh": { + "R_rear_thigh": { + "x": 53.25, + "y": 12.58, + "rotation": 103.29, + "width": 91, + "height": 149 + } + }, + "R_front_toe1": { + "front_toeB": { + "x": 24.49, + "y": -2.61, + "rotation": 104.18, + "width": 56, + "height": 57 + } + }, + "R_front_thigh": { + "R_front_thigh": { + "x": 35.28, + "y": 2.11, + "rotation": 130.33, + "width": 108, + "height": 108 + } + }, + "R_front_leg": { + "R_front_leg": { + "x": 17.79, + "y": 4.22, + "rotation": 37.62, + "width": 101, + "height": 89 + } + }, + "R_front_toe2": { + "front_toeB": { + "x": 26.39, + "y": 1.16, + "rotation": 104.57, + "width": 56, + "height": 57 + } + }, + "R_front_toe3": { + "front_toeB": { + "x": 30.66, + "y": -0.06, + "rotation": 112.29, + "width": 56, + "height": 57 + } + }, + "chin": { + "chin": { + "x": 66.55, + "y": 7.32, + "rotation": 30.01, + "width": 214, + "height": 146 + } + }, + "R_wing": { + "R_wing01": { + "x": 170.08, + "y": -23.67, + "rotation": -130.33, + "width": 219, + "height": 310 + }, + "R_wing02": { + "x": 171.14, + "y": -19.33, + "rotation": -130.33, + "width": 203, + "height": 305 + }, + "R_wing03": { + "x": 166.46, + "y": 29.23, + "rotation": -130.33, + "width": 272, + "height": 247 + }, + "R_wing04": { + "x": 42.94, + "y": 134.05, + "rotation": -130.33, + "width": 279, + "height": 144 + }, + "R_wing05": { + "x": -8.83, + "y": 142.59, + "rotation": -130.33, + "width": 251, + "height": 229 + }, + "R_wing06": { + "x": -123.33, + "y": 111.22, + "rotation": -130.33, + "width": 200, + "height": 366 + }, + "R_wing07": { + "x": -40.17, + "y": 118.03, + "rotation": -130.33, + "width": 200, + "height": 263 + }, + "R_wing08": { + "x": 48.01, + "y": 28.76, + "rotation": -130.33, + "width": 234, + "height": 254 + }, + "R_wing09": { + "x": 128.1, + "y": 21.12, + "rotation": -130.33, + "width": 248, + "height": 204 + } + }, + "head": { + "head": { + "x": 76.68, + "y": 32.21, + "rotation": -47.12, + "width": 296, + "height": 260 + } + }, + "logo": { + "logo": { + "y": -176.72, + "width": 897, + "height": 92 + } + } + } +}} \ No newline at end of file diff --git a/documentation/demos/demo34/dragon/front_toeA.png b/documentation/demos/demo34/dragon/front_toeA.png new file mode 100755 index 00000000..f021032e Binary files /dev/null and b/documentation/demos/demo34/dragon/front_toeA.png differ diff --git a/documentation/demos/demo34/dragon/front_toeB.png b/documentation/demos/demo34/dragon/front_toeB.png new file mode 100755 index 00000000..0b48c237 Binary files /dev/null and b/documentation/demos/demo34/dragon/front_toeB.png differ diff --git a/documentation/demos/demo34/dragon/head.png b/documentation/demos/demo34/dragon/head.png new file mode 100755 index 00000000..5e4e436f Binary files /dev/null and b/documentation/demos/demo34/dragon/head.png differ diff --git a/documentation/demos/demo34/dragon/license.txt b/documentation/demos/demo34/dragon/license.txt new file mode 100755 index 00000000..41ebddd5 --- /dev/null +++ b/documentation/demos/demo34/dragon/license.txt @@ -0,0 +1,5 @@ +Copyright (c) 2013, ODI EntertainmenT + +The project file and images in this "dragon" project are provided for +demonstration purposes only and may not be redistributed for any reason nor +used as the basis for derivative work. \ No newline at end of file diff --git a/documentation/demos/demo34/dragon/logo.png b/documentation/demos/demo34/dragon/logo.png new file mode 100755 index 00000000..cf43dad2 Binary files /dev/null and b/documentation/demos/demo34/dragon/logo.png differ diff --git a/documentation/demos/demo34/dragon/rear-toe.png b/documentation/demos/demo34/dragon/rear-toe.png new file mode 100755 index 00000000..e4c7fa87 Binary files /dev/null and b/documentation/demos/demo34/dragon/rear-toe.png differ diff --git a/documentation/demos/demo34/dragon/tail01.png b/documentation/demos/demo34/dragon/tail01.png new file mode 100755 index 00000000..e9bcef7f Binary files /dev/null and b/documentation/demos/demo34/dragon/tail01.png differ diff --git a/documentation/demos/demo34/dragon/tail02.png b/documentation/demos/demo34/dragon/tail02.png new file mode 100755 index 00000000..8b31a936 Binary files /dev/null and b/documentation/demos/demo34/dragon/tail02.png differ diff --git a/documentation/demos/demo34/dragon/tail03.png b/documentation/demos/demo34/dragon/tail03.png new file mode 100755 index 00000000..aa09539f Binary files /dev/null and b/documentation/demos/demo34/dragon/tail03.png differ diff --git a/documentation/demos/demo34/dragon/tail04.png b/documentation/demos/demo34/dragon/tail04.png new file mode 100755 index 00000000..2aeeed4f Binary files /dev/null and b/documentation/demos/demo34/dragon/tail04.png differ diff --git a/documentation/demos/demo34/dragon/tail05.png b/documentation/demos/demo34/dragon/tail05.png new file mode 100755 index 00000000..f41005c5 Binary files /dev/null and b/documentation/demos/demo34/dragon/tail05.png differ diff --git a/documentation/demos/demo34/dragon/tail06.png b/documentation/demos/demo34/dragon/tail06.png new file mode 100755 index 00000000..31f68a4d Binary files /dev/null and b/documentation/demos/demo34/dragon/tail06.png differ diff --git a/documentation/demos/demo34/dragon/template.png b/documentation/demos/demo34/dragon/template.png new file mode 100755 index 00000000..3f2ef650 Binary files /dev/null and b/documentation/demos/demo34/dragon/template.png differ diff --git a/documentation/demos/demo34/goblins/dagger.png b/documentation/demos/demo34/goblins/dagger.png new file mode 100755 index 00000000..9a666d63 Binary files /dev/null and b/documentation/demos/demo34/goblins/dagger.png differ diff --git a/documentation/demos/demo34/goblins/goblin/eyes-closed.png b/documentation/demos/demo34/goblins/goblin/eyes-closed.png new file mode 100755 index 00000000..e306dd40 Binary files /dev/null and b/documentation/demos/demo34/goblins/goblin/eyes-closed.png differ diff --git a/documentation/demos/demo34/goblins/goblin/head.png b/documentation/demos/demo34/goblins/goblin/head.png new file mode 100755 index 00000000..82b49f7f Binary files /dev/null and b/documentation/demos/demo34/goblins/goblin/head.png differ diff --git a/documentation/demos/demo34/goblins/goblin/left-arm.png b/documentation/demos/demo34/goblins/goblin/left-arm.png new file mode 100755 index 00000000..42f60e0a Binary files /dev/null and b/documentation/demos/demo34/goblins/goblin/left-arm.png differ diff --git a/documentation/demos/demo34/goblins/goblin/left-foot.png b/documentation/demos/demo34/goblins/goblin/left-foot.png new file mode 100755 index 00000000..89c142b7 Binary files /dev/null and b/documentation/demos/demo34/goblins/goblin/left-foot.png differ diff --git a/documentation/demos/demo34/goblins/goblin/left-hand.png b/documentation/demos/demo34/goblins/goblin/left-hand.png new file mode 100755 index 00000000..39700f01 Binary files /dev/null and b/documentation/demos/demo34/goblins/goblin/left-hand.png differ diff --git a/documentation/demos/demo34/goblins/goblin/left-lower-leg.png b/documentation/demos/demo34/goblins/goblin/left-lower-leg.png new file mode 100755 index 00000000..dd3e83b6 Binary files /dev/null and b/documentation/demos/demo34/goblins/goblin/left-lower-leg.png differ diff --git a/documentation/demos/demo34/goblins/goblin/left-shoulder.png b/documentation/demos/demo34/goblins/goblin/left-shoulder.png new file mode 100755 index 00000000..220b09cb Binary files /dev/null and b/documentation/demos/demo34/goblins/goblin/left-shoulder.png differ diff --git a/documentation/demos/demo34/goblins/goblin/left-upper-leg.png b/documentation/demos/demo34/goblins/goblin/left-upper-leg.png new file mode 100755 index 00000000..a031cf68 Binary files /dev/null and b/documentation/demos/demo34/goblins/goblin/left-upper-leg.png differ diff --git a/documentation/demos/demo34/goblins/goblin/neck.png b/documentation/demos/demo34/goblins/goblin/neck.png new file mode 100755 index 00000000..f4f3f04d Binary files /dev/null and b/documentation/demos/demo34/goblins/goblin/neck.png differ diff --git a/documentation/demos/demo34/goblins/goblin/pelvis.png b/documentation/demos/demo34/goblins/goblin/pelvis.png new file mode 100755 index 00000000..a8fc15c0 Binary files /dev/null and b/documentation/demos/demo34/goblins/goblin/pelvis.png differ diff --git a/documentation/demos/demo34/goblins/goblin/right-arm.png b/documentation/demos/demo34/goblins/goblin/right-arm.png new file mode 100755 index 00000000..c7b752bb Binary files /dev/null and b/documentation/demos/demo34/goblins/goblin/right-arm.png differ diff --git a/documentation/demos/demo34/goblins/goblin/right-foot.png b/documentation/demos/demo34/goblins/goblin/right-foot.png new file mode 100755 index 00000000..ce982d31 Binary files /dev/null and b/documentation/demos/demo34/goblins/goblin/right-foot.png differ diff --git a/documentation/demos/demo34/goblins/goblin/right-hand.png b/documentation/demos/demo34/goblins/goblin/right-hand.png new file mode 100755 index 00000000..2363fba0 Binary files /dev/null and b/documentation/demos/demo34/goblins/goblin/right-hand.png differ diff --git a/documentation/demos/demo34/goblins/goblin/right-lower-leg.png b/documentation/demos/demo34/goblins/goblin/right-lower-leg.png new file mode 100755 index 00000000..b9bb4965 Binary files /dev/null and b/documentation/demos/demo34/goblins/goblin/right-lower-leg.png differ diff --git a/documentation/demos/demo34/goblins/goblin/right-shoulder.png b/documentation/demos/demo34/goblins/goblin/right-shoulder.png new file mode 100755 index 00000000..48baa266 Binary files /dev/null and b/documentation/demos/demo34/goblins/goblin/right-shoulder.png differ diff --git a/documentation/demos/demo34/goblins/goblin/right-upper-leg.png b/documentation/demos/demo34/goblins/goblin/right-upper-leg.png new file mode 100755 index 00000000..d5fac442 Binary files /dev/null and b/documentation/demos/demo34/goblins/goblin/right-upper-leg.png differ diff --git a/documentation/demos/demo34/goblins/goblin/torso.png b/documentation/demos/demo34/goblins/goblin/torso.png new file mode 100755 index 00000000..f9b4314a Binary files /dev/null and b/documentation/demos/demo34/goblins/goblin/torso.png differ diff --git a/documentation/demos/demo34/goblins/goblin/undie-straps.png b/documentation/demos/demo34/goblins/goblin/undie-straps.png new file mode 100755 index 00000000..6088d354 Binary files /dev/null and b/documentation/demos/demo34/goblins/goblin/undie-straps.png differ diff --git a/documentation/demos/demo34/goblins/goblin/undies.png b/documentation/demos/demo34/goblins/goblin/undies.png new file mode 100755 index 00000000..95016bab Binary files /dev/null and b/documentation/demos/demo34/goblins/goblin/undies.png differ diff --git a/documentation/demos/demo34/goblins/goblingirl/eyes-closed.png b/documentation/demos/demo34/goblins/goblingirl/eyes-closed.png new file mode 100755 index 00000000..d6826843 Binary files /dev/null and b/documentation/demos/demo34/goblins/goblingirl/eyes-closed.png differ diff --git a/documentation/demos/demo34/goblins/goblingirl/head.png b/documentation/demos/demo34/goblins/goblingirl/head.png new file mode 100755 index 00000000..5434995f Binary files /dev/null and b/documentation/demos/demo34/goblins/goblingirl/head.png differ diff --git a/documentation/demos/demo34/goblins/goblingirl/left-arm.png b/documentation/demos/demo34/goblins/goblingirl/left-arm.png new file mode 100755 index 00000000..00c5bbc0 Binary files /dev/null and b/documentation/demos/demo34/goblins/goblingirl/left-arm.png differ diff --git a/documentation/demos/demo34/goblins/goblingirl/left-foot.png b/documentation/demos/demo34/goblins/goblingirl/left-foot.png new file mode 100755 index 00000000..e1adb405 Binary files /dev/null and b/documentation/demos/demo34/goblins/goblingirl/left-foot.png differ diff --git a/documentation/demos/demo34/goblins/goblingirl/left-hand.png b/documentation/demos/demo34/goblins/goblingirl/left-hand.png new file mode 100755 index 00000000..e070bf29 Binary files /dev/null and b/documentation/demos/demo34/goblins/goblingirl/left-hand.png differ diff --git a/documentation/demos/demo34/goblins/goblingirl/left-lower-leg.png b/documentation/demos/demo34/goblins/goblingirl/left-lower-leg.png new file mode 100755 index 00000000..346866ff Binary files /dev/null and b/documentation/demos/demo34/goblins/goblingirl/left-lower-leg.png differ diff --git a/documentation/demos/demo34/goblins/goblingirl/left-shoulder.png b/documentation/demos/demo34/goblins/goblingirl/left-shoulder.png new file mode 100755 index 00000000..0cb53d45 Binary files /dev/null and b/documentation/demos/demo34/goblins/goblingirl/left-shoulder.png differ diff --git a/documentation/demos/demo34/goblins/goblingirl/left-upper-leg.png b/documentation/demos/demo34/goblins/goblingirl/left-upper-leg.png new file mode 100755 index 00000000..be09a930 Binary files /dev/null and b/documentation/demos/demo34/goblins/goblingirl/left-upper-leg.png differ diff --git a/documentation/demos/demo34/goblins/goblingirl/neck.png b/documentation/demos/demo34/goblins/goblingirl/neck.png new file mode 100755 index 00000000..14b62b3c Binary files /dev/null and b/documentation/demos/demo34/goblins/goblingirl/neck.png differ diff --git a/documentation/demos/demo34/goblins/goblingirl/pelvis.png b/documentation/demos/demo34/goblins/goblingirl/pelvis.png new file mode 100755 index 00000000..f24c2a7d Binary files /dev/null and b/documentation/demos/demo34/goblins/goblingirl/pelvis.png differ diff --git a/documentation/demos/demo34/goblins/goblingirl/right-arm.png b/documentation/demos/demo34/goblins/goblingirl/right-arm.png new file mode 100755 index 00000000..5818fc62 Binary files /dev/null and b/documentation/demos/demo34/goblins/goblingirl/right-arm.png differ diff --git a/documentation/demos/demo34/goblins/goblingirl/right-foot.png b/documentation/demos/demo34/goblins/goblingirl/right-foot.png new file mode 100755 index 00000000..716f4f09 Binary files /dev/null and b/documentation/demos/demo34/goblins/goblingirl/right-foot.png differ diff --git a/documentation/demos/demo34/goblins/goblingirl/right-hand.png b/documentation/demos/demo34/goblins/goblingirl/right-hand.png new file mode 100755 index 00000000..cd5eadce Binary files /dev/null and b/documentation/demos/demo34/goblins/goblingirl/right-hand.png differ diff --git a/documentation/demos/demo34/goblins/goblingirl/right-lower-leg.png b/documentation/demos/demo34/goblins/goblingirl/right-lower-leg.png new file mode 100755 index 00000000..f1357209 Binary files /dev/null and b/documentation/demos/demo34/goblins/goblingirl/right-lower-leg.png differ diff --git a/documentation/demos/demo34/goblins/goblingirl/right-shoulder.png b/documentation/demos/demo34/goblins/goblingirl/right-shoulder.png new file mode 100755 index 00000000..297a5fce Binary files /dev/null and b/documentation/demos/demo34/goblins/goblingirl/right-shoulder.png differ diff --git a/documentation/demos/demo34/goblins/goblingirl/right-upper-leg.png b/documentation/demos/demo34/goblins/goblingirl/right-upper-leg.png new file mode 100755 index 00000000..d6dae75c Binary files /dev/null and b/documentation/demos/demo34/goblins/goblingirl/right-upper-leg.png differ diff --git a/documentation/demos/demo34/goblins/goblingirl/torso.png b/documentation/demos/demo34/goblins/goblingirl/torso.png new file mode 100755 index 00000000..2a92320d Binary files /dev/null and b/documentation/demos/demo34/goblins/goblingirl/torso.png differ diff --git a/documentation/demos/demo34/goblins/goblingirl/undie-straps.png b/documentation/demos/demo34/goblins/goblingirl/undie-straps.png new file mode 100755 index 00000000..36913d57 Binary files /dev/null and b/documentation/demos/demo34/goblins/goblingirl/undie-straps.png differ diff --git a/documentation/demos/demo34/goblins/goblingirl/undies.png b/documentation/demos/demo34/goblins/goblingirl/undies.png new file mode 100755 index 00000000..ac3ac2ed Binary files /dev/null and b/documentation/demos/demo34/goblins/goblingirl/undies.png differ diff --git a/documentation/demos/demo34/goblins/goblins-skeleton.json b/documentation/demos/demo34/goblins/goblins-skeleton.json new file mode 100644 index 00000000..043c9dcf --- /dev/null +++ b/documentation/demos/demo34/goblins/goblins-skeleton.json @@ -0,0 +1,201 @@ +{ +"bones": [ + { "name": "root" }, + { "name": "hip", "parent": "root", "x": 0.64, "y": 114.41 }, + { "name": "left upper leg", "parent": "hip", "length": 50.39, "x": 14.45, "y": 2.81, "rotation": -89.09 }, + { "name": "left lower leg", "parent": "left upper leg", "length": 49.89, "x": 56.34, "y": 0.98, "rotation": -16.65 }, + { "name": "left foot", "parent": "left lower leg", "length": 46.5, "x": 58.94, "y": -7.61, "rotation": 102.43 }, + { "name": "right upper leg", "parent": "hip", "length": 42.45, "x": -20.07, "y": -6.83, "rotation": -97.49 }, + { "name": "right lower leg", "parent": "right upper leg", "length": 58.52, "x": 42.99, "y": -0.61, "rotation": -14.34 }, + { "name": "right foot", "parent": "right lower leg", "length": 45.45, "x": 64.88, "y": 0.04, "rotation": 110.3 }, + { "name": "torso", "parent": "hip", "length": 85.82, "x": -6.42, "y": 1.97, "rotation": 93.92 }, + { "name": "neck", "parent": "torso", "length": 18.38, "x": 81.67, "y": -6.34, "rotation": -1.51 }, + { "name": "head", "parent": "neck", "length": 68.28, "x": 20.93, "y": 11.59, "rotation": -13.92 }, + { "name": "right shoulder", "parent": "torso", "length": 37.24, "x": 76.02, "y": 18.14, "rotation": 133.88 }, + { "name": "right arm", "parent": "right shoulder", "length": 36.74, "x": 37.6, "y": 0.31, "rotation": 36.32 }, + { "name": "right hand", "parent": "right arm", "length": 15.32, "x": 36.9, "y": 0.34, "rotation": 2.35 }, + { "name": "left shoulder", "parent": "torso", "length": 35.43, "x": 74.04, "y": -20.38, "rotation": -156.96 }, + { "name": "left arm", "parent": "left shoulder", "length": 35.62, "x": 37.85, "y": -2.34, "rotation": 28.16 }, + { "name": "left hand", "parent": "left arm", "length": 11.52, "x": 35.62, "y": 0.07, "rotation": 2.7 }, + { "name": "pelvis", "parent": "hip", "x": 1.41, "y": -6.57 } +], +"slots": [ + { "name": "left shoulder", "bone": "left shoulder", "attachment": "left shoulder" }, + { "name": "left arm", "bone": "left arm", "attachment": "left arm" }, + { "name": "left hand item", "bone": "left hand", "attachment": "spear" }, + { "name": "left hand", "bone": "left hand", "attachment": "left hand" }, + { "name": "left foot", "bone": "left foot", "attachment": "left foot" }, + { "name": "left lower leg", "bone": "left lower leg", "attachment": "left lower leg" }, + { "name": "left upper leg", "bone": "left upper leg", "attachment": "left upper leg" }, + { "name": "neck", "bone": "neck", "attachment": "neck" }, + { "name": "torso", "bone": "torso", "attachment": "torso" }, + { "name": "pelvis", "bone": "pelvis", "attachment": "pelvis" }, + { "name": "right foot", "bone": "right foot", "attachment": "right foot" }, + { "name": "right lower leg", "bone": "right lower leg", "attachment": "right lower leg" }, + { "name": "undie straps", "bone": "pelvis", "attachment": "undie straps" }, + { "name": "undies", "bone": "pelvis", "attachment": "undies" }, + { "name": "right upper leg", "bone": "right upper leg", "attachment": "right upper leg" }, + { "name": "head", "bone": "head", "attachment": "head" }, + { "name": "eyes", "bone": "head" }, + { "name": "right shoulder", "bone": "right shoulder", "attachment": "right shoulder" }, + { "name": "right arm", "bone": "right arm", "attachment": "right arm" }, + { "name": "right hand item", "bone": "right hand", "attachment": "dagger" }, + { "name": "right hand", "bone": "right hand", "attachment": "right hand" } +], +"skins": { + "default": { + "left hand item": { + "dagger": { "x": 7.88, "y": -23.45, "rotation": 10.47, "width": 26, "height": 108 }, + "spear": { "x": -4.55, "y": 39.2, "rotation": 13.04, "width": 22, "height": 368 } + }, + "right hand item": { + "dagger": { "x": 7.17, "y": -22.38, "rotation": -5.27, "width": 26, "height": 108 } + } + }, + "goblin": { + "neck": { + "neck": { "name": "goblin/neck", "x": 10.1, "y": 0.42, "rotation": -93.69, "width": 36, "height": 41 } + }, + "undies": { + "undies": { "name": "goblin/undies", "x": 6.3, "y": 0.12, "rotation": 0.91, "width": 36, "height": 29 } + }, + "right hand": { + "right hand": { "name": "goblin/right-hand", "x": 7.88, "y": 2.78, "rotation": 91.96, "width": 36, "height": 37 } + }, + "right arm": { + "right arm": { "name": "goblin/right-arm", "x": 16.44, "y": -1.04, "rotation": 94.32, "width": 23, "height": 50 } + }, + "head": { + "head": { "name": "goblin/head", "x": 25.73, "y": 2.33, "rotation": -92.29, "width": 103, "height": 66 } + }, + "left shoulder": { + "left shoulder": { "name": "goblin/left-shoulder", "x": 15.56, "y": -2.26, "rotation": 62.01, "width": 29, "height": 44 } + }, + "left arm": { + "left arm": { + "name": "goblin/left-arm", + "x": 16.7, + "y": -1.69, + "scaleX": 1.057, + "scaleY": 1.057, + "rotation": 33.84, + "width": 37, + "height": 35 + } + }, + "left hand": { + "left hand": { + "name": "goblin/left-hand", + "x": 3.47, + "y": 3.41, + "scaleX": 0.892, + "scaleY": 0.892, + "rotation": 31.14, + "width": 36, + "height": 41 + } + }, + "right lower leg": { + "right lower leg": { "name": "goblin/right-lower-leg", "x": 25.68, "y": -3.15, "rotation": 111.83, "width": 36, "height": 76 } + }, + "right upper leg": { + "right upper leg": { "name": "goblin/right-upper-leg", "x": 20.35, "y": 1.47, "rotation": 97.49, "width": 34, "height": 63 } + }, + "pelvis": { + "pelvis": { "name": "goblin/pelvis", "x": -5.61, "y": 0.76, "width": 62, "height": 43 } + }, + "left lower leg": { + "left lower leg": { "name": "goblin/left-lower-leg", "x": 23.58, "y": -2.06, "rotation": 105.75, "width": 33, "height": 70 } + }, + "left upper leg": { + "left upper leg": { "name": "goblin/left-upper-leg", "x": 29.68, "y": -3.87, "rotation": 89.09, "width": 33, "height": 73 } + }, + "torso": { + "torso": { "name": "goblin/torso", "x": 38.09, "y": -3.87, "rotation": -94.95, "width": 68, "height": 96 } + }, + "right shoulder": { + "right shoulder": { "name": "goblin/right-shoulder", "x": 15.68, "y": -1.03, "rotation": 130.65, "width": 39, "height": 45 } + }, + "right foot": { + "right foot": { "name": "goblin/right-foot", "x": 23.56, "y": 9.8, "rotation": 1.52, "width": 63, "height": 33 } + }, + "left foot": { + "left foot": { "name": "goblin/left-foot", "x": 24.85, "y": 8.74, "rotation": 3.32, "width": 65, "height": 31 } + }, + "undie straps": { + "undie straps": { "name": "goblin/undie-straps", "x": -3.87, "y": 13.1, "scaleX": 1.089, "width": 55, "height": 19 } + }, + "eyes": { + "eyes closed": { "name": "goblin/eyes-closed", "x": 32.21, "y": -21.27, "rotation": -88.92, "width": 34, "height": 12 } + } + }, + "goblingirl": { + "left upper leg": { + "left upper leg": { "name": "goblingirl/left-upper-leg", "x": 30.21, "y": -2.95, "rotation": 89.09, "width": 33, "height": 70 } + }, + "left lower leg": { + "left lower leg": { "name": "goblingirl/left-lower-leg", "x": 25.02, "y": -0.6, "rotation": 105.75, "width": 33, "height": 70 } + }, + "left foot": { + "left foot": { "name": "goblingirl/left-foot", "x": 25.17, "y": 7.92, "rotation": 3.32, "width": 65, "height": 31 } + }, + "right upper leg": { + "right upper leg": { "name": "goblingirl/right-upper-leg", "x": 19.69, "y": 2.13, "rotation": 97.49, "width": 34, "height": 63 } + }, + "right lower leg": { + "right lower leg": { "name": "goblingirl/right-lower-leg", "x": 26.15, "y": -3.27, "rotation": 111.83, "width": 36, "height": 76 } + }, + "right foot": { + "right foot": { "name": "goblingirl/right-foot", "x": 23.46, "y": 9.66, "rotation": 1.52, "width": 63, "height": 33 } + }, + "torso": { + "torso": { "name": "goblingirl/torso", "x": 36.28, "y": -5.14, "rotation": -95.74, "width": 68, "height": 96 } + }, + "left shoulder": { + "left shoulder": { "name": "goblingirl/left-shoulder", "x": 19.8, "y": -0.42, "rotation": 61.21, "width": 28, "height": 46 } + }, + "left arm": { + "left arm": { "name": "goblingirl/left-arm", "x": 19.64, "y": -2.42, "rotation": 33.05, "width": 37, "height": 35 } + }, + "left hand": { + "left hand": { + "name": "goblingirl/left-hand", + "x": 4.34, + "y": 2.39, + "scaleX": 0.896, + "scaleY": 0.896, + "rotation": 30.34, + "width": 35, + "height": 40 + } + }, + "neck": { + "neck": { "name": "goblingirl/neck", "x": 6.16, "y": -3.14, "rotation": -98.86, "width": 35, "height": 41 } + }, + "head": { + "head": { "name": "goblingirl/head", "x": 27.71, "y": -4.32, "rotation": -85.58, "width": 103, "height": 81 } + }, + "right shoulder": { + "right shoulder": { "name": "goblingirl/right-shoulder", "x": 14.46, "y": 0.45, "rotation": 129.85, "width": 39, "height": 45 } + }, + "right arm": { + "right arm": { "name": "goblingirl/right-arm", "x": 16.85, "y": -0.66, "rotation": 93.52, "width": 28, "height": 50 } + }, + "right hand": { + "right hand": { "name": "goblingirl/right-hand", "x": 7.21, "y": 3.43, "rotation": 91.16, "width": 36, "height": 37 } + }, + "pelvis": { + "pelvis": { "name": "goblingirl/pelvis", "x": -3.87, "y": 3.18, "width": 62, "height": 43 } + }, + "undie straps": { + "undie straps": { "name": "goblingirl/undie-straps", "x": -1.51, "y": 14.18, "width": 55, "height": 19 } + }, + "undies": { + "undies": { "name": "goblingirl/undies", "x": 5.4, "y": 1.7, "width": 36, "height": 29 } + }, + "eyes": { + "eyes closed": { "name": "goblingirl/eyes-closed", "x": 28, "y": -25.54, "rotation": -87.04, "width": 37, "height": 21 } + } + } +} +} \ No newline at end of file diff --git a/documentation/demos/demo34/goblins/goblins-walk.json b/documentation/demos/demo34/goblins/goblins-walk.json new file mode 100644 index 00000000..468b8ec6 --- /dev/null +++ b/documentation/demos/demo34/goblins/goblins-walk.json @@ -0,0 +1,296 @@ +{ +"bones": { + "left upper leg": { + "rotate": [ + { "time": 0, "angle": -26.55 }, + { "time": 0.1333, "angle": -8.78 }, + { "time": 0.2333, "angle": 9.51 }, + { "time": 0.3666, "angle": 30.74 }, + { "time": 0.5, "angle": 25.33 }, + { "time": 0.6333, "angle": 26.11 }, + { "time": 0.7333, "angle": -7.7 }, + { "time": 0.8666, "angle": -21.19 }, + { "time": 1, "angle": -26.55 } + ], + "translate": [ + { "time": 0, "x": -1.32, "y": 1.7 }, + { "time": 0.3666, "x": -0.06, "y": 2.42 }, + { "time": 1, "x": -1.32, "y": 1.7 } + ] + }, + "right upper leg": { + "rotate": [ + { "time": 0, "angle": 42.45 }, + { "time": 0.1333, "angle": 52.1 }, + { "time": 0.2333, "angle": 8.53 }, + { "time": 0.5, "angle": -16.93 }, + { "time": 0.6333, "angle": 1.89 }, + { + "time": 0.7333, + "angle": 28.06, + "curve": [ 0.462, 0.11, 1, 1 ] + }, + { + "time": 0.8666, + "angle": 58.68, + "curve": [ 0.5, 0.02, 1, 1 ] + }, + { "time": 1, "angle": 42.45 } + ], + "translate": [ + { "time": 0, "x": 6.23, "y": 0 }, + { "time": 0.2333, "x": 2.14, "y": 2.4 }, + { "time": 0.5, "x": 2.44, "y": 4.8 }, + { "time": 1, "x": 6.23, "y": 0 } + ] + }, + "left lower leg": { + "rotate": [ + { "time": 0, "angle": -22.98 }, + { "time": 0.1333, "angle": -63.5 }, + { "time": 0.2333, "angle": -73.76 }, + { "time": 0.5, "angle": 5.11 }, + { "time": 0.6333, "angle": -28.29 }, + { "time": 0.7333, "angle": 4.08 }, + { "time": 0.8666, "angle": 3.53 }, + { "time": 1, "angle": -22.98 } + ], + "translate": [ + { "time": 0, "x": 0, "y": 0 }, + { "time": 0.2333, "x": 2.55, "y": -0.47 }, + { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, + { "time": 1, "x": 0, "y": 0 } + ] + }, + "left foot": { + "rotate": [ + { "time": 0, "angle": -3.69 }, + { "time": 0.1333, "angle": -10.42 }, + { "time": 0.2333, "angle": -5.01 }, + { "time": 0.3666, "angle": 3.87 }, + { "time": 0.5, "angle": -3.87 }, + { "time": 0.6333, "angle": 2.78 }, + { "time": 0.7333, "angle": 1.68 }, + { "time": 0.8666, "angle": -8.54 }, + { "time": 1, "angle": -3.69 } + ] + }, + "right shoulder": { + "rotate": [ + { + "time": 0, + "angle": 5.29, + "curve": [ 0.264, 0, 0.75, 1 ] + }, + { "time": 0.6333, "angle": 6.65 }, + { "time": 1, "angle": 5.29 } + ] + }, + "right arm": { + "rotate": [ + { + "time": 0, + "angle": -4.02, + "curve": [ 0.267, 0, 0.804, 0.99 ] + }, + { + "time": 0.6333, + "angle": 19.78, + "curve": [ 0.307, 0, 0.787, 0.99 ] + }, + { "time": 1, "angle": -4.02 } + ] + }, + "right hand": { + "rotate": [ + { "time": 0, "angle": 8.98 }, + { "time": 0.6333, "angle": 0.51 }, + { "time": 1, "angle": 8.98 } + ] + }, + "left shoulder": { + "rotate": [ + { + "time": 0, + "angle": 6.25, + "curve": [ 0.339, 0, 0.683, 1 ] + }, + { + "time": 0.5, + "angle": -11.78, + "curve": [ 0.281, 0, 0.686, 0.99 ] + }, + { "time": 1, "angle": 6.25 } + ], + "translate": [ + { "time": 0, "x": 1.15, "y": 0.23 } + ] + }, + "left hand": { + "rotate": [ + { + "time": 0, + "angle": -21.23, + "curve": [ 0.295, 0, 0.755, 0.98 ] + }, + { + "time": 0.5, + "angle": -27.28, + "curve": [ 0.241, 0, 0.75, 0.97 ] + }, + { "time": 1, "angle": -21.23 } + ] + }, + "left arm": { + "rotate": [ + { + "time": 0, + "angle": 28.37, + "curve": [ 0.339, 0, 0.683, 1 ] + }, + { + "time": 0.5, + "angle": 60.09, + "curve": [ 0.281, 0, 0.686, 0.99 ] + }, + { "time": 1, "angle": 28.37 } + ] + }, + "torso": { + "rotate": [ + { "time": 0, "angle": -10.28 }, + { + "time": 0.1333, + "angle": -15.38, + "curve": [ 0.545, 0, 0.818, 1 ] + }, + { + "time": 0.3666, + "angle": -9.78, + "curve": [ 0.58, 0.17, 0.669, 0.99 ] + }, + { + "time": 0.6333, + "angle": -15.75, + "curve": [ 0.235, 0.01, 0.795, 1 ] + }, + { + "time": 0.8666, + "angle": -7.06, + "curve": [ 0.209, 0, 0.816, 0.98 ] + }, + { "time": 1, "angle": -10.28 } + ], + "translate": [ + { "time": 0, "x": -1.29, "y": 1.68 } + ] + }, + "right foot": { + "rotate": [ + { "time": 0, "angle": -5.25 }, + { "time": 0.2333, "angle": -1.91 }, + { "time": 0.3666, "angle": -6.45 }, + { "time": 0.5, "angle": -5.39 }, + { "time": 0.7333, "angle": -11.68 }, + { "time": 0.8666, "angle": 0.46 }, + { "time": 1, "angle": -5.25 } + ] + }, + "right lower leg": { + "rotate": [ + { + "time": 0, + "angle": -3.39, + "curve": [ 0.316, 0.01, 0.741, 0.98 ] + }, + { + "time": 0.1333, + "angle": -45.53, + "curve": [ 0.229, 0, 0.738, 0.97 ] + }, + { "time": 0.2333, "angle": -4.83 }, + { "time": 0.5, "angle": -19.53 }, + { "time": 0.6333, "angle": -64.8 }, + { + "time": 0.7333, + "angle": -82.56, + "curve": [ 0.557, 0.18, 1, 1 ] + }, + { "time": 1, "angle": -3.39 } + ], + "translate": [ + { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, + { "time": 0.5, "x": 0, "y": 0 }, + { "time": 0.6333, "x": 2.18, "y": 0.21 }, + { "time": 1, "x": 0, "y": 0 } + ] + }, + "hip": { + "rotate": [ + { "time": 0, "angle": 0, "curve": "stepped" }, + { "time": 1, "angle": 0 } + ], + "translate": [ + { "time": 0, "x": 0, "y": -4.16 }, + { + "time": 0.1333, + "x": 0, + "y": -7.05, + "curve": [ 0.359, 0.47, 0.646, 0.74 ] + }, + { "time": 0.3666, "x": 0, "y": 6.78 }, + { "time": 0.5, "x": 0, "y": -6.13 }, + { + "time": 0.6333, + "x": 0, + "y": -7.05, + "curve": [ 0.359, 0.47, 0.646, 0.74 ] + }, + { "time": 0.8666, "x": 0, "y": 6.78 }, + { "time": 1, "x": 0, "y": -4.16 } + ] + }, + "neck": { + "rotate": [ + { "time": 0, "angle": 3.6 }, + { "time": 0.1333, "angle": 17.49 }, + { "time": 0.2333, "angle": 6.1 }, + { "time": 0.3666, "angle": 3.45 }, + { "time": 0.5, "angle": 5.17 }, + { "time": 0.6333, "angle": 18.36 }, + { "time": 0.7333, "angle": 6.09 }, + { "time": 0.8666, "angle": 2.28 }, + { "time": 1, "angle": 3.6 } + ] + }, + "head": { + "rotate": [ + { + "time": 0, + "angle": 3.6, + "curve": [ 0, 0, 0.704, 1.17 ] + }, + { "time": 0.1333, "angle": -0.2 }, + { "time": 0.2333, "angle": 6.1 }, + { "time": 0.3666, "angle": 3.45 }, + { + "time": 0.5, + "angle": 5.17, + "curve": [ 0, 0, 0.704, 1.61 ] + }, + { "time": 0.6666, "angle": 1.1 }, + { "time": 0.7333, "angle": 6.09 }, + { "time": 0.8666, "angle": 2.28 }, + { "time": 1, "angle": 3.6 } + ] + } +}, +"slots": { + "eyes": { + "attachment": [ + { "time": 0.7, "name": "eyes closed" }, + { "time": 0.8, "name": null } + ] + } +} +} \ No newline at end of file diff --git a/documentation/demos/demo34/goblins/spear.png b/documentation/demos/demo34/goblins/spear.png new file mode 100755 index 00000000..0704dc32 Binary files /dev/null and b/documentation/demos/demo34/goblins/spear.png differ diff --git a/documentation/demos/demo34/index.html b/documentation/demos/demo34/index.html index af952eb6..194cba88 100755 --- a/documentation/demos/demo34/index.html +++ b/documentation/demos/demo34/index.html @@ -1,10 +1,51 @@ + + + + + + + +
+ + +
+ +
+
+

Skeletal animation

+
+
+ +
+
+
+

+ First attemp at support Spine from @EsotericSoft format. +

+
+
+ Show bones +
+
+
+
+
+ + + + CAAT example: UI.Label + + + + + + + +
+ + +
+ +
+
+

Label - Reload for new layouts

+
+
+ +
+
+
+

Controls:

+
    +
  • None.
  • +
+
+
+

+ This demo features the following elements: +

+
    +
  • UI.Label object
  • +
  • Defining styles
  • +
  • Adding anchors
  • +
  • Mixing images and text
  • +
+
+
+
+
+
+ + + + + + + + + + \ No newline at end of file diff --git a/documentation/demos/demo36/spritemap.html b/documentation/demos/demo36/spritemap.html new file mode 100644 index 00000000..260f080f --- /dev/null +++ b/documentation/demos/demo36/spritemap.html @@ -0,0 +1,261 @@ + + + + + CAAT example: Atlas Bitmaps + + + + + + + +
+ + +
+ +
+
+

Atlas Bitmaps

+
+
+ +
+
+
+

Controls:

+
    +
  • None.
  • +
+
+
+

+ This demo features the following elements: +

+
    +
  • Create SpriteImage objects
  • +
  • Use Atlas bitmaps
  • +
  • Create fonts from sub-images contained in Atlas bitmaps
  • +
+
+
+
+
+
+ + + + + + + + + + \ No newline at end of file diff --git a/documentation/demos/index.html b/documentation/demos/index.html index 922e03d0..9eec55c1 100644 --- a/documentation/demos/index.html +++ b/documentation/demos/index.html @@ -10,42 +10,44 @@

Demos

- +
+ Skeletal animation + Sprites control + Path management + Procedural fishpond + Sprites traversing a random path + Pixel perfect collistion detection with mouse + Sprites traversing a random path + accelerometer input + Actor anchors + Hierarchical rotations + Hierarchy II + Some actor behaviors + Procedural grass + Circles collision + Box2D integration + Scene transitions + Scene timers + SpriteImage demo + Masking + Video playback and manipullation + Keyboard demo + Quadtree based collision + Flightcontrol like demo + TileMap engine preview + Multitouch test + Action To + Path Creation + Flip cards + Fonts + Paint demo + Auto Layout + UI.TextActor vs drawString + SVG Parser + CSS3 @KeyFrames + +
\ No newline at end of file diff --git a/documentation/demos/menu/menu.html b/documentation/demos/menu/menu.html index 7f530a84..8fd87743 100644 --- a/documentation/demos/menu/menu.html +++ b/documentation/demos/menu/menu.html @@ -12,6 +12,11 @@

Demos

  • Index
  • Tutorial

    diff --git a/documentation/demos/thumbs/demo1.png b/documentation/demos/thumbs/demo1.png new file mode 100644 index 00000000..264e805c Binary files /dev/null and b/documentation/demos/thumbs/demo1.png differ diff --git a/documentation/demos/thumbs/demo10.png b/documentation/demos/thumbs/demo10.png new file mode 100644 index 00000000..35d3510a Binary files /dev/null and b/documentation/demos/thumbs/demo10.png differ diff --git a/documentation/demos/thumbs/demo11.png b/documentation/demos/thumbs/demo11.png new file mode 100644 index 00000000..b63f733c Binary files /dev/null and b/documentation/demos/thumbs/demo11.png differ diff --git a/documentation/demos/thumbs/demo12.png b/documentation/demos/thumbs/demo12.png new file mode 100644 index 00000000..e3206e0f Binary files /dev/null and b/documentation/demos/thumbs/demo12.png differ diff --git a/documentation/demos/thumbs/demo13.png b/documentation/demos/thumbs/demo13.png new file mode 100644 index 00000000..6d0a5805 Binary files /dev/null and b/documentation/demos/thumbs/demo13.png differ diff --git a/documentation/demos/thumbs/demo14.png b/documentation/demos/thumbs/demo14.png new file mode 100644 index 00000000..4d4103c5 Binary files /dev/null and b/documentation/demos/thumbs/demo14.png differ diff --git a/documentation/demos/thumbs/demo15.png b/documentation/demos/thumbs/demo15.png new file mode 100644 index 00000000..9ad9f5ab Binary files /dev/null and b/documentation/demos/thumbs/demo15.png differ diff --git a/documentation/demos/thumbs/demo16.png b/documentation/demos/thumbs/demo16.png new file mode 100644 index 00000000..e55869d6 Binary files /dev/null and b/documentation/demos/thumbs/demo16.png differ diff --git a/documentation/demos/thumbs/demo17.png b/documentation/demos/thumbs/demo17.png new file mode 100644 index 00000000..2040f656 Binary files /dev/null and b/documentation/demos/thumbs/demo17.png differ diff --git a/documentation/demos/thumbs/demo18.png b/documentation/demos/thumbs/demo18.png new file mode 100644 index 00000000..32e24761 Binary files /dev/null and b/documentation/demos/thumbs/demo18.png differ diff --git a/documentation/demos/thumbs/demo19.png b/documentation/demos/thumbs/demo19.png new file mode 100644 index 00000000..8d25d41a Binary files /dev/null and b/documentation/demos/thumbs/demo19.png differ diff --git a/documentation/demos/thumbs/demo2.png b/documentation/demos/thumbs/demo2.png new file mode 100644 index 00000000..cc03f655 Binary files /dev/null and b/documentation/demos/thumbs/demo2.png differ diff --git a/documentation/demos/thumbs/demo20.png b/documentation/demos/thumbs/demo20.png new file mode 100644 index 00000000..7e3684cb Binary files /dev/null and b/documentation/demos/thumbs/demo20.png differ diff --git a/documentation/demos/thumbs/demo21.png b/documentation/demos/thumbs/demo21.png new file mode 100644 index 00000000..1cc229b0 Binary files /dev/null and b/documentation/demos/thumbs/demo21.png differ diff --git a/documentation/demos/thumbs/demo22.png b/documentation/demos/thumbs/demo22.png new file mode 100644 index 00000000..ccc1ba90 Binary files /dev/null and b/documentation/demos/thumbs/demo22.png differ diff --git a/documentation/demos/thumbs/demo23.png b/documentation/demos/thumbs/demo23.png new file mode 100644 index 00000000..ac3850f3 Binary files /dev/null and b/documentation/demos/thumbs/demo23.png differ diff --git a/documentation/demos/thumbs/demo24.png b/documentation/demos/thumbs/demo24.png new file mode 100644 index 00000000..95e28607 Binary files /dev/null and b/documentation/demos/thumbs/demo24.png differ diff --git a/documentation/demos/thumbs/demo25.png b/documentation/demos/thumbs/demo25.png new file mode 100644 index 00000000..78112cad Binary files /dev/null and b/documentation/demos/thumbs/demo25.png differ diff --git a/documentation/demos/thumbs/demo26.png b/documentation/demos/thumbs/demo26.png new file mode 100644 index 00000000..6816c3de Binary files /dev/null and b/documentation/demos/thumbs/demo26.png differ diff --git a/documentation/demos/thumbs/demo27.png b/documentation/demos/thumbs/demo27.png new file mode 100644 index 00000000..b2dbcf63 Binary files /dev/null and b/documentation/demos/thumbs/demo27.png differ diff --git a/documentation/demos/thumbs/demo28.png b/documentation/demos/thumbs/demo28.png new file mode 100644 index 00000000..c9b460b7 Binary files /dev/null and b/documentation/demos/thumbs/demo28.png differ diff --git a/documentation/demos/thumbs/demo29.png b/documentation/demos/thumbs/demo29.png new file mode 100644 index 00000000..32f9bd2d Binary files /dev/null and b/documentation/demos/thumbs/demo29.png differ diff --git a/documentation/demos/thumbs/demo3.png b/documentation/demos/thumbs/demo3.png new file mode 100644 index 00000000..cedd52be Binary files /dev/null and b/documentation/demos/thumbs/demo3.png differ diff --git a/documentation/demos/thumbs/demo30.png b/documentation/demos/thumbs/demo30.png new file mode 100644 index 00000000..9ef02995 Binary files /dev/null and b/documentation/demos/thumbs/demo30.png differ diff --git a/documentation/demos/thumbs/demo31.png b/documentation/demos/thumbs/demo31.png new file mode 100644 index 00000000..f607c012 Binary files /dev/null and b/documentation/demos/thumbs/demo31.png differ diff --git a/documentation/demos/thumbs/demo32.png b/documentation/demos/thumbs/demo32.png new file mode 100644 index 00000000..7d99019d Binary files /dev/null and b/documentation/demos/thumbs/demo32.png differ diff --git a/documentation/demos/thumbs/demo33.png b/documentation/demos/thumbs/demo33.png new file mode 100644 index 00000000..7a84d1b8 Binary files /dev/null and b/documentation/demos/thumbs/demo33.png differ diff --git a/documentation/demos/thumbs/demo34.png b/documentation/demos/thumbs/demo34.png new file mode 100644 index 00000000..0525cef5 Binary files /dev/null and b/documentation/demos/thumbs/demo34.png differ diff --git a/documentation/demos/thumbs/demo4.png b/documentation/demos/thumbs/demo4.png new file mode 100644 index 00000000..8b70f179 Binary files /dev/null and b/documentation/demos/thumbs/demo4.png differ diff --git a/documentation/demos/thumbs/demo5.png b/documentation/demos/thumbs/demo5.png new file mode 100644 index 00000000..f1eabb4e Binary files /dev/null and b/documentation/demos/thumbs/demo5.png differ diff --git a/documentation/demos/thumbs/demo6.png b/documentation/demos/thumbs/demo6.png new file mode 100644 index 00000000..1e1ff05f Binary files /dev/null and b/documentation/demos/thumbs/demo6.png differ diff --git a/documentation/demos/thumbs/demo7.png b/documentation/demos/thumbs/demo7.png new file mode 100644 index 00000000..56c960f1 Binary files /dev/null and b/documentation/demos/thumbs/demo7.png differ diff --git a/documentation/demos/thumbs/demo8.png b/documentation/demos/thumbs/demo8.png new file mode 100644 index 00000000..f685a60c Binary files /dev/null and b/documentation/demos/thumbs/demo8.png differ diff --git a/documentation/demos/thumbs/demo9.png b/documentation/demos/thumbs/demo9.png new file mode 100644 index 00000000..50d77e33 Binary files /dev/null and b/documentation/demos/thumbs/demo9.png differ diff --git a/documentation/jsdoc/files.html b/documentation/jsdoc/files.html index d03344d8..bb93f836 100644 --- a/documentation/jsdoc/files.html +++ b/documentation/jsdoc/files.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -204,20 +204,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -370,6 +372,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -1284,6 +1296,54 @@

    /Users/ibon/js/CAAT/src/Modules/Skeleton/Bone.js

    + +
    + + + + +
    +
    +
    + + +
    + + +
    + +
    @@ -1496,7 +1556,7 @@

    /

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:04:03 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:20 GMT-0700 (PDT)
    \ No newline at end of file diff --git a/documentation/jsdoc/index.html b/documentation/jsdoc/index.html index a60eeceb..3fec5a25 100644 --- a/documentation/jsdoc/index.html +++ b/documentation/jsdoc/index.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -204,20 +204,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -370,6 +372,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -485,13 +497,13 @@

    CAAT.Behavior.PathBehavior


    @@ -509,13 +521,13 @@

    CAAT.Behavior.Scale1Beha


    @@ -526,6 +538,12 @@

    CAAT.Behavior.ScaleBehavi


    +
    +
    +

    CAAT.CSS

    @@ -982,6 +1000,36 @@

    CAAT.Module.Runtime.B


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

    CAAT.Module.Storage

    @@ -1124,7 +1172,7 @@

    String

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:04:03 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:20 GMT-0700 (PDT)
    \ No newline at end of file diff --git a/documentation/jsdoc/symbols/B2DCircularBody.html b/documentation/jsdoc/symbols/B2DCircularBody.html deleted file mode 100644 index 140e1240..00000000 --- a/documentation/jsdoc/symbols/B2DCircularBody.html +++ /dev/null @@ -1,379 +0,0 @@ - - - - - - - JsDoc Reference - B2DCircularBody - - - - - - - - - - - - - -
    - -

    - - Class B2DCircularBody -

    - - -

    - -
    Extends - CAAT.Foundation.Box2D.B2DBodyActor.
    - - - - - -
    Defined in: B2DCircularBody.js. - -

    - - - - - - - - - - - - - - - - - -
    Class Summary
    Constructor AttributesConstructor Name and Description
      - -
    -
    - - - - - - - - -
    -
    Fields borrowed from class CAAT.Foundation.Box2D.B2DBodyActor:
    bodyData, bodyDef, bodyType, density, fixtureDef, friction, recycle, restitution, world, worldBody, worldBodyFixture
    -
    - - - - - - - - - -
    -
    Methods borrowed from class CAAT.Foundation.Box2D.B2DBodyActor:
    __init, animate, check, createBody, destroy, getCenter, getDistanceJointLocalAnchor, setAwake, setBodyType, setDensity, setFriction, setLocation, setPositionAnchor, setPositionAnchored, setRecycle, setRestitution, setSleepingAllowed
    -
    - - - - - - - -
    -
    - Class Detail -
    - -
    - B2DCircularBody() -
    - -
    - - -
    - - - - - - - - - - - - -
    - - - - - - - - - - - -
    -
    - - - -
    - - Documentation generated by JsDoc Toolkit 2.4.0 on Tue Feb 26 2013 09:46:20 GMT-0800 (PST) -
    - - diff --git a/documentation/jsdoc/symbols/B2DPolygonBody.html b/documentation/jsdoc/symbols/B2DPolygonBody.html deleted file mode 100644 index b1ff207a..00000000 --- a/documentation/jsdoc/symbols/B2DPolygonBody.html +++ /dev/null @@ -1,379 +0,0 @@ - - - - - - - JsDoc Reference - B2DPolygonBody - - - - - - - - - - - - - -
    - -

    - - Class B2DPolygonBody -

    - - -

    - -
    Extends - CAAT.Foundation.Box2D.B2DBodyActor.
    - - - - - -
    Defined in: B2DPolygonBody.js. - -

    - - - - - - - - - - - - - - - - - -
    Class Summary
    Constructor AttributesConstructor Name and Description
      - -
    -
    - - - - - - - - -
    -
    Fields borrowed from class CAAT.Foundation.Box2D.B2DBodyActor:
    bodyData, bodyDef, bodyType, density, fixtureDef, friction, recycle, restitution, world, worldBody, worldBodyFixture
    -
    - - - - - - - - - -
    -
    Methods borrowed from class CAAT.Foundation.Box2D.B2DBodyActor:
    __init, animate, check, createBody, destroy, getCenter, getDistanceJointLocalAnchor, setAwake, setBodyType, setDensity, setFriction, setLocation, setPositionAnchor, setPositionAnchored, setRecycle, setRestitution, setSleepingAllowed
    -
    - - - - - - - -
    -
    - Class Detail -
    - -
    - B2DPolygonBody() -
    - -
    - - -
    - - - - - - - - - - - - -
    - - - - - - - - - - - -
    -
    - - - -
    - - Documentation generated by JsDoc Toolkit 2.4.0 on Tue Feb 26 2013 09:46:20 GMT-0800 (PST) -
    - - diff --git a/documentation/jsdoc/symbols/CAAT.Behavior.AlphaBehavior.html b/documentation/jsdoc/symbols/CAAT.Behavior.AlphaBehavior.html index 573252ba..9129fdbb 100644 --- a/documentation/jsdoc/symbols/CAAT.Behavior.AlphaBehavior.html +++ b/documentation/jsdoc/symbols/CAAT.Behavior.AlphaBehavior.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -511,7 +523,7 @@

    -
    Fields borrowed from class CAAT.Behavior.BaseBehavior:
    actor, behaviorDuration, behaviorStartTime, cycleBehavior, discardable, doValueApplication, id, interpolator, lifecycleListenerList, solved, status, timeOffset
    +
    Fields borrowed from class CAAT.Behavior.BaseBehavior:
    actor, behaviorDuration, behaviorStartTime, cycleBehavior, discardable, doValueApplication, id, interpolator, isRelative, lifecycleListenerList, solved, status, timeOffset
    @@ -599,7 +611,7 @@

    -
    Methods borrowed from class CAAT.Behavior.BaseBehavior:
    __init, addListener, apply, emptyListenerList, fireBehaviorAppliedEvent, fireBehaviorExpiredEvent, fireBehaviorStartedEvent, getDuration, getStartTime, initialize, isBehaviorInTime, normalizeTime, setCycle, setDefaultInterpolator, setDelayTime, setExpired, setFrameTime, setId, setInterpolator, setOutOfFrameTime, setPingPong, setStatus, setTimeOffset, setValueApplication
    +
    Methods borrowed from class CAAT.Behavior.BaseBehavior:
    __init, addListener, apply, emptyListenerList, fireBehaviorAppliedEvent, fireBehaviorExpiredEvent, fireBehaviorStartedEvent, getDuration, getStartTime, initialize, isBehaviorInTime, isCycle, normalizeTime, setCycle, setDefaultInterpolator, setDelayTime, setExpired, setFrameTime, setId, setInterpolator, setOutOfFrameTime, setPingPong, setRelative, setRelativeValues, setStatus, setTimeOffset, setValueApplication
    @@ -979,7 +991,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:03:52 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:15 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.Behavior.BaseBehavior.Status.html b/documentation/jsdoc/symbols/CAAT.Behavior.BaseBehavior.Status.html index 4f3d2c73..69e3d577 100644 --- a/documentation/jsdoc/symbols/CAAT.Behavior.BaseBehavior.Status.html +++ b/documentation/jsdoc/symbols/CAAT.Behavior.BaseBehavior.Status.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -642,7 +654,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:03:52 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:15 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.Behavior.BaseBehavior.html b/documentation/jsdoc/symbols/CAAT.Behavior.BaseBehavior.html index d11fa401..52d9d0e7 100644 --- a/documentation/jsdoc/symbols/CAAT.Behavior.BaseBehavior.html +++ b/documentation/jsdoc/symbols/CAAT.Behavior.BaseBehavior.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -573,6 +585,16 @@

    + +   + + +
    does this behavior apply relative values ??
    + + + <private>   @@ -771,20 +793,20 @@

    - <private>   +   -
    normalizeTime(time) + -
    Convert scene time into something more manageable for the behavior.
    +
    -   + <private>   -
    parse(obj) + -
    Parse a behavior of this type.
    +
    Convert scene time into something more manageable for the behavior.
    @@ -797,6 +819,15 @@

    + +   + +
    parse(obj) +
    +
    Parse a behavior of this type.
    + + +   @@ -887,6 +918,24 @@

    + +   + +
    setRelative(bool) +
    +
    Set this behavior as relative value application to some other measures.
    + + + + +   + + +
    + + + <private>   @@ -1180,6 +1229,28 @@

    +
    + + +
    + + + isRelative + +
    +
    + does this behavior apply relative values ?? + + +
    + + + + + + + +
    @@ -1855,6 +1926,31 @@

    +
    + + +
    + + + isCycle() + +
    +
    + + + +
    + + + + + + + + + + +
    @@ -1895,15 +1991,15 @@


    - -
    + +
    <static> - parse(obj) + CAAT.Behavior.BaseBehavior.parse(obj)
    - Parse a behavior of this type. +
    @@ -1918,7 +2014,7 @@

    obj -
    {object} an object with a behavior definition.
    +
    @@ -1931,15 +2027,15 @@


    - -
    <static> + +
    - CAAT.Behavior.BaseBehavior.parse(obj) + parse(obj)
    - + Parse a behavior of this type.
    @@ -1954,7 +2050,7 @@

    obj -
    +
    {object} an object with a behavior definition.
    @@ -2345,6 +2441,75 @@

    +
    + + +
    + + {*} + setRelative(bool) + +
    +
    + Set this behavior as relative value application to some other measures. +Each Behavior will define its own. + + +
    + + + + +
    +
    Parameters:
    + +
    + bool + +
    +
    + +
    + + + + + +
    +
    Returns:
    + +
    {*}
    + +
    + + + + +
    + + +
    + + + setRelativeValues() + +
    +
    + + + +
    + + + + + + + + + + +
    @@ -2490,7 +2655,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:03:52 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:15 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.Behavior.ContainerBehavior.html b/documentation/jsdoc/symbols/CAAT.Behavior.ContainerBehavior.html index 05c39a48..c1c30037 100644 --- a/documentation/jsdoc/symbols/CAAT.Behavior.ContainerBehavior.html +++ b/documentation/jsdoc/symbols/CAAT.Behavior.ContainerBehavior.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -501,7 +513,7 @@

    -
    Fields borrowed from class CAAT.Behavior.BaseBehavior:
    actor, behaviorDuration, behaviorStartTime, cycleBehavior, discardable, doValueApplication, id, interpolator, lifecycleListenerList, solved, status, timeOffset
    +
    Fields borrowed from class CAAT.Behavior.BaseBehavior:
    actor, behaviorDuration, behaviorStartTime, cycleBehavior, discardable, doValueApplication, id, interpolator, isRelative, lifecycleListenerList, solved, status, timeOffset
    @@ -523,7 +535,7 @@

    <private>   -
    __init() +
    __init(conforming)
    @@ -547,6 +559,15 @@

    + +   + +
    behaviorApplied(behavior, scenetime, time, actor, value) +
    +
    + + +   @@ -610,6 +631,15 @@

    + +   + +
    setCycle(cycle, recurse) +
    +
    + + +   @@ -652,7 +682,7 @@

    -
    Methods borrowed from class CAAT.Behavior.BaseBehavior:
    addListener, emptyListenerList, fireBehaviorAppliedEvent, fireBehaviorExpiredEvent, fireBehaviorStartedEvent, getDuration, getPropertyName, getStartTime, initialize, isBehaviorInTime, normalizeTime, setCycle, setDefaultInterpolator, setId, setInterpolator, setOutOfFrameTime, setPingPong, setStatus, setTimeOffset, setValueApplication
    +
    Methods borrowed from class CAAT.Behavior.BaseBehavior:
    addListener, emptyListenerList, fireBehaviorAppliedEvent, fireBehaviorExpiredEvent, fireBehaviorStartedEvent, getDuration, getPropertyName, getStartTime, initialize, isBehaviorInTime, isCycle, normalizeTime, setDefaultInterpolator, setId, setInterpolator, setOutOfFrameTime, setPingPong, setRelative, setRelativeValues, setStatus, setTimeOffset, setValueApplication
    @@ -729,7 +759,7 @@

    <private> - __init() + __init(conforming)
    @@ -741,6 +771,17 @@

    +
    +
    Parameters:
    + +
    + conforming + +
    +
    {bool=} conform this behavior duration to that of its children.
    + +
    + @@ -828,6 +869,66 @@

    +
    + + +
    + + + behaviorApplied(behavior, scenetime, time, actor, value) + +
    +
    + + + +
    + + + + +
    +
    Parameters:
    + +
    + behavior + +
    +
    + +
    + scenetime + +
    +
    + +
    + time + +
    +
    + +
    + actor + +
    +
    + +
    + value + +
    +
    + +
    + + + + + + + +
    @@ -1130,6 +1231,48 @@

    +
    + + +
    + + + setCycle(cycle, recurse) + +
    +
    + + + +
    + + + + +
    +
    Parameters:
    + +
    + cycle + +
    +
    + +
    + recurse + +
    +
    + +
    + + + + + + + +
    @@ -1320,7 +1463,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:03:53 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:15 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.Behavior.GenericBehavior.html b/documentation/jsdoc/symbols/CAAT.Behavior.GenericBehavior.html index 395b026d..3d854425 100644 --- a/documentation/jsdoc/symbols/CAAT.Behavior.GenericBehavior.html +++ b/documentation/jsdoc/symbols/CAAT.Behavior.GenericBehavior.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -541,7 +553,7 @@

    -
    Fields borrowed from class CAAT.Behavior.BaseBehavior:
    actor, behaviorDuration, behaviorStartTime, cycleBehavior, discardable, doValueApplication, id, interpolator, lifecycleListenerList, solved, status, timeOffset
    +
    Fields borrowed from class CAAT.Behavior.BaseBehavior:
    actor, behaviorDuration, behaviorStartTime, cycleBehavior, discardable, doValueApplication, id, interpolator, isRelative, lifecycleListenerList, solved, status, timeOffset
    @@ -584,7 +596,7 @@

    -
    Methods borrowed from class CAAT.Behavior.BaseBehavior:
    __init, addListener, apply, calculateKeyFrameData, calculateKeyFramesData, emptyListenerList, fireBehaviorAppliedEvent, fireBehaviorExpiredEvent, fireBehaviorStartedEvent, getDuration, getKeyFrameDataValues, getPropertyName, getStartTime, initialize, isBehaviorInTime, normalizeTime, parse, setCycle, setDefaultInterpolator, setDelayTime, setExpired, setFrameTime, setId, setInterpolator, setOutOfFrameTime, setPingPong, setStatus, setTimeOffset, setValueApplication
    +
    Methods borrowed from class CAAT.Behavior.BaseBehavior:
    __init, addListener, apply, calculateKeyFrameData, calculateKeyFramesData, emptyListenerList, fireBehaviorAppliedEvent, fireBehaviorExpiredEvent, fireBehaviorStartedEvent, getDuration, getKeyFrameDataValues, getPropertyName, getStartTime, initialize, isBehaviorInTime, isCycle, normalizeTime, parse, setCycle, setDefaultInterpolator, setDelayTime, setExpired, setFrameTime, setId, setInterpolator, setOutOfFrameTime, setPingPong, setRelative, setRelativeValues, setStatus, setTimeOffset, setValueApplication
    @@ -859,7 +871,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:03:53 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:15 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.Behavior.Interpolator.html b/documentation/jsdoc/symbols/CAAT.Behavior.Interpolator.html index d9d0d121..b76a40d8 100644 --- a/documentation/jsdoc/symbols/CAAT.Behavior.Interpolator.html +++ b/documentation/jsdoc/symbols/CAAT.Behavior.Interpolator.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -1539,7 +1551,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:03:53 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:15 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.Behavior.PathBehavior.AUTOROTATE.html b/documentation/jsdoc/symbols/CAAT.Behavior.PathBehavior.autorotate.html similarity index 91% rename from documentation/jsdoc/symbols/CAAT.Behavior.PathBehavior.AUTOROTATE.html rename to documentation/jsdoc/symbols/CAAT.Behavior.PathBehavior.autorotate.html index a865ff54..0cd3ba4c 100644 --- a/documentation/jsdoc/symbols/CAAT.Behavior.PathBehavior.AUTOROTATE.html +++ b/documentation/jsdoc/symbols/CAAT.Behavior.PathBehavior.autorotate.html @@ -5,14 +5,14 @@ - JsDoc Reference - CAAT.Behavior.PathBehavior.autorotate + JsDoc Reference - CAAT.Behavior.PathBehavior.AUTOROTATE - - - - - - - - - - - -
    - -

    - - Class CAAT.Event.KeyEvent.__init -

    - - -

    - - - - - - -
    Defined in: KeyEvent.js. - -

    - - - - - - - - - - - - - - - - - -
    Class Summary
    Constructor AttributesConstructor Name and Description
    <private>   -
    - CAAT.Event.KeyEvent.__init(keyCode, up_or_down, modifiers, originalEvent) -
    -
    Define a key event.
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Method Summary
    Method AttributesMethod Name and Description
      - -
    -
      - -
    -
      - -
    -
      - -
    -
      - -
    -
      - -
    -
      - -
    -
      - -
    -
    - - - - - - - - - -
    -
    - Class Detail -
    - -
    <private> - CAAT.Event.KeyEvent.__init(keyCode, up_or_down, modifiers, originalEvent) -
    - -
    - Define a key event. - -
    - - - - - -
    -
    Parameters:
    - -
    - keyCode - -
    -
    - -
    - up_or_down - -
    -
    - -
    - modifiers - -
    -
    - -
    - originalEvent - -
    -
    - -
    - - - - - - - - -
    - - - - - - - -
    - Method Detail -
    - - -
    - - - getAction() - -
    -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - - getKeyCode() - -
    -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - - getSourceEvent() - -
    -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - - isAltPressed() - -
    -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - - isControlPressed() - -
    -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - - isShiftPressed() - -
    -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - - modifiers() - -
    -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - - preventDefault() - -
    -
    - - - -
    - - - - - - - - - - - - - - - - - - -
    -
    - - - -
    - - Documentation generated by JsDoc Toolkit 2.4.0 on Tue Feb 26 2013 09:21:05 GMT-0800 (PST) -
    - - diff --git a/documentation/jsdoc/symbols/CAAT.Event.KeyEvent.html b/documentation/jsdoc/symbols/CAAT.Event.KeyEvent.html index 78e4aaed..dcda1de0 100644 --- a/documentation/jsdoc/symbols/CAAT.Event.KeyEvent.html +++ b/documentation/jsdoc/symbols/CAAT.Event.KeyEvent.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -881,7 +893,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:03:54 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:16 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.Event.MouseEvent.html b/documentation/jsdoc/symbols/CAAT.Event.MouseEvent.html index 80841ae0..82b4d544 100644 --- a/documentation/jsdoc/symbols/CAAT.Event.MouseEvent.html +++ b/documentation/jsdoc/symbols/CAAT.Event.MouseEvent.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -1136,7 +1148,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:03:54 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:16 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.Event.TouchEvent.html b/documentation/jsdoc/symbols/CAAT.Event.TouchEvent.html index 93ee294a..e4391ac3 100644 --- a/documentation/jsdoc/symbols/CAAT.Event.TouchEvent.html +++ b/documentation/jsdoc/symbols/CAAT.Event.TouchEvent.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -1220,7 +1232,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:03:54 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:16 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.Event.TouchInfo.html b/documentation/jsdoc/symbols/CAAT.Event.TouchInfo.html index 7f495301..a8e702e0 100644 --- a/documentation/jsdoc/symbols/CAAT.Event.TouchInfo.html +++ b/documentation/jsdoc/symbols/CAAT.Event.TouchInfo.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -609,7 +621,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:03:54 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:16 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.Event.html b/documentation/jsdoc/symbols/CAAT.Event.html index bb8eedf8..14ae0ccb 100644 --- a/documentation/jsdoc/symbols/CAAT.Event.html +++ b/documentation/jsdoc/symbols/CAAT.Event.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -523,7 +535,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:03:54 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:16 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.Foundation.Actor.html b/documentation/jsdoc/symbols/CAAT.Foundation.Actor.html index 24e2c272..c502f09f 100644 --- a/documentation/jsdoc/symbols/CAAT.Foundation.Actor.html +++ b/documentation/jsdoc/symbols/CAAT.Foundation.Actor.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -824,6 +836,17 @@

    + +   + + +
    if this actor is cached, when destroy is called, it does not call 'clean' method, which clears some +internal properties.
    + + +   @@ -1296,6 +1319,15 @@

    + +   + +
    clean() +
    +
    + + +   @@ -1896,6 +1928,15 @@

    + +   + +
    setCachedActor(cached) +
    +
    + + +   @@ -3077,6 +3118,29 @@

    +
    + + +
    + + + isCachedActor + +
    +
    + if this actor is cached, when destroy is called, it does not call 'clean' method, which clears some +internal properties. + + +
    + + + + + + + +
    @@ -4358,6 +4422,31 @@

    +
    + + +
    + + + clean() + +
    +
    + + + +
    + + + + + + + + + + +
    @@ -7074,6 +7163,42 @@

    +
    + + +
    + + + setCachedActor(cached) + +
    +
    + + + +
    + + + + +
    +
    Parameters:
    + +
    + cached + +
    +
    + +
    + + + + + + + +
    @@ -8800,7 +8925,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:03:56 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:16 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.Foundation.ActorContainer.AddHint.html b/documentation/jsdoc/symbols/CAAT.Foundation.ActorContainer.AddHint.html index 0760c885..38ecc5ea 100644 --- a/documentation/jsdoc/symbols/CAAT.Foundation.ActorContainer.AddHint.html +++ b/documentation/jsdoc/symbols/CAAT.Foundation.ActorContainer.AddHint.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -635,7 +647,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:03:57 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:17 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.Foundation.ActorContainer.html b/documentation/jsdoc/symbols/CAAT.Foundation.ActorContainer.html index 3783deb8..7fde28dc 100644 --- a/documentation/jsdoc/symbols/CAAT.Foundation.ActorContainer.html +++ b/documentation/jsdoc/symbols/CAAT.Foundation.ActorContainer.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -572,7 +584,7 @@

    -
    Fields borrowed from class CAAT.Foundation.Actor:
    __super, AABB, alpha, backgroundImage, behaviorList, cached, clip, clipPath, dirty, discardable, duration, expired, fillStyle, frameAlpha, gestureEnabled, glEnabled, height, id, inFrame, invalid, isAA, isGlobalAlpha, lifecycleListenerList, minimumSize, modelViewMatrix, modelViewMatrixI, mouseEnabled, oldX, oldY, parent, pointed, preferredSize, preventLayout, rotationAngle, rotationX, rotationY, scaleAnchor, scaleTX, scaleTY, scaleX, scaleY, size_active, size_total, start_time, strokeStyle, tAnchorX, tAnchorY, time, viewVertices, visible, wdirty, width, worldModelViewMatrix, worldModelViewMatrixI, x, y
    +
    Fields borrowed from class CAAT.Foundation.Actor:
    __super, AABB, alpha, backgroundImage, behaviorList, cached, clip, clipPath, dirty, discardable, duration, expired, fillStyle, frameAlpha, gestureEnabled, glEnabled, height, id, inFrame, invalid, isAA, isCachedActor, isGlobalAlpha, lifecycleListenerList, minimumSize, modelViewMatrix, modelViewMatrixI, mouseEnabled, oldX, oldY, parent, pointed, preferredSize, preventLayout, rotationAngle, rotationX, rotationY, scaleAnchor, scaleTX, scaleTY, scaleX, scaleY, size_active, size_total, start_time, strokeStyle, tAnchorX, tAnchorY, time, viewVertices, visible, wdirty, width, worldModelViewMatrix, worldModelViewMatrixI, x, y
    @@ -627,6 +639,24 @@

    + +   + +
    addActor(child, constraint) +
    +
    + + + + +   + +
    addActorImmediately(child, constraint) +
    +
    + + +   @@ -878,7 +908,7 @@

    -
    Methods borrowed from class CAAT.Foundation.Actor:
    __scale1To, addAnimation, addBehavior, addListener, cacheAsBitmap, centerAt, centerOn, contains, create, disableDrag, emptyBehaviorList, enableDrag, enableEvents, fireEvent, gestureChange, gestureEnd, gestureStart, getAnchor, getAnchorPercent, getBehavior, getId, getMinimumSize, getPreferredSize, getTextureGLPage, glNeedsFlush, glSetShader, initialize, invalidate, isCached, isGestureEnabled, isInAnimationFrame, isVisible, modelToModel, modelToView, mouseClick, mouseDblClick, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseOut, mouseOver, mouseUp, moveTo, paint, playAnimation, removeBehaviorById, removeBehaviour, removeListener, resetAnimationTime, resetAsButton, resetTransform, rotateTo, scaleTo, scaleXTo, scaleYTo, setAlpha, setAnimationEndCallback, setAnimationImageIndex, setAsButton, setBackgroundImage, setBackgroundImageOffset, setButtonImageIndex, setChangeFPS, setClip, setDiscardable, setExpired, setFillStyle, setFrameTime, setGestureEnabled, setGLCoords, setGlobalAlpha, setGlobalAnchor, setId, setImageTransformation, setLocation, setMinimumSize, setModelViewMatrix, setOutOfFrameTime, setPaint, setParent, setPosition, setPositionAnchor, setPositionAnchored, setPreferredSize, setPreventLayout, setRotation, setRotationAnchor, setRotationAnchored, setScale, setScaleAnchor, setScaleAnchored, setScreenBounds, setSize, setSpriteIndex, setStrokeStyle, setUV, setVisible, stopCacheAsBitmap, touchEnd, touchMove, touchStart, viewToModel
    +
    Methods borrowed from class CAAT.Foundation.Actor:
    __scale1To, addAnimation, addBehavior, addListener, cacheAsBitmap, centerAt, centerOn, clean, contains, create, disableDrag, emptyBehaviorList, enableDrag, enableEvents, fireEvent, gestureChange, gestureEnd, gestureStart, getAnchor, getAnchorPercent, getBehavior, getId, getMinimumSize, getPreferredSize, getTextureGLPage, glNeedsFlush, glSetShader, initialize, invalidate, isCached, isGestureEnabled, isInAnimationFrame, isVisible, modelToModel, modelToView, mouseClick, mouseDblClick, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseOut, mouseOver, mouseUp, moveTo, paint, playAnimation, removeBehaviorById, removeBehaviour, removeListener, resetAnimationTime, resetAsButton, resetTransform, rotateTo, scaleTo, scaleXTo, scaleYTo, setAlpha, setAnimationEndCallback, setAnimationImageIndex, setAsButton, setBackgroundImage, setBackgroundImageOffset, setButtonImageIndex, setCachedActor, setChangeFPS, setClip, setDiscardable, setExpired, setFillStyle, setFrameTime, setGestureEnabled, setGLCoords, setGlobalAlpha, setGlobalAnchor, setId, setImageTransformation, setLocation, setMinimumSize, setModelViewMatrix, setOutOfFrameTime, setPaint, setParent, setPosition, setPositionAnchor, setPositionAnchored, setPreferredSize, setPreventLayout, setRotation, setRotationAnchor, setRotationAnchored, setScale, setScaleAnchor, setScaleAnchored, setScreenBounds, setSize, setSpriteIndex, setStrokeStyle, setUV, setVisible, stopCacheAsBitmap, touchEnd, touchMove, touchStart, viewToModel
    @@ -1247,6 +1277,90 @@

    +
    + + +
    + + + addActor(child, constraint) + +
    +
    + + + +
    + + + + +
    +
    Parameters:
    + +
    + child + +
    +
    + +
    + constraint + +
    +
    + +
    + + + + + + + + +
    + + +
    + + + addActorImmediately(child, constraint) + +
    +
    + + + +
    + + + + +
    +
    Parameters:
    + +
    + child + +
    +
    + +
    + constraint + +
    +
    + +
    + + + + + + + +
    @@ -2308,7 +2422,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:03:57 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:17 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.Foundation.Box2D.B2DBodyActor.html b/documentation/jsdoc/symbols/CAAT.Foundation.Box2D.B2DBodyActor.html index 3672bb37..a7e99275 100644 --- a/documentation/jsdoc/symbols/CAAT.Foundation.Box2D.B2DBodyActor.html +++ b/documentation/jsdoc/symbols/CAAT.Foundation.Box2D.B2DBodyActor.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -601,7 +613,7 @@

    -
    Fields borrowed from class CAAT.Foundation.Actor:
    __super, AABB, alpha, backgroundImage, behaviorList, cached, clip, clipPath, dirty, discardable, duration, expired, fillStyle, frameAlpha, gestureEnabled, glEnabled, height, id, inFrame, invalid, isAA, isGlobalAlpha, lifecycleListenerList, minimumSize, modelViewMatrix, modelViewMatrixI, mouseEnabled, oldX, oldY, parent, pointed, preferredSize, preventLayout, rotationAngle, rotationX, rotationY, scaleAnchor, scaleTX, scaleTY, scaleX, scaleY, size_active, size_total, start_time, strokeStyle, tAnchorX, tAnchorY, time, viewVertices, visible, wdirty, width, worldModelViewMatrix, worldModelViewMatrixI, x, y
    +
    Fields borrowed from class CAAT.Foundation.Actor:
    __super, AABB, alpha, backgroundImage, behaviorList, cached, clip, clipPath, dirty, discardable, duration, expired, fillStyle, frameAlpha, gestureEnabled, glEnabled, height, id, inFrame, invalid, isAA, isCachedActor, isGlobalAlpha, lifecycleListenerList, minimumSize, modelViewMatrix, modelViewMatrixI, mouseEnabled, oldX, oldY, parent, pointed, preferredSize, preventLayout, rotationAngle, rotationX, rotationY, scaleAnchor, scaleTX, scaleTY, scaleX, scaleY, size_active, size_total, start_time, strokeStyle, tAnchorX, tAnchorY, time, viewVertices, visible, wdirty, width, worldModelViewMatrix, worldModelViewMatrixI, x, y
    @@ -782,7 +794,7 @@

    -
    Methods borrowed from class CAAT.Foundation.Actor:
    __paintActor, __scale1To, __validateLayout, addAnimation, addBehavior, addListener, cacheAsBitmap, centerAt, centerOn, contains, create, disableDrag, drawScreenBoundingBox, emptyBehaviorList, enableDrag, enableEvents, endAnimate, findActorAtPosition, findActorById, fireEvent, gestureChange, gestureEnd, gestureStart, getAnchor, getAnchorPercent, getBehavior, getId, getMinimumSize, getPreferredSize, getTextureGLPage, glNeedsFlush, glSetShader, initialize, invalidate, invalidateLayout, isCached, isGestureEnabled, isInAnimationFrame, isVisible, modelToModel, modelToView, mouseClick, mouseDblClick, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseOut, mouseOver, mouseUp, moveTo, paint, paintActor, paintActorGL, playAnimation, removeBehaviorById, removeBehaviour, removeListener, resetAnimationTime, resetAsButton, resetTransform, rotateTo, scaleTo, scaleXTo, scaleYTo, setAlpha, setAnimationEndCallback, setAnimationImageIndex, setAsButton, setBackgroundImage, setBackgroundImageOffset, setBounds, setButtonImageIndex, setChangeFPS, setClip, setDiscardable, setExpired, setFillStyle, setFrameTime, setGestureEnabled, setGLCoords, setGlobalAlpha, setGlobalAnchor, setId, setImageTransformation, setMinimumSize, setModelViewMatrix, setOutOfFrameTime, setPaint, setParent, setPosition, setPreferredSize, setPreventLayout, setRotation, setRotationAnchor, setRotationAnchored, setScale, setScaleAnchor, setScaleAnchored, setScreenBounds, setSize, setSpriteIndex, setStrokeStyle, setUV, setVisible, stopCacheAsBitmap, touchEnd, touchMove, touchStart, viewToModel
    +
    Methods borrowed from class CAAT.Foundation.Actor:
    __paintActor, __scale1To, __validateLayout, addAnimation, addBehavior, addListener, cacheAsBitmap, centerAt, centerOn, clean, contains, create, disableDrag, drawScreenBoundingBox, emptyBehaviorList, enableDrag, enableEvents, endAnimate, findActorAtPosition, findActorById, fireEvent, gestureChange, gestureEnd, gestureStart, getAnchor, getAnchorPercent, getBehavior, getId, getMinimumSize, getPreferredSize, getTextureGLPage, glNeedsFlush, glSetShader, initialize, invalidate, invalidateLayout, isCached, isGestureEnabled, isInAnimationFrame, isVisible, modelToModel, modelToView, mouseClick, mouseDblClick, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseOut, mouseOver, mouseUp, moveTo, paint, paintActor, paintActorGL, playAnimation, removeBehaviorById, removeBehaviour, removeListener, resetAnimationTime, resetAsButton, resetTransform, rotateTo, scaleTo, scaleXTo, scaleYTo, setAlpha, setAnimationEndCallback, setAnimationImageIndex, setAsButton, setBackgroundImage, setBackgroundImageOffset, setBounds, setButtonImageIndex, setCachedActor, setChangeFPS, setClip, setDiscardable, setExpired, setFillStyle, setFrameTime, setGestureEnabled, setGLCoords, setGlobalAlpha, setGlobalAnchor, setId, setImageTransformation, setMinimumSize, setModelViewMatrix, setOutOfFrameTime, setPaint, setParent, setPosition, setPreferredSize, setPreventLayout, setRotation, setRotationAnchor, setRotationAnchored, setScale, setScaleAnchor, setScaleAnchored, setScreenBounds, setSize, setSpriteIndex, setStrokeStyle, setUV, setVisible, stopCacheAsBitmap, touchEnd, touchMove, touchStart, viewToModel
    @@ -1702,7 +1714,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:03:57 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:17 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.Foundation.Box2D.B2DCircularBody.html b/documentation/jsdoc/symbols/CAAT.Foundation.Box2D.B2DCircularBody.html index ada0fde0..1936c59c 100644 --- a/documentation/jsdoc/symbols/CAAT.Foundation.Box2D.B2DCircularBody.html +++ b/documentation/jsdoc/symbols/CAAT.Foundation.Box2D.B2DCircularBody.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -501,7 +513,7 @@

    -
    Fields borrowed from class CAAT.Foundation.Box2D.B2DBodyActor:
    bodyData, bodyDef, bodyType, density, fixtureDef, friction, recycle, restitution, world, worldBody, worldBodyFixture
    Fields borrowed from class CAAT.Foundation.Actor:
    __super, AABB, alpha, backgroundImage, behaviorList, cached, clip, clipPath, dirty, discardable, duration, expired, fillStyle, frameAlpha, gestureEnabled, glEnabled, height, id, inFrame, invalid, isAA, isGlobalAlpha, lifecycleListenerList, minimumSize, modelViewMatrix, modelViewMatrixI, mouseEnabled, oldX, oldY, parent, pointed, preferredSize, preventLayout, rotationAngle, rotationX, rotationY, scaleAnchor, scaleTX, scaleTY, scaleX, scaleY, size_active, size_total, start_time, strokeStyle, tAnchorX, tAnchorY, time, viewVertices, visible, wdirty, width, worldModelViewMatrix, worldModelViewMatrixI, x, y
    +
    Fields borrowed from class CAAT.Foundation.Box2D.B2DBodyActor:
    bodyData, bodyDef, bodyType, density, fixtureDef, friction, recycle, restitution, world, worldBody, worldBodyFixture
    Fields borrowed from class CAAT.Foundation.Actor:
    __super, AABB, alpha, backgroundImage, behaviorList, cached, clip, clipPath, dirty, discardable, duration, expired, fillStyle, frameAlpha, gestureEnabled, glEnabled, height, id, inFrame, invalid, isAA, isCachedActor, isGlobalAlpha, lifecycleListenerList, minimumSize, modelViewMatrix, modelViewMatrixI, mouseEnabled, oldX, oldY, parent, pointed, preferredSize, preventLayout, rotationAngle, rotationX, rotationY, scaleAnchor, scaleTX, scaleTY, scaleX, scaleY, size_active, size_total, start_time, strokeStyle, tAnchorX, tAnchorY, time, viewVertices, visible, wdirty, width, worldModelViewMatrix, worldModelViewMatrixI, x, y
    @@ -544,7 +556,7 @@

    -
    Methods borrowed from class CAAT.Foundation.Box2D.B2DBodyActor:
    __init, animate, check, destroy, getCenter, getDistanceJointLocalAnchor, setAwake, setBodyType, setDensity, setFriction, setLocation, setPositionAnchor, setPositionAnchored, setRecycle, setRestitution, setSleepingAllowed
    Methods borrowed from class CAAT.Foundation.Actor:
    __paintActor, __scale1To, __validateLayout, addAnimation, addBehavior, addListener, cacheAsBitmap, centerAt, centerOn, contains, create, disableDrag, drawScreenBoundingBox, emptyBehaviorList, enableDrag, enableEvents, endAnimate, findActorAtPosition, findActorById, fireEvent, gestureChange, gestureEnd, gestureStart, getAnchor, getAnchorPercent, getBehavior, getId, getMinimumSize, getPreferredSize, getTextureGLPage, glNeedsFlush, glSetShader, initialize, invalidate, invalidateLayout, isCached, isGestureEnabled, isInAnimationFrame, isVisible, modelToModel, modelToView, mouseClick, mouseDblClick, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseOut, mouseOver, mouseUp, moveTo, paint, paintActor, paintActorGL, playAnimation, removeBehaviorById, removeBehaviour, removeListener, resetAnimationTime, resetAsButton, resetTransform, rotateTo, scaleTo, scaleXTo, scaleYTo, setAlpha, setAnimationEndCallback, setAnimationImageIndex, setAsButton, setBackgroundImage, setBackgroundImageOffset, setBounds, setButtonImageIndex, setChangeFPS, setClip, setDiscardable, setExpired, setFillStyle, setFrameTime, setGestureEnabled, setGLCoords, setGlobalAlpha, setGlobalAnchor, setId, setImageTransformation, setMinimumSize, setModelViewMatrix, setOutOfFrameTime, setPaint, setParent, setPosition, setPreferredSize, setPreventLayout, setRotation, setRotationAnchor, setRotationAnchored, setScale, setScaleAnchor, setScaleAnchored, setScreenBounds, setSize, setSpriteIndex, setStrokeStyle, setUV, setVisible, stopCacheAsBitmap, touchEnd, touchMove, touchStart, viewToModel
    +
    Methods borrowed from class CAAT.Foundation.Box2D.B2DBodyActor:
    __init, animate, check, destroy, getCenter, getDistanceJointLocalAnchor, setAwake, setBodyType, setDensity, setFriction, setLocation, setPositionAnchor, setPositionAnchored, setRecycle, setRestitution, setSleepingAllowed
    Methods borrowed from class CAAT.Foundation.Actor:
    __paintActor, __scale1To, __validateLayout, addAnimation, addBehavior, addListener, cacheAsBitmap, centerAt, centerOn, clean, contains, create, disableDrag, drawScreenBoundingBox, emptyBehaviorList, enableDrag, enableEvents, endAnimate, findActorAtPosition, findActorById, fireEvent, gestureChange, gestureEnd, gestureStart, getAnchor, getAnchorPercent, getBehavior, getId, getMinimumSize, getPreferredSize, getTextureGLPage, glNeedsFlush, glSetShader, initialize, invalidate, invalidateLayout, isCached, isGestureEnabled, isInAnimationFrame, isVisible, modelToModel, modelToView, mouseClick, mouseDblClick, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseOut, mouseOver, mouseUp, moveTo, paint, paintActor, paintActorGL, playAnimation, removeBehaviorById, removeBehaviour, removeListener, resetAnimationTime, resetAsButton, resetTransform, rotateTo, scaleTo, scaleXTo, scaleYTo, setAlpha, setAnimationEndCallback, setAnimationImageIndex, setAsButton, setBackgroundImage, setBackgroundImageOffset, setBounds, setButtonImageIndex, setCachedActor, setChangeFPS, setClip, setDiscardable, setExpired, setFillStyle, setFrameTime, setGestureEnabled, setGLCoords, setGlobalAlpha, setGlobalAnchor, setId, setImageTransformation, setMinimumSize, setModelViewMatrix, setOutOfFrameTime, setPaint, setParent, setPosition, setPreferredSize, setPreventLayout, setRotation, setRotationAnchor, setRotationAnchored, setScale, setScaleAnchor, setScaleAnchored, setScreenBounds, setSize, setSpriteIndex, setStrokeStyle, setUV, setVisible, stopCacheAsBitmap, touchEnd, touchMove, touchStart, viewToModel
    @@ -713,7 +725,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:03:57 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:17 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.Foundation.Box2D.B2DPolygonBody.html b/documentation/jsdoc/symbols/CAAT.Foundation.Box2D.B2DPolygonBody.html index 88904c23..0590f04f 100644 --- a/documentation/jsdoc/symbols/CAAT.Foundation.Box2D.B2DPolygonBody.html +++ b/documentation/jsdoc/symbols/CAAT.Foundation.Box2D.B2DPolygonBody.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -501,7 +513,7 @@

    -
    Fields borrowed from class CAAT.Foundation.Box2D.B2DBodyActor:
    bodyData, bodyDef, bodyType, density, fixtureDef, friction, recycle, restitution, world, worldBody, worldBodyFixture
    Fields borrowed from class CAAT.Foundation.Actor:
    __super, AABB, alpha, backgroundImage, behaviorList, cached, clip, clipPath, dirty, discardable, duration, expired, fillStyle, frameAlpha, gestureEnabled, glEnabled, height, id, inFrame, invalid, isAA, isGlobalAlpha, lifecycleListenerList, minimumSize, modelViewMatrix, modelViewMatrixI, mouseEnabled, oldX, oldY, parent, pointed, preferredSize, preventLayout, rotationAngle, rotationX, rotationY, scaleAnchor, scaleTX, scaleTY, scaleX, scaleY, size_active, size_total, start_time, strokeStyle, tAnchorX, tAnchorY, time, viewVertices, visible, wdirty, width, worldModelViewMatrix, worldModelViewMatrixI, x, y
    +
    Fields borrowed from class CAAT.Foundation.Box2D.B2DBodyActor:
    bodyData, bodyDef, bodyType, density, fixtureDef, friction, recycle, restitution, world, worldBody, worldBodyFixture
    Fields borrowed from class CAAT.Foundation.Actor:
    __super, AABB, alpha, backgroundImage, behaviorList, cached, clip, clipPath, dirty, discardable, duration, expired, fillStyle, frameAlpha, gestureEnabled, glEnabled, height, id, inFrame, invalid, isAA, isCachedActor, isGlobalAlpha, lifecycleListenerList, minimumSize, modelViewMatrix, modelViewMatrixI, mouseEnabled, oldX, oldY, parent, pointed, preferredSize, preventLayout, rotationAngle, rotationX, rotationY, scaleAnchor, scaleTX, scaleTY, scaleX, scaleY, size_active, size_total, start_time, strokeStyle, tAnchorX, tAnchorY, time, viewVertices, visible, wdirty, width, worldModelViewMatrix, worldModelViewMatrixI, x, y
    @@ -553,7 +565,7 @@

    -
    Methods borrowed from class CAAT.Foundation.Box2D.B2DBodyActor:
    __init, animate, check, destroy, getCenter, setAwake, setBodyType, setDensity, setFriction, setLocation, setPositionAnchor, setPositionAnchored, setRecycle, setRestitution, setSleepingAllowed
    Methods borrowed from class CAAT.Foundation.Actor:
    __paintActor, __scale1To, __validateLayout, addAnimation, addBehavior, addListener, cacheAsBitmap, centerAt, centerOn, contains, create, disableDrag, drawScreenBoundingBox, emptyBehaviorList, enableDrag, enableEvents, endAnimate, findActorAtPosition, findActorById, fireEvent, gestureChange, gestureEnd, gestureStart, getAnchor, getAnchorPercent, getBehavior, getId, getMinimumSize, getPreferredSize, getTextureGLPage, glNeedsFlush, glSetShader, initialize, invalidate, invalidateLayout, isCached, isGestureEnabled, isInAnimationFrame, isVisible, modelToModel, modelToView, mouseClick, mouseDblClick, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseOut, mouseOver, mouseUp, moveTo, paint, paintActor, paintActorGL, playAnimation, removeBehaviorById, removeBehaviour, removeListener, resetAnimationTime, resetAsButton, resetTransform, rotateTo, scaleTo, scaleXTo, scaleYTo, setAlpha, setAnimationEndCallback, setAnimationImageIndex, setAsButton, setBackgroundImage, setBackgroundImageOffset, setBounds, setButtonImageIndex, setChangeFPS, setClip, setDiscardable, setExpired, setFillStyle, setFrameTime, setGestureEnabled, setGLCoords, setGlobalAlpha, setGlobalAnchor, setId, setImageTransformation, setMinimumSize, setModelViewMatrix, setOutOfFrameTime, setPaint, setParent, setPosition, setPreferredSize, setPreventLayout, setRotation, setRotationAnchor, setRotationAnchored, setScale, setScaleAnchor, setScaleAnchored, setScreenBounds, setSize, setSpriteIndex, setStrokeStyle, setUV, setVisible, stopCacheAsBitmap, touchEnd, touchMove, touchStart, viewToModel
    +
    Methods borrowed from class CAAT.Foundation.Box2D.B2DBodyActor:
    __init, animate, check, destroy, getCenter, setAwake, setBodyType, setDensity, setFriction, setLocation, setPositionAnchor, setPositionAnchored, setRecycle, setRestitution, setSleepingAllowed
    Methods borrowed from class CAAT.Foundation.Actor:
    __paintActor, __scale1To, __validateLayout, addAnimation, addBehavior, addListener, cacheAsBitmap, centerAt, centerOn, clean, contains, create, disableDrag, drawScreenBoundingBox, emptyBehaviorList, enableDrag, enableEvents, endAnimate, findActorAtPosition, findActorById, fireEvent, gestureChange, gestureEnd, gestureStart, getAnchor, getAnchorPercent, getBehavior, getId, getMinimumSize, getPreferredSize, getTextureGLPage, glNeedsFlush, glSetShader, initialize, invalidate, invalidateLayout, isCached, isGestureEnabled, isInAnimationFrame, isVisible, modelToModel, modelToView, mouseClick, mouseDblClick, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseOut, mouseOver, mouseUp, moveTo, paint, paintActor, paintActorGL, playAnimation, removeBehaviorById, removeBehaviour, removeListener, resetAnimationTime, resetAsButton, resetTransform, rotateTo, scaleTo, scaleXTo, scaleYTo, setAlpha, setAnimationEndCallback, setAnimationImageIndex, setAsButton, setBackgroundImage, setBackgroundImageOffset, setBounds, setButtonImageIndex, setCachedActor, setChangeFPS, setClip, setDiscardable, setExpired, setFillStyle, setFrameTime, setGestureEnabled, setGLCoords, setGlobalAlpha, setGlobalAnchor, setId, setImageTransformation, setMinimumSize, setModelViewMatrix, setOutOfFrameTime, setPaint, setParent, setPosition, setPreferredSize, setPreventLayout, setRotation, setRotationAnchor, setRotationAnchored, setScale, setScaleAnchor, setScaleAnchored, setScreenBounds, setSize, setSpriteIndex, setStrokeStyle, setUV, setVisible, stopCacheAsBitmap, touchEnd, touchMove, touchStart, viewToModel
    @@ -747,7 +759,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:03:57 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:17 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.Foundation.Box2D.html b/documentation/jsdoc/symbols/CAAT.Foundation.Box2D.html index 625b7c20..16c20545 100644 --- a/documentation/jsdoc/symbols/CAAT.Foundation.Box2D.html +++ b/documentation/jsdoc/symbols/CAAT.Foundation.Box2D.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -523,7 +535,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:03:57 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:17 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.Foundation.Director.html b/documentation/jsdoc/symbols/CAAT.Foundation.Director.html index 1f55b6dc..8eda44f7 100644 --- a/documentation/jsdoc/symbols/CAAT.Foundation.Director.html +++ b/documentation/jsdoc/symbols/CAAT.Foundation.Director.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -1103,7 +1115,7 @@

    -
    Fields borrowed from class CAAT.Foundation.ActorContainer:
    activeChildren, addHint, boundingBox, childrenList, layoutInvalidated, layoutManager, pendingChildrenList, runion
    Fields borrowed from class CAAT.Foundation.Actor:
    __super, AABB, alpha, backgroundImage, behaviorList, cached, clip, clipPath, dirty, discardable, duration, expired, fillStyle, frameAlpha, gestureEnabled, height, id, inFrame, invalid, isAA, isGlobalAlpha, lifecycleListenerList, minimumSize, modelViewMatrix, modelViewMatrixI, mouseEnabled, oldX, oldY, parent, pointed, preferredSize, preventLayout, rotationAngle, rotationX, rotationY, scaleAnchor, scaleTX, scaleTY, scaleX, scaleY, size_active, size_total, start_time, strokeStyle, tAnchorX, tAnchorY, viewVertices, visible, wdirty, width, worldModelViewMatrix, worldModelViewMatrixI, x, y
    +
    Fields borrowed from class CAAT.Foundation.ActorContainer:
    activeChildren, addHint, boundingBox, childrenList, layoutInvalidated, layoutManager, pendingChildrenList, runion
    Fields borrowed from class CAAT.Foundation.Actor:
    __super, AABB, alpha, backgroundImage, behaviorList, cached, clip, clipPath, dirty, discardable, duration, expired, fillStyle, frameAlpha, gestureEnabled, height, id, inFrame, invalid, isAA, isCachedActor, isGlobalAlpha, lifecycleListenerList, minimumSize, modelViewMatrix, modelViewMatrixI, mouseEnabled, oldX, oldY, parent, pointed, preferredSize, preventLayout, rotationAngle, rotationX, rotationY, scaleAnchor, scaleTX, scaleTY, scaleX, scaleY, size_active, size_total, start_time, strokeStyle, tAnchorX, tAnchorY, viewVertices, visible, wdirty, width, worldModelViewMatrix, worldModelViewMatrixI, x, y
    @@ -1926,6 +1938,15 @@

    + +   + + +
    + + +   @@ -2078,7 +2099,7 @@

    -
    Methods borrowed from class CAAT.Foundation.ActorContainer:
    __paintActor, __validateLayout, __validateTree, addChildAt, addChildDelayed, addChildImmediately, destroy, drawScreenBoundingBox, emptyChildren, endAnimate, findActorById, findChild, getChildAt, getLayout, getNumActiveChildren, getNumChildren, invalidateLayout, paintActor, paintActorGL, recalcSize, removeChild, removeChildAt, removeFirstChild, removeLastChild, setLayout, setZOrder
    Methods borrowed from class CAAT.Foundation.Actor:
    __scale1To, addAnimation, addBehavior, addListener, cacheAsBitmap, centerAt, centerOn, contains, create, disableDrag, emptyBehaviorList, enableDrag, fireEvent, gestureChange, gestureEnd, gestureStart, getAnchor, getAnchorPercent, getBehavior, getId, getMinimumSize, getPreferredSize, getTextureGLPage, glNeedsFlush, glSetShader, invalidate, isCached, isGestureEnabled, isInAnimationFrame, isVisible, modelToModel, modelToView, mouseClick, mouseDblClick, mouseOut, mouseOver, moveTo, paint, playAnimation, removeBehaviorById, removeBehaviour, removeListener, resetAnimationTime, resetAsButton, resetTransform, rotateTo, scaleTo, scaleXTo, scaleYTo, setAlpha, setAnimationEndCallback, setAnimationImageIndex, setAsButton, setBackgroundImage, setBackgroundImageOffset, setButtonImageIndex, setChangeFPS, setClip, setDiscardable, setExpired, setFillStyle, setFrameTime, setGestureEnabled, setGLCoords, setGlobalAlpha, setGlobalAnchor, setId, setImageTransformation, setLocation, setMinimumSize, setModelViewMatrix, setOutOfFrameTime, setPaint, setParent, setPosition, setPositionAnchor, setPositionAnchored, setPreferredSize, setPreventLayout, setRotation, setRotationAnchor, setRotationAnchored, setScale, setScaleAnchor, setScaleAnchored, setScreenBounds, setSize, setSpriteIndex, setStrokeStyle, setUV, setVisible, stopCacheAsBitmap, touchEnd, touchMove, touchStart, viewToModel
    +
    Methods borrowed from class CAAT.Foundation.ActorContainer:
    __paintActor, __validateLayout, __validateTree, addActor, addActorImmediately, addChildAt, addChildDelayed, addChildImmediately, destroy, drawScreenBoundingBox, emptyChildren, endAnimate, findActorById, findChild, getChildAt, getLayout, getNumActiveChildren, getNumChildren, invalidateLayout, paintActor, paintActorGL, recalcSize, removeChild, removeChildAt, removeFirstChild, removeLastChild, setLayout, setZOrder
    Methods borrowed from class CAAT.Foundation.Actor:
    __scale1To, addAnimation, addBehavior, addListener, cacheAsBitmap, centerAt, centerOn, contains, create, disableDrag, emptyBehaviorList, enableDrag, fireEvent, gestureChange, gestureEnd, gestureStart, getAnchor, getAnchorPercent, getBehavior, getId, getMinimumSize, getPreferredSize, getTextureGLPage, glNeedsFlush, glSetShader, invalidate, isCached, isGestureEnabled, isInAnimationFrame, isVisible, modelToModel, modelToView, mouseClick, mouseDblClick, mouseOut, mouseOver, moveTo, paint, playAnimation, removeBehaviorById, removeBehaviour, removeListener, resetAnimationTime, resetAsButton, resetTransform, rotateTo, scaleTo, scaleXTo, scaleYTo, setAlpha, setAnimationEndCallback, setAnimationImageIndex, setAsButton, setBackgroundImage, setBackgroundImageOffset, setButtonImageIndex, setCachedActor, setChangeFPS, setClip, setDiscardable, setExpired, setFillStyle, setFrameTime, setGestureEnabled, setGLCoords, setGlobalAlpha, setGlobalAnchor, setId, setImageTransformation, setLocation, setMinimumSize, setModelViewMatrix, setOutOfFrameTime, setPaint, setParent, setPosition, setPositionAnchor, setPositionAnchored, setPreferredSize, setPreventLayout, setRotation, setRotationAnchor, setRotationAnchored, setScale, setScaleAnchor, setScaleAnchored, setScreenBounds, setSize, setSpriteIndex, setStrokeStyle, setUV, setVisible, stopCacheAsBitmap, touchEnd, touchMove, touchStart, viewToModel
    @@ -6871,6 +6892,42 @@

    +
    + + +
    + + + setAudioFormatExtensions(extensions) + +
    +
    + + + +
    + + + + +
    +
    Parameters:
    + +
    + extensions + +
    +
    + +
    + + + + + + + +
    @@ -7591,7 +7648,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:03:58 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:18 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.Foundation.Scene.html b/documentation/jsdoc/symbols/CAAT.Foundation.Scene.html index ce78da2a..838c3591 100644 --- a/documentation/jsdoc/symbols/CAAT.Foundation.Scene.html +++ b/documentation/jsdoc/symbols/CAAT.Foundation.Scene.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -571,7 +583,7 @@

    -
    Fields borrowed from class CAAT.Foundation.ActorContainer:
    activeChildren, addHint, boundingBox, childrenList, layoutInvalidated, layoutManager, pendingChildrenList, runion
    Fields borrowed from class CAAT.Foundation.Actor:
    __super, AABB, alpha, backgroundImage, behaviorList, cached, clip, clipPath, dirty, discardable, duration, expired, fillStyle, frameAlpha, gestureEnabled, glEnabled, height, id, inFrame, invalid, isAA, isGlobalAlpha, lifecycleListenerList, minimumSize, modelViewMatrix, modelViewMatrixI, mouseEnabled, oldX, oldY, parent, pointed, preferredSize, preventLayout, rotationAngle, rotationX, rotationY, scaleAnchor, scaleTX, scaleTY, scaleX, scaleY, size_active, size_total, start_time, strokeStyle, tAnchorX, tAnchorY, time, viewVertices, visible, wdirty, width, worldModelViewMatrix, worldModelViewMatrixI, x, y
    +
    Fields borrowed from class CAAT.Foundation.ActorContainer:
    activeChildren, addHint, boundingBox, childrenList, layoutInvalidated, layoutManager, pendingChildrenList, runion
    Fields borrowed from class CAAT.Foundation.Actor:
    __super, AABB, alpha, backgroundImage, behaviorList, cached, clip, clipPath, dirty, discardable, duration, expired, fillStyle, frameAlpha, gestureEnabled, glEnabled, height, id, inFrame, invalid, isAA, isCachedActor, isGlobalAlpha, lifecycleListenerList, minimumSize, modelViewMatrix, modelViewMatrixI, mouseEnabled, oldX, oldY, parent, pointed, preferredSize, preventLayout, rotationAngle, rotationX, rotationY, scaleAnchor, scaleTX, scaleTY, scaleX, scaleY, size_active, size_total, start_time, strokeStyle, tAnchorX, tAnchorY, time, viewVertices, visible, wdirty, width, worldModelViewMatrix, worldModelViewMatrixI, x, y
    @@ -849,7 +861,7 @@

    -
    Methods borrowed from class CAAT.Foundation.ActorContainer:
    __paintActor, __validateLayout, __validateTree, addChild, addChildAt, addChildDelayed, addChildImmediately, animate, destroy, drawScreenBoundingBox, emptyChildren, endAnimate, findActorById, findChild, getChildAt, getLayout, getNumActiveChildren, getNumChildren, invalidateLayout, paintActor, paintActorGL, recalcSize, removeChild, removeChildAt, removeFirstChild, removeLastChild, setBounds, setLayout, setZOrder
    Methods borrowed from class CAAT.Foundation.Actor:
    __scale1To, addAnimation, addListener, cacheAsBitmap, centerAt, centerOn, contains, create, disableDrag, emptyBehaviorList, enableDrag, enableEvents, fireEvent, gestureChange, gestureEnd, gestureStart, getAnchor, getAnchorPercent, getBehavior, getId, getMinimumSize, getPreferredSize, getTextureGLPage, glNeedsFlush, glSetShader, initialize, invalidate, isCached, isGestureEnabled, isInAnimationFrame, isVisible, modelToModel, modelToView, mouseClick, mouseDblClick, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseOut, mouseOver, mouseUp, moveTo, playAnimation, removeBehaviorById, removeBehaviour, removeListener, resetAnimationTime, resetAsButton, resetTransform, rotateTo, scaleTo, scaleXTo, scaleYTo, setAlpha, setAnimationEndCallback, setAnimationImageIndex, setAsButton, setBackgroundImage, setBackgroundImageOffset, setButtonImageIndex, setChangeFPS, setClip, setDiscardable, setFillStyle, setFrameTime, setGestureEnabled, setGLCoords, setGlobalAlpha, setGlobalAnchor, setId, setImageTransformation, setLocation, setMinimumSize, setModelViewMatrix, setOutOfFrameTime, setPaint, setParent, setPosition, setPositionAnchor, setPositionAnchored, setPreferredSize, setPreventLayout, setRotation, setRotationAnchor, setRotationAnchored, setScale, setScaleAnchor, setScaleAnchored, setScreenBounds, setSize, setSpriteIndex, setStrokeStyle, setUV, setVisible, stopCacheAsBitmap, touchEnd, touchMove, touchStart, viewToModel
    +
    Methods borrowed from class CAAT.Foundation.ActorContainer:
    __paintActor, __validateLayout, __validateTree, addActor, addActorImmediately, addChild, addChildAt, addChildDelayed, addChildImmediately, animate, destroy, drawScreenBoundingBox, emptyChildren, endAnimate, findActorById, findChild, getChildAt, getLayout, getNumActiveChildren, getNumChildren, invalidateLayout, paintActor, paintActorGL, recalcSize, removeChild, removeChildAt, removeFirstChild, removeLastChild, setBounds, setLayout, setZOrder
    Methods borrowed from class CAAT.Foundation.Actor:
    __scale1To, addAnimation, addListener, cacheAsBitmap, centerAt, centerOn, clean, contains, create, disableDrag, emptyBehaviorList, enableDrag, enableEvents, fireEvent, gestureChange, gestureEnd, gestureStart, getAnchor, getAnchorPercent, getBehavior, getId, getMinimumSize, getPreferredSize, getTextureGLPage, glNeedsFlush, glSetShader, initialize, invalidate, isCached, isGestureEnabled, isInAnimationFrame, isVisible, modelToModel, modelToView, mouseClick, mouseDblClick, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseOut, mouseOver, mouseUp, moveTo, playAnimation, removeBehaviorById, removeBehaviour, removeListener, resetAnimationTime, resetAsButton, resetTransform, rotateTo, scaleTo, scaleXTo, scaleYTo, setAlpha, setAnimationEndCallback, setAnimationImageIndex, setAsButton, setBackgroundImage, setBackgroundImageOffset, setButtonImageIndex, setCachedActor, setChangeFPS, setClip, setDiscardable, setFillStyle, setFrameTime, setGestureEnabled, setGLCoords, setGlobalAlpha, setGlobalAnchor, setId, setImageTransformation, setLocation, setMinimumSize, setModelViewMatrix, setOutOfFrameTime, setPaint, setParent, setPosition, setPositionAnchor, setPositionAnchored, setPreferredSize, setPreventLayout, setRotation, setRotationAnchor, setRotationAnchored, setScale, setScaleAnchor, setScaleAnchored, setScreenBounds, setSize, setSpriteIndex, setStrokeStyle, setUV, setVisible, stopCacheAsBitmap, touchEnd, touchMove, touchStart, viewToModel
    @@ -2366,7 +2378,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:03:58 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:18 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.Foundation.SpriteImage.html b/documentation/jsdoc/symbols/CAAT.Foundation.SpriteImage.html index 0d86a175..31cf4d2f 100644 --- a/documentation/jsdoc/symbols/CAAT.Foundation.SpriteImage.html +++ b/documentation/jsdoc/symbols/CAAT.Foundation.SpriteImage.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -843,6 +855,24 @@

    + +   + + +
    Create elements as director.getImage values.
    + + + + +   + +
    copy(other) +
    +
    + + +   @@ -1003,6 +1033,15 @@

    + +   + + +
    + + +   @@ -1013,6 +1052,15 @@

    + +   + + +
    + + +   @@ -2115,6 +2163,80 @@

    +
    + + +
    + + + addElementsAsImages(prefix) + +
    +
    + Create elements as director.getImage values. +Create as much as elements defined in this sprite image. +The elements will be named prefix+ + + +
    + + + + +
    +
    Parameters:
    + +
    + prefix + +
    +
    + +
    + + + + + + + + +
    + + +
    + + + copy(other) + +
    +
    + + + +
    + + + + +
    +
    Parameters:
    + +
    + other + +
    +
    + +
    + + + + + + + +
    @@ -2686,6 +2808,42 @@

    +
    + + +
    + + + initializeFromGlyphDesigner(text) + +
    +
    + + + +
    + + + + +
    +
    Parameters:
    + +
    + text + +
    +
    + +
    + + + + + + + +
    @@ -2729,6 +2887,48 @@

    +
    + + +
    + + + initializeFromTexturePackerJSON(image, obj) + +
    +
    + + + +
    + + + + +
    +
    Parameters:
    + +
    + image + +
    +
    + +
    + obj + +
    +
    + +
    + + + + + + + +
    @@ -3928,7 +4128,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:03:59 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:18 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.Foundation.SpriteImageAnimationHelper.html b/documentation/jsdoc/symbols/CAAT.Foundation.SpriteImageAnimationHelper.html index 3ecbb565..a5ac63b7 100644 --- a/documentation/jsdoc/symbols/CAAT.Foundation.SpriteImageAnimationHelper.html +++ b/documentation/jsdoc/symbols/CAAT.Foundation.SpriteImageAnimationHelper.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -726,7 +738,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:03:59 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:18 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.Foundation.SpriteImageHelper.html b/documentation/jsdoc/symbols/CAAT.Foundation.SpriteImageHelper.html index 2daf465d..e5838e0e 100644 --- a/documentation/jsdoc/symbols/CAAT.Foundation.SpriteImageHelper.html +++ b/documentation/jsdoc/symbols/CAAT.Foundation.SpriteImageHelper.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -684,7 +696,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:03:59 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:18 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.Foundation.Timer.TimerManager.html b/documentation/jsdoc/symbols/CAAT.Foundation.Timer.TimerManager.html index 193756ef..56babdf2 100644 --- a/documentation/jsdoc/symbols/CAAT.Foundation.Timer.TimerManager.html +++ b/documentation/jsdoc/symbols/CAAT.Foundation.Timer.TimerManager.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -935,7 +947,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:03:59 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:18 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.Foundation.Timer.TimerTask.html b/documentation/jsdoc/symbols/CAAT.Foundation.Timer.TimerTask.html index 991f9561..26095a9d 100644 --- a/documentation/jsdoc/symbols/CAAT.Foundation.Timer.TimerTask.html +++ b/documentation/jsdoc/symbols/CAAT.Foundation.Timer.TimerTask.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -1160,7 +1172,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:03:59 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:18 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.Foundation.Timer.html b/documentation/jsdoc/symbols/CAAT.Foundation.Timer.html index 54ba34a4..1085319b 100644 --- a/documentation/jsdoc/symbols/CAAT.Foundation.Timer.html +++ b/documentation/jsdoc/symbols/CAAT.Foundation.Timer.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -523,7 +535,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:03:59 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:18 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.Foundation.UI.Dock.html b/documentation/jsdoc/symbols/CAAT.Foundation.UI.Dock.html index a008bce0..37ec6f26 100644 --- a/documentation/jsdoc/symbols/CAAT.Foundation.UI.Dock.html +++ b/documentation/jsdoc/symbols/CAAT.Foundation.UI.Dock.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -591,7 +603,7 @@

    -
    Fields borrowed from class CAAT.Foundation.ActorContainer:
    activeChildren, addHint, boundingBox, childrenList, layoutInvalidated, layoutManager, pendingChildrenList, runion
    Fields borrowed from class CAAT.Foundation.Actor:
    __super, AABB, alpha, backgroundImage, behaviorList, cached, clip, clipPath, dirty, discardable, duration, expired, fillStyle, frameAlpha, gestureEnabled, glEnabled, height, id, inFrame, invalid, isAA, isGlobalAlpha, lifecycleListenerList, minimumSize, modelViewMatrix, modelViewMatrixI, mouseEnabled, oldX, oldY, parent, pointed, preferredSize, preventLayout, rotationAngle, rotationX, rotationY, scaleAnchor, scaleTX, scaleTY, scaleX, scaleY, size_active, size_total, start_time, strokeStyle, tAnchorX, tAnchorY, time, viewVertices, visible, wdirty, width, worldModelViewMatrix, worldModelViewMatrixI, x, y
    +
    Fields borrowed from class CAAT.Foundation.ActorContainer:
    activeChildren, addHint, boundingBox, childrenList, layoutInvalidated, layoutManager, pendingChildrenList, runion
    Fields borrowed from class CAAT.Foundation.Actor:
    __super, AABB, alpha, backgroundImage, behaviorList, cached, clip, clipPath, dirty, discardable, duration, expired, fillStyle, frameAlpha, gestureEnabled, glEnabled, height, id, inFrame, invalid, isAA, isCachedActor, isGlobalAlpha, lifecycleListenerList, minimumSize, modelViewMatrix, modelViewMatrixI, mouseEnabled, oldX, oldY, parent, pointed, preferredSize, preventLayout, rotationAngle, rotationX, rotationY, scaleAnchor, scaleTX, scaleTY, scaleX, scaleY, size_active, size_total, start_time, strokeStyle, tAnchorX, tAnchorY, time, viewVertices, visible, wdirty, width, worldModelViewMatrix, worldModelViewMatrixI, x, y
    @@ -725,7 +737,7 @@

    -
    Methods borrowed from class CAAT.Foundation.ActorContainer:
    __init, __paintActor, __validateLayout, __validateTree, addChildAt, addChildDelayed, addChildImmediately, animate, destroy, drawScreenBoundingBox, emptyChildren, endAnimate, findActorAtPosition, findActorById, findChild, getChildAt, getLayout, getNumActiveChildren, getNumChildren, invalidateLayout, paintActor, paintActorGL, recalcSize, removeChild, removeChildAt, removeFirstChild, removeLastChild, setBounds, setLayout, setZOrder
    Methods borrowed from class CAAT.Foundation.Actor:
    __scale1To, addAnimation, addBehavior, addListener, cacheAsBitmap, centerAt, centerOn, contains, create, disableDrag, emptyBehaviorList, enableDrag, enableEvents, fireEvent, gestureChange, gestureEnd, gestureStart, getAnchor, getAnchorPercent, getBehavior, getId, getMinimumSize, getPreferredSize, getTextureGLPage, glNeedsFlush, glSetShader, invalidate, isCached, isGestureEnabled, isInAnimationFrame, isVisible, modelToModel, modelToView, mouseClick, mouseDblClick, mouseDown, mouseDrag, mouseEnter, mouseOut, mouseOver, mouseUp, moveTo, paint, playAnimation, removeBehaviorById, removeBehaviour, removeListener, resetAnimationTime, resetAsButton, resetTransform, rotateTo, scaleTo, scaleXTo, scaleYTo, setAlpha, setAnimationEndCallback, setAnimationImageIndex, setAsButton, setBackgroundImage, setBackgroundImageOffset, setButtonImageIndex, setChangeFPS, setClip, setDiscardable, setExpired, setFillStyle, setFrameTime, setGestureEnabled, setGLCoords, setGlobalAlpha, setGlobalAnchor, setId, setImageTransformation, setLocation, setMinimumSize, setModelViewMatrix, setOutOfFrameTime, setPaint, setParent, setPosition, setPositionAnchor, setPositionAnchored, setPreferredSize, setPreventLayout, setRotation, setRotationAnchor, setRotationAnchored, setScale, setScaleAnchor, setScaleAnchored, setScreenBounds, setSize, setSpriteIndex, setStrokeStyle, setUV, setVisible, stopCacheAsBitmap, touchEnd, touchMove, touchStart, viewToModel
    +
    Methods borrowed from class CAAT.Foundation.ActorContainer:
    __init, __paintActor, __validateLayout, __validateTree, addActor, addActorImmediately, addChildAt, addChildDelayed, addChildImmediately, animate, destroy, drawScreenBoundingBox, emptyChildren, endAnimate, findActorAtPosition, findActorById, findChild, getChildAt, getLayout, getNumActiveChildren, getNumChildren, invalidateLayout, paintActor, paintActorGL, recalcSize, removeChild, removeChildAt, removeFirstChild, removeLastChild, setBounds, setLayout, setZOrder
    Methods borrowed from class CAAT.Foundation.Actor:
    __scale1To, addAnimation, addBehavior, addListener, cacheAsBitmap, centerAt, centerOn, clean, contains, create, disableDrag, emptyBehaviorList, enableDrag, enableEvents, fireEvent, gestureChange, gestureEnd, gestureStart, getAnchor, getAnchorPercent, getBehavior, getId, getMinimumSize, getPreferredSize, getTextureGLPage, glNeedsFlush, glSetShader, invalidate, isCached, isGestureEnabled, isInAnimationFrame, isVisible, modelToModel, modelToView, mouseClick, mouseDblClick, mouseDown, mouseDrag, mouseEnter, mouseOut, mouseOver, mouseUp, moveTo, paint, playAnimation, removeBehaviorById, removeBehaviour, removeListener, resetAnimationTime, resetAsButton, resetTransform, rotateTo, scaleTo, scaleXTo, scaleYTo, setAlpha, setAnimationEndCallback, setAnimationImageIndex, setAsButton, setBackgroundImage, setBackgroundImageOffset, setButtonImageIndex, setCachedActor, setChangeFPS, setClip, setDiscardable, setExpired, setFillStyle, setFrameTime, setGestureEnabled, setGLCoords, setGlobalAlpha, setGlobalAnchor, setId, setImageTransformation, setLocation, setMinimumSize, setModelViewMatrix, setOutOfFrameTime, setPaint, setParent, setPosition, setPositionAnchor, setPositionAnchored, setPreferredSize, setPreventLayout, setRotation, setRotationAnchor, setRotationAnchored, setScale, setScaleAnchor, setScaleAnchored, setScreenBounds, setSize, setSpriteIndex, setStrokeStyle, setUV, setVisible, stopCacheAsBitmap, touchEnd, touchMove, touchStart, viewToModel
    @@ -1472,7 +1484,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:03:59 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:18 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.Foundation.UI.IMActor.html b/documentation/jsdoc/symbols/CAAT.Foundation.UI.IMActor.html index 3ad41b74..095a91de 100644 --- a/documentation/jsdoc/symbols/CAAT.Foundation.UI.IMActor.html +++ b/documentation/jsdoc/symbols/CAAT.Foundation.UI.IMActor.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -521,7 +533,7 @@

    -
    Fields borrowed from class CAAT.Foundation.Actor:
    __super, AABB, alpha, backgroundImage, behaviorList, cached, clip, clipPath, dirty, discardable, duration, expired, fillStyle, frameAlpha, gestureEnabled, glEnabled, height, id, inFrame, invalid, isAA, isGlobalAlpha, lifecycleListenerList, minimumSize, modelViewMatrix, modelViewMatrixI, mouseEnabled, oldX, oldY, parent, pointed, preferredSize, preventLayout, rotationAngle, rotationX, rotationY, scaleAnchor, scaleTX, scaleTY, scaleX, scaleY, size_active, size_total, start_time, strokeStyle, tAnchorX, tAnchorY, time, viewVertices, visible, wdirty, width, worldModelViewMatrix, worldModelViewMatrixI, x, y
    +
    Fields borrowed from class CAAT.Foundation.Actor:
    __super, AABB, alpha, backgroundImage, behaviorList, cached, clip, clipPath, dirty, discardable, duration, expired, fillStyle, frameAlpha, gestureEnabled, glEnabled, height, id, inFrame, invalid, isAA, isCachedActor, isGlobalAlpha, lifecycleListenerList, minimumSize, modelViewMatrix, modelViewMatrixI, mouseEnabled, oldX, oldY, parent, pointed, preferredSize, preventLayout, rotationAngle, rotationX, rotationY, scaleAnchor, scaleTX, scaleTY, scaleX, scaleY, size_active, size_total, start_time, strokeStyle, tAnchorX, tAnchorY, time, viewVertices, visible, wdirty, width, worldModelViewMatrix, worldModelViewMatrixI, x, y
    @@ -573,7 +585,7 @@

    -
    Methods borrowed from class CAAT.Foundation.Actor:
    __init, __paintActor, __scale1To, __validateLayout, addAnimation, addBehavior, addListener, animate, cacheAsBitmap, centerAt, centerOn, contains, create, destroy, disableDrag, drawScreenBoundingBox, emptyBehaviorList, enableDrag, enableEvents, endAnimate, findActorAtPosition, findActorById, fireEvent, gestureChange, gestureEnd, gestureStart, getAnchor, getAnchorPercent, getBehavior, getId, getMinimumSize, getPreferredSize, getTextureGLPage, glNeedsFlush, glSetShader, initialize, invalidate, invalidateLayout, isCached, isGestureEnabled, isInAnimationFrame, isVisible, modelToModel, modelToView, mouseClick, mouseDblClick, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseOut, mouseOver, mouseUp, moveTo, paintActor, paintActorGL, playAnimation, removeBehaviorById, removeBehaviour, removeListener, resetAnimationTime, resetAsButton, resetTransform, rotateTo, scaleTo, scaleXTo, scaleYTo, setAlpha, setAnimationEndCallback, setAnimationImageIndex, setAsButton, setBackgroundImage, setBackgroundImageOffset, setBounds, setButtonImageIndex, setChangeFPS, setClip, setDiscardable, setExpired, setFillStyle, setFrameTime, setGestureEnabled, setGLCoords, setGlobalAlpha, setGlobalAnchor, setId, setImageTransformation, setLocation, setMinimumSize, setModelViewMatrix, setOutOfFrameTime, setPaint, setParent, setPosition, setPositionAnchor, setPositionAnchored, setPreferredSize, setPreventLayout, setRotation, setRotationAnchor, setRotationAnchored, setScale, setScaleAnchor, setScaleAnchored, setScreenBounds, setSize, setSpriteIndex, setStrokeStyle, setUV, setVisible, stopCacheAsBitmap, touchEnd, touchMove, touchStart, viewToModel
    +
    Methods borrowed from class CAAT.Foundation.Actor:
    __init, __paintActor, __scale1To, __validateLayout, addAnimation, addBehavior, addListener, animate, cacheAsBitmap, centerAt, centerOn, clean, contains, create, destroy, disableDrag, drawScreenBoundingBox, emptyBehaviorList, enableDrag, enableEvents, endAnimate, findActorAtPosition, findActorById, fireEvent, gestureChange, gestureEnd, gestureStart, getAnchor, getAnchorPercent, getBehavior, getId, getMinimumSize, getPreferredSize, getTextureGLPage, glNeedsFlush, glSetShader, initialize, invalidate, invalidateLayout, isCached, isGestureEnabled, isInAnimationFrame, isVisible, modelToModel, modelToView, mouseClick, mouseDblClick, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseOut, mouseOver, mouseUp, moveTo, paintActor, paintActorGL, playAnimation, removeBehaviorById, removeBehaviour, removeListener, resetAnimationTime, resetAsButton, resetTransform, rotateTo, scaleTo, scaleXTo, scaleYTo, setAlpha, setAnimationEndCallback, setAnimationImageIndex, setAsButton, setBackgroundImage, setBackgroundImageOffset, setBounds, setButtonImageIndex, setCachedActor, setChangeFPS, setClip, setDiscardable, setExpired, setFillStyle, setFrameTime, setGestureEnabled, setGLCoords, setGlobalAlpha, setGlobalAnchor, setId, setImageTransformation, setLocation, setMinimumSize, setModelViewMatrix, setOutOfFrameTime, setPaint, setParent, setPosition, setPositionAnchor, setPositionAnchored, setPreferredSize, setPreventLayout, setRotation, setRotationAnchor, setRotationAnchored, setScale, setScaleAnchor, setScaleAnchored, setScreenBounds, setSize, setSpriteIndex, setStrokeStyle, setUV, setVisible, stopCacheAsBitmap, touchEnd, touchMove, touchStart, viewToModel
    @@ -816,7 +828,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:03:59 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:18 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.Foundation.UI.InterpolatorActor.html b/documentation/jsdoc/symbols/CAAT.Foundation.UI.InterpolatorActor.html index 59c28fad..1caf5b4f 100644 --- a/documentation/jsdoc/symbols/CAAT.Foundation.UI.InterpolatorActor.html +++ b/documentation/jsdoc/symbols/CAAT.Foundation.UI.InterpolatorActor.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -531,7 +543,7 @@

    -
    Fields borrowed from class CAAT.Foundation.Actor:
    __super, AABB, alpha, backgroundImage, behaviorList, cached, clip, clipPath, dirty, discardable, duration, expired, fillStyle, frameAlpha, gestureEnabled, glEnabled, height, id, inFrame, invalid, isAA, isGlobalAlpha, lifecycleListenerList, minimumSize, modelViewMatrix, modelViewMatrixI, mouseEnabled, oldX, oldY, parent, pointed, preferredSize, preventLayout, rotationAngle, rotationX, rotationY, scaleAnchor, scaleTX, scaleTY, scaleX, scaleY, size_active, size_total, start_time, strokeStyle, tAnchorX, tAnchorY, time, viewVertices, visible, wdirty, width, worldModelViewMatrix, worldModelViewMatrixI, x, y
    +
    Fields borrowed from class CAAT.Foundation.Actor:
    __super, AABB, alpha, backgroundImage, behaviorList, cached, clip, clipPath, dirty, discardable, duration, expired, fillStyle, frameAlpha, gestureEnabled, glEnabled, height, id, inFrame, invalid, isAA, isCachedActor, isGlobalAlpha, lifecycleListenerList, minimumSize, modelViewMatrix, modelViewMatrixI, mouseEnabled, oldX, oldY, parent, pointed, preferredSize, preventLayout, rotationAngle, rotationX, rotationY, scaleAnchor, scaleTX, scaleTY, scaleX, scaleY, size_active, size_total, start_time, strokeStyle, tAnchorX, tAnchorY, time, viewVertices, visible, wdirty, width, worldModelViewMatrix, worldModelViewMatrixI, x, y
    @@ -592,7 +604,7 @@

    -
    Methods borrowed from class CAAT.Foundation.Actor:
    __init, __paintActor, __scale1To, __validateLayout, addAnimation, addBehavior, addListener, animate, cacheAsBitmap, centerAt, centerOn, contains, create, destroy, disableDrag, drawScreenBoundingBox, emptyBehaviorList, enableDrag, enableEvents, endAnimate, findActorAtPosition, findActorById, fireEvent, gestureChange, gestureEnd, gestureStart, getAnchor, getAnchorPercent, getBehavior, getId, getMinimumSize, getPreferredSize, getTextureGLPage, glNeedsFlush, glSetShader, initialize, invalidate, invalidateLayout, isCached, isGestureEnabled, isInAnimationFrame, isVisible, modelToModel, modelToView, mouseClick, mouseDblClick, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseOut, mouseOver, mouseUp, moveTo, paintActor, paintActorGL, playAnimation, removeBehaviorById, removeBehaviour, removeListener, resetAnimationTime, resetAsButton, resetTransform, rotateTo, scaleTo, scaleXTo, scaleYTo, setAlpha, setAnimationEndCallback, setAnimationImageIndex, setAsButton, setBackgroundImage, setBackgroundImageOffset, setBounds, setButtonImageIndex, setChangeFPS, setClip, setDiscardable, setExpired, setFillStyle, setFrameTime, setGestureEnabled, setGLCoords, setGlobalAlpha, setGlobalAnchor, setId, setImageTransformation, setLocation, setMinimumSize, setModelViewMatrix, setOutOfFrameTime, setPaint, setParent, setPosition, setPositionAnchor, setPositionAnchored, setPreferredSize, setPreventLayout, setRotation, setRotationAnchor, setRotationAnchored, setScale, setScaleAnchor, setScaleAnchored, setScreenBounds, setSize, setSpriteIndex, setStrokeStyle, setUV, setVisible, stopCacheAsBitmap, touchEnd, touchMove, touchStart, viewToModel
    +
    Methods borrowed from class CAAT.Foundation.Actor:
    __init, __paintActor, __scale1To, __validateLayout, addAnimation, addBehavior, addListener, animate, cacheAsBitmap, centerAt, centerOn, clean, contains, create, destroy, disableDrag, drawScreenBoundingBox, emptyBehaviorList, enableDrag, enableEvents, endAnimate, findActorAtPosition, findActorById, fireEvent, gestureChange, gestureEnd, gestureStart, getAnchor, getAnchorPercent, getBehavior, getId, getMinimumSize, getPreferredSize, getTextureGLPage, glNeedsFlush, glSetShader, initialize, invalidate, invalidateLayout, isCached, isGestureEnabled, isInAnimationFrame, isVisible, modelToModel, modelToView, mouseClick, mouseDblClick, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseOut, mouseOver, mouseUp, moveTo, paintActor, paintActorGL, playAnimation, removeBehaviorById, removeBehaviour, removeListener, resetAnimationTime, resetAsButton, resetTransform, rotateTo, scaleTo, scaleXTo, scaleYTo, setAlpha, setAnimationEndCallback, setAnimationImageIndex, setAsButton, setBackgroundImage, setBackgroundImageOffset, setBounds, setButtonImageIndex, setCachedActor, setChangeFPS, setClip, setDiscardable, setExpired, setFillStyle, setFrameTime, setGestureEnabled, setGLCoords, setGlobalAlpha, setGlobalAnchor, setId, setImageTransformation, setLocation, setMinimumSize, setModelViewMatrix, setOutOfFrameTime, setPaint, setParent, setPosition, setPositionAnchor, setPositionAnchored, setPreferredSize, setPreventLayout, setRotation, setRotationAnchor, setRotationAnchored, setScale, setScaleAnchor, setScaleAnchored, setScreenBounds, setSize, setSpriteIndex, setStrokeStyle, setUV, setVisible, stopCacheAsBitmap, touchEnd, touchMove, touchStart, viewToModel
    @@ -910,7 +922,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:03:59 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:18 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.Foundation.UI.Label#__init.html b/documentation/jsdoc/symbols/CAAT.Foundation.UI.Label#__init.html deleted file mode 100644 index 07ff859f..00000000 --- a/documentation/jsdoc/symbols/CAAT.Foundation.UI.Label#__init.html +++ /dev/null @@ -1,401 +0,0 @@ - - - - - - - JsDoc Reference - CAAT.Foundation.UI.Label#__init - - - - - - - - - - - -
    - - -
    -

    Classes

    - -
    - -
    - -
    - -

    - - Class CAAT.Foundation.UI.Label#__init -

    - - -

    - - - - - - -
    Defined in: Label.js. - -

    - - - - - - - - - - - - - - - - - -
    Class Summary
    Constructor AttributesConstructor Name and Description
    <private>   - -
    This object represents a label object.
    -
    - - - - - - - - - - - - -
    -
    - Class Detail -
    - -
    <private> - CAAT.Foundation.UI.Label#__init() -
    - -
    - This object represents a label object. -A label is a complex presentation object which is able to: -
  • define comples styles -
  • contains multiline text -
  • keep track of per-line baseline regardless of fonts used. -
  • Mix images and text. -
  • Layout text and images in a fixed width or by parsing a free-flowing document -
  • Add anchoring capabilities. - -
  • - - - - - - - - - -
    -
    Returns:
    - -
    {*}
    - -
    - - - - -
    - - - - - - - - - - - -
    -
    - - - -
    - - Documentation generated by JsDoc Toolkit 2.4.0 on Tue Feb 26 2013 11:37:28 GMT-0800 (PST) -
    - - diff --git a/documentation/jsdoc/symbols/CAAT.Foundation.UI.Label.html b/documentation/jsdoc/symbols/CAAT.Foundation.UI.Label.html index 89e8ae70..6d43a427 100644 --- a/documentation/jsdoc/symbols/CAAT.Foundation.UI.Label.html +++ b/documentation/jsdoc/symbols/CAAT.Foundation.UI.Label.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -621,7 +633,7 @@

    -
    Fields borrowed from class CAAT.Foundation.Actor:
    __super, AABB, alpha, backgroundImage, behaviorList, cached, clip, clipPath, dirty, discardable, duration, expired, fillStyle, frameAlpha, gestureEnabled, glEnabled, height, id, inFrame, invalid, isAA, isGlobalAlpha, lifecycleListenerList, minimumSize, modelViewMatrix, modelViewMatrixI, mouseEnabled, oldX, oldY, parent, pointed, preferredSize, preventLayout, rotationAngle, rotationX, rotationY, scaleAnchor, scaleTX, scaleTY, scaleX, scaleY, size_active, size_total, start_time, strokeStyle, tAnchorX, tAnchorY, time, viewVertices, visible, wdirty, width, worldModelViewMatrix, worldModelViewMatrixI, x, y
    +
    Fields borrowed from class CAAT.Foundation.Actor:
    __super, AABB, alpha, backgroundImage, behaviorList, cached, clip, clipPath, dirty, discardable, duration, expired, fillStyle, frameAlpha, gestureEnabled, glEnabled, height, id, inFrame, invalid, isAA, isCachedActor, isGlobalAlpha, lifecycleListenerList, minimumSize, modelViewMatrix, modelViewMatrixI, mouseEnabled, oldX, oldY, parent, pointed, preferredSize, preventLayout, rotationAngle, rotationX, rotationY, scaleAnchor, scaleTX, scaleTY, scaleX, scaleY, size_active, size_total, start_time, strokeStyle, tAnchorX, tAnchorY, time, viewVertices, visible, wdirty, width, worldModelViewMatrix, worldModelViewMatrixI, x, y
    @@ -733,7 +745,7 @@

      -
    setDocumentPosition() +
    setDocumentPosition(halign, valign)
    @@ -757,6 +769,15 @@

    + +   + + +
    Make the label actor the size the label document has been calculated for.
    + + +   @@ -799,7 +820,7 @@

    -
    Methods borrowed from class CAAT.Foundation.Actor:
    __paintActor, __scale1To, __validateLayout, addAnimation, addBehavior, addListener, animate, cacheAsBitmap, centerAt, centerOn, contains, create, destroy, disableDrag, drawScreenBoundingBox, emptyBehaviorList, enableDrag, enableEvents, endAnimate, findActorAtPosition, findActorById, fireEvent, gestureChange, gestureEnd, gestureStart, getAnchor, getAnchorPercent, getBehavior, getId, getMinimumSize, getPreferredSize, getTextureGLPage, glNeedsFlush, glSetShader, initialize, invalidate, invalidateLayout, isCached, isGestureEnabled, isInAnimationFrame, isVisible, modelToModel, modelToView, mouseDblClick, mouseDown, mouseDrag, mouseEnter, mouseOut, mouseOver, mouseUp, moveTo, paintActor, paintActorGL, playAnimation, removeBehaviorById, removeBehaviour, removeListener, resetAnimationTime, resetAsButton, resetTransform, rotateTo, scaleTo, scaleXTo, scaleYTo, setAlpha, setAnimationEndCallback, setAnimationImageIndex, setAsButton, setBackgroundImage, setBackgroundImageOffset, setButtonImageIndex, setChangeFPS, setClip, setDiscardable, setExpired, setFillStyle, setFrameTime, setGestureEnabled, setGLCoords, setGlobalAlpha, setGlobalAnchor, setId, setImageTransformation, setLocation, setMinimumSize, setModelViewMatrix, setOutOfFrameTime, setPaint, setParent, setPosition, setPositionAnchor, setPositionAnchored, setPreferredSize, setPreventLayout, setRotation, setRotationAnchor, setRotationAnchored, setScale, setScaleAnchor, setScaleAnchored, setScreenBounds, setSpriteIndex, setStrokeStyle, setUV, setVisible, stopCacheAsBitmap, touchEnd, touchMove, touchStart, viewToModel
    +
    Methods borrowed from class CAAT.Foundation.Actor:
    __paintActor, __scale1To, __validateLayout, addAnimation, addBehavior, addListener, animate, cacheAsBitmap, centerAt, centerOn, clean, contains, create, destroy, disableDrag, drawScreenBoundingBox, emptyBehaviorList, enableDrag, enableEvents, endAnimate, findActorAtPosition, findActorById, fireEvent, gestureChange, gestureEnd, gestureStart, getAnchor, getAnchorPercent, getBehavior, getId, getMinimumSize, getPreferredSize, getTextureGLPage, glNeedsFlush, glSetShader, initialize, invalidate, invalidateLayout, isCached, isGestureEnabled, isInAnimationFrame, isVisible, modelToModel, modelToView, mouseDblClick, mouseDown, mouseDrag, mouseEnter, mouseOut, mouseOver, mouseUp, moveTo, paintActor, paintActorGL, playAnimation, removeBehaviorById, removeBehaviour, removeListener, resetAnimationTime, resetAsButton, resetTransform, rotateTo, scaleTo, scaleXTo, scaleYTo, setAlpha, setAnimationEndCallback, setAnimationImageIndex, setAsButton, setBackgroundImage, setBackgroundImageOffset, setButtonImageIndex, setCachedActor, setChangeFPS, setClip, setDiscardable, setExpired, setFillStyle, setFrameTime, setGestureEnabled, setGLCoords, setGlobalAlpha, setGlobalAnchor, setId, setImageTransformation, setLocation, setMinimumSize, setModelViewMatrix, setOutOfFrameTime, setPaint, setParent, setPosition, setPositionAnchor, setPositionAnchored, setPreferredSize, setPreventLayout, setRotation, setRotationAnchor, setRotationAnchored, setScale, setScaleAnchor, setScaleAnchored, setScreenBounds, setSpriteIndex, setStrokeStyle, setUV, setVisible, stopCacheAsBitmap, touchEnd, touchMove, touchStart, viewToModel
    @@ -1525,7 +1546,7 @@

    - setDocumentPosition() + setDocumentPosition(halign, valign)
    @@ -1537,6 +1558,23 @@

    +
    +
    Parameters:
    + +
    + halign + +
    +
    + +
    + valign + +
    +
    + +
    + @@ -1605,6 +1643,42 @@

    +
    + + +
    + + + setMatchTextSize(match) + +
    +
    + Make the label actor the size the label document has been calculated for. + + +
    + + + + +
    +
    Parameters:
    + +
    + match + +
    +
    {boolean}
    + +
    + + + + + + + +
    @@ -1781,7 +1855,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:03:59 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:18 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.Foundation.UI.Layout.BorderLayout.html b/documentation/jsdoc/symbols/CAAT.Foundation.UI.Layout.BorderLayout.html index b6bd422c..288b3245 100644 --- a/documentation/jsdoc/symbols/CAAT.Foundation.UI.Layout.BorderLayout.html +++ b/documentation/jsdoc/symbols/CAAT.Foundation.UI.Layout.BorderLayout.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -1049,7 +1061,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:03:59 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:18 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.Foundation.UI.Layout.BoxLayout.html b/documentation/jsdoc/symbols/CAAT.Foundation.UI.Layout.BoxLayout.html index 8bcab1d8..acb46951 100644 --- a/documentation/jsdoc/symbols/CAAT.Foundation.UI.Layout.BoxLayout.html +++ b/documentation/jsdoc/symbols/CAAT.Foundation.UI.Layout.BoxLayout.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -1092,7 +1104,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:03:59 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:18 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.Foundation.UI.Layout.GridLayout.html b/documentation/jsdoc/symbols/CAAT.Foundation.UI.Layout.GridLayout.html index aeae53da..2952e828 100644 --- a/documentation/jsdoc/symbols/CAAT.Foundation.UI.Layout.GridLayout.html +++ b/documentation/jsdoc/symbols/CAAT.Foundation.UI.Layout.GridLayout.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -829,7 +841,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:03:59 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:18 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.Foundation.UI.Layout.LayoutManager.html b/documentation/jsdoc/symbols/CAAT.Foundation.UI.Layout.LayoutManager.html index 96b8efa6..8ac5ad99 100644 --- a/documentation/jsdoc/symbols/CAAT.Foundation.UI.Layout.LayoutManager.html +++ b/documentation/jsdoc/symbols/CAAT.Foundation.UI.Layout.LayoutManager.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -1510,7 +1522,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:03:59 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:18 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.Foundation.UI.Layout.html b/documentation/jsdoc/symbols/CAAT.Foundation.UI.Layout.html index 039cc984..1022a459 100644 --- a/documentation/jsdoc/symbols/CAAT.Foundation.UI.Layout.html +++ b/documentation/jsdoc/symbols/CAAT.Foundation.UI.Layout.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -523,7 +535,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:03:59 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:18 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.Foundation.UI.PathActor.html b/documentation/jsdoc/symbols/CAAT.Foundation.UI.PathActor.html index 2fe0d864..06724ee0 100644 --- a/documentation/jsdoc/symbols/CAAT.Foundation.UI.PathActor.html +++ b/documentation/jsdoc/symbols/CAAT.Foundation.UI.PathActor.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -551,7 +563,7 @@

    -
    Fields borrowed from class CAAT.Foundation.Actor:
    __super, AABB, alpha, backgroundImage, behaviorList, cached, clip, clipPath, dirty, discardable, duration, expired, fillStyle, frameAlpha, gestureEnabled, glEnabled, height, id, inFrame, invalid, isAA, isGlobalAlpha, lifecycleListenerList, minimumSize, modelViewMatrix, modelViewMatrixI, mouseEnabled, oldX, oldY, parent, pointed, preferredSize, preventLayout, rotationAngle, rotationX, rotationY, scaleAnchor, scaleTX, scaleTY, scaleX, scaleY, size_active, size_total, start_time, strokeStyle, tAnchorX, tAnchorY, time, viewVertices, visible, wdirty, width, worldModelViewMatrix, worldModelViewMatrixI, x, y
    +
    Fields borrowed from class CAAT.Foundation.Actor:
    __super, AABB, alpha, backgroundImage, behaviorList, cached, clip, clipPath, dirty, discardable, duration, expired, fillStyle, frameAlpha, gestureEnabled, glEnabled, height, id, inFrame, invalid, isAA, isCachedActor, isGlobalAlpha, lifecycleListenerList, minimumSize, modelViewMatrix, modelViewMatrixI, mouseEnabled, oldX, oldY, parent, pointed, preferredSize, preventLayout, rotationAngle, rotationX, rotationY, scaleAnchor, scaleTX, scaleTY, scaleX, scaleY, size_active, size_total, start_time, strokeStyle, tAnchorX, tAnchorY, time, viewVertices, visible, wdirty, width, worldModelViewMatrix, worldModelViewMatrixI, x, y
    @@ -657,7 +669,7 @@

    -
    Methods borrowed from class CAAT.Foundation.Actor:
    __init, __paintActor, __scale1To, __validateLayout, addAnimation, addBehavior, addListener, animate, cacheAsBitmap, centerAt, centerOn, contains, create, destroy, disableDrag, drawScreenBoundingBox, emptyBehaviorList, enableDrag, enableEvents, endAnimate, findActorAtPosition, findActorById, fireEvent, gestureChange, gestureEnd, gestureStart, getAnchor, getAnchorPercent, getBehavior, getId, getMinimumSize, getPreferredSize, getTextureGLPage, glNeedsFlush, glSetShader, initialize, invalidate, invalidateLayout, isCached, isGestureEnabled, isInAnimationFrame, isVisible, modelToModel, modelToView, mouseClick, mouseDblClick, mouseEnter, mouseExit, mouseMove, mouseOut, mouseOver, moveTo, paintActor, paintActorGL, playAnimation, removeBehaviorById, removeBehaviour, removeListener, resetAnimationTime, resetAsButton, resetTransform, rotateTo, scaleTo, scaleXTo, scaleYTo, setAlpha, setAnimationEndCallback, setAnimationImageIndex, setAsButton, setBackgroundImage, setBackgroundImageOffset, setBounds, setButtonImageIndex, setChangeFPS, setClip, setDiscardable, setExpired, setFillStyle, setFrameTime, setGestureEnabled, setGLCoords, setGlobalAlpha, setGlobalAnchor, setId, setImageTransformation, setLocation, setMinimumSize, setModelViewMatrix, setOutOfFrameTime, setPaint, setParent, setPosition, setPositionAnchor, setPositionAnchored, setPreferredSize, setPreventLayout, setRotation, setRotationAnchor, setRotationAnchored, setScale, setScaleAnchor, setScaleAnchored, setScreenBounds, setSize, setSpriteIndex, setStrokeStyle, setUV, setVisible, stopCacheAsBitmap, touchEnd, touchMove, touchStart, viewToModel
    +
    Methods borrowed from class CAAT.Foundation.Actor:
    __init, __paintActor, __scale1To, __validateLayout, addAnimation, addBehavior, addListener, animate, cacheAsBitmap, centerAt, centerOn, clean, contains, create, destroy, disableDrag, drawScreenBoundingBox, emptyBehaviorList, enableDrag, enableEvents, endAnimate, findActorAtPosition, findActorById, fireEvent, gestureChange, gestureEnd, gestureStart, getAnchor, getAnchorPercent, getBehavior, getId, getMinimumSize, getPreferredSize, getTextureGLPage, glNeedsFlush, glSetShader, initialize, invalidate, invalidateLayout, isCached, isGestureEnabled, isInAnimationFrame, isVisible, modelToModel, modelToView, mouseClick, mouseDblClick, mouseEnter, mouseExit, mouseMove, mouseOut, mouseOver, moveTo, paintActor, paintActorGL, playAnimation, removeBehaviorById, removeBehaviour, removeListener, resetAnimationTime, resetAsButton, resetTransform, rotateTo, scaleTo, scaleXTo, scaleYTo, setAlpha, setAnimationEndCallback, setAnimationImageIndex, setAsButton, setBackgroundImage, setBackgroundImageOffset, setBounds, setButtonImageIndex, setCachedActor, setChangeFPS, setClip, setDiscardable, setExpired, setFillStyle, setFrameTime, setGestureEnabled, setGLCoords, setGlobalAlpha, setGlobalAnchor, setId, setImageTransformation, setLocation, setMinimumSize, setModelViewMatrix, setOutOfFrameTime, setPaint, setParent, setPosition, setPositionAnchor, setPositionAnchored, setPreferredSize, setPreventLayout, setRotation, setRotationAnchor, setRotationAnchored, setScale, setScaleAnchor, setScaleAnchored, setScreenBounds, setSize, setSpriteIndex, setStrokeStyle, setUV, setVisible, stopCacheAsBitmap, touchEnd, touchMove, touchStart, viewToModel
    @@ -1193,7 +1205,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:03:59 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:18 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.Foundation.UI.ShapeActor.html b/documentation/jsdoc/symbols/CAAT.Foundation.UI.ShapeActor.html index c7370edc..294e9e3c 100644 --- a/documentation/jsdoc/symbols/CAAT.Foundation.UI.ShapeActor.html +++ b/documentation/jsdoc/symbols/CAAT.Foundation.UI.ShapeActor.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -571,7 +583,7 @@

    -
    Fields borrowed from class CAAT.Foundation.ActorContainer:
    activeChildren, addHint, boundingBox, childrenList, layoutInvalidated, layoutManager, pendingChildrenList, runion
    Fields borrowed from class CAAT.Foundation.Actor:
    __super, AABB, alpha, backgroundImage, behaviorList, cached, clip, clipPath, dirty, discardable, duration, expired, fillStyle, frameAlpha, gestureEnabled, glEnabled, height, id, inFrame, invalid, isAA, isGlobalAlpha, lifecycleListenerList, minimumSize, modelViewMatrix, modelViewMatrixI, mouseEnabled, oldX, oldY, parent, pointed, preferredSize, preventLayout, rotationAngle, rotationX, rotationY, scaleAnchor, scaleTX, scaleTY, scaleX, scaleY, size_active, size_total, start_time, strokeStyle, tAnchorX, tAnchorY, time, viewVertices, visible, wdirty, width, worldModelViewMatrix, worldModelViewMatrixI, x, y
    +
    Fields borrowed from class CAAT.Foundation.ActorContainer:
    activeChildren, addHint, boundingBox, childrenList, layoutInvalidated, layoutManager, pendingChildrenList, runion
    Fields borrowed from class CAAT.Foundation.Actor:
    __super, AABB, alpha, backgroundImage, behaviorList, cached, clip, clipPath, dirty, discardable, duration, expired, fillStyle, frameAlpha, gestureEnabled, glEnabled, height, id, inFrame, invalid, isAA, isCachedActor, isGlobalAlpha, lifecycleListenerList, minimumSize, modelViewMatrix, modelViewMatrixI, mouseEnabled, oldX, oldY, parent, pointed, preferredSize, preventLayout, rotationAngle, rotationX, rotationY, scaleAnchor, scaleTX, scaleTY, scaleX, scaleY, size_active, size_total, start_time, strokeStyle, tAnchorX, tAnchorY, time, viewVertices, visible, wdirty, width, worldModelViewMatrix, worldModelViewMatrixI, x, y
    @@ -723,7 +735,7 @@

    -
    Methods borrowed from class CAAT.Foundation.ActorContainer:
    __paintActor, __validateLayout, __validateTree, addChild, addChildAt, addChildDelayed, addChildImmediately, animate, destroy, drawScreenBoundingBox, emptyChildren, endAnimate, findActorAtPosition, findActorById, findChild, getChildAt, getLayout, getNumActiveChildren, getNumChildren, invalidateLayout, paintActor, paintActorGL, recalcSize, removeChild, removeChildAt, removeFirstChild, removeLastChild, setBounds, setLayout, setZOrder
    Methods borrowed from class CAAT.Foundation.Actor:
    __scale1To, addAnimation, addBehavior, addListener, cacheAsBitmap, centerAt, centerOn, contains, create, disableDrag, emptyBehaviorList, enableDrag, enableEvents, fireEvent, gestureChange, gestureEnd, gestureStart, getAnchor, getAnchorPercent, getBehavior, getId, getMinimumSize, getPreferredSize, getTextureGLPage, glNeedsFlush, glSetShader, initialize, invalidate, isCached, isGestureEnabled, isInAnimationFrame, isVisible, modelToModel, modelToView, mouseClick, mouseDblClick, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseOut, mouseOver, mouseUp, moveTo, playAnimation, removeBehaviorById, removeBehaviour, removeListener, resetAnimationTime, resetAsButton, resetTransform, rotateTo, scaleTo, scaleXTo, scaleYTo, setAlpha, setAnimationEndCallback, setAnimationImageIndex, setAsButton, setBackgroundImage, setBackgroundImageOffset, setButtonImageIndex, setChangeFPS, setClip, setDiscardable, setExpired, setFillStyle, setFrameTime, setGestureEnabled, setGLCoords, setGlobalAlpha, setGlobalAnchor, setId, setImageTransformation, setLocation, setMinimumSize, setModelViewMatrix, setOutOfFrameTime, setPaint, setParent, setPosition, setPositionAnchor, setPositionAnchored, setPreferredSize, setPreventLayout, setRotation, setRotationAnchor, setRotationAnchored, setScale, setScaleAnchor, setScaleAnchored, setScreenBounds, setSize, setSpriteIndex, setStrokeStyle, setUV, setVisible, stopCacheAsBitmap, touchEnd, touchMove, touchStart, viewToModel
    +
    Methods borrowed from class CAAT.Foundation.ActorContainer:
    __paintActor, __validateLayout, __validateTree, addActor, addActorImmediately, addChild, addChildAt, addChildDelayed, addChildImmediately, animate, destroy, drawScreenBoundingBox, emptyChildren, endAnimate, findActorAtPosition, findActorById, findChild, getChildAt, getLayout, getNumActiveChildren, getNumChildren, invalidateLayout, paintActor, paintActorGL, recalcSize, removeChild, removeChildAt, removeFirstChild, removeLastChild, setBounds, setLayout, setZOrder
    Methods borrowed from class CAAT.Foundation.Actor:
    __scale1To, addAnimation, addBehavior, addListener, cacheAsBitmap, centerAt, centerOn, clean, contains, create, disableDrag, emptyBehaviorList, enableDrag, enableEvents, fireEvent, gestureChange, gestureEnd, gestureStart, getAnchor, getAnchorPercent, getBehavior, getId, getMinimumSize, getPreferredSize, getTextureGLPage, glNeedsFlush, glSetShader, initialize, invalidate, isCached, isGestureEnabled, isInAnimationFrame, isVisible, modelToModel, modelToView, mouseClick, mouseDblClick, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseOut, mouseOver, mouseUp, moveTo, playAnimation, removeBehaviorById, removeBehaviour, removeListener, resetAnimationTime, resetAsButton, resetTransform, rotateTo, scaleTo, scaleXTo, scaleYTo, setAlpha, setAnimationEndCallback, setAnimationImageIndex, setAsButton, setBackgroundImage, setBackgroundImageOffset, setButtonImageIndex, setCachedActor, setChangeFPS, setClip, setDiscardable, setExpired, setFillStyle, setFrameTime, setGestureEnabled, setGLCoords, setGlobalAlpha, setGlobalAnchor, setId, setImageTransformation, setLocation, setMinimumSize, setModelViewMatrix, setOutOfFrameTime, setPaint, setParent, setPosition, setPositionAnchor, setPositionAnchored, setPreferredSize, setPreventLayout, setRotation, setRotationAnchor, setRotationAnchored, setScale, setScaleAnchor, setScaleAnchored, setScreenBounds, setSize, setSpriteIndex, setStrokeStyle, setUV, setVisible, stopCacheAsBitmap, touchEnd, touchMove, touchStart, viewToModel
    @@ -1447,7 +1459,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:04:00 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:18 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.Foundation.UI.StarActor.html b/documentation/jsdoc/symbols/CAAT.Foundation.UI.StarActor.html index 9a8cdaf4..c058d218 100644 --- a/documentation/jsdoc/symbols/CAAT.Foundation.UI.StarActor.html +++ b/documentation/jsdoc/symbols/CAAT.Foundation.UI.StarActor.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -581,7 +593,7 @@

    -
    Fields borrowed from class CAAT.Foundation.ActorContainer:
    activeChildren, addHint, boundingBox, childrenList, layoutInvalidated, layoutManager, pendingChildrenList, runion
    Fields borrowed from class CAAT.Foundation.Actor:
    __super, AABB, alpha, backgroundImage, behaviorList, cached, clip, clipPath, dirty, discardable, duration, expired, fillStyle, frameAlpha, gestureEnabled, glEnabled, height, id, inFrame, invalid, isAA, isGlobalAlpha, lifecycleListenerList, minimumSize, modelViewMatrix, modelViewMatrixI, mouseEnabled, oldX, oldY, parent, pointed, preferredSize, preventLayout, rotationAngle, rotationX, rotationY, scaleAnchor, scaleTX, scaleTY, scaleX, scaleY, size_active, size_total, start_time, strokeStyle, tAnchorX, tAnchorY, time, viewVertices, visible, wdirty, width, worldModelViewMatrix, worldModelViewMatrixI, x, y
    +
    Fields borrowed from class CAAT.Foundation.ActorContainer:
    activeChildren, addHint, boundingBox, childrenList, layoutInvalidated, layoutManager, pendingChildrenList, runion
    Fields borrowed from class CAAT.Foundation.Actor:
    __super, AABB, alpha, backgroundImage, behaviorList, cached, clip, clipPath, dirty, discardable, duration, expired, fillStyle, frameAlpha, gestureEnabled, glEnabled, height, id, inFrame, invalid, isAA, isCachedActor, isGlobalAlpha, lifecycleListenerList, minimumSize, modelViewMatrix, modelViewMatrixI, mouseEnabled, oldX, oldY, parent, pointed, preferredSize, preventLayout, rotationAngle, rotationX, rotationY, scaleAnchor, scaleTX, scaleTY, scaleX, scaleY, size_active, size_total, start_time, strokeStyle, tAnchorX, tAnchorY, time, viewVertices, visible, wdirty, width, worldModelViewMatrix, worldModelViewMatrixI, x, y
    @@ -741,7 +753,7 @@

    -
    Methods borrowed from class CAAT.Foundation.ActorContainer:
    __paintActor, __validateLayout, __validateTree, addChild, addChildAt, addChildDelayed, addChildImmediately, animate, destroy, drawScreenBoundingBox, emptyChildren, endAnimate, findActorAtPosition, findActorById, findChild, getChildAt, getLayout, getNumActiveChildren, getNumChildren, invalidateLayout, paintActor, paintActorGL, recalcSize, removeChild, removeChildAt, removeFirstChild, removeLastChild, setBounds, setLayout, setZOrder
    Methods borrowed from class CAAT.Foundation.Actor:
    __scale1To, addAnimation, addBehavior, addListener, cacheAsBitmap, centerAt, centerOn, contains, create, disableDrag, emptyBehaviorList, enableDrag, enableEvents, fireEvent, gestureChange, gestureEnd, gestureStart, getAnchor, getAnchorPercent, getBehavior, getId, getMinimumSize, getPreferredSize, getTextureGLPage, glNeedsFlush, glSetShader, invalidate, isCached, isGestureEnabled, isInAnimationFrame, isVisible, modelToModel, modelToView, mouseClick, mouseDblClick, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseOut, mouseOver, mouseUp, moveTo, playAnimation, removeBehaviorById, removeBehaviour, removeListener, resetAnimationTime, resetAsButton, resetTransform, rotateTo, scaleTo, scaleXTo, scaleYTo, setAlpha, setAnimationEndCallback, setAnimationImageIndex, setAsButton, setBackgroundImage, setBackgroundImageOffset, setButtonImageIndex, setChangeFPS, setClip, setDiscardable, setExpired, setFillStyle, setFrameTime, setGestureEnabled, setGLCoords, setGlobalAlpha, setGlobalAnchor, setId, setImageTransformation, setLocation, setMinimumSize, setModelViewMatrix, setOutOfFrameTime, setPaint, setParent, setPosition, setPositionAnchor, setPositionAnchored, setPreferredSize, setPreventLayout, setRotation, setRotationAnchor, setRotationAnchored, setScale, setScaleAnchor, setScaleAnchored, setScreenBounds, setSize, setSpriteIndex, setStrokeStyle, setUV, setVisible, stopCacheAsBitmap, touchEnd, touchMove, touchStart, viewToModel
    +
    Methods borrowed from class CAAT.Foundation.ActorContainer:
    __paintActor, __validateLayout, __validateTree, addActor, addActorImmediately, addChild, addChildAt, addChildDelayed, addChildImmediately, animate, destroy, drawScreenBoundingBox, emptyChildren, endAnimate, findActorAtPosition, findActorById, findChild, getChildAt, getLayout, getNumActiveChildren, getNumChildren, invalidateLayout, paintActor, paintActorGL, recalcSize, removeChild, removeChildAt, removeFirstChild, removeLastChild, setBounds, setLayout, setZOrder
    Methods borrowed from class CAAT.Foundation.Actor:
    __scale1To, addAnimation, addBehavior, addListener, cacheAsBitmap, centerAt, centerOn, clean, contains, create, disableDrag, emptyBehaviorList, enableDrag, enableEvents, fireEvent, gestureChange, gestureEnd, gestureStart, getAnchor, getAnchorPercent, getBehavior, getId, getMinimumSize, getPreferredSize, getTextureGLPage, glNeedsFlush, glSetShader, invalidate, isCached, isGestureEnabled, isInAnimationFrame, isVisible, modelToModel, modelToView, mouseClick, mouseDblClick, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseOut, mouseOver, mouseUp, moveTo, playAnimation, removeBehaviorById, removeBehaviour, removeListener, resetAnimationTime, resetAsButton, resetTransform, rotateTo, scaleTo, scaleXTo, scaleYTo, setAlpha, setAnimationEndCallback, setAnimationImageIndex, setAsButton, setBackgroundImage, setBackgroundImageOffset, setButtonImageIndex, setCachedActor, setChangeFPS, setClip, setDiscardable, setExpired, setFillStyle, setFrameTime, setGestureEnabled, setGLCoords, setGlobalAlpha, setGlobalAnchor, setId, setImageTransformation, setLocation, setMinimumSize, setModelViewMatrix, setOutOfFrameTime, setPaint, setParent, setPosition, setPositionAnchor, setPositionAnchored, setPreferredSize, setPreventLayout, setRotation, setRotationAnchor, setRotationAnchored, setScale, setScaleAnchor, setScaleAnchored, setScreenBounds, setSize, setSpriteIndex, setStrokeStyle, setUV, setVisible, stopCacheAsBitmap, touchEnd, touchMove, touchStart, viewToModel
    @@ -1521,7 +1533,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:04:00 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:18 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.Foundation.UI.TextActor.html b/documentation/jsdoc/symbols/CAAT.Foundation.UI.TextActor.html index 8236fa05..0c9b3c2a 100644 --- a/documentation/jsdoc/symbols/CAAT.Foundation.UI.TextActor.html +++ b/documentation/jsdoc/symbols/CAAT.Foundation.UI.TextActor.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -651,7 +663,7 @@

    -
    Fields borrowed from class CAAT.Foundation.Actor:
    __super, AABB, alpha, backgroundImage, behaviorList, cached, clip, clipPath, dirty, discardable, duration, expired, fillStyle, frameAlpha, gestureEnabled, glEnabled, height, id, inFrame, invalid, isAA, isGlobalAlpha, lifecycleListenerList, minimumSize, modelViewMatrix, modelViewMatrixI, mouseEnabled, oldX, oldY, parent, pointed, preferredSize, preventLayout, rotationAngle, rotationX, rotationY, scaleAnchor, scaleTX, scaleTY, scaleX, scaleY, size_active, size_total, start_time, strokeStyle, tAnchorX, tAnchorY, time, viewVertices, visible, wdirty, width, worldModelViewMatrix, worldModelViewMatrixI, x, y
    +
    Fields borrowed from class CAAT.Foundation.Actor:
    __super, AABB, alpha, backgroundImage, behaviorList, cached, clip, clipPath, dirty, discardable, duration, expired, fillStyle, frameAlpha, gestureEnabled, glEnabled, height, id, inFrame, invalid, isAA, isCachedActor, isGlobalAlpha, lifecycleListenerList, minimumSize, modelViewMatrix, modelViewMatrixI, mouseEnabled, oldX, oldY, parent, pointed, preferredSize, preventLayout, rotationAngle, rotationX, rotationY, scaleAnchor, scaleTX, scaleTY, scaleX, scaleY, size_active, size_total, start_time, strokeStyle, tAnchorX, tAnchorY, time, viewVertices, visible, wdirty, width, worldModelViewMatrix, worldModelViewMatrixI, x, y
    @@ -911,7 +923,7 @@

    -
    Methods borrowed from class CAAT.Foundation.Actor:
    __paintActor, __scale1To, __validateLayout, addAnimation, addBehavior, addListener, animate, cacheAsBitmap, centerOn, contains, create, destroy, disableDrag, drawScreenBoundingBox, emptyBehaviorList, enableDrag, enableEvents, endAnimate, findActorAtPosition, findActorById, fireEvent, gestureChange, gestureEnd, gestureStart, getAnchor, getAnchorPercent, getBehavior, getId, getMinimumSize, getPreferredSize, getTextureGLPage, glNeedsFlush, glSetShader, initialize, invalidate, invalidateLayout, isCached, isGestureEnabled, isInAnimationFrame, isVisible, modelToModel, modelToView, mouseClick, mouseDblClick, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseOut, mouseOver, mouseUp, moveTo, paintActor, paintActorGL, playAnimation, removeBehaviorById, removeBehaviour, removeListener, resetAnimationTime, resetAsButton, resetTransform, rotateTo, scaleTo, scaleXTo, scaleYTo, setAlpha, setAnimationEndCallback, setAnimationImageIndex, setAsButton, setBackgroundImage, setBackgroundImageOffset, setButtonImageIndex, setChangeFPS, setClip, setDiscardable, setExpired, setFillStyle, setFrameTime, setGestureEnabled, setGLCoords, setGlobalAlpha, setGlobalAnchor, setId, setImageTransformation, setMinimumSize, setModelViewMatrix, setOutOfFrameTime, setPaint, setParent, setPositionAnchor, setPositionAnchored, setPreferredSize, setPreventLayout, setRotation, setRotationAnchor, setRotationAnchored, setScale, setScaleAnchor, setScaleAnchored, setScreenBounds, setSpriteIndex, setStrokeStyle, setUV, setVisible, stopCacheAsBitmap, touchEnd, touchMove, touchStart, viewToModel
    +
    Methods borrowed from class CAAT.Foundation.Actor:
    __paintActor, __scale1To, __validateLayout, addAnimation, addBehavior, addListener, animate, cacheAsBitmap, centerOn, clean, contains, create, destroy, disableDrag, drawScreenBoundingBox, emptyBehaviorList, enableDrag, enableEvents, endAnimate, findActorAtPosition, findActorById, fireEvent, gestureChange, gestureEnd, gestureStart, getAnchor, getAnchorPercent, getBehavior, getId, getMinimumSize, getPreferredSize, getTextureGLPage, glNeedsFlush, glSetShader, initialize, invalidate, invalidateLayout, isCached, isGestureEnabled, isInAnimationFrame, isVisible, modelToModel, modelToView, mouseClick, mouseDblClick, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseOut, mouseOver, mouseUp, moveTo, paintActor, paintActorGL, playAnimation, removeBehaviorById, removeBehaviour, removeListener, resetAnimationTime, resetAsButton, resetTransform, rotateTo, scaleTo, scaleXTo, scaleYTo, setAlpha, setAnimationEndCallback, setAnimationImageIndex, setAsButton, setBackgroundImage, setBackgroundImageOffset, setButtonImageIndex, setCachedActor, setChangeFPS, setClip, setDiscardable, setExpired, setFillStyle, setFrameTime, setGestureEnabled, setGLCoords, setGlobalAlpha, setGlobalAnchor, setId, setImageTransformation, setMinimumSize, setModelViewMatrix, setOutOfFrameTime, setPaint, setParent, setPositionAnchor, setPositionAnchored, setPreferredSize, setPreventLayout, setRotation, setRotationAnchor, setRotationAnchored, setScale, setScaleAnchor, setScaleAnchored, setScreenBounds, setSpriteIndex, setStrokeStyle, setUV, setVisible, stopCacheAsBitmap, touchEnd, touchMove, touchStart, viewToModel
    @@ -2368,7 +2380,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:04:00 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:19 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.Foundation.UI.html b/documentation/jsdoc/symbols/CAAT.Foundation.UI.html index 8efeece6..4001629d 100644 --- a/documentation/jsdoc/symbols/CAAT.Foundation.UI.html +++ b/documentation/jsdoc/symbols/CAAT.Foundation.UI.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -528,7 +540,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:03:59 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:18 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.Foundation.html b/documentation/jsdoc/symbols/CAAT.Foundation.html index efdef7e0..d0baba69 100644 --- a/documentation/jsdoc/symbols/CAAT.Foundation.html +++ b/documentation/jsdoc/symbols/CAAT.Foundation.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -528,7 +540,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:03:54 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:16 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.KEYS.html b/documentation/jsdoc/symbols/CAAT.KEYS.html index 9ebd5dd6..9d8708c8 100644 --- a/documentation/jsdoc/symbols/CAAT.KEYS.html +++ b/documentation/jsdoc/symbols/CAAT.KEYS.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -3298,7 +3310,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:04:00 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:19 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.KEY_MODIFIERS.html b/documentation/jsdoc/symbols/CAAT.KEY_MODIFIERS.html index a00ebfad..bf25d2bf 100644 --- a/documentation/jsdoc/symbols/CAAT.KEY_MODIFIERS.html +++ b/documentation/jsdoc/symbols/CAAT.KEY_MODIFIERS.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -642,7 +654,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:04:00 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:19 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.Math.Bezier.html b/documentation/jsdoc/symbols/CAAT.Math.Bezier.html index 5e91765c..51af9e0c 100644 --- a/documentation/jsdoc/symbols/CAAT.Math.Bezier.html +++ b/documentation/jsdoc/symbols/CAAT.Math.Bezier.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -1221,7 +1233,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:04:00 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:19 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.Math.CatmullRom.html b/documentation/jsdoc/symbols/CAAT.Math.CatmullRom.html index 3ec6b2b2..ad3721df 100644 --- a/documentation/jsdoc/symbols/CAAT.Math.CatmullRom.html +++ b/documentation/jsdoc/symbols/CAAT.Math.CatmullRom.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -847,7 +859,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:04:00 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:19 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.Math.Curve.html b/documentation/jsdoc/symbols/CAAT.Math.Curve.html index add1af3d..268489a4 100644 --- a/documentation/jsdoc/symbols/CAAT.Math.Curve.html +++ b/documentation/jsdoc/symbols/CAAT.Math.Curve.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -1270,7 +1282,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:04:00 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:19 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.Math.Dimension.html b/documentation/jsdoc/symbols/CAAT.Math.Dimension.html index adb1fc75..157422f5 100644 --- a/documentation/jsdoc/symbols/CAAT.Math.Dimension.html +++ b/documentation/jsdoc/symbols/CAAT.Math.Dimension.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -684,7 +696,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:04:00 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:19 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.Math.Matrix.html b/documentation/jsdoc/symbols/CAAT.Math.Matrix.html index 3583457e..2cf1057b 100644 --- a/documentation/jsdoc/symbols/CAAT.Math.Matrix.html +++ b/documentation/jsdoc/symbols/CAAT.Math.Matrix.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -1586,7 +1598,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:04:00 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:19 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.Math.Matrix3.html b/documentation/jsdoc/symbols/CAAT.Math.Matrix3.html index 573122e7..32d65479 100644 --- a/documentation/jsdoc/symbols/CAAT.Math.Matrix3.html +++ b/documentation/jsdoc/symbols/CAAT.Math.Matrix3.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -1876,7 +1888,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:04:01 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:19 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.Math.Point.html b/documentation/jsdoc/symbols/CAAT.Math.Point.html index ac369ad3..9f6734ff 100644 --- a/documentation/jsdoc/symbols/CAAT.Math.Point.html +++ b/documentation/jsdoc/symbols/CAAT.Math.Point.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -1564,7 +1576,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:04:01 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:19 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.Math.Rectangle.html b/documentation/jsdoc/symbols/CAAT.Math.Rectangle.html index 8f18548f..896030f4 100644 --- a/documentation/jsdoc/symbols/CAAT.Math.Rectangle.html +++ b/documentation/jsdoc/symbols/CAAT.Math.Rectangle.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -1377,7 +1389,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:04:01 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:19 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.Math.html b/documentation/jsdoc/symbols/CAAT.Math.html index 4c504a6c..85e041f4 100644 --- a/documentation/jsdoc/symbols/CAAT.Math.html +++ b/documentation/jsdoc/symbols/CAAT.Math.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -523,7 +535,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:04:00 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:19 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.Module.Audio.AudioManager.html b/documentation/jsdoc/symbols/CAAT.Module.Audio.AudioManager.html index d2bc84b2..a725dc33 100644 --- a/documentation/jsdoc/symbols/CAAT.Module.Audio.AudioManager.html +++ b/documentation/jsdoc/symbols/CAAT.Module.Audio.AudioManager.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -497,9 +509,9 @@

      -
    Audio formats.
    +
    available formats for audio elements.
    @@ -507,9 +519,9 @@

      -
    Some browser info needed to know whether we´re in FF so we can fix the loop bug.
    +
    Audio formats.
    @@ -594,6 +606,15 @@

    + + <private>   + + +
    + + + <private>   @@ -603,6 +624,15 @@

    + + <private>   + + +
    + + +   @@ -730,6 +760,15 @@

    + +   + + +
    + + +   @@ -833,15 +872,16 @@


    - +
    - audioTypes + audioFormatExtensions
    - Audio formats. + available formats for audio elements. +the system will load audio files with the extensions in this preferred order.
    @@ -855,15 +895,15 @@


    - +
    - browserInfo + audioTypes
    - Some browser info needed to know whether we´re in FF so we can fix the loop bug. + Audio formats.
    @@ -1017,6 +1057,42 @@

    Method Detail

    + +
    <private> + + + __getAudioUrl(url) + +
    +
    + + + +
    + + + + +
    +
    Parameters:
    + +
    + url + +
    +
    + +
    + + + + + + + + +
    +
    <private> @@ -1040,6 +1116,31 @@

    +
    + + +
    <private> + + + __setCurrentAudioFormatExtension() + +
    +
    + + + +
    + + + + + + + + + + +
    @@ -1681,6 +1782,42 @@

    +
    + + +
    + + + setAudioFormatExtensions(formats) + +
    +
    + + + +
    + + + + +
    +
    Parameters:
    + +
    + formats + +
    +
    + +
    + + + + + + + +
    @@ -1841,7 +1978,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:04:01 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:19 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.Module.Audio.html b/documentation/jsdoc/symbols/CAAT.Module.Audio.html index 51ad494d..3f46bad8 100644 --- a/documentation/jsdoc/symbols/CAAT.Module.Audio.html +++ b/documentation/jsdoc/symbols/CAAT.Module.Audio.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -523,7 +535,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:04:01 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:19 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.Module.CircleManager.PackedCircle.html b/documentation/jsdoc/symbols/CAAT.Module.CircleManager.PackedCircle.html index 32c8e850..2e7df24f 100644 --- a/documentation/jsdoc/symbols/CAAT.Module.CircleManager.PackedCircle.html +++ b/documentation/jsdoc/symbols/CAAT.Module.CircleManager.PackedCircle.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -1670,7 +1682,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:04:01 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:19 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.Module.CircleManager.PackedCircleManager.html b/documentation/jsdoc/symbols/CAAT.Module.CircleManager.PackedCircleManager.html index d6a5a031..15d0bcd6 100644 --- a/documentation/jsdoc/symbols/CAAT.Module.CircleManager.PackedCircleManager.html +++ b/documentation/jsdoc/symbols/CAAT.Module.CircleManager.PackedCircleManager.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -1379,7 +1391,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:04:01 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:19 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.Module.CircleManager.html b/documentation/jsdoc/symbols/CAAT.Module.CircleManager.html index 311db92c..6e23dc8c 100644 --- a/documentation/jsdoc/symbols/CAAT.Module.CircleManager.html +++ b/documentation/jsdoc/symbols/CAAT.Module.CircleManager.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -523,7 +535,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:04:01 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:19 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.Module.Collision.QuadTree.html b/documentation/jsdoc/symbols/CAAT.Module.Collision.QuadTree.html index 00b78214..0b063614 100644 --- a/documentation/jsdoc/symbols/CAAT.Module.Collision.QuadTree.html +++ b/documentation/jsdoc/symbols/CAAT.Module.Collision.QuadTree.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -811,7 +823,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:04:01 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:19 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.Module.Collision.SpatialHash.html b/documentation/jsdoc/symbols/CAAT.Module.Collision.SpatialHash.html index 7eb1ad26..e702cfc9 100644 --- a/documentation/jsdoc/symbols/CAAT.Module.Collision.SpatialHash.html +++ b/documentation/jsdoc/symbols/CAAT.Module.Collision.SpatialHash.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -1163,7 +1175,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:04:01 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:19 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.Module.Collision.html b/documentation/jsdoc/symbols/CAAT.Module.Collision.html index 1e50050f..9ad203a9 100644 --- a/documentation/jsdoc/symbols/CAAT.Module.Collision.html +++ b/documentation/jsdoc/symbols/CAAT.Module.Collision.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -523,7 +535,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:04:01 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:19 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.Module.ColorUtil.Color.html b/documentation/jsdoc/symbols/CAAT.Module.ColorUtil.Color.html index 5af841d7..a6dcabc3 100644 --- a/documentation/jsdoc/symbols/CAAT.Module.ColorUtil.Color.html +++ b/documentation/jsdoc/symbols/CAAT.Module.ColorUtil.Color.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -868,7 +880,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:04:01 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:19 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.Module.ColorUtil.html b/documentation/jsdoc/symbols/CAAT.Module.ColorUtil.html index 4891ae45..7dfbba61 100644 --- a/documentation/jsdoc/symbols/CAAT.Module.ColorUtil.html +++ b/documentation/jsdoc/symbols/CAAT.Module.ColorUtil.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -528,7 +540,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:04:01 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:19 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.Module.Debug.Debug.html b/documentation/jsdoc/symbols/CAAT.Module.Debug.Debug.html index b9cc6ef9..2dc76ce0 100644 --- a/documentation/jsdoc/symbols/CAAT.Module.Debug.Debug.html +++ b/documentation/jsdoc/symbols/CAAT.Module.Debug.Debug.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -732,7 +744,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:04:01 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:19 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.Module.Debug.html b/documentation/jsdoc/symbols/CAAT.Module.Debug.html index 2c6dea5c..f72f052d 100644 --- a/documentation/jsdoc/symbols/CAAT.Module.Debug.html +++ b/documentation/jsdoc/symbols/CAAT.Module.Debug.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -523,7 +535,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:04:01 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:19 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.Module.Font.Font.html b/documentation/jsdoc/symbols/CAAT.Module.Font.Font.html index b91e3bd0..811d546d 100644 --- a/documentation/jsdoc/symbols/CAAT.Module.Font.Font.html +++ b/documentation/jsdoc/symbols/CAAT.Module.Font.Font.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -1468,7 +1480,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:04:02 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:19 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.Module.Font.html b/documentation/jsdoc/symbols/CAAT.Module.Font.html index 6709f73b..b345b6a7 100644 --- a/documentation/jsdoc/symbols/CAAT.Module.Font.html +++ b/documentation/jsdoc/symbols/CAAT.Module.Font.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -523,7 +535,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:04:01 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:19 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.Module.Image.ImageProcessor.IMBumpMapping.html b/documentation/jsdoc/symbols/CAAT.Module.Image.ImageProcessor.IMBumpMapping.html index 9bbdc9ff..93aa4247 100644 --- a/documentation/jsdoc/symbols/CAAT.Module.Image.ImageProcessor.IMBumpMapping.html +++ b/documentation/jsdoc/symbols/CAAT.Module.Image.ImageProcessor.IMBumpMapping.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -957,7 +969,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:04:02 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:19 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.Module.Image.ImageProcessor.IMPlasma.html b/documentation/jsdoc/symbols/CAAT.Module.Image.ImageProcessor.IMPlasma.html index e7f6505b..e8227cc2 100644 --- a/documentation/jsdoc/symbols/CAAT.Module.Image.ImageProcessor.IMPlasma.html +++ b/documentation/jsdoc/symbols/CAAT.Module.Image.ImageProcessor.IMPlasma.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -714,7 +726,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:04:02 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:19 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.Module.Image.ImageProcessor.IMRotoZoom.html b/documentation/jsdoc/symbols/CAAT.Module.Image.ImageProcessor.IMRotoZoom.html index c4243497..211e96e5 100644 --- a/documentation/jsdoc/symbols/CAAT.Module.Image.ImageProcessor.IMRotoZoom.html +++ b/documentation/jsdoc/symbols/CAAT.Module.Image.ImageProcessor.IMRotoZoom.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -760,7 +772,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:04:02 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:19 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.Module.Image.ImageProcessor.ImageProcessor.html b/documentation/jsdoc/symbols/CAAT.Module.Image.ImageProcessor.ImageProcessor.html index 2bbcd2bc..8b5a73d4 100644 --- a/documentation/jsdoc/symbols/CAAT.Module.Image.ImageProcessor.ImageProcessor.html +++ b/documentation/jsdoc/symbols/CAAT.Module.Image.ImageProcessor.ImageProcessor.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -1095,7 +1107,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:04:02 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:19 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.Module.Image.ImageProcessor.html b/documentation/jsdoc/symbols/CAAT.Module.Image.ImageProcessor.html index 2e40f9ba..95a269fb 100644 --- a/documentation/jsdoc/symbols/CAAT.Module.Image.ImageProcessor.html +++ b/documentation/jsdoc/symbols/CAAT.Module.Image.ImageProcessor.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -523,7 +535,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:04:02 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:19 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.Module.Image.ImageUtil.html b/documentation/jsdoc/symbols/CAAT.Module.Image.ImageUtil.html index c07f2a1d..ec45f7f0 100644 --- a/documentation/jsdoc/symbols/CAAT.Module.Image.ImageUtil.html +++ b/documentation/jsdoc/symbols/CAAT.Module.Image.ImageUtil.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -787,7 +799,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:04:02 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:19 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.Module.Image.html b/documentation/jsdoc/symbols/CAAT.Module.Image.html index 6a6eca31..10a88b59 100644 --- a/documentation/jsdoc/symbols/CAAT.Module.Image.html +++ b/documentation/jsdoc/symbols/CAAT.Module.Image.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -528,7 +540,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:04:02 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:19 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.Module.Locale.ResourceBundle.html b/documentation/jsdoc/symbols/CAAT.Module.Locale.ResourceBundle.html index 6365e1d6..a3daeddc 100644 --- a/documentation/jsdoc/symbols/CAAT.Module.Locale.ResourceBundle.html +++ b/documentation/jsdoc/symbols/CAAT.Module.Locale.ResourceBundle.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -1008,7 +1020,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:04:02 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:19 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.Module.Locale.html b/documentation/jsdoc/symbols/CAAT.Module.Locale.html index 7dfab9ca..9e7cf55c 100644 --- a/documentation/jsdoc/symbols/CAAT.Module.Locale.html +++ b/documentation/jsdoc/symbols/CAAT.Module.Locale.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -523,7 +535,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:04:02 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:19 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.Module.Preloader.ImagePreloader.html b/documentation/jsdoc/symbols/CAAT.Module.Preloader.ImagePreloader.html index 25af7ad7..355069cc 100644 --- a/documentation/jsdoc/symbols/CAAT.Module.Preloader.ImagePreloader.html +++ b/documentation/jsdoc/symbols/CAAT.Module.Preloader.ImagePreloader.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -759,7 +771,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:04:02 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:19 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.Module.Preloader.Preloader.html b/documentation/jsdoc/symbols/CAAT.Module.Preloader.Preloader.html index a5f8ea6f..57c00fea 100644 --- a/documentation/jsdoc/symbols/CAAT.Module.Preloader.Preloader.html +++ b/documentation/jsdoc/symbols/CAAT.Module.Preloader.Preloader.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -618,6 +630,15 @@

    + +   + +
    setBaseURL(base) +
    +
    + + + @@ -1013,6 +1034,42 @@

    +
    + + +
    + + + setBaseURL(base) + +
    +
    + + + +
    + + + + +
    +
    Parameters:
    + +
    + base + +
    +
    + +
    + + + + + + + + @@ -1027,7 +1084,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:04:02 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:19 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.Module.Preloader.html b/documentation/jsdoc/symbols/CAAT.Module.Preloader.html index 056208e6..318f650b 100644 --- a/documentation/jsdoc/symbols/CAAT.Module.Preloader.html +++ b/documentation/jsdoc/symbols/CAAT.Module.Preloader.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -523,7 +535,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:04:02 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:19 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.Module.Runtime.BrowserInfo.html b/documentation/jsdoc/symbols/CAAT.Module.Runtime.BrowserInfo.html index fa31ab70..93041561 100644 --- a/documentation/jsdoc/symbols/CAAT.Module.Runtime.BrowserInfo.html +++ b/documentation/jsdoc/symbols/CAAT.Module.Runtime.BrowserInfo.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -636,7 +648,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:04:02 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:19 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.Module.Runtime.html b/documentation/jsdoc/symbols/CAAT.Module.Runtime.html index c5f40910..f3788e5d 100644 --- a/documentation/jsdoc/symbols/CAAT.Module.Runtime.html +++ b/documentation/jsdoc/symbols/CAAT.Module.Runtime.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -528,7 +540,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:04:02 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:19 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.Module.Skeleton#SkeletonActor.html b/documentation/jsdoc/symbols/CAAT.Module.Skeleton#SkeletonActor.html new file mode 100644 index 00000000..9162c6b6 --- /dev/null +++ b/documentation/jsdoc/symbols/CAAT.Module.Skeleton#SkeletonActor.html @@ -0,0 +1,541 @@ + + + + + + + JsDoc Reference - CAAT.Module.Skeleton#SkeletonActor + + + + + + + + + + + +
    + + +
    +

    Classes

    + +
    + +
    + +
    + +

    + + Class CAAT.Module.Skeleton#SkeletonActor +

    + + +

    + + + + + + +
    Defined in: SkeletonActor.js. + +

    + + + + + + + + + + + + + + + + + +
    Class Summary
    Constructor AttributesConstructor Name and Description
      + +
    +
    + + + + + + + + + + + + +
    +
    + Class Detail +
    + +
    + CAAT.Module.Skeleton#SkeletonActor() +
    + +
    + + +
    + + + + + + + + + + + + +
    + + + + + + + + + + + +
    +
    + + + +
    + + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:19 GMT-0700 (PDT) +
    + + diff --git a/documentation/jsdoc/symbols/CAAT.Module.Skeleton.Bone.html b/documentation/jsdoc/symbols/CAAT.Module.Skeleton.Bone.html new file mode 100644 index 00000000..1a9a2149 --- /dev/null +++ b/documentation/jsdoc/symbols/CAAT.Module.Skeleton.Bone.html @@ -0,0 +1,2217 @@ + + + + + + + JsDoc Reference - CAAT.Module.Skeleton.Bone + + + + + + + + + + + +
    + + +
    +

    Classes

    + +
    + +
    + +
    + +

    + + Class CAAT.Module.Skeleton.Bone +

    + + +

    + + + + + + +
    Defined in: Bone.js. + +

    + + + + + + + + + + + + + + + + + +
    Class Summary
    Constructor AttributesConstructor Name and Description
      + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Field Summary
    Field AttributesField Name and Description
      +
    + children +
    +
    +
      + +
    +
      + +
    +
      + +
    +
      + +
    +
      + +
    +
      +
    + matrix +
    +
    +
      +
    + parent +
    +
    +
      + +
    Bone rotation angle
    +
      +
    + size +
    +
    Bone size.
    +
      +
    + wmatrix +
    +
    +
      +
    + x +
    +
    Bone x position relative parent
    +
      +
    + y +
    +
    Bone y position relative parent
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Method Summary
    Method AttributesMethod Name and Description
    <private>   + +
    +
    <private>   + +
    +
    <private>   +
    __init(id) +
    +
    +
    <private>   +
    __noValue(keyframes) +
    +
    +
    <private>   +
    __setInterpolator(behavior, curve) +
    +
    +
    <private>   + +
    +
    <private>   +
    __setParent(parent) +
    +
    +
      +
    addBone(bone) +
    +
    +
      +
    addRotationKeyframe(name, angleStart, angleEnd, timeStart, timeEnd, curve) +
    +
    +
      +
    addScaleKeyframe(name, scaleX, endScaleX, scaleY, endScaleY, timeStart, timeEnd, curve) +
    +
    +
      +
    addTranslationKeyframe(name, startX, startY, endX, endY, timeStart, timeEnd, curve) +
    +
    +
      +
    apply(time, animationTime) +
    +
    +
      + +
    +
      + +
    +
      + +
    +
      +
    paint(actorMatrix, ctx) +
    +
    +
      +
    setAnimation(name) +
    +
    +
      + +
    +
      +
    setPosition(x, y) +
    +
    +
      +
    setRotateTransform(angle, anchorX, anchorY) +
    +
    default anchor values are for spine tool.
    +
      +
    setScaleTransform(sx, sy, anchorX, anchorY) +
    +
    +
      +
    setSize(s) +
    +
    +
      + +
    +
    + + + + + + + + + +
    +
    + Class Detail +
    + +
    + CAAT.Module.Skeleton.Bone() +
    + +
    + + +
    + + + + + + + + + + + + +
    + + + + +
    + Field Detail +
    + + +
    + + {Array.} + children + +
    +
    + + + +
    + + + + + + + + +
    + + +
    + + {object} + keyframesByAnimation + +
    +
    + + + +
    + + + + + + + + +
    + + +
    + + {CAAT.Behavior.ContainerBehavior} + keyframesRotate + +
    +
    + + + +
    + + + + + + + + +
    + + +
    + + {CAAT.Behavior.ContainerBehavior} + keyframesScale + +
    +
    + + + +
    + + + + + + + + +
    + + +
    + + {CAAT.Behavior.ContainerBehavior} + keyframesTranslate + +
    +
    + + + +
    + + + + + + + + +
    + + +
    + + {CAAT.PathUtil.Path} + keyframesTranslatePath + +
    +
    + + + +
    + + + + + + + + +
    + + +
    + + {CAAT.Math.Matrix} + matrix + +
    +
    + + + +
    + + + + + + + + +
    + + +
    + + {CAAT.Skeleton.Bone} + parent + +
    +
    + + + +
    + + + + + + + + +
    + + +
    + + + rotationAngle + +
    +
    + Bone rotation angle + + +
    + + + + + + + + +
    + + +
    + + {number} + size + +
    +
    + Bone size. + + +
    + + + + + + + + +
    + + +
    + + {CAAT.Math.Matrix} + wmatrix + +
    +
    + + + +
    + + + + + + + + +
    + + +
    + + {number} + x + +
    +
    + Bone x position relative parent + + +
    + + + + + + + + +
    + + +
    + + + y + +
    +
    + Bone y position relative parent + + +
    + + + + + + + + + + + + + + +
    + Method Detail +
    + + +
    <private> + + + __createAnimation(name) + +
    +
    + + + +
    + + + + +
    +
    Parameters:
    + +
    + name + +
    +
    + +
    + + + + + + + + +
    + + +
    <private> + + + __getAnimation(name) + +
    +
    + + + +
    + + + + +
    +
    Parameters:
    + +
    + name + +
    +
    + +
    + + + + + + + + +
    + + +
    <private> + + + __init(id) + +
    +
    + + + +
    + + + + +
    +
    Parameters:
    + +
    + id + +
    +
    + +
    + + + + + + + + +
    + + +
    <private> + + + __noValue(keyframes) + +
    +
    + + + +
    + + + + +
    +
    Parameters:
    + +
    + keyframes + +
    +
    + +
    + + + + + + + + +
    + + +
    <private> + + + __setInterpolator(behavior, curve) + +
    +
    + + + +
    + + + + +
    +
    Parameters:
    + +
    + behavior + +
    +
    + +
    + curve + +
    +
    + +
    + + + + + + + + +
    + + +
    <private> + + + __setModelViewMatrix() + +
    +
    + + + +
    + + + + + + + + + + + +
    + + +
    <private> + + {*} + __setParent(parent) + +
    +
    + + + +
    + + + + +
    +
    Parameters:
    + +
    + parent + +
    +
    {CAAT.Skeleton.Bone}
    + +
    + + + + + +
    +
    Returns:
    + +
    {*}
    + +
    + + + + +
    + + +
    + + + addBone(bone) + +
    +
    + + + +
    + + + + +
    +
    Parameters:
    + +
    + bone + +
    +
    + +
    + + + + + + + + +
    + + +
    + + + addRotationKeyframe(name, angleStart, angleEnd, timeStart, timeEnd, curve) + +
    +
    + + + +
    + + + + +
    +
    Parameters:
    + +
    + name + +
    +
    {string} keyframe animation name
    + +
    + angleStart + +
    +
    {number} rotation start angle
    + +
    + angleEnd + +
    +
    {number} rotation end angle
    + +
    + timeStart + +
    +
    {number} keyframe start time
    + +
    + timeEnd + +
    +
    {number} keyframe end time
    + +
    + curve + +
    +
    {Array.=} 4 numbers definint a quadric bezier info. two first points + assumed to be 0,0.
    + +
    + + + + + + + + +
    + + +
    + + + addScaleKeyframe(name, scaleX, endScaleX, scaleY, endScaleY, timeStart, timeEnd, curve) + +
    +
    + + + +
    + + + + +
    +
    Parameters:
    + +
    + name + +
    +
    + +
    + scaleX + +
    +
    + +
    + endScaleX + +
    +
    + +
    + scaleY + +
    +
    + +
    + endScaleY + +
    +
    + +
    + timeStart + +
    +
    + +
    + timeEnd + +
    +
    + +
    + curve + +
    +
    + +
    + + + + + + + + +
    + + +
    + + + addTranslationKeyframe(name, startX, startY, endX, endY, timeStart, timeEnd, curve) + +
    +
    + + + +
    + + + + +
    +
    Parameters:
    + +
    + name + +
    +
    + +
    + startX + +
    +
    + +
    + startY + +
    +
    + +
    + endX + +
    +
    + +
    + endY + +
    +
    + +
    + timeStart + +
    +
    + +
    + timeEnd + +
    +
    + +
    + curve + +
    +
    + +
    + + + + + + + + +
    + + +
    + + + apply(time, animationTime) + +
    +
    + + + +
    + + + + +
    +
    Parameters:
    + +
    + time + +
    +
    {number}
    + +
    + animationTime + +
    +
    + +
    + + + + + + + + +
    + + +
    + + + endRotationKeyframes(name) + +
    +
    + + + +
    + + + + +
    +
    Parameters:
    + +
    + name + +
    +
    + +
    + + + + + + + + +
    + + +
    + + + endScaleKeyframes(name) + +
    +
    + + + +
    + + + + +
    +
    Parameters:
    + +
    + name + +
    +
    + +
    + + + + + + + + +
    + + +
    + + + endTranslationKeyframes(name) + +
    +
    + + + +
    + + + + +
    +
    Parameters:
    + +
    + name + +
    +
    + +
    + + + + + + + + +
    + + +
    + + + paint(actorMatrix, ctx) + +
    +
    + + + +
    + + + + +
    +
    Parameters:
    + +
    + actorMatrix + +
    +
    + +
    + ctx + +
    +
    + +
    + + + + + + + + +
    + + +
    + + + setAnimation(name) + +
    +
    + + + +
    + + + + +
    +
    Parameters:
    + +
    + name + +
    +
    + +
    + + + + + + + + +
    + + +
    + + + setBehaviorApplicationTime(t) + +
    +
    + + + +
    + + + + +
    +
    Parameters:
    + +
    + t + +
    +
    + +
    + + + + + + + + +
    + + +
    + + + setPosition(x, y) + +
    +
    + + + +
    + + + + +
    +
    Parameters:
    + +
    + x + +
    +
    + +
    + y + +
    +
    + +
    + + + + + + + + +
    + + +
    + + {*} + setRotateTransform(angle, anchorX, anchorY) + +
    +
    + default anchor values are for spine tool. + + +
    + + + + +
    +
    Parameters:
    + +
    + angle + +
    +
    {number}
    + +
    + anchorX + +
    +
    {number=}
    + +
    + anchorY + +
    +
    {number=}
    + +
    + + + + + +
    +
    Returns:
    + +
    {*}
    + +
    + + + + +
    + + +
    + + {*} + setScaleTransform(sx, sy, anchorX, anchorY) + +
    +
    + + + +
    + + + + +
    +
    Parameters:
    + +
    + sx + +
    +
    {number}
    + +
    + sy + +
    +
    {number}
    + +
    + anchorX + +
    +
    {number=} anchorX: .5 by default
    + +
    + anchorY + +
    +
    {number=} anchorY. .5 by default
    + +
    + + + + + +
    +
    Returns:
    + +
    {*}
    + +
    + + + + +
    + + +
    + + + setSize(s) + +
    +
    + + + +
    + + + + +
    +
    Parameters:
    + +
    + s + +
    +
    + +
    + + + + + + + + +
    + + +
    + + + transformContext(ctx) + +
    +
    + + + +
    + + + + +
    +
    Parameters:
    + +
    + ctx + +
    +
    + +
    + + + + + + + + + + + + + + + +
    +
    + + + +
    + + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:19 GMT-0700 (PDT) +
    + + diff --git a/documentation/jsdoc/symbols/CAAT.Module.Skeleton.BoneActor.html b/documentation/jsdoc/symbols/CAAT.Module.Skeleton.BoneActor.html new file mode 100644 index 00000000..30e535e3 --- /dev/null +++ b/documentation/jsdoc/symbols/CAAT.Module.Skeleton.BoneActor.html @@ -0,0 +1,1286 @@ + + + + + + + JsDoc Reference - CAAT.Module.Skeleton.BoneActor + + + + + + + + + + + +
    + + +
    +

    Classes

    + +
    + +
    + +
    + +

    + + Class CAAT.Module.Skeleton.BoneActor +

    + + +

    + + + + + + +
    Defined in: BoneActor.js. + +

    + + + + + + + + + + + + + + + + + +
    Class Summary
    Constructor AttributesConstructor Name and Description
      + +
    +
    + + + + + + + + + + + + + + + + + + + + + + +
    Field Summary
    Field AttributesField Name and Description
      + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Method Summary
    Method AttributesMethod Name and Description
    <private>   + +
    +
    <private>   +
    __init() +
    +
    +
    <private>   + +
    +
      +
    addAttachment(id, normalized_x, normalized_y, callback) +
    +
    +
      + +
    +
      +
    addSkinDataKeyframe(name, start, duration) +
    +
    +
      + +
    +
      + +
    +
      + +
    +
      +
    paint(ctx, time) +
    +
    +
      +
    prepareAABB(time) +
    +
    +
      +
    setBone(bone) +
    +
    +
      + +
    +
      + +
    +
      + +
    +
    + + + + + + + + + +
    +
    + Class Detail +
    + +
    + CAAT.Module.Skeleton.BoneActor() +
    + +
    + + +
    + + + + + + + + + + + + +
    + + + + +
    + Field Detail +
    + + +
    + + + attachments + +
    +
    + + + +
    + + + + + + + + + + + + + + +
    + Method Detail +
    + + +
    <private> + + + __getCurrentSkinInfo(time) + +
    +
    + + + +
    + + + + +
    +
    Parameters:
    + +
    + time + +
    +
    + +
    + + + + + + + + +
    + + +
    <private> + + + __init() + +
    +
    + + + +
    + + + + + + + + + + + +
    + + +
    <private> + + + __setupAttachments() + +
    +
    + + + +
    + + + + + + + + + + + +
    + + +
    + + + addAttachment(id, normalized_x, normalized_y, callback) + +
    +
    + + + +
    + + + + +
    +
    Parameters:
    + +
    + id + +
    +
    + +
    + normalized_x + +
    +
    + +
    + normalized_y + +
    +
    + +
    + callback + +
    +
    + +
    + + + + + + + + +
    + + +
    + + + addAttachmentListener(al) + +
    +
    + + + +
    + + + + +
    +
    Parameters:
    + +
    + al + +
    +
    + +
    + + + + + + + + +
    + + +
    + + + addSkinDataKeyframe(name, start, duration) + +
    +
    + + + +
    + + + + +
    +
    Parameters:
    + +
    + name + +
    +
    + +
    + start + +
    +
    + +
    + duration + +
    +
    + +
    + + + + + + + + +
    + + +
    + + + addSkinInfo(si) + +
    +
    + + + +
    + + + + +
    +
    Parameters:
    + +
    + si + +
    +
    + +
    + + + + + + + + +
    + + +
    + + + emptySkinDataKeyframe() + +
    +
    + + + +
    + + + + + + + + + + + +
    + + +
    + + + getAttachment(id) + +
    +
    + + + +
    + + + + +
    +
    Parameters:
    + +
    + id + +
    +
    + +
    + + + + + + + + +
    + + +
    + + + paint(ctx, time) + +
    +
    + + + +
    + + + + +
    +
    Parameters:
    + +
    + ctx + +
    +
    + +
    + time + +
    +
    + +
    + + + + + + + + +
    + + +
    + + + prepareAABB(time) + +
    +
    + + + +
    + + + + +
    +
    Parameters:
    + +
    + time + +
    +
    + +
    + + + + + + + + +
    + + +
    + + + setBone(bone) + +
    +
    + + + +
    + + + + +
    +
    Parameters:
    + +
    + bone + +
    +
    + +
    + + + + + + + + +
    + + +
    + + + setDefaultSkinInfoByName(name) + +
    +
    + + + +
    + + + + +
    +
    Parameters:
    + +
    + name + +
    +
    + +
    + + + + + + + + +
    + + +
    + + + setModelViewMatrix() + +
    +
    + + + +
    + + + + + + + + + + + +
    + + +
    + + + setupAnimation(time) + +
    +
    + + + +
    + + + + +
    +
    Parameters:
    + +
    + time + +
    +
    + +
    + + + + + + + + + + + + + + + +
    +
    + + + +
    + + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:19 GMT-0700 (PDT) +
    + + diff --git a/documentation/jsdoc/symbols/CAAT.Module.Skeleton.Skeleton.html b/documentation/jsdoc/symbols/CAAT.Module.Skeleton.Skeleton.html new file mode 100644 index 00000000..26ff3c74 --- /dev/null +++ b/documentation/jsdoc/symbols/CAAT.Module.Skeleton.Skeleton.html @@ -0,0 +1,1468 @@ + + + + + + + JsDoc Reference - CAAT.Module.Skeleton.Skeleton + + + + + + + + + + + +
    + + +
    +

    Classes

    + +
    + +
    + +
    + +

    + + Class CAAT.Module.Skeleton.Skeleton +

    + + +

    + + + + + + +
    Defined in: Skeleton.js. + +

    + + + + + + + + + + + + + + + + + +
    Class Summary
    Constructor AttributesConstructor Name and Description
      + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Method Summary
    Method AttributesMethod Name and Description
    <private>   +
    __init(skeletonDataFromFile) +
    +
    +
    <private>   +
    __setSkeleton(skeletonDataFromFile) +
    +
    +
      +
    addAnimation(name, animation) +
    +
    +
      +
    addAnimationFromFile(name, url) +
    +
    +
      +
    addBone(boneInfo) +
    +
    +
      +
    addRotationKeyframe(name, keyframeInfo) +
    +
    +
      +
    addScaleKeyframe(name, keyframeInfo) +
    +
    +
      +
    addTranslationKeyframe(name, keyframeInfo) +
    +
    +
      +
    calculate(time, animationTime) +
    +
    +
      +
    endKeyframes(name, boneId) +
    +
    +
      + +
    +
      + +
    +
      +
    getBoneByIndex(index) +
    +
    +
      + +
    +
      + +
    +
      +
    getRoot() +
    +
    +
      + +
    +
      +
    paint(actorMatrix, ctx) +
    +
    +
      +
    setAnimation(name) +
    +
    +
      + +
    +
    + + + + + + + + + +
    +
    + Class Detail +
    + +
    + CAAT.Module.Skeleton.Skeleton() +
    + +
    + + +
    + + + + + + + + + + + + +
    + + + + + + + +
    + Method Detail +
    + + +
    <private> + + + __init(skeletonDataFromFile) + +
    +
    + + + +
    + + + + +
    +
    Parameters:
    + +
    + skeletonDataFromFile + +
    +
    + +
    + + + + + + + + +
    + + +
    <private> + + + __setSkeleton(skeletonDataFromFile) + +
    +
    + + + +
    + + + + +
    +
    Parameters:
    + +
    + skeletonDataFromFile + +
    +
    + +
    + + + + + + + + +
    + + +
    + + + addAnimation(name, animation) + +
    +
    + + + +
    + + + + +
    +
    Parameters:
    + +
    + name + +
    +
    + +
    + animation + +
    +
    + +
    + + + + + + + + +
    + + +
    + + + addAnimationFromFile(name, url) + +
    +
    + + + +
    + + + + +
    +
    Parameters:
    + +
    + name + +
    +
    + +
    + url + +
    +
    + +
    + + + + + + + + +
    + + +
    + + + addBone(boneInfo) + +
    +
    + + + +
    + + + + +
    +
    Parameters:
    + +
    + boneInfo + +
    +
    + +
    + + + + + + + + +
    + + +
    + + + addRotationKeyframe(name, keyframeInfo) + +
    +
    + + + +
    + + + + +
    +
    Parameters:
    + +
    + name + +
    +
    + +
    + keyframeInfo + +
    +
    + +
    + + + + + + + + +
    + + +
    + + + addScaleKeyframe(name, keyframeInfo) + +
    +
    + + + +
    + + + + +
    +
    Parameters:
    + +
    + name + +
    +
    + +
    + keyframeInfo + +
    +
    + +
    + + + + + + + + +
    + + +
    + + + addTranslationKeyframe(name, keyframeInfo) + +
    +
    + + + +
    + + + + +
    +
    Parameters:
    + +
    + name + +
    +
    + +
    + keyframeInfo + +
    +
    + +
    + + + + + + + + +
    + + +
    + + + calculate(time, animationTime) + +
    +
    + + + +
    + + + + +
    +
    Parameters:
    + +
    + time + +
    +
    + +
    + animationTime + +
    +
    + +
    + + + + + + + + +
    + + +
    + + + endKeyframes(name, boneId) + +
    +
    + + + +
    + + + + +
    +
    Parameters:
    + +
    + name + +
    +
    + +
    + boneId + +
    +
    + +
    + + + + + + + + +
    + + +
    + + + getAnimationDataByName(name) + +
    +
    + + + +
    + + + + +
    +
    Parameters:
    + +
    + name + +
    +
    + +
    + + + + + + + + +
    + + +
    + + + getBoneById(id) + +
    +
    + + + +
    + + + + +
    +
    Parameters:
    + +
    + id + +
    +
    + +
    + + + + + + + + +
    + + +
    + + + getBoneByIndex(index) + +
    +
    + + + +
    + + + + +
    +
    Parameters:
    + +
    + index + +
    +
    + +
    + + + + + + + + +
    + + +
    + + + getCurrentAnimationData() + +
    +
    + + + +
    + + + + + + + + + + + +
    + + +
    + + + getNumBones() + +
    +
    + + + +
    + + + + + + + + + + + +
    + + +
    + + + getRoot() + +
    +
    + + + +
    + + + + + + + + + + + +
    + + +
    + + + getSkeletonDataFromFile() + +
    +
    + + + +
    + + + + + + + + + + + +
    + + +
    + + + paint(actorMatrix, ctx) + +
    +
    + + + +
    + + + + +
    +
    Parameters:
    + +
    + actorMatrix + +
    +
    + +
    + ctx + +
    +
    + +
    + + + + + + + + +
    + + +
    + + + setAnimation(name) + +
    +
    + + + +
    + + + + +
    +
    Parameters:
    + +
    + name + +
    +
    + +
    + + + + + + + + +
    + + +
    + + + setSkeletonFromFile(url) + +
    +
    + + + +
    + + + + +
    +
    Parameters:
    + +
    + url + +
    +
    + +
    + + + + + + + + + + + + + + + +
    +
    + + + +
    + + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:19 GMT-0700 (PDT) +
    + + diff --git a/documentation/jsdoc/symbols/CAAT.Module.Skeleton.html b/documentation/jsdoc/symbols/CAAT.Module.Skeleton.html new file mode 100644 index 00000000..f5b82ee1 --- /dev/null +++ b/documentation/jsdoc/symbols/CAAT.Module.Skeleton.html @@ -0,0 +1,541 @@ + + + + + + + JsDoc Reference - CAAT.Module.Skeleton + + + + + + + + + + + +
    + + +
    +

    Classes

    + +
    + +
    + +
    + +

    + + Namespace CAAT.Module.Skeleton +

    + + +

    + + + + + + +
    Defined in: Bone.js. + +

    + + + + + + + + + + + + + + + + + +
    Namespace Summary
    Constructor AttributesConstructor Name and Description
      + +
    +
    + + + + + + + + + + + + +
    +
    + Namespace Detail +
    + +
    + CAAT.Module.Skeleton +
    + +
    + + +
    + + + + + + + + + + + + +
    + + + + + + + + + + + +
    +
    + + + +
    + + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:19 GMT-0700 (PDT) +
    + + diff --git a/documentation/jsdoc/symbols/CAAT.Module.Storage.LocalStorage.html b/documentation/jsdoc/symbols/CAAT.Module.Storage.LocalStorage.html index ee3bd162..80d88476 100644 --- a/documentation/jsdoc/symbols/CAAT.Module.Storage.LocalStorage.html +++ b/documentation/jsdoc/symbols/CAAT.Module.Storage.LocalStorage.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -714,7 +726,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:04:02 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:19 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.Module.Storage.html b/documentation/jsdoc/symbols/CAAT.Module.Storage.html index 807fb9ef..0bc6cbf1 100644 --- a/documentation/jsdoc/symbols/CAAT.Module.Storage.html +++ b/documentation/jsdoc/symbols/CAAT.Module.Storage.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -528,7 +540,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:04:02 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:19 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.Module.TexturePacker.TextureElement.html b/documentation/jsdoc/symbols/CAAT.Module.TexturePacker.TextureElement.html index 64750fd3..6cd3b08b 100644 --- a/documentation/jsdoc/symbols/CAAT.Module.TexturePacker.TextureElement.html +++ b/documentation/jsdoc/symbols/CAAT.Module.TexturePacker.TextureElement.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -706,7 +718,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:04:02 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:19 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.Module.TexturePacker.TexturePage.html b/documentation/jsdoc/symbols/CAAT.Module.TexturePacker.TexturePage.html index f9eba8bc..8b1df16f 100644 --- a/documentation/jsdoc/symbols/CAAT.Module.TexturePacker.TexturePage.html +++ b/documentation/jsdoc/symbols/CAAT.Module.TexturePacker.TexturePage.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -1406,7 +1418,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:04:02 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:19 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.Module.TexturePacker.TexturePageManager.html b/documentation/jsdoc/symbols/CAAT.Module.TexturePacker.TexturePageManager.html index 4e435be9..9a039ac4 100644 --- a/documentation/jsdoc/symbols/CAAT.Module.TexturePacker.TexturePageManager.html +++ b/documentation/jsdoc/symbols/CAAT.Module.TexturePacker.TexturePageManager.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -732,7 +744,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:04:02 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:19 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.Module.TexturePacker.TextureScan.html b/documentation/jsdoc/symbols/CAAT.Module.TexturePacker.TextureScan.html index 6fc658ee..65d38914 100644 --- a/documentation/jsdoc/symbols/CAAT.Module.TexturePacker.TextureScan.html +++ b/documentation/jsdoc/symbols/CAAT.Module.TexturePacker.TextureScan.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -838,7 +850,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:04:02 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:19 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.Module.TexturePacker.TextureScanMap.html b/documentation/jsdoc/symbols/CAAT.Module.TexturePacker.TextureScanMap.html index 11d99fdc..7db26062 100644 --- a/documentation/jsdoc/symbols/CAAT.Module.TexturePacker.TextureScanMap.html +++ b/documentation/jsdoc/symbols/CAAT.Module.TexturePacker.TextureScanMap.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -864,7 +876,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:04:02 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:19 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.Module.TexturePacker.html b/documentation/jsdoc/symbols/CAAT.Module.TexturePacker.html index 361aa7f2..3ad9a001 100644 --- a/documentation/jsdoc/symbols/CAAT.Module.TexturePacker.html +++ b/documentation/jsdoc/symbols/CAAT.Module.TexturePacker.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -523,7 +535,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:04:02 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:19 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.ModuleManager.html b/documentation/jsdoc/symbols/CAAT.ModuleManager.html index 288beb8c..33abe32f 100644 --- a/documentation/jsdoc/symbols/CAAT.ModuleManager.html +++ b/documentation/jsdoc/symbols/CAAT.ModuleManager.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -474,123 +486,6 @@

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Method Summary
    Method AttributesMethod Name and Description
    <static>   -
    CAAT.ModuleManager.addModuleSolvedListener(modulename, callback) -
    -
    Add an observer for a given module load event.
    -
    <static>   -
    CAAT.ModuleManager.baseURL(baseURL) -
    -
    Define global base position for modules structure.
    -
    <static>   -
    CAAT.ModuleManager.bring(file) -
    -
    Bring the given object, and if no present, start solving and loading dependencies.
    -
    <static>   -
    CAAT.ModuleManager.debug(d) -
    -
    Enable debug capabilities for the loaded modules.
    -
    <static>   -
    CAAT.ModuleManager.load(file, onload, onerror) -
    -
    Load a javascript file.
    -
    <static>   -
    CAAT.ModuleManager.onReady(f) -
    -
    This method will be called everytime all the specified to-be-brought dependencies have been solved.
    -
    <static>   -
    CAAT.ModuleManager.setModulePath(module, path) -
    -
    Define a module path.
    -
    <static>   -
    CAAT.ModuleManager.solveAll() -
    -
    Solve all elements specified in the module loaded.
    -
    <static>   -
    CAAT.ModuleManager.solvedInOrder() -
    -
    Dump solved modules and get them sorted in the order they were resolved.
    -
    <static>   -
    CAAT.ModuleManager.status() -
    -
    Get CAAT´s module manager status.
    -
    <static>   -
    CAAT.ModuleManager.symbol(symbol, path) -
    -
    Define a symbol, or file to be loaded and checked dependencies against.
    -
    - - - - @@ -629,448 +524,6 @@

    -
    - Method Detail -
    - - -
    <static> - - {*} - CAAT.ModuleManager.addModuleSolvedListener(modulename, callback) - -
    -
    - Add an observer for a given module load event. - - -
    - - - - -
    -
    Parameters:
    - -
    - modulename - -
    -
    {string}
    - -
    - callback - -
    -
    {function()}
    - -
    - - - - - -
    -
    Returns:
    - -
    {*}
    - -
    - - - - -
    - - -
    <static> - - {*} - CAAT.ModuleManager.baseURL(baseURL) - -
    -
    - Define global base position for modules structure. - - -
    - - - - -
    -
    Parameters:
    - -
    - baseURL - -
    -
    {string}
    - -
    - - - - - -
    -
    Returns:
    - -
    {*}
    - -
    - - - - -
    - - -
    <static> - - {*} - CAAT.ModuleManager.bring(file) - -
    -
    - Bring the given object, and if no present, start solving and loading dependencies. - - -
    - - - - -
    -
    Parameters:
    - -
    - file - -
    -
    {string}
    - -
    - - - - - -
    -
    Returns:
    - -
    {*}
    - -
    - - - - -
    - - -
    <static> - - {*} - CAAT.ModuleManager.debug(d) - -
    -
    - Enable debug capabilities for the loaded modules. -Otherwise, the modules will have cache invalidation features. - - -
    - - - - -
    -
    Parameters:
    - -
    - d - -
    -
    {boolean}
    - -
    - - - - - -
    -
    Returns:
    - -
    {*}
    - -
    - - - - -
    - - -
    <static> - - - CAAT.ModuleManager.load(file, onload, onerror) - -
    -
    - Load a javascript file. - - -
    - - - - -
    -
    Parameters:
    - -
    - file - -
    -
    {string}
    - -
    - onload - -
    -
    {function()}
    - -
    - onerror - -
    -
    {function()}
    - -
    - - - - - - - - -
    - - -
    <static> - - {*} - CAAT.ModuleManager.onReady(f) - -
    -
    - This method will be called everytime all the specified to-be-brought dependencies have been solved. - - -
    - - - - -
    -
    Parameters:
    - -
    - f - -
    -
    - -
    - - - - - -
    -
    Returns:
    - -
    {*}
    - -
    - - - - -
    - - -
    <static> - - - CAAT.ModuleManager.setModulePath(module, path) - -
    -
    - Define a module path. Multiple module paths can be specified. - - -
    - - - - -
    -
    Parameters:
    - -
    - module - -
    -
    {string}
    - -
    - path - -
    -
    {string}
    - -
    - - - - - - - - -
    - - -
    <static> - - - CAAT.ModuleManager.solveAll() - -
    -
    - Solve all elements specified in the module loaded. -It is useful when minimizing a file. - - -
    - - - - - - - - - - - -
    - - -
    <static> - - - CAAT.ModuleManager.solvedInOrder() - -
    -
    - Dump solved modules and get them sorted in the order they were resolved. - - -
    - - - - - - - - - - - -
    - - -
    <static> - - - CAAT.ModuleManager.status() - -
    -
    - Get CAAT´s module manager status. - - -
    - - - - - - - - - - - -
    - - -
    <static> - - {*} - CAAT.ModuleManager.symbol(symbol, path) - -
    -
    - Define a symbol, or file to be loaded and checked dependencies against. - - -
    - - - - -
    -
    Parameters:
    - -
    - symbol - -
    -
    {string}
    - -
    - path - -
    -
    {string}
    - -
    - - - - - -
    -
    Returns:
    - -
    {*}
    - -
    - - - - - - - @@ -1082,7 +535,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:04:02 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:19 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.PathUtil.ArcPath.html b/documentation/jsdoc/symbols/CAAT.PathUtil.ArcPath.html index 800f454e..17d504ed 100644 --- a/documentation/jsdoc/symbols/CAAT.PathUtil.ArcPath.html +++ b/documentation/jsdoc/symbols/CAAT.PathUtil.ArcPath.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -1816,7 +1828,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:04:02 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:19 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.PathUtil.CurvePath.html b/documentation/jsdoc/symbols/CAAT.PathUtil.CurvePath.html index 4b1e738a..8f967467 100644 --- a/documentation/jsdoc/symbols/CAAT.PathUtil.CurvePath.html +++ b/documentation/jsdoc/symbols/CAAT.PathUtil.CurvePath.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -1464,7 +1476,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:04:03 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:19 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.PathUtil.LinearPath.html b/documentation/jsdoc/symbols/CAAT.PathUtil.LinearPath.html index c37ed6df..0d363d93 100644 --- a/documentation/jsdoc/symbols/CAAT.PathUtil.LinearPath.html +++ b/documentation/jsdoc/symbols/CAAT.PathUtil.LinearPath.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -1389,7 +1401,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:04:03 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:19 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.PathUtil.Path.html b/documentation/jsdoc/symbols/CAAT.PathUtil.Path.html index 71ef641c..82037567 100644 --- a/documentation/jsdoc/symbols/CAAT.PathUtil.Path.html +++ b/documentation/jsdoc/symbols/CAAT.PathUtil.Path.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -1028,7 +1040,7 @@

      -
    getPosition(time, open_contour, tangent_threshold) +
    getPosition(time, open_contour)
    This method, returns a CAAT.Foundation.Point instance indicating a coordinate in the path.
    @@ -3131,7 +3143,7 @@

    {CAAT.Foundation.Point} - getPosition(time, open_contour, tangent_threshold) + getPosition(time, open_contour)
    @@ -3167,13 +3179,7 @@

    {boolean=} treat this path as an open contour. It is intended for -open paths, and interpolators which give values above 1. see @link
    - -
    - tangent_threshold - -
    -
    {number=}
    +open paths, and interpolators which give values above 1. see tutorial 7.1. @@ -4499,7 +4505,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:04:03 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:20 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.PathUtil.PathSegment.html b/documentation/jsdoc/symbols/CAAT.PathUtil.PathSegment.html index 99001782..8a43f7a9 100644 --- a/documentation/jsdoc/symbols/CAAT.PathUtil.PathSegment.html +++ b/documentation/jsdoc/symbols/CAAT.PathUtil.PathSegment.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -1522,7 +1534,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:04:03 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:20 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.PathUtil.RectPath.html b/documentation/jsdoc/symbols/CAAT.PathUtil.RectPath.html index e2b944c4..3b652da3 100644 --- a/documentation/jsdoc/symbols/CAAT.PathUtil.RectPath.html +++ b/documentation/jsdoc/symbols/CAAT.PathUtil.RectPath.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -1490,7 +1502,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:04:03 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:20 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.PathUtil.SVGPath.html b/documentation/jsdoc/symbols/CAAT.PathUtil.SVGPath.html index 457d14c9..c3ece987 100644 --- a/documentation/jsdoc/symbols/CAAT.PathUtil.SVGPath.html +++ b/documentation/jsdoc/symbols/CAAT.PathUtil.SVGPath.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -1671,7 +1683,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:04:03 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:20 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.PathUtil.html b/documentation/jsdoc/symbols/CAAT.PathUtil.html index 836be210..044f83ab 100644 --- a/documentation/jsdoc/symbols/CAAT.PathUtil.html +++ b/documentation/jsdoc/symbols/CAAT.PathUtil.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -523,7 +535,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:04:02 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:19 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.WebGL.ColorProgram.html b/documentation/jsdoc/symbols/CAAT.WebGL.ColorProgram.html index 1a695e76..0e75aad8 100644 --- a/documentation/jsdoc/symbols/CAAT.WebGL.ColorProgram.html +++ b/documentation/jsdoc/symbols/CAAT.WebGL.ColorProgram.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -867,7 +879,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:04:03 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:20 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.WebGL.GLU.html b/documentation/jsdoc/symbols/CAAT.WebGL.GLU.html index c2e800a2..c5d69e63 100644 --- a/documentation/jsdoc/symbols/CAAT.WebGL.GLU.html +++ b/documentation/jsdoc/symbols/CAAT.WebGL.GLU.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -771,7 +783,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:04:03 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:20 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.WebGL.Program.html b/documentation/jsdoc/symbols/CAAT.WebGL.Program.html index a72b1ff8..2a4c8e0c 100644 --- a/documentation/jsdoc/symbols/CAAT.WebGL.Program.html +++ b/documentation/jsdoc/symbols/CAAT.WebGL.Program.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -1046,7 +1058,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:04:03 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:20 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.WebGL.TextureProgram.html b/documentation/jsdoc/symbols/CAAT.WebGL.TextureProgram.html index bb9441c7..14997f0e 100644 --- a/documentation/jsdoc/symbols/CAAT.WebGL.TextureProgram.html +++ b/documentation/jsdoc/symbols/CAAT.WebGL.TextureProgram.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -1555,7 +1567,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:04:03 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:20 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.WebGL.html b/documentation/jsdoc/symbols/CAAT.WebGL.html index 7f85aef7..e4a95ca5 100644 --- a/documentation/jsdoc/symbols/CAAT.WebGL.html +++ b/documentation/jsdoc/symbols/CAAT.WebGL.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -528,7 +540,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:04:03 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:20 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/CAAT.constants.extendsWith.constants.extendsWith.constants.extendsWith.extendsWith.extendsWith.extendsWith-DocumentElement.html b/documentation/jsdoc/symbols/CAAT.constants.extendsWith.constants.extendsWith.constants.extendsWith.extendsWith.extendsWith.extendsWith-DocumentElement.html deleted file mode 100644 index d9f06314..00000000 --- a/documentation/jsdoc/symbols/CAAT.constants.extendsWith.constants.extendsWith.constants.extendsWith.extendsWith.extendsWith.extendsWith-DocumentElement.html +++ /dev/null @@ -1,410 +0,0 @@ - - - - - - - JsDoc Reference - CAAT.constants.extendsWith.constants.extendsWith.constants.extendsWith.extendsWith.extendsWith.extendsWith-DocumentElement - - - - - - - - - - - -
    - - -
    -

    Classes

    - -
    - -
    - -
    - -

    - - Class CAAT.constants.extendsWith.constants.extendsWith.constants.extendsWith.extendsWith.extendsWith.extendsWith-DocumentElement -

    - - -

    - - - - - - -
    Defined in: Label.js. - -

    - - - - - - - - - - - - - - - - - -
    Class Summary
    Constructor AttributesConstructor Name and Description
    <inner>   - -
    Abstract document element.
    -
    - - - - - - - - - - - - -
    -
    - Class Detail -
    - -
    <inner> - CAAT.constants.extendsWith.constants.extendsWith.constants.extendsWith.extendsWith.extendsWith.extendsWith-DocumentElement(anchor, style) -
    - -
    - Abstract document element. -The document contains a collection of DocumentElementText and DocumentElementImage. - -
    - - - - - -
    -
    Parameters:
    - -
    - anchor - -
    -
    - -
    - style - -
    -
    - -
    - - - - - -
    -
    Returns:
    - -
    {*}
    - -
    - - - - -
    - - - - - - - - - - - -
    -
    - - - -
    - - Documentation generated by JsDoc Toolkit 2.4.0 on Tue Feb 26 2013 11:39:05 GMT-0800 (PST) -
    - - diff --git a/documentation/jsdoc/symbols/CAAT.constants.extendsWith.constants.extendsWith.constants.extendsWith.extendsWith.extendsWith.extendsWith-DocumentElementText.html b/documentation/jsdoc/symbols/CAAT.constants.extendsWith.constants.extendsWith.constants.extendsWith.extendsWith.extendsWith.extendsWith-DocumentElementText.html deleted file mode 100644 index 510a2f79..00000000 --- a/documentation/jsdoc/symbols/CAAT.constants.extendsWith.constants.extendsWith.constants.extendsWith.extendsWith.extendsWith.extendsWith-DocumentElementText.html +++ /dev/null @@ -1,434 +0,0 @@ - - - - - - - JsDoc Reference - CAAT.constants.extendsWith.constants.extendsWith.constants.extendsWith.extendsWith.extendsWith.extendsWith-DocumentElementText - - - - - - - - - - - -
    - - -
    -

    Classes

    - -
    - -
    - -
    - -

    - - Class CAAT.constants.extendsWith.constants.extendsWith.constants.extendsWith.extendsWith.extendsWith.extendsWith-DocumentElementText -

    - - -

    - - - - - - -
    Defined in: Label.js. - -

    - - - - - - - - - - - - - - - - - -
    Class Summary
    Constructor AttributesConstructor Name and Description
    <inner>   - -
    This class represents a text in the document.
    -
    - - - - - - - - - - - - -
    -
    - Class Detail -
    - -
    <inner> - CAAT.constants.extendsWith.constants.extendsWith.constants.extendsWith.extendsWith.extendsWith.extendsWith-DocumentElementText(text, x, width, height, style, anchor) -
    - -
    - This class represents a text in the document. The text will have applied the styles selected -when it was defined. - -
    - - - - - -
    -
    Parameters:
    - -
    - text - -
    -
    - -
    - x - -
    -
    - -
    - width - -
    -
    - -
    - height - -
    -
    - -
    - style - -
    -
    - -
    - anchor - -
    -
    - -
    - - - - - -
    -
    Returns:
    - -
    {*}
    - -
    - - - - -
    - - - - - - - - - - - -
    -
    - - - -
    - - Documentation generated by JsDoc Toolkit 2.4.0 on Tue Feb 26 2013 11:39:05 GMT-0800 (PST) -
    - - diff --git a/documentation/jsdoc/symbols/CAAT.constants.extendsWith.constants.extendsWith.constants.extendsWith.extendsWith.extendsWith.extendsWith-DocumentLine.html b/documentation/jsdoc/symbols/CAAT.constants.extendsWith.constants.extendsWith.constants.extendsWith.extendsWith.extendsWith.extendsWith-DocumentLine.html deleted file mode 100644 index 8ba1348e..00000000 --- a/documentation/jsdoc/symbols/CAAT.constants.extendsWith.constants.extendsWith.constants.extendsWith.extendsWith.extendsWith.extendsWith-DocumentLine.html +++ /dev/null @@ -1,393 +0,0 @@ - - - - - - - JsDoc Reference - CAAT.constants.extendsWith.constants.extendsWith.constants.extendsWith.extendsWith.extendsWith.extendsWith-DocumentLine - - - - - - - - - - - -
    - - -
    -

    Classes

    - -
    - -
    - -
    - -

    - - Class CAAT.constants.extendsWith.constants.extendsWith.constants.extendsWith.extendsWith.extendsWith.extendsWith-DocumentLine -

    - - -

    - - - - - - -
    Defined in: Label.js. - -

    - - - - - - - - - - - - - - - - - -
    Class Summary
    Constructor AttributesConstructor Name and Description
    <inner>   - -
    This class represents a document line.
    -
    - - - - - - - - - - - - -
    -
    - Class Detail -
    - -
    <inner> - CAAT.constants.extendsWith.constants.extendsWith.constants.extendsWith.extendsWith.extendsWith.extendsWith-DocumentLine() -
    - -
    - This class represents a document line. -It contains a collection of DocumentElement objects. - -
    - - - - - - - - - -
    -
    Returns:
    - -
    {*}
    - -
    - - - - -
    - - - - - - - - - - - -
    -
    - - - -
    - - Documentation generated by JsDoc Toolkit 2.4.0 on Tue Feb 26 2013 11:39:05 GMT-0800 (PST) -
    - - diff --git a/documentation/jsdoc/symbols/CAAT.constants.extendsWith.constants.extendsWith.constants.extendsWith.extendsWith.extendsWith.extendsWith-renderContext.html b/documentation/jsdoc/symbols/CAAT.constants.extendsWith.constants.extendsWith.constants.extendsWith.extendsWith.extendsWith.extendsWith-renderContext.html deleted file mode 100644 index b0432a91..00000000 --- a/documentation/jsdoc/symbols/CAAT.constants.extendsWith.constants.extendsWith.constants.extendsWith.extendsWith.extendsWith.extendsWith-renderContext.html +++ /dev/null @@ -1,392 +0,0 @@ - - - - - - - JsDoc Reference - CAAT.constants.extendsWith.constants.extendsWith.constants.extendsWith.extendsWith.extendsWith.extendsWith-renderContext - - - - - - - - - - - -
    - - -
    -

    Classes

    - -
    - -
    - -
    - -

    - - Class CAAT.constants.extendsWith.constants.extendsWith.constants.extendsWith.extendsWith.extendsWith.extendsWith-renderContext -

    - - -

    - - - - - - -
    Defined in: Label.js. - -

    - - - - - - - - - - - - - - - - - -
    Class Summary
    Constructor AttributesConstructor Name and Description
    <inner>   - -
    This class keeps track of styles, images, and the current applied style.
    -
    - - - - - - - - - - - - -
    -
    - Class Detail -
    - -
    <inner> - CAAT.constants.extendsWith.constants.extendsWith.constants.extendsWith.extendsWith.extendsWith.extendsWith-renderContext() -
    - -
    - This class keeps track of styles, images, and the current applied style. - -
    - - - - - - - - - -
    -
    Returns:
    - -
    {*}
    - -
    - - - - -
    - - - - - - - - - - - -
    -
    - - - -
    - - Documentation generated by JsDoc Toolkit 2.4.0 on Tue Feb 26 2013 11:39:05 GMT-0800 (PST) -
    - - diff --git a/documentation/jsdoc/symbols/CAAT.extendsWith-DocumentElement.html b/documentation/jsdoc/symbols/CAAT.extendsWith-DocumentElement.html deleted file mode 100644 index faf08669..00000000 --- a/documentation/jsdoc/symbols/CAAT.extendsWith-DocumentElement.html +++ /dev/null @@ -1,392 +0,0 @@ - - - - - - - JsDoc Reference - CAAT.extendsWith-DocumentElement - - - - - - - - - - - - - -
    - -

    - - Class CAAT.extendsWith-DocumentElement -

    - - -

    - - - - - - -
    Defined in: Label.js. - -

    - - - - - - - - - - - - - - - - - -
    Class Summary
    Constructor AttributesConstructor Name and Description
    <inner>   - -
    Abstract document element.
    -
    - - - - - - - - - - - - -
    -
    - Class Detail -
    - -
    <inner> - CAAT.extendsWith-DocumentElement(anchor, style) -
    - -
    - Abstract document element. -The document contains a collection of DocumentElementText and DocumentElementImage. - -
    - - - - - -
    -
    Parameters:
    - -
    - anchor - -
    -
    - -
    - style - -
    -
    - -
    - - - - - -
    -
    Returns:
    - -
    {*}
    - -
    - - - - -
    - - - - - - - - - - - -
    -
    - - - -
    - - Documentation generated by JsDoc Toolkit 2.4.0 on Tue Feb 26 2013 09:43:15 GMT-0800 (PST) -
    - - diff --git a/documentation/jsdoc/symbols/CAAT.extendsWith-DocumentElementImage.html b/documentation/jsdoc/symbols/CAAT.extendsWith-DocumentElementImage.html deleted file mode 100644 index 2ba06eef..00000000 --- a/documentation/jsdoc/symbols/CAAT.extendsWith-DocumentElementImage.html +++ /dev/null @@ -1,415 +0,0 @@ - - - - - - - JsDoc Reference - CAAT.extendsWith-DocumentElementImage - - - - - - - - - - - - - -
    - -

    - - Class CAAT.extendsWith-DocumentElementImage -

    - - -

    - - - - - - -
    Defined in: Label.js. - -

    - - - - - - - - - - - - - - - - - -
    Class Summary
    Constructor AttributesConstructor Name and Description
    <inner>   -
    - CAAT.extendsWith-DocumentElementImage(x, image, r, c, style, anchor) -
    -
    This class represents an image in the document.
    -
    - - - - - - - - - - - - -
    -
    - Class Detail -
    - -
    <inner> - CAAT.extendsWith-DocumentElementImage(x, image, r, c, style, anchor) -
    - -
    - This class represents an image in the document. - -
    - - - - - -
    -
    Parameters:
    - -
    - x - -
    -
    - -
    - image - -
    -
    - -
    - r - -
    -
    - -
    - c - -
    -
    - -
    - style - -
    -
    - -
    - anchor - -
    -
    - -
    - - - - - -
    -
    Returns:
    - -
    {*}
    - -
    - - - - -
    - - - - - - - - - - - -
    -
    - - - -
    - - Documentation generated by JsDoc Toolkit 2.4.0 on Tue Feb 26 2013 09:43:15 GMT-0800 (PST) -
    - - diff --git a/documentation/jsdoc/symbols/CAAT.extendsWith-DocumentElementText.html b/documentation/jsdoc/symbols/CAAT.extendsWith-DocumentElementText.html deleted file mode 100644 index 415ee70e..00000000 --- a/documentation/jsdoc/symbols/CAAT.extendsWith-DocumentElementText.html +++ /dev/null @@ -1,416 +0,0 @@ - - - - - - - JsDoc Reference - CAAT.extendsWith-DocumentElementText - - - - - - - - - - - - - -
    - -

    - - Class CAAT.extendsWith-DocumentElementText -

    - - -

    - - - - - - -
    Defined in: Label.js. - -

    - - - - - - - - - - - - - - - - - -
    Class Summary
    Constructor AttributesConstructor Name and Description
    <inner>   -
    - CAAT.extendsWith-DocumentElementText(text, x, width, height, style, anchor) -
    -
    This class represents a text in the document.
    -
    - - - - - - - - - - - - -
    -
    - Class Detail -
    - -
    <inner> - CAAT.extendsWith-DocumentElementText(text, x, width, height, style, anchor) -
    - -
    - This class represents a text in the document. The text will have applied the styles selected -when it was defined. - -
    - - - - - -
    -
    Parameters:
    - -
    - text - -
    -
    - -
    - x - -
    -
    - -
    - width - -
    -
    - -
    - height - -
    -
    - -
    - style - -
    -
    - -
    - anchor - -
    -
    - -
    - - - - - -
    -
    Returns:
    - -
    {*}
    - -
    - - - - -
    - - - - - - - - - - - -
    -
    - - - -
    - - Documentation generated by JsDoc Toolkit 2.4.0 on Tue Feb 26 2013 09:43:15 GMT-0800 (PST) -
    - - diff --git a/documentation/jsdoc/symbols/CAAT.extendsWith-DocumentLine.html b/documentation/jsdoc/symbols/CAAT.extendsWith-DocumentLine.html deleted file mode 100644 index 022fc18c..00000000 --- a/documentation/jsdoc/symbols/CAAT.extendsWith-DocumentLine.html +++ /dev/null @@ -1,375 +0,0 @@ - - - - - - - JsDoc Reference - CAAT.extendsWith-DocumentLine - - - - - - - - - - - - - -
    - -

    - - Class CAAT.extendsWith-DocumentLine -

    - - -

    - - - - - - -
    Defined in: Label.js. - -

    - - - - - - - - - - - - - - - - - -
    Class Summary
    Constructor AttributesConstructor Name and Description
    <inner>   - -
    This class represents a document line.
    -
    - - - - - - - - - - - - -
    -
    - Class Detail -
    - -
    <inner> - CAAT.extendsWith-DocumentLine() -
    - -
    - This class represents a document line. -It contains a collection of DocumentElement objects. - -
    - - - - - - - - - -
    -
    Returns:
    - -
    {*}
    - -
    - - - - -
    - - - - - - - - - - - -
    -
    - - - -
    - - Documentation generated by JsDoc Toolkit 2.4.0 on Tue Feb 26 2013 09:43:15 GMT-0800 (PST) -
    - - diff --git a/documentation/jsdoc/symbols/CAAT.extendsWith-renderContext.html b/documentation/jsdoc/symbols/CAAT.extendsWith-renderContext.html deleted file mode 100644 index 804ed092..00000000 --- a/documentation/jsdoc/symbols/CAAT.extendsWith-renderContext.html +++ /dev/null @@ -1,374 +0,0 @@ - - - - - - - JsDoc Reference - CAAT.extendsWith-renderContext - - - - - - - - - - - - - -
    - -

    - - Class CAAT.extendsWith-renderContext -

    - - -

    - - - - - - -
    Defined in: Label.js. - -

    - - - - - - - - - - - - - - - - - -
    Class Summary
    Constructor AttributesConstructor Name and Description
    <inner>   - -
    This class keeps track of styles, images, and the current applied style.
    -
    - - - - - - - - - - - - -
    -
    - Class Detail -
    - -
    <inner> - CAAT.extendsWith-renderContext() -
    - -
    - This class keeps track of styles, images, and the current applied style. - -
    - - - - - - - - - -
    -
    Returns:
    - -
    {*}
    - -
    - - - - -
    - - - - - - - - - - - -
    -
    - - - -
    - - Documentation generated by JsDoc Toolkit 2.4.0 on Tue Feb 26 2013 09:43:15 GMT-0800 (PST) -
    - - diff --git a/documentation/jsdoc/symbols/CAAT.extendsWith.__init.html b/documentation/jsdoc/symbols/CAAT.extendsWith.__init.html deleted file mode 100644 index 90c39240..00000000 --- a/documentation/jsdoc/symbols/CAAT.extendsWith.__init.html +++ /dev/null @@ -1,381 +0,0 @@ - - - - - - - JsDoc Reference - CAAT.extendsWith.__init - - - - - - - - - - - - - -
    - -

    - - Class CAAT.extendsWith.__init -

    - - -

    - - - - - - -
    Defined in: Label.js. - -

    - - - - - - - - - - - - - - - - - -
    Class Summary
    Constructor AttributesConstructor Name and Description
    <private>   - -
    This object represents a label object.
    -
    - - - - - - - - - - - - -
    -
    - Class Detail -
    - -
    <private> - CAAT.extendsWith.__init() -
    - -
    - This object represents a label object. -A label is a complex presentation object which is able to: -
  • define comples styles -
  • contains multiline text -
  • keep track of per-line baseline regardless of fonts used. -
  • Mix images and text. -
  • Layout text and images in a fixed width or by parsing a free-flowing document -
  • Add anchoring capabilities. - -
  • - - - - - - - - - -
    -
    Returns:
    - -
    {*}
    - -
    - - - - -
    - - - - - - - - - - - -
    -
    - - - -
    - - Documentation generated by JsDoc Toolkit 2.4.0 on Tue Feb 26 2013 09:43:15 GMT-0800 (PST) -
    - - diff --git a/documentation/jsdoc/symbols/CAAT.html b/documentation/jsdoc/symbols/CAAT.html index f4129d33..68a85653 100644 --- a/documentation/jsdoc/symbols/CAAT.html +++ b/documentation/jsdoc/symbols/CAAT.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -724,6 +736,16 @@

    + + <static>   + +
    + CAAT.Module +
    +
    This function defines CAAT modules, and creates Constructor Class objects.
    + + + <static>   @@ -930,15 +952,6 @@

    - - <private> <static>   - -
    CAAT.Module(obj) -
    -
    This function defines CAAT modules, and creates Constructor Class objects.
    - - - <static>   @@ -1650,6 +1663,40 @@

    +
    + + +
    <static> + + + CAAT.Module + +
    +
    + This function defines CAAT modules, and creates Constructor Class objects. + +obj parameter has the following structure: +{ + defines{string}, // class name + depends{Array=}, // dependencies class names + extendsClass{string}, // class to extend from + extensdWith{object}, // actual prototype to extend + aliases{Array} // other class names +} + +
    + Defined in: ModuleManager.js. + + +
    + + + + + + + +
    @@ -2215,56 +2262,6 @@

    -
    - - -
    <private> <static> - - - CAAT.Module(obj) - -
    -
    - This function defines CAAT modules, and creates Constructor Class objects. - -obj parameter has the following structure: -{ - defines{string}, // class name - depends{Array=}, // dependencies class names - extendsClass{string}, // class to extend from - extensdWith{object}, // actual prototype to extend - aliases{Array}, // other class names - onCreation{function=} // optional callback to call after class creation. - onPreCreation{function=} // optional callback to call after namespace class creation. -} - -
    - Defined in: ModuleManager.js. - - -
    - - - - -
    -
    Parameters:
    - -
    - obj - -
    -
    {object}
    - -
    - - - - - - - -
    @@ -2558,7 +2555,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:03:52 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:15 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/String.html b/documentation/jsdoc/symbols/String.html index 6c24c3fd..66660573 100644 --- a/documentation/jsdoc/symbols/String.html +++ b/documentation/jsdoc/symbols/String.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -544,7 +556,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:04:03 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:20 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/_global_.html b/documentation/jsdoc/symbols/_global_.html index f505dd54..148273ea 100644 --- a/documentation/jsdoc/symbols/_global_.html +++ b/documentation/jsdoc/symbols/_global_.html @@ -12,7 +12,7 @@ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; - width: 980px; + width: 940px; } .header @@ -48,7 +48,7 @@ { margin-top: 24px; float: left; - width: 340px; + width: 300px; position: absolute; left: 8px; background-color: #F3F3F3; @@ -57,8 +57,8 @@ #content { - margin-left: 370px; - width: 700px; + margin-left: 340px; + width: 600px; } .classList @@ -209,20 +209,22 @@

    Classes

  • CAAT.Behavior.PathBehavior
  • -
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • -
  • CAAT.Behavior.PathBehavior.autorotate
  • +
  • CAAT.Behavior.PathBehavior.AUTOROTATE
  • +
  • CAAT.Behavior.RotateBehavior
  • CAAT.Behavior.Scale1Behavior
  • -
  • CAAT.Behavior.Scale1Behavior.AXIS
  • -
  • CAAT.Behavior.Scale1Behavior.Axis
  • +
  • CAAT.Behavior.Scale1Behavior.AXIS
  • +
  • CAAT.Behavior.ScaleBehavior
  • +
  • CAAT.Class
  • +
  • CAAT.CSS
  • CAAT.Event
  • @@ -375,6 +377,16 @@

    Classes

  • CAAT.Module.Runtime.BrowserInfo
  • +
  • CAAT.Module.Skeleton
  • + +
  • CAAT.Module.Skeleton#SkeletonActor
  • + +
  • CAAT.Module.Skeleton.Bone
  • + +
  • CAAT.Module.Skeleton.BoneActor
  • + +
  • CAAT.Module.Skeleton.Skeleton
  • +
  • CAAT.Module.Storage
  • CAAT.Module.Storage.LocalStorage
  • @@ -731,7 +743,7 @@

    - Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 23:03:51 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:15 GMT-0700 (PDT)
    diff --git a/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_Behavior_BaseBehavior.js.html b/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_Behavior_BaseBehavior.js.html index 52d097a8..e8aadd21 100644 --- a/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_Behavior_BaseBehavior.js.html +++ b/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_Behavior_BaseBehavior.js.html @@ -255,388 +255,413 @@ 248 discardable:false, 249 250 /** -251 * Parse a behavior of this type. -252 * @param obj {object} an object with a behavior definition. -253 */ -254 parse : function( obj ) { -255 if ( obj.pingpong ) { -256 this.setPingPong(); -257 } -258 if ( obj.cycle ) { -259 this.setCycle(true); -260 } -261 var delay= obj.delay || 0; -262 var duration= obj.duration || 1000; -263 -264 this.setDelayTime( delay, duration ); +251 * does this behavior apply relative values ?? +252 */ +253 isRelative : false, +254 +255 /** +256 * Set this behavior as relative value application to some other measures. +257 * Each Behavior will define its own. +258 * @param bool +259 * @returns {*} +260 */ +261 setRelative : function( bool ) { +262 this.isRelative= bool; +263 return this; +264 }, 265 -266 if ( obj.interpolator ) { -267 this.setInterpolator( CAAT.Behavior.Interpolator.parse(obj.interpolator) ); -268 } +266 setRelativeValues : function() { +267 this.isRelative= true; +268 return this; 269 }, 270 271 /** -272 * Set whether this behavior will apply behavior values to a reference Actor instance. -273 * @param apply {boolean} -274 * @return {*} -275 */ -276 setValueApplication:function (apply) { -277 this.doValueApplication = apply; -278 return this; -279 }, -280 -281 /** -282 * Set this behavior offset time. -283 * This method is intended to make a behavior start applying (the first) time from a different -284 * start time. -285 * @param offset {number} between 0 and 1 -286 * @return {*} -287 */ -288 setTimeOffset:function (offset) { -289 this.timeOffset = offset; -290 return this; -291 }, -292 -293 /** -294 * Set this behavior status -295 * @param st {CAAT.Behavior.BaseBehavior.Status} -296 * @return {*} -297 * @private -298 */ -299 setStatus : function(st) { -300 this.status= st; -301 return this; -302 }, -303 -304 /** -305 * Sets this behavior id. -306 * @param id {object} -307 * +272 * Parse a behavior of this type. +273 * @param obj {object} an object with a behavior definition. +274 */ +275 parse : function( obj ) { +276 if ( obj.pingpong ) { +277 this.setPingPong(); +278 } +279 if ( obj.cycle ) { +280 this.setCycle(true); +281 } +282 var delay= obj.delay || 0; +283 var duration= obj.duration || 1000; +284 +285 this.setDelayTime( delay, duration ); +286 +287 if ( obj.interpolator ) { +288 this.setInterpolator( CAAT.Behavior.Interpolator.parse(obj.interpolator) ); +289 } +290 }, +291 +292 /** +293 * Set whether this behavior will apply behavior values to a reference Actor instance. +294 * @param apply {boolean} +295 * @return {*} +296 */ +297 setValueApplication:function (apply) { +298 this.doValueApplication = apply; +299 return this; +300 }, +301 +302 /** +303 * Set this behavior offset time. +304 * This method is intended to make a behavior start applying (the first) time from a different +305 * start time. +306 * @param offset {number} between 0 and 1 +307 * @return {*} 308 */ -309 setId:function (id) { -310 this.id = id; +309 setTimeOffset:function (offset) { +310 this.timeOffset = offset; 311 return this; 312 }, 313 314 /** -315 * Sets the default interpolator to a linear ramp, that is, behavior will be applied linearly. -316 * @return this -317 */ -318 setDefaultInterpolator:function () { -319 this.interpolator = DefaultInterpolator; -320 return this; -321 }, -322 -323 /** -324 * Sets default interpolator to be linear from 0..1 and from 1..0. -325 * @return this -326 */ -327 setPingPong:function () { -328 this.interpolator = DefaultInterpolatorPP; -329 return this; -330 }, -331 -332 /** -333 * Sets behavior start time and duration. Start time is set absolutely relative to scene time. -334 * @param startTime {number} an integer indicating behavior start time in scene time in ms.. -335 * @param duration {number} an integer indicating behavior duration in ms. -336 */ -337 setFrameTime:function (startTime, duration) { -338 this.behaviorStartTime = startTime; -339 this.behaviorDuration = duration; -340 this.status =CAAT.Behavior.BaseBehavior.Status.NOT_STARTED; -341 -342 return this; -343 }, -344 -345 /** -346 * Sets behavior start time and duration. Start time is relative to scene time. -347 * -348 * a call to -349 * setFrameTime( scene.time, duration ) is equivalent to -350 * setDelayTime( 0, duration ) -351 * @param delay {number} -352 * @param duration {number} -353 */ -354 setDelayTime:function (delay, duration) { -355 this.behaviorStartTime = delay; -356 this.behaviorDuration = duration; -357 this.status =CAAT.Behavior.BaseBehavior.Status.NOT_STARTED; -358 this.solved = false; -359 this.expired = false; -360 -361 return this; +315 * Set this behavior status +316 * @param st {CAAT.Behavior.BaseBehavior.Status} +317 * @return {*} +318 * @private +319 */ +320 setStatus : function(st) { +321 this.status= st; +322 return this; +323 }, +324 +325 /** +326 * Sets this behavior id. +327 * @param id {object} +328 * +329 */ +330 setId:function (id) { +331 this.id = id; +332 return this; +333 }, +334 +335 /** +336 * Sets the default interpolator to a linear ramp, that is, behavior will be applied linearly. +337 * @return this +338 */ +339 setDefaultInterpolator:function () { +340 this.interpolator = DefaultInterpolator; +341 return this; +342 }, +343 +344 /** +345 * Sets default interpolator to be linear from 0..1 and from 1..0. +346 * @return this +347 */ +348 setPingPong:function () { +349 this.interpolator = DefaultInterpolatorPP; +350 return this; +351 }, +352 +353 /** +354 * Sets behavior start time and duration. Start time is set absolutely relative to scene time. +355 * @param startTime {number} an integer indicating behavior start time in scene time in ms.. +356 * @param duration {number} an integer indicating behavior duration in ms. +357 */ +358 setFrameTime:function (startTime, duration) { +359 this.behaviorStartTime = startTime; +360 this.behaviorDuration = duration; +361 this.status =CAAT.Behavior.BaseBehavior.Status.NOT_STARTED; 362 -363 }, -364 -365 /** -366 * Make this behavior not applicable. -367 * @return {*} -368 */ -369 setOutOfFrameTime:function () { -370 this.status =CAAT.Behavior.BaseBehavior.Status.EXPIRED; -371 this.behaviorStartTime = Number.MAX_VALUE; -372 this.behaviorDuration = 0; -373 return this; -374 }, -375 -376 /** -377 * Changes behavior default interpolator to another instance of CAAT.Interpolator. -378 * If the behavior is not defined by CAAT.Interpolator factory methods, the interpolation function must return -379 * its values in the range 0..1. The behavior will only apply for such value range. -380 * @param interpolator a CAAT.Interpolator instance. -381 */ -382 setInterpolator:function (interpolator) { -383 this.interpolator = interpolator; -384 return this; -385 }, -386 -387 /** -388 * This method must no be called directly. -389 * The director loop will call this method in orther to apply actor behaviors. -390 * @param time the scene time the behaviro is being applied at. -391 * @param actor a CAAT.Actor instance the behavior is being applied to. -392 */ -393 apply:function (time, actor) { -394 -395 if (!this.solved) { -396 this.behaviorStartTime += time; -397 this.solved = true; -398 } -399 -400 time += this.timeOffset * this.behaviorDuration; -401 -402 var orgTime = time; -403 if (this.isBehaviorInTime(time, actor)) { -404 time = this.normalizeTime(time); -405 this.fireBehaviorAppliedEvent( -406 actor, -407 orgTime, -408 time, -409 this.setForTime(time, actor)); -410 } -411 }, -412 -413 /** -414 * Sets the behavior to cycle, ie apply forever. -415 * @param bool a boolean indicating whether the behavior is cycle. -416 */ -417 setCycle:function (bool) { -418 this.cycleBehavior = bool; -419 return this; -420 }, -421 -422 /** -423 * Adds an observer to this behavior. -424 * @param behaviorListener an observer instance. -425 */ -426 addListener:function (behaviorListener) { -427 this.lifecycleListenerList.push(behaviorListener); -428 return this; -429 }, -430 -431 /** -432 * Remove all registered listeners to the behavior. -433 */ -434 emptyListenerList:function () { -435 this.lifecycleListenerList = []; -436 return this; -437 }, -438 -439 /** -440 * @return an integer indicating the behavior start time in ms.. -441 */ -442 getStartTime:function () { -443 return this.behaviorStartTime; -444 }, -445 -446 /** -447 * @return an integer indicating the behavior duration time in ms. -448 */ -449 getDuration:function () { -450 return this.behaviorDuration; -451 -452 }, -453 -454 /** -455 * Chekcs whether the behaviour is in scene time. -456 * In case it gets out of scene time, and has not been tagged as expired, the behavior is expired and observers -457 * are notified about that fact. -458 * @param time the scene time to check the behavior against. -459 * @param actor the actor the behavior is being applied to. -460 * @return a boolean indicating whether the behavior is in scene time. -461 */ -462 isBehaviorInTime:function (time, actor) { +363 return this; +364 }, +365 +366 /** +367 * Sets behavior start time and duration. Start time is relative to scene time. +368 * +369 * a call to +370 * setFrameTime( scene.time, duration ) is equivalent to +371 * setDelayTime( 0, duration ) +372 * @param delay {number} +373 * @param duration {number} +374 */ +375 setDelayTime:function (delay, duration) { +376 this.behaviorStartTime = delay; +377 this.behaviorDuration = duration; +378 this.status =CAAT.Behavior.BaseBehavior.Status.NOT_STARTED; +379 this.solved = false; +380 this.expired = false; +381 +382 return this; +383 +384 }, +385 +386 /** +387 * Make this behavior not applicable. +388 * @return {*} +389 */ +390 setOutOfFrameTime:function () { +391 this.status =CAAT.Behavior.BaseBehavior.Status.EXPIRED; +392 this.behaviorStartTime = Number.MAX_VALUE; +393 this.behaviorDuration = 0; +394 return this; +395 }, +396 +397 /** +398 * Changes behavior default interpolator to another instance of CAAT.Interpolator. +399 * If the behavior is not defined by CAAT.Interpolator factory methods, the interpolation function must return +400 * its values in the range 0..1. The behavior will only apply for such value range. +401 * @param interpolator a CAAT.Interpolator instance. +402 */ +403 setInterpolator:function (interpolator) { +404 this.interpolator = interpolator; +405 return this; +406 }, +407 +408 /** +409 * This method must no be called directly. +410 * The director loop will call this method in orther to apply actor behaviors. +411 * @param time the scene time the behaviro is being applied at. +412 * @param actor a CAAT.Actor instance the behavior is being applied to. +413 */ +414 apply:function (time, actor) { +415 +416 if (!this.solved) { +417 this.behaviorStartTime += time; +418 this.solved = true; +419 } +420 +421 time += this.timeOffset * this.behaviorDuration; +422 +423 var orgTime = time; +424 if (this.isBehaviorInTime(time, actor)) { +425 time = this.normalizeTime(time); +426 this.fireBehaviorAppliedEvent( +427 actor, +428 orgTime, +429 time, +430 this.setForTime(time, actor)); +431 } +432 }, +433 +434 /** +435 * Sets the behavior to cycle, ie apply forever. +436 * @param bool a boolean indicating whether the behavior is cycle. +437 */ +438 setCycle:function (bool) { +439 this.cycleBehavior = bool; +440 return this; +441 }, +442 +443 isCycle : function() { +444 return this.cycleBehavior; +445 }, +446 +447 /** +448 * Adds an observer to this behavior. +449 * @param behaviorListener an observer instance. +450 */ +451 addListener:function (behaviorListener) { +452 this.lifecycleListenerList.push(behaviorListener); +453 return this; +454 }, +455 +456 /** +457 * Remove all registered listeners to the behavior. +458 */ +459 emptyListenerList:function () { +460 this.lifecycleListenerList = []; +461 return this; +462 }, 463 -464 var st= CAAT.Behavior.BaseBehavior.Status; -465 -466 if (this.status === st.EXPIRED || this.behaviorStartTime < 0) { -467 return false; -468 } -469 -470 if (this.cycleBehavior) { -471 if (time >= this.behaviorStartTime) { -472 time = (time - this.behaviorStartTime) % this.behaviorDuration + this.behaviorStartTime; -473 } -474 } -475 -476 if (time > this.behaviorStartTime + this.behaviorDuration) { -477 if (this.status !== st.EXPIRED) { -478 this.setExpired(actor, time); -479 } -480 -481 return false; -482 } -483 -484 if (this.status === st.NOT_STARTED) { -485 this.status = st.STARTED; -486 this.fireBehaviorStartedEvent(actor, time); -487 } +464 /** +465 * @return an integer indicating the behavior start time in ms.. +466 */ +467 getStartTime:function () { +468 return this.behaviorStartTime; +469 }, +470 +471 /** +472 * @return an integer indicating the behavior duration time in ms. +473 */ +474 getDuration:function () { +475 return this.behaviorDuration; +476 +477 }, +478 +479 /** +480 * Chekcs whether the behaviour is in scene time. +481 * In case it gets out of scene time, and has not been tagged as expired, the behavior is expired and observers +482 * are notified about that fact. +483 * @param time the scene time to check the behavior against. +484 * @param actor the actor the behavior is being applied to. +485 * @return a boolean indicating whether the behavior is in scene time. +486 */ +487 isBehaviorInTime:function (time, actor) { 488 -489 return this.behaviorStartTime <= time; // && time<this.behaviorStartTime+this.behaviorDuration; -490 }, -491 -492 /** -493 * Notify observers the first time the behavior is applied. -494 * @param actor -495 * @param time -496 * @private -497 */ -498 fireBehaviorStartedEvent:function (actor, time) { -499 for (var i = 0, l = this.lifecycleListenerList.length; i < l; i++) { -500 var b = this.lifecycleListenerList[i]; -501 if (b.behaviorStarted) { -502 b.behaviorStarted(this, time, actor); -503 } -504 } -505 }, -506 -507 /** -508 * Notify observers about expiration event. -509 * @param actor a CAAT.Actor instance -510 * @param time an integer with the scene time the behavior was expired at. -511 * @private -512 */ -513 fireBehaviorExpiredEvent:function (actor, time) { -514 for (var i = 0, l = this.lifecycleListenerList.length; i < l; i++) { -515 var b = this.lifecycleListenerList[i]; -516 if (b.behaviorExpired) { -517 b.behaviorExpired(this, time, actor); -518 } -519 } -520 }, -521 -522 /** -523 * Notify observers about behavior being applied. -524 * @param actor a CAAT.Actor instance the behavior is being applied to. -525 * @param time the scene time of behavior application. -526 * @param normalizedTime the normalized time (0..1) considering 0 behavior start time and 1 -527 * behaviorStartTime+behaviorDuration. -528 * @param value the value being set for actor properties. each behavior will supply with its own value version. -529 * @private -530 */ -531 fireBehaviorAppliedEvent:function (actor, time, normalizedTime, value) { -532 for (var i = 0, l = this.lifecycleListenerList.length; i < l; i++) { -533 var b = this.lifecycleListenerList[i]; -534 if (b.behaviorApplied) { -535 b.behaviorApplied(this, time, normalizedTime, actor, value); -536 } -537 } -538 }, -539 -540 /** -541 * Convert scene time into something more manageable for the behavior. -542 * behaviorStartTime will be 0 and behaviorStartTime+behaviorDuration will be 1. -543 * the time parameter will be proportional to those values. -544 * @param time the scene time to be normalized. an integer. -545 * @private -546 */ -547 normalizeTime:function (time) { -548 time = time - this.behaviorStartTime; -549 if (this.cycleBehavior) { -550 time %= this.behaviorDuration; -551 } -552 -553 return this.interpolator.getPosition(time / this.behaviorDuration).y; -554 }, -555 -556 /** -557 * Sets the behavior as expired. -558 * This method must not be called directly. It is an auxiliary method to isBehaviorInTime method. -559 * @param actor {CAAT.Actor} -560 * @param time {integer} the scene time. -561 * @private -562 */ -563 setExpired:function (actor, time) { -564 // set for final interpolator value. -565 this.status = CAAT.Behavior.BaseBehavior.Status.EXPIRED; -566 this.setForTime(this.interpolator.getPosition(1).y, actor); -567 this.fireBehaviorExpiredEvent(actor, time); -568 -569 if (this.discardable) { -570 this.actor.removeBehavior(this); -571 } -572 }, -573 -574 /** -575 * This method must be overriden for every Behavior breed. -576 * Must not be called directly. -577 * @param actor {CAAT.Actor} a CAAT.Actor instance. -578 * @param time {number} an integer with the scene time. -579 * @private -580 */ -581 setForTime:function (time, actor) { -582 -583 }, -584 -585 /** -586 * @param overrides +489 var st= CAAT.Behavior.BaseBehavior.Status; +490 +491 if (this.status === st.EXPIRED || this.behaviorStartTime < 0) { +492 return false; +493 } +494 +495 if (this.cycleBehavior) { +496 if (time >= this.behaviorStartTime) { +497 time = (time - this.behaviorStartTime) % this.behaviorDuration + this.behaviorStartTime; +498 } +499 } +500 +501 if (time > this.behaviorStartTime + this.behaviorDuration) { +502 if (this.status !== st.EXPIRED) { +503 this.setExpired(actor, time); +504 } +505 +506 return false; +507 } +508 +509 if (this.status === st.NOT_STARTED) { +510 this.status = st.STARTED; +511 this.fireBehaviorStartedEvent(actor, time); +512 } +513 +514 return this.behaviorStartTime <= time; // && time<this.behaviorStartTime+this.behaviorDuration; +515 }, +516 +517 /** +518 * Notify observers the first time the behavior is applied. +519 * @param actor +520 * @param time +521 * @private +522 */ +523 fireBehaviorStartedEvent:function (actor, time) { +524 for (var i = 0, l = this.lifecycleListenerList.length; i < l; i++) { +525 var b = this.lifecycleListenerList[i]; +526 if (b.behaviorStarted) { +527 b.behaviorStarted(this, time, actor); +528 } +529 } +530 }, +531 +532 /** +533 * Notify observers about expiration event. +534 * @param actor a CAAT.Actor instance +535 * @param time an integer with the scene time the behavior was expired at. +536 * @private +537 */ +538 fireBehaviorExpiredEvent:function (actor, time) { +539 for (var i = 0, l = this.lifecycleListenerList.length; i < l; i++) { +540 var b = this.lifecycleListenerList[i]; +541 if (b.behaviorExpired) { +542 b.behaviorExpired(this, time, actor); +543 } +544 } +545 }, +546 +547 /** +548 * Notify observers about behavior being applied. +549 * @param actor a CAAT.Actor instance the behavior is being applied to. +550 * @param time the scene time of behavior application. +551 * @param normalizedTime the normalized time (0..1) considering 0 behavior start time and 1 +552 * behaviorStartTime+behaviorDuration. +553 * @param value the value being set for actor properties. each behavior will supply with its own value version. +554 * @private +555 */ +556 fireBehaviorAppliedEvent:function (actor, time, normalizedTime, value) { +557 for (var i = 0, l = this.lifecycleListenerList.length; i < l; i++) { +558 var b = this.lifecycleListenerList[i]; +559 if (b.behaviorApplied) { +560 b.behaviorApplied(this, time, normalizedTime, actor, value); +561 } +562 } +563 }, +564 +565 /** +566 * Convert scene time into something more manageable for the behavior. +567 * behaviorStartTime will be 0 and behaviorStartTime+behaviorDuration will be 1. +568 * the time parameter will be proportional to those values. +569 * @param time the scene time to be normalized. an integer. +570 * @private +571 */ +572 normalizeTime:function (time) { +573 time = time - this.behaviorStartTime; +574 if (this.cycleBehavior) { +575 time %= this.behaviorDuration; +576 } +577 +578 return this.interpolator.getPosition(time / this.behaviorDuration).y; +579 }, +580 +581 /** +582 * Sets the behavior as expired. +583 * This method must not be called directly. It is an auxiliary method to isBehaviorInTime method. +584 * @param actor {CAAT.Actor} +585 * @param time {integer} the scene time. +586 * @private 587 */ -588 initialize:function (overrides) { -589 if (overrides) { -590 for (var i in overrides) { -591 this[i] = overrides[i]; -592 } -593 } -594 -595 return this; -596 }, -597 -598 /** -599 * Get this behaviors CSS property name application. -600 * @return {String} -601 */ -602 getPropertyName:function () { -603 return ""; -604 }, -605 -606 /** -607 * Calculate a CSS3 @key-frame for this behavior at the given time. -608 * @param time {number} -609 */ -610 calculateKeyFrameData:function (time) { -611 }, -612 -613 /** -614 * Calculate a CSS3 @key-frame data values instead of building a CSS3 @key-frame value. -615 * @param time {number} -616 */ -617 getKeyFrameDataValues : function(time) { -618 }, +588 setExpired:function (actor, time) { +589 // set for final interpolator value. +590 this.status = CAAT.Behavior.BaseBehavior.Status.EXPIRED; +591 this.setForTime(this.interpolator.getPosition(1).y, actor); +592 this.fireBehaviorExpiredEvent(actor, time); +593 +594 if (this.discardable) { +595 this.actor.removeBehavior(this); +596 } +597 }, +598 +599 /** +600 * This method must be overriden for every Behavior breed. +601 * Must not be called directly. +602 * @param actor {CAAT.Actor} a CAAT.Actor instance. +603 * @param time {number} an integer with the scene time. +604 * @private +605 */ +606 setForTime:function (time, actor) { +607 +608 }, +609 +610 /** +611 * @param overrides +612 */ +613 initialize:function (overrides) { +614 if (overrides) { +615 for (var i in overrides) { +616 this[i] = overrides[i]; +617 } +618 } 619 -620 /** -621 * Calculate a complete CSS3 @key-frame set for this behavior. -622 * @param prefix {string} browser vendor prefix -623 * @param name {string} keyframes animation name -624 * @param keyframessize {number} number of keyframes to generate -625 */ -626 calculateKeyFramesData:function (prefix, name, keyframessize) { -627 } -628 -629 } -630 } -631 }); -632 -633 -634 -635 \ No newline at end of file +620 return this; +621 }, +622 +623 /** +624 * Get this behaviors CSS property name application. +625 * @return {String} +626 */ +627 getPropertyName:function () { +628 return ""; +629 }, +630 +631 /** +632 * Calculate a CSS3 @key-frame for this behavior at the given time. +633 * @param time {number} +634 */ +635 calculateKeyFrameData:function (time) { +636 }, +637 +638 /** +639 * Calculate a CSS3 @key-frame data values instead of building a CSS3 @key-frame value. +640 * @param time {number} +641 */ +642 getKeyFrameDataValues : function(time) { +643 }, +644 +645 /** +646 * Calculate a complete CSS3 @key-frame set for this behavior. +647 * @param prefix {string} browser vendor prefix +648 * @param name {string} keyframes animation name +649 * @param keyframessize {number} number of keyframes to generate +650 */ +651 calculateKeyFramesData:function (prefix, name, keyframessize) { +652 } +653 +654 } +655 } +656 }); +657 +658 +659 +660 \ No newline at end of file diff --git a/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_Behavior_ContainerBehavior.js.html b/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_Behavior_ContainerBehavior.js.html index f5cf3f7c..c04f6a46 100644 --- a/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_Behavior_ContainerBehavior.js.html +++ b/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_Behavior_ContainerBehavior.js.html @@ -43,376 +43,414 @@ 36 * @type {Array.<CAAT.Behavior.BaseBehavior>} 37 */ 38 behaviors:null, // contained behaviors array - 39 - 40 /** - 41 * @inheritDoc - 42 * @private - 43 */ - 44 __init:function () { - 45 this.__super(); - 46 this.behaviors = []; - 47 return this; - 48 }, - 49 - 50 /** - 51 * Proportionally change this container duration to its children. - 52 * @param duration {number} new duration in ms. - 53 * @return this; - 54 */ - 55 conformToDuration:function (duration) { - 56 this.duration = duration; - 57 - 58 var f = duration / this.duration; - 59 var bh; - 60 for (var i = 0; i < this.behaviors.length; i++) { - 61 bh = this.behaviors[i]; - 62 bh.setFrameTime(bh.getStartTime() * f, bh.getDuration() * f); - 63 } - 64 - 65 return this; - 66 }, - 67 - 68 /** - 69 * Get a behavior by mathing its id. - 70 * @param id {object} - 71 */ - 72 getBehaviorById : function(id) { - 73 for( var i=0; i<this.behaviors.length; i++ ) { - 74 if ( this.behaviors[i].id===id ) { - 75 return this.behaviors[i]; - 76 } - 77 } - 78 - 79 return null; - 80 }, - 81 - 82 /** - 83 * Add a new behavior to the container. - 84 * @param behavior {CAAT.Behavior.BaseBehavior} - 85 */ - 86 addBehavior:function (behavior) { - 87 this.behaviors.push(behavior); - 88 behavior.addListener(this); - 89 return this; - 90 }, - 91 - 92 /** - 93 * Applies every contained Behaviors. - 94 * The application time the contained behaviors will receive will be ContainerBehavior related and not the - 95 * received time. - 96 * @param time an integer indicating the time to apply the contained behaviors at. - 97 * @param actor a CAAT.Foundation.Actor instance indicating the actor to apply the behaviors for. - 98 */ - 99 apply:function (time, actor) { -100 -101 if (!this.solved) { -102 this.behaviorStartTime += time; -103 this.solved = true; -104 } -105 -106 time += this.timeOffset * this.behaviorDuration; -107 -108 if (this.isBehaviorInTime(time, actor)) { -109 time -= this.getStartTime(); -110 if (this.cycleBehavior) { -111 time %= this.getDuration(); -112 } -113 -114 var bh = this.behaviors; -115 for (var i = 0; i < bh.length; i++) { -116 bh[i].apply(time, actor); -117 } -118 } -119 }, -120 -121 /** -122 * This method is the observer implementation for every contained behavior. -123 * If a container is Cycle=true, won't allow its contained behaviors to be expired. -124 * @param behavior a CAAT.Behavior.BaseBehavior instance which has been expired. -125 * @param time an integer indicating the time at which has become expired. -126 * @param actor a CAAT.Foundation.Actor the expired behavior is being applied to. -127 */ -128 behaviorExpired:function (behavior, time, actor) { -129 if (this.cycleBehavior) { -130 behavior.setStatus(CAAT.Behavior.BaseBehavior.Status.STARTED); -131 } -132 }, + 39 recursiveCycleBehavior : false, + 40 conforming : false, + 41 + 42 /** + 43 * @param conforming {bool=} conform this behavior duration to that of its children. + 44 * @inheritDoc + 45 * @private + 46 */ + 47 __init:function ( conforming ) { + 48 this.__super(); + 49 this.behaviors = []; + 50 if ( conforming ) { + 51 this.conforming= true; + 52 } + 53 return this; + 54 }, + 55 + 56 /** + 57 * Proportionally change this container duration to its children. + 58 * @param duration {number} new duration in ms. + 59 * @return this; + 60 */ + 61 conformToDuration:function (duration) { + 62 this.duration = duration; + 63 + 64 var f = duration / this.duration; + 65 var bh; + 66 for (var i = 0; i < this.behaviors.length; i++) { + 67 bh = this.behaviors[i]; + 68 bh.setFrameTime(bh.getStartTime() * f, bh.getDuration() * f); + 69 } + 70 + 71 return this; + 72 }, + 73 + 74 /** + 75 * Get a behavior by mathing its id. + 76 * @param id {object} + 77 */ + 78 getBehaviorById : function(id) { + 79 for( var i=0; i<this.behaviors.length; i++ ) { + 80 if ( this.behaviors[i].id===id ) { + 81 return this.behaviors[i]; + 82 } + 83 } + 84 + 85 return null; + 86 }, + 87 + 88 setCycle : function( cycle, recurse ) { + 89 CAAT.Behavior.ContainerBehavior.superclass.setCycle.call(this,cycle); + 90 + 91 if ( recurse ) { + 92 for( var i=0; i<this.behaviors.length; i++ ) { + 93 this.behaviors[i].setCycle(cycle); + 94 } + 95 } + 96 + 97 this.recursiveCycleBehavior= recurse; + 98 + 99 return this; +100 }, +101 +102 /** +103 * Add a new behavior to the container. +104 * @param behavior {CAAT.Behavior.BaseBehavior} +105 */ +106 addBehavior:function (behavior) { +107 this.behaviors.push(behavior); +108 behavior.addListener(this); +109 +110 if ( this.conforming ) { +111 var len= behavior.behaviorDuration + behavior.behaviorStartTime; +112 if ( this.behaviorDuration < len ) { +113 this.behaviorDuration= len; +114 this.behaviorStartTime= 0; +115 } +116 } +117 +118 if ( this.recursiveCycleBehavior ) { +119 behavior.setCycle( this.isCycle() ); +120 } +121 +122 return this; +123 }, +124 +125 /** +126 * Applies every contained Behaviors. +127 * The application time the contained behaviors will receive will be ContainerBehavior related and not the +128 * received time. +129 * @param time an integer indicating the time to apply the contained behaviors at. +130 * @param actor a CAAT.Foundation.Actor instance indicating the actor to apply the behaviors for. +131 */ +132 apply:function (time, actor) { 133 -134 /** -135 * Implementation method of the behavior. -136 * Just call implementation method for its contained behaviors. -137 * @param time{number} an integer indicating the time the behavior is being applied at. -138 * @param actor{CAAT.Foundation.Actor} an actor the behavior is being applied to. -139 */ -140 setForTime:function (time, actor) { -141 var bh = this.behaviors; -142 for (var i = 0; i < bh.length; i++) { -143 bh[i].setForTime(time, actor); -144 } -145 -146 return null; -147 }, -148 -149 /** -150 * Expire this behavior and the children applied at the parameter time. -151 * @param actor {CAAT.Foundation.Actor} -152 * @param time {number} -153 * @return {*} -154 */ -155 setExpired:function (actor, time) { -156 -157 var bh = this.behaviors; -158 // set for final interpolator value. -159 for (var i = 0; i < bh.length; i++) { -160 var bb = bh[i]; -161 if ( bb.status !== CAAT.Behavior.BaseBehavior.Status.EXPIRED) { -162 bb.setExpired(actor, time - this.behaviorStartTime); -163 } +134 if (!this.solved) { +135 this.behaviorStartTime += time; +136 this.solved = true; +137 } +138 +139 time += this.timeOffset * this.behaviorDuration; +140 +141 if (this.isBehaviorInTime(time, actor)) { +142 time -= this.behaviorStartTime; +143 if (this.cycleBehavior) { +144 time %= this.behaviorDuration; +145 } +146 +147 var bh = this.behaviors; +148 for (var i = 0; i < bh.length; i++) { +149 bh[i].apply(time, actor); +150 } +151 } +152 }, +153 +154 /** +155 * This method is the observer implementation for every contained behavior. +156 * If a container is Cycle=true, won't allow its contained behaviors to be expired. +157 * @param behavior a CAAT.Behavior.BaseBehavior instance which has been expired. +158 * @param time an integer indicating the time at which has become expired. +159 * @param actor a CAAT.Foundation.Actor the expired behavior is being applied to. +160 */ +161 behaviorExpired:function (behavior, time, actor) { +162 if (this.cycleBehavior) { +163 behavior.setStatus(CAAT.Behavior.BaseBehavior.Status.STARTED); 164 } -165 -166 /** -167 * moved here from the beggining of the method. -168 * allow for expiration observers to reset container behavior and its sub-behaviors -169 * to redeem. -170 */ -171 CAAT.Behavior.ContainerBehavior.superclass.setExpired.call(this, actor, time); -172 -173 return this; -174 }, -175 -176 /** -177 * @inheritDoc -178 */ -179 setFrameTime:function (start, duration) { -180 CAAT.Behavior.ContainerBehavior.superclass.setFrameTime.call(this, start, duration); -181 -182 var bh = this.behaviors; -183 for (var i = 0; i < bh.length; i++) { -184 bh[i].setStatus(CAAT.Behavior.BaseBehavior.Status.NOT_STARTED); -185 } -186 return this; -187 }, -188 -189 /** -190 * @inheritDoc -191 */ -192 setDelayTime:function (start, duration) { -193 CAAT.Behavior.ContainerBehavior.superclass.setDelayTime.call(this, start, duration); +165 }, +166 +167 behaviorApplied : function(behavior, scenetime, time, actor, value ) { +168 this.fireBehaviorAppliedEvent(actor, scenetime, time, value); +169 }, +170 +171 /** +172 * Implementation method of the behavior. +173 * Just call implementation method for its contained behaviors. +174 * @param time{number} an integer indicating the time the behavior is being applied at. +175 * @param actor{CAAT.Foundation.Actor} an actor the behavior is being applied to. +176 */ +177 setForTime:function (time, actor) { +178 var retValue= null; +179 var bh = this.behaviors; +180 for (var i = 0; i < bh.length; i++) { +181 retValue= bh[i].setForTime(time, actor); +182 } +183 +184 return retValue; +185 }, +186 +187 /** +188 * Expire this behavior and the children applied at the parameter time. +189 * @param actor {CAAT.Foundation.Actor} +190 * @param time {number} +191 * @return {*} +192 */ +193 setExpired:function (actor, time) { 194 195 var bh = this.behaviors; -196 for (var i = 0; i < bh.length; i++) { -197 bh[i].setStatus(CAAT.Behavior.BaseBehavior.Status.NOT_STARTED); -198 } -199 return this; -200 }, -201 -202 /** -203 * @inheritDoc -204 */ -205 getKeyFrameDataValues : function(referenceTime) { -206 -207 var i, bh, time; -208 var keyFrameData= { -209 angle : 0, -210 scaleX : 1, -211 scaleY : 1, -212 x : 0, -213 y : 0 -214 }; -215 -216 for (i = 0; i < this.behaviors.length; i++) { -217 bh = this.behaviors[i]; -218 if (bh.status !== CAAT.Behavior.BaseBehavior.Status.EXPIRED && !(bh instanceof CAAT.Behavior.GenericBehavior)) { +196 // set for final interpolator value. +197 for (var i = 0; i < bh.length; i++) { +198 var bb = bh[i]; +199 if ( bb.status !== CAAT.Behavior.BaseBehavior.Status.EXPIRED) { +200 bb.setExpired(actor, time - this.behaviorStartTime); +201 } +202 } +203 +204 /** +205 * moved here from the beggining of the method. +206 * allow for expiration observers to reset container behavior and its sub-behaviors +207 * to redeem. +208 */ +209 CAAT.Behavior.ContainerBehavior.superclass.setExpired.call(this, actor, time); +210 +211 return this; +212 }, +213 +214 /** +215 * @inheritDoc +216 */ +217 setFrameTime:function (start, duration) { +218 CAAT.Behavior.ContainerBehavior.superclass.setFrameTime.call(this, start, duration); 219 -220 // ajustar tiempos: -221 // time es tiempo normalizado a duracion de comportamiento contenedor. -222 // 1.- desnormalizar -223 time = referenceTime * this.behaviorDuration; -224 -225 // 2.- calcular tiempo relativo de comportamiento respecto a contenedor -226 if (bh.behaviorStartTime <= time && bh.behaviorStartTime + bh.behaviorDuration >= time) { -227 // 3.- renormalizar tiempo reltivo a comportamiento. -228 time = (time - bh.behaviorStartTime) / bh.behaviorDuration; -229 -230 // 4.- obtener valor de comportamiento para tiempo normalizado relativo a contenedor -231 var obj= bh.getKeyFrameDataValues(time); -232 for( var pr in obj ) { -233 keyFrameData[pr]= obj[pr]; -234 } -235 } -236 } -237 } -238 -239 return keyFrameData; -240 }, -241 -242 /** -243 * @inheritDoc -244 */ -245 calculateKeyFrameData:function (referenceTime, prefix) { -246 -247 var i; -248 var bh; -249 -250 var retValue = {}; -251 var time; -252 var cssRuleValue; -253 var cssProperty; -254 var property; -255 -256 for (i = 0; i < this.behaviors.length; i++) { -257 bh = this.behaviors[i]; -258 if (bh.status !== CAAT.Behavior.BaseBehavior.Status.EXPIRED && !(bh instanceof CAAT.Behavior.GenericBehavior)) { -259 -260 // ajustar tiempos: -261 // time es tiempo normalizado a duracion de comportamiento contenedor. -262 // 1.- desnormalizar -263 time = referenceTime * this.behaviorDuration; -264 -265 // 2.- calcular tiempo relativo de comportamiento respecto a contenedor -266 if (bh.behaviorStartTime <= time && bh.behaviorStartTime + bh.behaviorDuration >= time) { -267 // 3.- renormalizar tiempo reltivo a comportamiento. -268 time = (time - bh.behaviorStartTime) / bh.behaviorDuration; -269 -270 // 4.- obtener valor de comportamiento para tiempo normalizado relativo a contenedor -271 cssRuleValue = bh.calculateKeyFrameData(time); -272 cssProperty = bh.getPropertyName(prefix); -273 -274 if (typeof retValue[cssProperty] === 'undefined') { -275 retValue[cssProperty] = ""; -276 } -277 -278 // 5.- asignar a objeto, par de propiedad/valor css -279 retValue[cssProperty] += cssRuleValue + " "; -280 } -281 -282 } -283 } +220 var bh = this.behaviors; +221 for (var i = 0; i < bh.length; i++) { +222 bh[i].setStatus(CAAT.Behavior.BaseBehavior.Status.NOT_STARTED); +223 } +224 return this; +225 }, +226 +227 /** +228 * @inheritDoc +229 */ +230 setDelayTime:function (start, duration) { +231 CAAT.Behavior.ContainerBehavior.superclass.setDelayTime.call(this, start, duration); +232 +233 var bh = this.behaviors; +234 for (var i = 0; i < bh.length; i++) { +235 bh[i].setStatus(CAAT.Behavior.BaseBehavior.Status.NOT_STARTED); +236 } +237 return this; +238 }, +239 +240 /** +241 * @inheritDoc +242 */ +243 getKeyFrameDataValues : function(referenceTime) { +244 +245 var i, bh, time; +246 var keyFrameData= { +247 angle : 0, +248 scaleX : 1, +249 scaleY : 1, +250 x : 0, +251 y : 0 +252 }; +253 +254 for (i = 0; i < this.behaviors.length; i++) { +255 bh = this.behaviors[i]; +256 if (bh.status !== CAAT.Behavior.BaseBehavior.Status.EXPIRED && !(bh instanceof CAAT.Behavior.GenericBehavior)) { +257 +258 // ajustar tiempos: +259 // time es tiempo normalizado a duracion de comportamiento contenedor. +260 // 1.- desnormalizar +261 time = referenceTime * this.behaviorDuration; +262 +263 // 2.- calcular tiempo relativo de comportamiento respecto a contenedor +264 if (bh.behaviorStartTime <= time && bh.behaviorStartTime + bh.behaviorDuration >= time) { +265 // 3.- renormalizar tiempo reltivo a comportamiento. +266 time = (time - bh.behaviorStartTime) / bh.behaviorDuration; +267 +268 // 4.- obtener valor de comportamiento para tiempo normalizado relativo a contenedor +269 var obj= bh.getKeyFrameDataValues(time); +270 for( var pr in obj ) { +271 keyFrameData[pr]= obj[pr]; +272 } +273 } +274 } +275 } +276 +277 return keyFrameData; +278 }, +279 +280 /** +281 * @inheritDoc +282 */ +283 calculateKeyFrameData:function (referenceTime, prefix) { 284 -285 -286 var tr = ""; -287 var pv; -288 -289 function xx(pr) { -290 if (retValue[pr]) { -291 tr += retValue[pr]; -292 } else { -293 if (prevValues) { -294 pv = prevValues[pr]; -295 if (pv) { -296 tr += pv; -297 retValue[pr] = pv; -298 } -299 } -300 } -301 } +285 var i; +286 var bh; +287 +288 var retValue = {}; +289 var time; +290 var cssRuleValue; +291 var cssProperty; +292 var property; +293 +294 for (i = 0; i < this.behaviors.length; i++) { +295 bh = this.behaviors[i]; +296 if (bh.status !== CAAT.Behavior.BaseBehavior.Status.EXPIRED && !(bh instanceof CAAT.Behavior.GenericBehavior)) { +297 +298 // ajustar tiempos: +299 // time es tiempo normalizado a duracion de comportamiento contenedor. +300 // 1.- desnormalizar +301 time = referenceTime * this.behaviorDuration; 302 -303 xx('translate'); -304 xx('rotate'); -305 xx('scale'); -306 -307 var keyFrameRule = ""; -308 -309 if (tr) { -310 keyFrameRule = '-' + prefix + '-transform: ' + tr + ';'; -311 } -312 -313 tr = ""; -314 xx('opacity'); -315 if (tr) { -316 keyFrameRule += ' opacity: ' + tr + ';'; -317 } -318 -319 keyFrameRule+=" -webkit-transform-origin: 0% 0%"; -320 -321 return { -322 rules:keyFrameRule, -323 ret:retValue -324 }; -325 -326 }, -327 -328 /** -329 * @inheritDoc -330 */ -331 calculateKeyFramesData:function (prefix, name, keyframessize, anchorX, anchorY) { -332 -333 function toKeyFrame(obj, prevKF) { -334 -335 for( var i in prevKF ) { -336 if ( !obj[i] ) { -337 obj[i]= prevKF[i]; -338 } -339 } +303 // 2.- calcular tiempo relativo de comportamiento respecto a contenedor +304 if (bh.behaviorStartTime <= time && bh.behaviorStartTime + bh.behaviorDuration >= time) { +305 // 3.- renormalizar tiempo reltivo a comportamiento. +306 time = (time - bh.behaviorStartTime) / bh.behaviorDuration; +307 +308 // 4.- obtener valor de comportamiento para tiempo normalizado relativo a contenedor +309 cssRuleValue = bh.calculateKeyFrameData(time); +310 cssProperty = bh.getPropertyName(prefix); +311 +312 if (typeof retValue[cssProperty] === 'undefined') { +313 retValue[cssProperty] = ""; +314 } +315 +316 // 5.- asignar a objeto, par de propiedad/valor css +317 retValue[cssProperty] += cssRuleValue + " "; +318 } +319 +320 } +321 } +322 +323 +324 var tr = ""; +325 var pv; +326 +327 function xx(pr) { +328 if (retValue[pr]) { +329 tr += retValue[pr]; +330 } else { +331 if (prevValues) { +332 pv = prevValues[pr]; +333 if (pv) { +334 tr += pv; +335 retValue[pr] = pv; +336 } +337 } +338 } +339 } 340 -341 var ret= "-" + prefix + "-transform:"; -342 -343 if ( obj.x || obj.y ) { -344 var x= obj.x || 0; -345 var y= obj.y || 0; -346 ret+= "translate("+x+"px,"+y+"px)"; -347 } -348 -349 if ( obj.angle ) { -350 ret+= " rotate("+obj.angle+"rad)"; -351 } -352 -353 if ( obj.scaleX!==1 || obj.scaleY!==1 ) { -354 ret+= " scale("+(obj.scaleX)+","+(obj.scaleY)+")"; -355 } +341 xx('translate'); +342 xx('rotate'); +343 xx('scale'); +344 +345 var keyFrameRule = ""; +346 +347 if (tr) { +348 keyFrameRule = '-' + prefix + '-transform: ' + tr + ';'; +349 } +350 +351 tr = ""; +352 xx('opacity'); +353 if (tr) { +354 keyFrameRule += ' opacity: ' + tr + ';'; +355 } 356 -357 ret+=";"; +357 keyFrameRule+=" -webkit-transform-origin: 0% 0%"; 358 -359 if ( obj.alpha ) { -360 ret+= " opacity: "+obj.alpha+";"; -361 } -362 -363 if ( anchorX!==.5 || anchorY!==.5) { -364 ret+= " -" + prefix + "-transform-origin:"+ (anchorX*100) + "% " + (anchorY*100) + "%;"; -365 } -366 -367 return ret; -368 } -369 -370 if (this.duration === Number.MAX_VALUE) { -371 return ""; -372 } -373 -374 if (typeof anchorX==="undefined") { -375 anchorX= .5; -376 } -377 -378 if (typeof anchorY==="undefined") { -379 anchorY= .5; -380 } -381 -382 if (typeof keyframessize === 'undefined') { -383 keyframessize = 100; -384 } -385 -386 var i; -387 var kfd = "@-" + prefix + "-keyframes " + name + " {"; -388 var time; -389 var prevKF= {}; +359 return { +360 rules:keyFrameRule, +361 ret:retValue +362 }; +363 +364 }, +365 +366 /** +367 * @inheritDoc +368 */ +369 calculateKeyFramesData:function (prefix, name, keyframessize, anchorX, anchorY) { +370 +371 function toKeyFrame(obj, prevKF) { +372 +373 for( var i in prevKF ) { +374 if ( !obj[i] ) { +375 obj[i]= prevKF[i]; +376 } +377 } +378 +379 var ret= "-" + prefix + "-transform:"; +380 +381 if ( obj.x || obj.y ) { +382 var x= obj.x || 0; +383 var y= obj.y || 0; +384 ret+= "translate("+x+"px,"+y+"px)"; +385 } +386 +387 if ( obj.angle ) { +388 ret+= " rotate("+obj.angle+"rad)"; +389 } 390 -391 for (i = 0; i <= keyframessize; i++) { -392 time = this.interpolator.getPosition(i / keyframessize).y; -393 -394 var obj = this.getKeyFrameDataValues(time); -395 -396 kfd += "" + -397 (i / keyframessize * 100) + "%" + // percentage -398 "{" + toKeyFrame(obj, prevKF) + "}\n"; -399 -400 prevKF= obj; -401 -402 } -403 -404 kfd += "}\n"; -405 -406 return kfd; -407 } -408 } -409 } -410 }); -411 \ No newline at end of file +391 if ( obj.scaleX!==1 || obj.scaleY!==1 ) { +392 ret+= " scale("+(obj.scaleX)+","+(obj.scaleY)+")"; +393 } +394 +395 ret+=";"; +396 +397 if ( obj.alpha ) { +398 ret+= " opacity: "+obj.alpha+";"; +399 } +400 +401 if ( anchorX!==.5 || anchorY!==.5) { +402 ret+= " -" + prefix + "-transform-origin:"+ (anchorX*100) + "% " + (anchorY*100) + "%;"; +403 } +404 +405 return ret; +406 } +407 +408 if (this.duration === Number.MAX_VALUE) { +409 return ""; +410 } +411 +412 if (typeof anchorX==="undefined") { +413 anchorX= .5; +414 } +415 +416 if (typeof anchorY==="undefined") { +417 anchorY= .5; +418 } +419 +420 if (typeof keyframessize === 'undefined') { +421 keyframessize = 100; +422 } +423 +424 var i; +425 var kfd = "@-" + prefix + "-keyframes " + name + " {"; +426 var time; +427 var prevKF= {}; +428 +429 for (i = 0; i <= keyframessize; i++) { +430 time = this.interpolator.getPosition(i / keyframessize).y; +431 +432 var obj = this.getKeyFrameDataValues(time); +433 +434 kfd += "" + +435 (i / keyframessize * 100) + "%" + // percentage +436 "{" + toKeyFrame(obj, prevKF) + "}\n"; +437 +438 prevKF= obj; +439 +440 } +441 +442 kfd += "}\n"; +443 +444 return kfd; +445 } +446 } +447 } +448 }); +449 \ No newline at end of file diff --git a/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_Behavior_PathBehavior.js.html b/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_Behavior_PathBehavior.js.html index b50db38c..8439fe23 100644 --- a/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_Behavior_PathBehavior.js.html +++ b/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_Behavior_PathBehavior.js.html @@ -116,222 +116,237 @@ 109 110 isOpenContour : false, 111 -112 setOpenContour : function(b) { -113 this.isOpenContour= b; -114 return this; -115 }, -116 -117 /** -118 * @inheritDoc -119 */ -120 getPropertyName:function () { -121 return "translate"; -122 }, -123 -124 /** -125 * Sets an actor rotation to be heading from past to current path's point. -126 * Take into account that this will be incompatible with rotation Behaviors -127 * since they will set their own rotation configuration. -128 * @param autorotate {boolean} -129 * @param autorotateOp {CAAT.PathBehavior.autorotate} whether the sprite is drawn heading to the right. -130 * @return this. -131 */ -132 setAutoRotate:function (autorotate, autorotateOp) { -133 this.autoRotate = autorotate; -134 if (autorotateOp !== undefined) { -135 this.autoRotateOp = autorotateOp; -136 } -137 return this; -138 }, -139 -140 /** -141 * Set the behavior path. -142 * The path can be any length, and will take behaviorDuration time to be traversed. -143 * @param {CAAT.Path} -144 * -145 * @deprecated -146 */ -147 setPath:function (path) { -148 this.path = path; -149 return this; -150 }, -151 -152 /** -153 * Set the behavior path. -154 * The path can be any length, and will take behaviorDuration time to be traversed. -155 * @param {CAAT.Path} -156 * @return this +112 relativeX : 0, +113 relativeY : 0, +114 +115 setOpenContour : function(b) { +116 this.isOpenContour= b; +117 return this; +118 }, +119 +120 /** +121 * @inheritDoc +122 */ +123 getPropertyName:function () { +124 return "translate"; +125 }, +126 +127 setRelativeValues : function( x, y ) { +128 this.relativeX= x; +129 this.relativeY= y; +130 this.isRelative= true; +131 return this; +132 }, +133 +134 +135 /** +136 * Sets an actor rotation to be heading from past to current path's point. +137 * Take into account that this will be incompatible with rotation Behaviors +138 * since they will set their own rotation configuration. +139 * @param autorotate {boolean} +140 * @param autorotateOp {CAAT.PathBehavior.autorotate} whether the sprite is drawn heading to the right. +141 * @return this. +142 */ +143 setAutoRotate:function (autorotate, autorotateOp) { +144 this.autoRotate = autorotate; +145 if (autorotateOp !== undefined) { +146 this.autoRotateOp = autorotateOp; +147 } +148 return this; +149 }, +150 +151 /** +152 * Set the behavior path. +153 * The path can be any length, and will take behaviorDuration time to be traversed. +154 * @param {CAAT.Path} +155 * +156 * @deprecated 157 */ -158 setValues:function (path) { -159 return this.setPath(path); -160 }, -161 -162 /** -163 * @see Actor.setPositionAnchor -164 * @deprecated -165 * @param tx a float with xoffset. -166 * @param ty a float with yoffset. -167 */ -168 setTranslation:function (tx, ty) { -169 return this; -170 }, -171 -172 /** -173 * @inheritDoc -174 */ -175 calculateKeyFrameData:function (time) { -176 time = this.interpolator.getPosition(time).y; -177 var point = this.path.getPosition(time); -178 return "translateX(" + point.x + "px) translateY(" + point.y + "px)"; -179 }, -180 -181 /** -182 * @inheritDoc -183 */ -184 getKeyFrameDataValues : function(time) { -185 time = this.interpolator.getPosition(time).y; -186 var point = this.path.getPosition(time); -187 var obj= { -188 x : point.x, -189 y : point.y -190 }; +158 setPath:function (path) { +159 this.path = path; +160 return this; +161 }, +162 +163 /** +164 * Set the behavior path. +165 * The path can be any length, and will take behaviorDuration time to be traversed. +166 * @param {CAAT.Path} +167 * @return this +168 */ +169 setValues:function (path) { +170 return this.setPath(path); +171 }, +172 +173 /** +174 * @see Actor.setPositionAnchor +175 * @deprecated +176 * @param tx a float with xoffset. +177 * @param ty a float with yoffset. +178 */ +179 setTranslation:function (tx, ty) { +180 return this; +181 }, +182 +183 /** +184 * @inheritDoc +185 */ +186 calculateKeyFrameData:function (time) { +187 time = this.interpolator.getPosition(time).y; +188 var point = this.path.getPosition(time); +189 return "translateX(" + point.x + "px) translateY(" + point.y + "px)"; +190 }, 191 -192 if ( this.autoRotate ) { -193 -194 var point2= time===0 ? point : this.path.getPosition(time -.001); -195 var ax = point.x - point2.x; -196 var ay = point.y - point2.y; -197 var angle = Math.atan2(ay, ax); -198 -199 obj.angle= angle; -200 } -201 -202 return obj; -203 }, +192 /** +193 * @inheritDoc +194 */ +195 getKeyFrameDataValues : function(time) { +196 time = this.interpolator.getPosition(time).y; +197 var point = this.path.getPosition(time); +198 var obj= { +199 x : point.x, +200 y : point.y +201 }; +202 +203 if ( this.autoRotate ) { 204 -205 /** -206 * @inheritDoc -207 */ -208 calculateKeyFramesData:function (prefix, name, keyframessize) { +205 var point2= time===0 ? point : this.path.getPosition(time -.001); +206 var ax = point.x - point2.x; +207 var ay = point.y - point2.y; +208 var angle = Math.atan2(ay, ax); 209 -210 if (typeof keyframessize === 'undefined') { -211 keyframessize = 100; -212 } -213 keyframessize >>= 0; -214 -215 var i; -216 var kfr; -217 var time; -218 var kfd = "@-" + prefix + "-keyframes " + name + " {"; -219 -220 for (i = 0; i <= keyframessize; i++) { -221 kfr = "" + -222 (i / keyframessize * 100) + "%" + // percentage -223 "{" + -224 "-" + prefix + "-transform:" + this.calculateKeyFrameData(i / keyframessize) + -225 "}"; -226 -227 kfd += kfr; -228 } -229 -230 kfd += "}"; -231 -232 return kfd; -233 }, -234 -235 /** -236 * @inheritDoc -237 */ -238 setForTime:function (time, actor) { -239 -240 if (!this.path) { -241 return { -242 x:actor.x, -243 y:actor.y -244 }; -245 } -246 -247 var point = this.path.getPosition(time, this.isOpenContour,.001); -248 -249 if (this.autoRotate) { +210 obj.angle= angle; +211 } +212 +213 return obj; +214 }, +215 +216 /** +217 * @inheritDoc +218 */ +219 calculateKeyFramesData:function (prefix, name, keyframessize) { +220 +221 if (typeof keyframessize === 'undefined') { +222 keyframessize = 100; +223 } +224 keyframessize >>= 0; +225 +226 var i; +227 var kfr; +228 var time; +229 var kfd = "@-" + prefix + "-keyframes " + name + " {"; +230 +231 for (i = 0; i <= keyframessize; i++) { +232 kfr = "" + +233 (i / keyframessize * 100) + "%" + // percentage +234 "{" + +235 "-" + prefix + "-transform:" + this.calculateKeyFrameData(i / keyframessize) + +236 "}"; +237 +238 kfd += kfr; +239 } +240 +241 kfd += "}"; +242 +243 return kfd; +244 }, +245 +246 /** +247 * @inheritDoc +248 */ +249 setForTime:function (time, actor) { 250 -251 if (-1 === this.prevX && -1 === this.prevY) { -252 this.prevX = point.x; -253 this.prevY = point.y; -254 } -255 -256 var ax = point.x - this.prevX; -257 var ay = point.y - this.prevY; -258 -259 if (ax === 0 && ay === 0) { -260 actor.setLocation(point.x, point.y); -261 return { x:actor.x, y:actor.y }; -262 } +251 if (!this.path) { +252 return { +253 x:actor.x, +254 y:actor.y +255 }; +256 } +257 +258 var point = this.path.getPosition(time, this.isOpenContour,.001); +259 if (this.isRelative ) { +260 point.x+= this.relativeX; +261 point.y+= this.relativeY; +262 } 263 -264 var angle = Math.atan2(ay, ax); -265 var si = CAAT.Foundation.SpriteImage; -266 var pba = CAAT.Behavior.PathBehavior.AUTOROTATE; -267 -268 // actor is heading left to right -269 if (this.autoRotateOp === pba.LEFT_TO_RIGHT) { -270 if (this.prevX <= point.x) { -271 actor.setImageTransformation(si.TR_NONE); -272 } -273 else { -274 actor.setImageTransformation(si.TR_FLIP_HORIZONTAL); -275 angle += Math.PI; -276 } -277 } else if (this.autoRotateOp === pba.RIGHT_TO_LEFT) { -278 if (this.prevX <= point.x) { -279 actor.setImageTransformation(si.TR_FLIP_HORIZONTAL); -280 } -281 else { -282 actor.setImageTransformation(si.TR_NONE); -283 angle -= Math.PI; -284 } -285 } -286 -287 actor.setRotation(angle); -288 -289 this.prevX = point.x; -290 this.prevY = point.y; -291 -292 var modulo = Math.sqrt(ax * ax + ay * ay); -293 ax /= modulo; -294 ay /= modulo; -295 } -296 -297 if (this.doValueApplication) { -298 actor.setLocation(point.x, point.y); -299 return { x:actor.x, y:actor.y }; -300 } else { -301 return { -302 x:point.x, -303 y:point.y -304 }; -305 } +264 if (this.autoRotate) { +265 +266 if (-1 === this.prevX && -1 === this.prevY) { +267 this.prevX = point.x; +268 this.prevY = point.y; +269 } +270 +271 var ax = point.x - this.prevX; +272 var ay = point.y - this.prevY; +273 +274 if (ax === 0 && ay === 0) { +275 actor.setLocation(point.x, point.y); +276 return { x:actor.x, y:actor.y }; +277 } +278 +279 var angle = Math.atan2(ay, ax); +280 var si = CAAT.Foundation.SpriteImage; +281 var pba = CAAT.Behavior.PathBehavior.AUTOROTATE; +282 +283 // actor is heading left to right +284 if (this.autoRotateOp === pba.LEFT_TO_RIGHT) { +285 if (this.prevX <= point.x) { +286 actor.setImageTransformation(si.TR_NONE); +287 } +288 else { +289 actor.setImageTransformation(si.TR_FLIP_HORIZONTAL); +290 angle += Math.PI; +291 } +292 } else if (this.autoRotateOp === pba.RIGHT_TO_LEFT) { +293 if (this.prevX <= point.x) { +294 actor.setImageTransformation(si.TR_FLIP_HORIZONTAL); +295 } +296 else { +297 actor.setImageTransformation(si.TR_NONE); +298 angle -= Math.PI; +299 } +300 } +301 +302 actor.setRotation(angle); +303 +304 this.prevX = point.x; +305 this.prevY = point.y; 306 -307 -308 }, -309 -310 /** -311 * Get a point on the path. -312 * If the time to get the point at is in behaviors frame time, a point on the path will be returned, otherwise -313 * a default {x:-1, y:-1} point will be returned. -314 * -315 * @param time {number} the time at which the point will be taken from the path. -316 * @return {object} an object of the form {x:float y:float} -317 */ -318 positionOnTime:function (time) { -319 if (this.isBehaviorInTime(time, null)) { -320 time = this.normalizeTime(time); -321 return this.path.getPosition(time); -322 } -323 -324 return {x:-1, y:-1}; -325 -326 } -327 }; -328 } -329 }); -330 \ No newline at end of file +307 var modulo = Math.sqrt(ax * ax + ay * ay); +308 ax /= modulo; +309 ay /= modulo; +310 } +311 +312 if (this.doValueApplication) { +313 actor.setLocation(point.x, point.y); +314 return { x:actor.x, y:actor.y }; +315 } else { +316 return { +317 x:point.x, +318 y:point.y +319 }; +320 } +321 +322 +323 }, +324 +325 /** +326 * Get a point on the path. +327 * If the time to get the point at is in behaviors frame time, a point on the path will be returned, otherwise +328 * a default {x:-1, y:-1} point will be returned. +329 * +330 * @param time {number} the time at which the point will be taken from the path. +331 * @return {object} an object of the form {x:float y:float} +332 */ +333 positionOnTime:function (time) { +334 if (this.isBehaviorInTime(time, null)) { +335 time = this.normalizeTime(time); +336 return this.path.getPosition(time); +337 } +338 +339 return {x:-1, y:-1}; +340 +341 } +342 }; +343 } +344 }); +345 \ No newline at end of file diff --git a/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_Behavior_RotateBehavior.js.html b/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_Behavior_RotateBehavior.js.html index ece1af31..ebce7154 100644 --- a/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_Behavior_RotateBehavior.js.html +++ b/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_Behavior_RotateBehavior.js.html @@ -75,128 +75,146 @@ 68 */ 69 anchorY:.50, 70 - 71 /** - 72 * @inheritDoc - 73 */ - 74 getPropertyName:function () { - 75 return "rotate"; - 76 }, - 77 - 78 /** - 79 * @inheritDoc - 80 */ - 81 setForTime:function (time, actor) { - 82 var angle = this.startAngle + time * (this.endAngle - this.startAngle); - 83 - 84 if (this.doValueApplication) { - 85 actor.setRotationAnchored(angle, this.anchorX, this.anchorY); - 86 } - 87 - 88 return angle; - 89 - 90 }, + 71 rotationRelative: 0, + 72 + 73 setRelativeValues : function(r) { + 74 this.rotationRelative= r; + 75 this.isRelative= true; + 76 return this; + 77 }, + 78 + 79 /** + 80 * @inheritDoc + 81 */ + 82 getPropertyName:function () { + 83 return "rotate"; + 84 }, + 85 + 86 /** + 87 * @inheritDoc + 88 */ + 89 setForTime:function (time, actor) { + 90 var angle = this.startAngle + time * (this.endAngle - this.startAngle); 91 - 92 /** - 93 * Set behavior bound values. - 94 * if no anchorx,anchory values are supplied, the behavior will assume - 95 * 50% for both values, that is, the actor's center. - 96 * - 97 * Be aware the anchor values are supplied in <b>RELATIVE PERCENT</b> to - 98 * actor's size. - 99 * -100 * @param startAngle {float} indicating the starting angle. -101 * @param endAngle {float} indicating the ending angle. -102 * @param anchorx {float} the percent position for anchorX -103 * @param anchory {float} the percent position for anchorY -104 */ -105 setValues:function (startAngle, endAngle, anchorx, anchory) { -106 this.startAngle = startAngle; -107 this.endAngle = endAngle; -108 if (typeof anchorx !== 'undefined' && typeof anchory !== 'undefined') { -109 this.anchorX = anchorx; -110 this.anchorY = anchory; -111 } -112 return this; -113 }, -114 -115 /** -116 * @deprecated -117 * Use setValues instead -118 * @param start -119 * @param end -120 */ -121 setAngles:function (start, end) { -122 return this.setValues(start, end); -123 }, -124 -125 /** -126 * Set the behavior rotation anchor. Use this method when setting an exact percent -127 * by calling setValues is complicated. -128 * @see CAAT.Actor -129 * -130 * These parameters are to set a custom rotation anchor point. if <code>anchor==CAAT.Actor.ANCHOR_CUSTOM -131 * </code> the custom rotation point is set. -132 * @param actor -133 * @param rx -134 * @param ry -135 * -136 */ -137 setAnchor:function (actor, rx, ry) { -138 this.anchorX = rx / actor.width; -139 this.anchorY = ry / actor.height; -140 return this; + 92 if ( this.isRelative ) { + 93 angle+= this.rotationRelative; + 94 if (angle>=Math.PI) { + 95 angle= (angle-2*Math.PI) + 96 } + 97 if ( angle<-2*Math.PI) { + 98 angle= (angle+2*Math.PI); + 99 } +100 } +101 +102 if (this.doValueApplication) { +103 actor.setRotationAnchored(angle, this.anchorX, this.anchorY); +104 } +105 +106 return angle; +107 +108 }, +109 +110 /** +111 * Set behavior bound values. +112 * if no anchorx,anchory values are supplied, the behavior will assume +113 * 50% for both values, that is, the actor's center. +114 * +115 * Be aware the anchor values are supplied in <b>RELATIVE PERCENT</b> to +116 * actor's size. +117 * +118 * @param startAngle {float} indicating the starting angle. +119 * @param endAngle {float} indicating the ending angle. +120 * @param anchorx {float} the percent position for anchorX +121 * @param anchory {float} the percent position for anchorY +122 */ +123 setValues:function (startAngle, endAngle, anchorx, anchory) { +124 this.startAngle = startAngle; +125 this.endAngle = endAngle; +126 if (typeof anchorx !== 'undefined' && typeof anchory !== 'undefined') { +127 this.anchorX = anchorx; +128 this.anchorY = anchory; +129 } +130 return this; +131 }, +132 +133 /** +134 * @deprecated +135 * Use setValues instead +136 * @param start +137 * @param end +138 */ +139 setAngles:function (start, end) { +140 return this.setValues(start, end); 141 }, 142 143 /** -144 * @inheritDoc -145 */ -146 calculateKeyFrameData:function (time) { -147 time = this.interpolator.getPosition(time).y; -148 return "rotate(" + (this.startAngle + time * (this.endAngle - this.startAngle)) + "rad)"; -149 }, -150 -151 /** -152 * @inheritDoc -153 */ -154 getKeyFrameDataValues : function(time) { -155 time = this.interpolator.getPosition(time).y; -156 return { -157 angle : this.startAngle + time * (this.endAngle - this.startAngle) -158 }; +144 * Set the behavior rotation anchor. Use this method when setting an exact percent +145 * by calling setValues is complicated. +146 * @see CAAT.Actor +147 * +148 * These parameters are to set a custom rotation anchor point. if <code>anchor==CAAT.Actor.ANCHOR_CUSTOM +149 * </code> the custom rotation point is set. +150 * @param actor +151 * @param rx +152 * @param ry +153 * +154 */ +155 setAnchor:function (actor, rx, ry) { +156 this.anchorX = rx / actor.width; +157 this.anchorY = ry / actor.height; +158 return this; 159 }, 160 161 /** 162 * @inheritDoc 163 */ -164 calculateKeyFramesData:function (prefix, name, keyframessize) { -165 -166 if (typeof keyframessize === 'undefined') { -167 keyframessize = 100; -168 } -169 keyframessize >>= 0; -170 -171 var i; -172 var kfr; -173 var kfd = "@-" + prefix + "-keyframes " + name + " {"; -174 -175 for (i = 0; i <= keyframessize; i++) { -176 kfr = "" + -177 (i / keyframessize * 100) + "%" + // percentage -178 "{" + -179 "-" + prefix + "-transform:" + this.calculateKeyFrameData(i / keyframessize) + -180 "; -" + prefix + "-transform-origin:" + (this.anchorX*100) + "% " + (this.anchorY*100) + "% " + -181 "}\n"; -182 -183 kfd += kfr; -184 } -185 -186 kfd += "}\n"; -187 -188 return kfd; -189 } -190 -191 }; +164 calculateKeyFrameData:function (time) { +165 time = this.interpolator.getPosition(time).y; +166 return "rotate(" + (this.startAngle + time * (this.endAngle - this.startAngle)) + "rad)"; +167 }, +168 +169 /** +170 * @inheritDoc +171 */ +172 getKeyFrameDataValues : function(time) { +173 time = this.interpolator.getPosition(time).y; +174 return { +175 angle : this.startAngle + time * (this.endAngle - this.startAngle) +176 }; +177 }, +178 +179 /** +180 * @inheritDoc +181 */ +182 calculateKeyFramesData:function (prefix, name, keyframessize) { +183 +184 if (typeof keyframessize === 'undefined') { +185 keyframessize = 100; +186 } +187 keyframessize >>= 0; +188 +189 var i; +190 var kfr; +191 var kfd = "@-" + prefix + "-keyframes " + name + " {"; 192 -193 } -194 }); -195 \ No newline at end of file +193 for (i = 0; i <= keyframessize; i++) { +194 kfr = "" + +195 (i / keyframessize * 100) + "%" + // percentage +196 "{" + +197 "-" + prefix + "-transform:" + this.calculateKeyFrameData(i / keyframessize) + +198 "; -" + prefix + "-transform-origin:" + (this.anchorX*100) + "% " + (this.anchorY*100) + "% " + +199 "}\n"; +200 +201 kfd += kfr; +202 } +203 +204 kfd += "}\n"; +205 +206 return kfd; +207 } +208 +209 }; +210 +211 } +212 }); +213 \ No newline at end of file diff --git a/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_Core_Class.js.html b/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_Core_Class.js.html new file mode 100644 index 00000000..9ec7d6e8 --- /dev/null +++ b/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_Core_Class.js.html @@ -0,0 +1,228 @@ +
      1 
    +  2 extend = function (subc, superc) {
    +  3     var subcp = subc.prototype;
    +  4 
    +  5     // Class pattern.
    +  6     var CAATObject = function () {
    +  7     };
    +  8     CAATObject.prototype = superc.prototype;
    +  9 
    + 10     subc.prototype = new CAATObject();       // chain prototypes.
    + 11     subc.superclass = superc.prototype;
    + 12     subc.prototype.constructor = subc;
    + 13 
    + 14     // Reset constructor. See Object Oriented Javascript for an in-depth explanation of this.
    + 15     if (superc.prototype.constructor === Object.prototype.constructor) {
    + 16         superc.prototype.constructor = superc;
    + 17     }
    + 18 
    + 19     // los metodos de superc, que no esten en esta clase, crear un metodo que
    + 20     // llama al metodo de superc.
    + 21     for (var method in subcp) {
    + 22         if (subcp.hasOwnProperty(method)) {
    + 23             subc.prototype[method] = subcp[method];
    + 24 
    + 25             /**
    + 26              * Sintactic sugar to add a __super attribute on every overriden method.
    + 27              * Despite comvenient, it slows things down by 5fps.
    + 28              *
    + 29              * Uncomment at your own risk.
    + 30              *
    + 31              // tenemos en super un metodo con igual nombre.
    + 32              if ( superc.prototype[method]) {
    + 33             subc.prototype[method]= (function(fn, fnsuper) {
    + 34                 return function() {
    + 35                     var prevMethod= this.__super;
    + 36 
    + 37                     this.__super= fnsuper;
    + 38 
    + 39                     var retValue= fn.apply(
    + 40                             this,
    + 41                             Array.prototype.slice.call(arguments) );
    + 42 
    + 43                     this.__super= prevMethod;
    + 44 
    + 45                     return retValue;
    + 46                 };
    + 47             })(subc.prototype[method], superc.prototype[method]);
    + 48         }
    + 49              */
    + 50 
    + 51         }
    + 52     }
    + 53 };
    + 54 
    + 55 
    + 56 extendWith = function (base, subclass, with_object) {
    + 57     var CAATObject = function () {
    + 58     };
    + 59 
    + 60     CAATObject.prototype = base.prototype;
    + 61 
    + 62     subclass.prototype = new CAATObject();
    + 63     subclass.superclass = base.prototype;
    + 64     subclass.prototype.constructor = subclass;
    + 65 
    + 66     if (base.prototype.constructor === Object.prototype.constructor) {
    + 67         base.prototype.constructor = base;
    + 68     }
    + 69 
    + 70     if (with_object) {
    + 71         for (var method in with_object) {
    + 72             if (with_object.hasOwnProperty(method)) {
    + 73                 subclass.prototype[ method ] = with_object[method];
    + 74                 /*
    + 75                  if ( base.prototype[method]) {
    + 76                  subclass.prototype[method]= (function(fn, fnsuper) {
    + 77                  return function() {
    + 78                  var prevMethod= this.__super;
    + 79                  this.__super= fnsuper;
    + 80                  var retValue= fn.apply(this, arguments );
    + 81                  this.__super= prevMethod;
    + 82 
    + 83                  return retValue;
    + 84                  };
    + 85                  })(subclass.prototype[method], base.prototype[method]);
    + 86                  }
    + 87                  /**/
    + 88             }
    + 89         }
    + 90     }
    + 91 };
    + 92 
    + 93 
    + 94 
    + 95 function proxyFunction(object, method, preMethod, postMethod, errorMethod) {
    + 96 
    + 97     return function () {
    + 98 
    + 99         var args = Array.prototype.slice.call(arguments);
    +100 
    +101         // call pre-method hook if present.
    +102         if (preMethod) {
    +103             preMethod({
    +104                 object: object,
    +105                 method: method,
    +106                 arguments: args });
    +107         }
    +108 
    +109         var retValue = null;
    +110 
    +111         try {
    +112             // apply original object call with proxied object as
    +113             // function context.
    +114             retValue = object[method].apply(object, args);
    +115 
    +116             // everything went right on function call, the call
    +117             // post-method hook if present
    +118             if (postMethod) {
    +119                 /*var rr= */
    +120                 var ret2 = postMethod({
    +121                     object: object,
    +122                     method: method,
    +123                     arguments: args });
    +124 
    +125                 if (ret2) {
    +126                     retValue = ret2;
    +127                 }
    +128             }
    +129         } catch (e) {
    +130             // an exeception was thrown, call exception-method hook if
    +131             // present and return its result as execution result.
    +132             if (errorMethod) {
    +133                 retValue = errorMethod({
    +134                     object: object,
    +135                     method: method,
    +136                     arguments: args,
    +137                     exception: e});
    +138             } else {
    +139                 // since there's no error hook, just throw the exception
    +140                 throw e;
    +141             }
    +142         }
    +143 
    +144         // return original returned value to the caller.
    +145         return retValue;
    +146     };
    +147 
    +148 }
    +149 
    +150 function proxyAttribute( proxy, object, attribute, getter, setter) {
    +151 
    +152     proxy.__defineGetter__(attribute, function () {
    +153         if (getter) {
    +154             getter(object, attribute);
    +155         }
    +156         return object[attribute];
    +157     });
    +158     proxy.__defineSetter__(attribute, function (value) {
    +159         object[attribute] = value;
    +160         if (setter) {
    +161             setter(object, attribute, value);
    +162         }
    +163     });
    +164 }
    +165 
    +166 function proxyObject(object, preMethod, postMethod, errorMethod, getter, setter) {
    +167 
    +168     /**
    +169      * If not a function then only non privitive objects can be proxied.
    +170      * If it is a previously created proxy, return the proxy itself.
    +171      */
    +172     if (typeof object !== 'object' || isArray(object) || isString(object) || object.$proxy) {
    +173         return object;
    +174     }
    +175 
    +176     var proxy = {};
    +177 
    +178     // hold the proxied object as member. Needed to assign proper
    +179     // context on proxy method call.
    +180     proxy.$proxy = true;
    +181     proxy.$proxy_delegate = object;
    +182 
    +183     // For every element in the object to be proxied
    +184     for (var method in object) {
    +185 
    +186         if (method === "constructor") {
    +187             continue;
    +188         }
    +189 
    +190         // only function members
    +191         if (typeof object[method] === 'function') {
    +192             proxy[method] = proxyFunction(object, method, preMethod, postMethod, errorMethod );
    +193         } else {
    +194             proxyAttribute(proxy, object, method, getter, setter);
    +195         }
    +196     }
    +197 
    +198     // return our newly created and populated with functions proxied object.
    +199     return proxy;
    +200 }
    +201 
    +202 
    +203 CAAT.Module({
    +204     defines : "CAAT.Core.Class",
    +205     extendsWith : function() {
    +206 
    +207         /**
    +208          * See LICENSE file.
    +209          *
    +210          * Extend a prototype with another to form a classical OOP inheritance procedure.
    +211          *
    +212          * @param subc {object} Prototype to define the base class
    +213          * @param superc {object} Prototype to be extended (derived class).
    +214          */
    +215 
    +216 
    +217         return {
    +218 
    +219         };
    +220     }
    +221 });
    \ No newline at end of file diff --git a/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_Core_ModuleManager.js.html b/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_Core_ModuleManager.js.html index d4da0959..4e87cbe7 100644 --- a/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_Core_ModuleManager.js.html +++ b/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_Core_ModuleManager.js.html @@ -5,7 +5,7 @@ .STRN {color: #393;} .REGX {color: #339;} .line {border-right: 1px dotted #666; color: #666; font-style: normal;} -
      1 (function(global) {
    +	
      1 (function(global, __obj_namespace) {
       2 
       3     String.prototype.endsWith= function(suffix) {
       4         return this.indexOf(suffix, this.length - suffix.length) !== -1;
    @@ -38,870 +38,888 @@
      31     var Class = function () {
      32     };
      33 
    - 34     // Create a new Class that inherits from this class
    - 35     Class.extend = function (extendingProt, constants, name, aliases, flags) {
    - 36 
    - 37         var _super = this.prototype;
    + 34     Class['__CLASS']='Class';
    + 35 
    + 36     // Create a new Class that inherits from this class
    + 37     Class.extend = function (extendingProt, constants, name, aliases, flags) {
      38 
    - 39         // Instantiate a base class (but only create the instance,
    - 40         // don't run the init constructor)
    - 41         initializing = true;
    - 42         var prototype = new this();
    - 43         initializing = false;
    - 44 
    - 45         // The dummy class constructor
    - 46         function CAATClass() {
    - 47             // All construction is actually done in the init method
    - 48             if (!initializing && this.__init) {
    - 49                 this.__init.apply(this, arguments);
    - 50             }
    - 51         }
    - 52 
    - 53         // Populate our constructed prototype object
    - 54         CAATClass.prototype = prototype;
    - 55         // Enforce the constructor to be what we expect
    - 56         CAATClass.prototype.constructor = CAATClass;
    - 57         CAATClass.superclass = _super;
    - 58         // And make this class extendable
    - 59         CAATClass.extend = Class.extend;
    - 60 
    - 61         assignNamespace( name, CAATClass );
    - 62         if ( constants ) {
    - 63             constants= (isFunction(constants) ? constants() : constants);
    - 64             for( var constant in constants ) {
    - 65                 if ( constants.hasOwnProperty(constant) ) {
    - 66                     CAATClass[ constant ]= constants[constant];
    - 67                 }
    - 68             }
    - 69         }
    - 70 
    - 71         CAATClass["__CLASS"]= name;
    + 39         var _super = this.prototype;
    + 40 
    + 41         // Instantiate a base class (but only create the instance,
    + 42         // don't run the init constructor)
    + 43         initializing = true;
    + 44         var prototype = new this();
    + 45         initializing = false;
    + 46 
    + 47         // The dummy class constructor
    + 48         function CAATClass() {
    + 49             // All construction is actually done in the init method
    + 50             if (!initializing && this.__init) {
    + 51                 this.__init.apply(this, arguments);
    + 52             }
    + 53         }
    + 54 
    + 55         // Populate our constructed prototype object
    + 56         CAATClass.prototype = prototype;
    + 57         // Enforce the constructor to be what we expect
    + 58         CAATClass.prototype.constructor = CAATClass;
    + 59         CAATClass.superclass = _super;
    + 60         // And make this class extendable
    + 61         CAATClass.extend = Class.extend;
    + 62 
    + 63         assignNamespace( name, CAATClass );
    + 64         if ( constants ) {
    + 65             constants= (isFunction(constants) ? constants() : constants);
    + 66             for( var constant in constants ) {
    + 67                 if ( constants.hasOwnProperty(constant) ) {
    + 68                     CAATClass[ constant ]= constants[constant];
    + 69                 }
    + 70             }
    + 71         }
      72 
    - 73         if ( aliases ) {
    - 74             if ( !isArray(aliases) ) {
    - 75                 aliases= [aliases];
    - 76             }
    - 77             for( var i=0; i<aliases.length; i++ ) {
    - 78                 ensureNamespace( aliases[i] );
    - 79                 var ns= assignNamespace( aliases[i], CAATClass );
    - 80 
    - 81                 // assign constants to alias classes.
    - 82                 if ( constants ) {
    - 83                     for( var constant in constants ) {
    - 84                         if ( constants.hasOwnProperty(constant) ) {
    - 85                             ns[ constant ]= constants[constant];
    - 86                         }
    - 87                     }
    - 88                 }
    - 89             }
    - 90         }
    - 91 
    - 92         extendingProt= (isFunction(extendingProt) ? extendingProt() : extendingProt);
    + 73         CAATClass["__CLASS"]= name;
    + 74 
    + 75         if ( aliases ) {
    + 76             if ( !isArray(aliases) ) {
    + 77                 aliases= [aliases];
    + 78             }
    + 79             for( var i=0; i<aliases.length; i++ ) {
    + 80                 ensureNamespace( aliases[i] );
    + 81                 var ns= assignNamespace( aliases[i], CAATClass );
    + 82 
    + 83                 // assign constants to alias classes.
    + 84                 if ( constants ) {
    + 85                     for( var constant in constants ) {
    + 86                         if ( constants.hasOwnProperty(constant) ) {
    + 87                             ns[ constant ]= constants[constant];
    + 88                         }
    + 89                     }
    + 90                 }
    + 91             }
    + 92         }
      93 
    - 94         // Copy the properties over onto the new prototype
    - 95         for (var fname in extendingProt) {
    - 96             // Check if we're overwriting an existing function
    - 97             prototype[fname] = ( (fname === "__init" || (flags && flags.decorated) ) && isFunction(extendingProt[fname]) && isFunction(_super[fname]) ) ?
    - 98                 (function (name, fn) {
    - 99                     return function () {
    -100                         var tmp = this.__super;
    -101                         this.__super = _super[name];
    -102                         var ret = fn.apply(this, arguments);
    -103                         this.__super = tmp;
    -104                         return ret;
    -105                     };
    -106                 })(fname, extendingProt[fname]) :
    -107 
    -108                 extendingProt[fname];
    -109         }
    -110 
    -111         return CAATClass;
    -112     }
    -113 
    -114     var Node= function( obj ) { //name, dependencies, callback ) {
    -115         this.name= obj.defines;
    -116         this.extendWith= obj.extendsWith;
    -117         this.callback= obj.onCreate;
    -118         this.callbackPreCreation= obj.onPreCreate;
    -119         this.dependencies= obj.depends;
    -120         this.baseClass= obj.extendsClass;
    -121         this.aliases= obj.aliases;
    -122         this.constants= obj.constants;
    -123         this.decorated= obj.decorated;
    -124 
    -125         this.children= [];
    + 94         extendingProt= (isFunction(extendingProt) ? extendingProt() : extendingProt);
    + 95 
    + 96         // Copy the properties over onto the new prototype
    + 97         for (var fname in extendingProt) {
    + 98             // Check if we're overwriting an existing function
    + 99             prototype[fname] = ( (fname === "__init" || (flags && flags.decorated) ) && isFunction(extendingProt[fname]) && isFunction(_super[fname]) ) ?
    +100                 (function (name, fn) {
    +101                     return function () {
    +102                         var tmp = this.__super;
    +103                         this.__super = _super[name];
    +104                         var ret = fn.apply(this, arguments);
    +105                         this.__super = tmp;
    +106                         return ret;
    +107                     };
    +108                 })(fname, extendingProt[fname]) :
    +109 
    +110                 extendingProt[fname];
    +111         }
    +112 
    +113         return CAATClass;
    +114     }
    +115 
    +116     var Node= function( obj ) { //name, dependencies, callback ) {
    +117         this.name= obj.defines;
    +118         this.extendWith= obj.extendsWith;
    +119         this.callback= obj.onCreate;
    +120         this.callbackPreCreation= obj.onPreCreate;
    +121         this.dependencies= obj.depends;
    +122         this.baseClass= obj.extendsClass;
    +123         this.aliases= obj.aliases;
    +124         this.constants= obj.constants;
    +125         this.decorated= obj.decorated;
     126 
    -127         return this;
    -128     };
    -129 
    -130     Node.prototype= {
    -131         children:       null,
    -132         name:           null,
    -133         extendWith:     null,
    -134         callback:       null,
    -135         dependencies:   null,
    -136         baseClass:      null,
    -137         aliases:        null,
    -138         constants:      null,
    -139 
    -140         decorated:      false,
    +127         this.children= [];
    +128 
    +129         return this;
    +130     };
    +131 
    +132     Node.prototype= {
    +133         children:       null,
    +134         name:           null,
    +135         extendWith:     null,
    +136         callback:       null,
    +137         dependencies:   null,
    +138         baseClass:      null,
    +139         aliases:        null,
    +140         constants:      null,
     141 
    -142         solved:         false,
    -143         visited:        false,
    -144 
    -145         status : function() {
    -146             console.log("  Module: "+this.name+
    -147                 (this.dependencies.length ?
    -148                     (" unsolved_deps:["+this.dependencies+"]") :
    -149                     " no dependencies.")+
    -150                 ( this.solved ? " solved" : " ------> NOT solved.")
    -151             );
    -152         },
    -153 
    -154         removeDependency : function( modulename ) {
    -155             for( var i=0; i<this.dependencies.length; i++ ) {
    -156                 if ( this.dependencies[i]===modulename ) {
    -157                     this.dependencies.splice(i,1);
    -158                     break;
    -159                 }
    -160             }
    -161 
    -162 
    -163         },
    +142         decorated:      false,
    +143 
    +144         solved:         false,
    +145         visited:        false,
    +146 
    +147         status : function() {
    +148             console.log("  Module: "+this.name+
    +149                 (this.dependencies.length ?
    +150                     (" unsolved_deps:["+this.dependencies+"]") :
    +151                     " no dependencies.")+
    +152                 ( this.solved ? " solved" : " ------> NOT solved.")
    +153             );
    +154         },
    +155 
    +156         removeDependency : function( modulename ) {
    +157             for( var i=0; i<this.dependencies.length; i++ ) {
    +158                 if ( this.dependencies[i]===modulename ) {
    +159                     this.dependencies.splice(i,1);
    +160                     break;
    +161                 }
    +162             }
    +163 
     164 
    -165         assignDependency : function( node ) {
    +165         },
     166 
    -167             var i;
    -168             for( i=0; i<this.dependencies.length; i++ ) {
    -169                 if ( this.dependencies[i] === node.name ) {
    -170                     this.children.push( node );
    -171                     this.dependencies.splice(i,1);
    -172 //                    console.log("Added dependency: "+node.name+" on "+this.name);
    -173                     break;
    -174                 }
    -175             }
    -176         },
    -177 
    -178         isSolved : function() {
    -179             return this.solved;
    -180         },
    -181 
    -182         solveDeep : function() {
    +167         assignDependency : function( node ) {
    +168 
    +169             var i;
    +170             for( i=0; i<this.dependencies.length; i++ ) {
    +171                 if ( this.dependencies[i] === node.name ) {
    +172                     this.children.push( node );
    +173                     this.dependencies.splice(i,1);
    +174 //                    console.log("Added dependency: "+node.name+" on "+this.name);
    +175                     break;
    +176                 }
    +177             }
    +178         },
    +179 
    +180         isSolved : function() {
    +181             return this.solved;
    +182         },
     183 
    -184             if ( this.visited ) {
    -185                 return true;
    -186             }
    -187 
    -188             this.visited= true;
    +184         solveDeep : function() {
    +185 
    +186             if ( this.visited ) {
    +187                 return true;
    +188             }
     189 
    -190             if ( this.solved ) {
    -191                 return true;
    -192             }
    -193 
    -194             if ( this.dependencies.length!==0 ) {
    -195                 return false;
    -196             }
    -197 
    -198             var b= true;
    -199             for( var i=0; i<this.children.length; i++ ) {
    -200                 if (! this.children[i].solveDeep() ) {
    -201                     return false;
    -202                 }
    -203             }
    -204 
    -205             //////
    -206             this.__initModule();
    -207 
    -208             this.solved= true;
    -209             mm.solved( this );
    -210 
    -211             return true;
    -212         },
    -213 
    -214         __initModule : function() {
    +190             this.visited= true;
    +191 
    +192             if ( this.solved ) {
    +193                 return true;
    +194             }
    +195 
    +196             if ( this.dependencies.length!==0 ) {
    +197                 return false;
    +198             }
    +199 
    +200             var b= true;
    +201             for( var i=0; i<this.children.length; i++ ) {
    +202                 if (! this.children[i].solveDeep() ) {
    +203                     return false;
    +204                 }
    +205             }
    +206 
    +207             //////
    +208             this.__initModule();
    +209 
    +210             this.solved= true;
    +211             mm.solved( this );
    +212 
    +213             return true;
    +214         },
     215 
    -216             var c= null;
    -217             if ( this.baseClass ) {
    -218                 c= findClass( this.baseClass );
    -219 
    -220                 if ( !c ) {
    -221                     console.log("  "+this.name+" -> Can't extend non-existant class: "+this.baseClass );
    -222                     return;
    -223                 }
    -224 
    -225             } else {
    -226                 c= Class;
    -227             }
    -228 
    -229             c= c.extend( this.extendWith, this.constants, this.name, this.aliases, { decorated : this.decorated } );
    +216         __initModule : function() {
    +217 
    +218             var c= null;
    +219             if ( this.baseClass ) {
    +220                 c= findClass( this.baseClass );
    +221 
    +222                 if ( !c ) {
    +223                     console.log("  "+this.name+" -> Can't extend non-existant class: "+this.baseClass );
    +224                     return;
    +225                 }
    +226 
    +227             } else {
    +228                 c= Class;
    +229             }
     230 
    -231             console.log("Created module: "+this.name);
    +231             c= c.extend( this.extendWith, this.constants, this.name, this.aliases, { decorated : this.decorated } );
     232 
    -233             if ( this.callback ) {
    -234                 this.callback();
    -235             }
    -236 
    -237         }
    -238     };
    -239 
    -240     var ScriptFile= function(path, module) {
    -241         this.path= path;
    -242         this.module= module;
    -243         return this;
    -244     }
    -245 
    -246     ScriptFile.prototype= {
    -247         path : null,
    -248         processed: false,
    -249         module: null,
    -250 
    -251         setProcessed : function() {
    -252             this.processed= true;
    -253         },
    -254 
    -255         isProcessed : function() {
    -256             return this.processed;
    -257         }
    -258     };
    -259 
    -260     var ModuleManager= function() {
    -261         this.nodes= [];
    -262         this.loadedFiles= [];
    -263         this.path= {};
    -264         this.solveListener= [];
    -265         this.orderedSolvedModules= [];
    -266         this.readyListener= [];
    -267 
    -268         return this;
    -269     };
    -270 
    -271     ModuleManager.baseURL= "";
    -272     ModuleManager.modulePath= {};
    -273     ModuleManager.sortedModulePath= [];
    -274     ModuleManager.symbol= {};
    -275 
    -276     ModuleManager.prototype= {
    +233             console.log("Created module: "+this.name);
    +234 
    +235             if ( this.callback ) {
    +236                 this.callback();
    +237             }
    +238 
    +239         }
    +240     };
    +241 
    +242     var ScriptFile= function(path, module) {
    +243         this.path= path;
    +244         this.module= module;
    +245         return this;
    +246     }
    +247 
    +248     ScriptFile.prototype= {
    +249         path : null,
    +250         processed: false,
    +251         module: null,
    +252 
    +253         setProcessed : function() {
    +254             this.processed= true;
    +255         },
    +256 
    +257         isProcessed : function() {
    +258             return this.processed;
    +259         }
    +260     };
    +261 
    +262     var ModuleManager= function() {
    +263         this.nodes= [];
    +264         this.loadedFiles= [];
    +265         this.path= {};
    +266         this.solveListener= [];
    +267         this.orderedSolvedModules= [];
    +268         this.readyListener= [];
    +269 
    +270         return this;
    +271     };
    +272 
    +273     ModuleManager.baseURL= "";
    +274     ModuleManager.modulePath= {};
    +275     ModuleManager.sortedModulePath= [];
    +276     ModuleManager.symbol= {};
     277 
    -278         nodes:      null,           // built nodes.
    -279         loadedFiles:null,           // list of loaded files. avoid loading each file more than once
    -280         solveListener: null,        // listener for a module solved
    -281         readyListener: null,        // listener for all modules solved
    -282         orderedSolvedModules: null, // order in which modules where solved.
    -283 
    -284         addSolvedListener : function( modulename, callback ) {
    -285             this.solveListener.push( {
    -286                 name : modulename,
    -287                 callback : callback
    -288             });
    -289         },
    -290 
    -291         solved : function( module ) {
    -292             var i;
    -293 
    -294             for( i=0; i<this.solveListener.length; i++ ) {
    -295                 if ( this.solveListener[i].name===module.name) {
    -296                     this.solveListener[i].callback();
    -297                 }
    -298             }
    -299 
    -300             this.orderedSolvedModules.push( module );
    +278     ModuleManager.prototype= {
    +279 
    +280         nodes:      null,           // built nodes.
    +281         loadedFiles:null,           // list of loaded files. avoid loading each file more than once
    +282         solveListener: null,        // listener for a module solved
    +283         readyListener: null,        // listener for all modules solved
    +284         orderedSolvedModules: null, // order in which modules where solved.
    +285 
    +286         addSolvedListener : function( modulename, callback ) {
    +287             this.solveListener.push( {
    +288                 name : modulename,
    +289                 callback : callback
    +290             });
    +291         },
    +292 
    +293         solved : function( module ) {
    +294             var i;
    +295 
    +296             for( i=0; i<this.solveListener.length; i++ ) {
    +297                 if ( this.solveListener[i].name===module.name) {
    +298                     this.solveListener[i].callback();
    +299                 }
    +300             }
     301 
    -302             this.notifyReady();
    -303         },
    -304 
    -305         notifyReady : function() {
    -306             var i;
    -307 
    -308             for( i=0; i<this.nodes.length; i++ ) {
    -309                 if ( !this.nodes[i].isSolved() ) {
    -310                     return;
    -311                 }
    -312             }
    -313 
    -314             // if there's any pending files to be processed, still not notify about being solved.
    -315             for( i=0; i<this.loadedFiles.length; i++ ) {
    -316                 if ( !this.loadedFiles[i].isProcessed() ) {
    -317                     // aun hay ficheros sin procesar, no notificar.
    -318                     return;
    -319                 }
    -320             }
    -321 
    -322             /**
    -323              * Make ModuleManager.bring reentrant.
    -324              */
    -325             var me= this;
    -326             var arr= Array.prototype.slice.call(this.readyListener);
    -327             setTimeout( function() {
    -328                 for( var i=0; i<arr.length; i++ ) {
    -329                     arr[i]();
    -330                 }
    -331             }, 0 );
    -332 
    -333             this.readyListener= [];
    -334         },
    -335 
    -336         status : function() {
    -337             for( var i=0; i<this.nodes.length; i++ ) {
    -338                 this.nodes[i].status();
    -339             }
    -340         },
    -341 
    -342         module : function( obj ) {//name, dependencies, callback ) {
    +302             this.orderedSolvedModules.push( module );
    +303 
    +304             this.notifyReady();
    +305         },
    +306 
    +307         notifyReady : function() {
    +308             var i;
    +309 
    +310             for( i=0; i<this.nodes.length; i++ ) {
    +311                 if ( !this.nodes[i].isSolved() ) {
    +312                     return;
    +313                 }
    +314             }
    +315 
    +316             // if there's any pending files to be processed, still not notify about being solved.
    +317             for( i=0; i<this.loadedFiles.length; i++ ) {
    +318                 if ( !this.loadedFiles[i].isProcessed() ) {
    +319                     // aun hay ficheros sin procesar, no notificar.
    +320                     return;
    +321                 }
    +322             }
    +323 
    +324             /**
    +325              * Make ModuleManager.bring reentrant.
    +326              */
    +327             var me= this;
    +328             var arr= Array.prototype.slice.call(this.readyListener);
    +329             setTimeout( function() {
    +330                 for( var i=0; i<arr.length; i++ ) {
    +331                     arr[i]();
    +332                 }
    +333             }, 0 );
    +334 
    +335             this.readyListener= [];
    +336         },
    +337 
    +338         status : function() {
    +339             for( var i=0; i<this.nodes.length; i++ ) {
    +340                 this.nodes[i].status();
    +341             }
    +342         },
     343 
    -344             var node, nnode, i;
    +344         module : function( obj ) {//name, dependencies, callback ) {
     345 
    -346             if ( this.isModuleScheduledToSolve( obj.defines ) ) {
    -347 //                console.log("Discarded module: "+obj.class+" (already loaded)");
    -348                 return this;
    -349             }
    -350 
    -351             if ( obj.onPreCreate ) {
    -352 //                console.log("  --> "+obj.defines+" onPrecreation");
    -353                 try {
    -354                     obj.onPreCreate();
    -355                 } catch(e) {
    -356                     console.log("  -> catched "+e+" on module "+obj.defines+" preCreation.");
    -357                 }
    -358             }
    -359 
    -360             if (!obj.depends ) {
    -361                 obj.depends= [];
    -362             }
    -363 
    -364             var dependencies= obj.depends;
    +346             var node, nnode, i;
    +347 
    +348             if ( this.isModuleScheduledToSolve( obj.defines ) ) {
    +349 //                console.log("Discarded module: "+obj.class+" (already loaded)");
    +350                 return this;
    +351             }
    +352 
    +353             if ( obj.onPreCreate ) {
    +354 //                console.log("  --> "+obj.defines+" onPrecreation");
    +355                 try {
    +356                     obj.onPreCreate();
    +357                 } catch(e) {
    +358                     console.log("  -> catched "+e+" on module "+obj.defines+" preCreation.");
    +359                 }
    +360             }
    +361 
    +362             if (!obj.depends ) {
    +363                 obj.depends= [];
    +364             }
     365 
    -366             if ( dependencies ) {
    -367                 if ( !isArray(dependencies) ) {
    -368                     dependencies= [ dependencies ];
    -369                     obj.depends= dependencies;
    -370                 }
    -371             }
    -372 
    -373             // elimina dependencias ya resueltas en otras cargas.
    -374             i=0;
    -375             while( i<dependencies.length ) {
    -376                 if ( this.alreadySolved( dependencies[i] ) ) {
    -377                      dependencies.splice(i,1);
    -378                 } else {
    -379                     i++;
    -380                 }
    -381             }
    -382 
    -383             nnode= new Node( obj );
    +366             var dependencies= obj.depends;
    +367 
    +368             if ( dependencies ) {
    +369                 if ( !isArray(dependencies) ) {
    +370                     dependencies= [ dependencies ];
    +371                     obj.depends= dependencies;
    +372                 }
    +373             }
    +374 
    +375             // elimina dependencias ya resueltas en otras cargas.
    +376             i=0;
    +377             while( i<dependencies.length ) {
    +378                 if ( this.alreadySolved( dependencies[i] ) ) {
    +379                      dependencies.splice(i,1);
    +380                 } else {
    +381                     i++;
    +382                 }
    +383             }
     384 
    -385             // asignar nuevo nodo a quien lo tenga como dependencia.
    -386             for( var i=0; i<this.nodes.length; i++ ) {
    -387                 this.nodes[i].assignDependency(nnode);
    -388             }
    -389             this.nodes.push( nnode );
    -390 
    -391             /**
    -392              * Making dependency resolution a two step process will allow us to pack all modules into one
    -393              * single file so that the module manager does not have to load external files.
    -394              * Useful when CAAt has been packed into one single bundle.
    -395              */
    -396 
    -397             /**
    -398              * remove already loaded modules dependencies.
    -399              */
    -400             for( i=0; i<obj.depends.length;  ) {
    -401 
    -402                 if ( this.isModuleScheduledToSolve( obj.depends[i] ) ) {
    -403                     var dep= this.findNode( obj.depends[i] );
    -404                     if ( null!==dep ) {
    -405                         nnode.assignDependency( dep );
    -406                     } else {
    -407                         //// ERRR
    -408                         alert("Module loaded and does not exist in loaded modules nodes. "+obj.depends[i]);
    -409                         i++;
    -410                     }
    -411                 } else {
    -412                     i+=1;
    -413                 }
    -414             }
    -415 
    -416             /**
    -417              * now, for the rest of non solved dependencies, load their files.
    -418              */
    -419             (function(mm, obj) {
    -420                 setTimeout( function() {
    -421                     for( i=0; i<obj.depends.length; i++ ) {
    -422                         mm.loadFile( obj.depends[i] );
    -423                     }
    -424                 }, 0 );
    -425             })(this, obj);
    -426 
    -427             return this;
    +385             nnode= new Node( obj );
    +386 
    +387             // asignar nuevo nodo a quien lo tenga como dependencia.
    +388             for( var i=0; i<this.nodes.length; i++ ) {
    +389                 this.nodes[i].assignDependency(nnode);
    +390             }
    +391             this.nodes.push( nnode );
    +392 
    +393             /**
    +394              * Making dependency resolution a two step process will allow us to pack all modules into one
    +395              * single file so that the module manager does not have to load external files.
    +396              * Useful when CAAt has been packed into one single bundle.
    +397              */
    +398 
    +399             /**
    +400              * remove already loaded modules dependencies.
    +401              */
    +402             for( i=0; i<obj.depends.length;  ) {
    +403 
    +404                 if ( this.isModuleScheduledToSolve( obj.depends[i] ) ) {
    +405                     var dep= this.findNode( obj.depends[i] );
    +406                     if ( null!==dep ) {
    +407                         nnode.assignDependency( dep );
    +408                     } else {
    +409                         //// ERRR
    +410                         alert("Module loaded and does not exist in loaded modules nodes. "+obj.depends[i]);
    +411                         i++;
    +412                     }
    +413                 } else {
    +414                     i+=1;
    +415                 }
    +416             }
    +417 
    +418             /**
    +419              * now, for the rest of non solved dependencies, load their files.
    +420              */
    +421             (function(mm, obj) {
    +422                 setTimeout( function() {
    +423                     for( i=0; i<obj.depends.length; i++ ) {
    +424                         mm.loadFile( obj.depends[i] );
    +425                     }
    +426                 }, 0 );
    +427             })(this, obj);
     428 
    -429         },
    +429             return this;
     430 
    -431         findNode : function( name ) {
    -432             for( var i=0; i<this.nodes.length; i++ ) {
    -433                 if ( this.nodes[i].name===name ) {
    -434                     return this.nodes[i];
    -435                 }
    -436             }
    -437 
    -438             return null;
    -439         } ,
    -440 
    -441         alreadySolved : function( name ) {
    -442             for( var i= 0; i<this.nodes.length; i++ ) {
    -443                 if ( this.nodes[i].name===name && this.nodes[i].isSolved() ) {
    -444                     return true;
    -445                 }
    -446             }
    -447 
    -448             return false;
    -449         },
    -450 
    -451         exists : function(path) {
    -452             var path= path.split(".");
    -453             var root= global;
    -454 
    -455             for( var i=0; i<path.length; i++ ) {
    -456                 if (!root[path[i]]) {
    -457                     return false;
    -458                 }
    -459 
    -460                 root= root[path[i]];
    -461             }
    -462 
    -463             return true;
    -464         },
    -465 
    -466         loadFile : function( module ) {
    +431         },
    +432 
    +433         findNode : function( name ) {
    +434             for( var i=0; i<this.nodes.length; i++ ) {
    +435                 if ( this.nodes[i].name===name ) {
    +436                     return this.nodes[i];
    +437                 }
    +438             }
    +439 
    +440             return null;
    +441         } ,
    +442 
    +443         alreadySolved : function( name ) {
    +444             for( var i= 0; i<this.nodes.length; i++ ) {
    +445                 if ( this.nodes[i].name===name && this.nodes[i].isSolved() ) {
    +446                     return true;
    +447                 }
    +448             }
    +449 
    +450             return false;
    +451         },
    +452 
    +453         exists : function(path) {
    +454             var path= path.split(".");
    +455             var root= global;
    +456 
    +457             for( var i=0; i<path.length; i++ ) {
    +458                 if (!root[path[i]]) {
    +459                     return false;
    +460                 }
    +461 
    +462                 root= root[path[i]];
    +463             }
    +464 
    +465             return true;
    +466         },
     467 
    -468 
    -469             if (this.exists(module)) {
    -470                 return;
    -471             }
    -472 
    -473             var path= this.getPath( module );
    +468         loadFile : function( module ) {
    +469 
    +470 
    +471             if (this.exists(module)) {
    +472                 return;
    +473             }
     474 
    -475             // avoid loading any js file more than once.
    -476             for( var i=0; i<this.loadedFiles.length; i++ ) {
    -477                 if ( this.loadedFiles[i].path===path ) {
    -478                     return;
    -479                 }
    -480             }
    -481 
    -482             var sf= new ScriptFile( path, module );
    -483             this.loadedFiles.push( sf );
    -484 
    -485             var node= document.createElement("script");
    -486             node.type = 'text/javascript';
    -487             node.charset = 'utf-8';
    -488             node.async = true;
    -489             node.addEventListener('load', this.moduleLoaded.bind(this), false);
    -490             node.addEventListener('error', this.moduleErrored.bind(this), false);
    -491             node.setAttribute('module-name', module);
    -492             node.src = path+(!DEBUG ? "?"+(new Date().getTime()) : "");
    -493 
    -494             document.getElementsByTagName('head')[0].appendChild( node );
    +475             var path= this.getPath( module );
    +476 
    +477             // avoid loading any js file more than once.
    +478             for( var i=0; i<this.loadedFiles.length; i++ ) {
    +479                 if ( this.loadedFiles[i].path===path ) {
    +480                     return;
    +481                 }
    +482             }
    +483 
    +484             var sf= new ScriptFile( path, module );
    +485             this.loadedFiles.push( sf );
    +486 
    +487             var node= document.createElement("script");
    +488             node.type = 'text/javascript';
    +489             node.charset = 'utf-8';
    +490             node.async = true;
    +491             node.addEventListener('load', this.moduleLoaded.bind(this), false);
    +492             node.addEventListener('error', this.moduleErrored.bind(this), false);
    +493             node.setAttribute('module-name', module);
    +494             node.src = path+(!DEBUG ? "?"+(new Date().getTime()) : "");
     495 
    -496         },
    +496             document.getElementsByTagName('head')[0].appendChild( node );
     497 
    -498         /**
    -499          * Resolve a module name.
    -500          *
    -501          *  + if the module ends with .js
    -502          *    if starts with /, return as is.
    -503          *    else reppend baseURL and return.
    -504          *
    -505          * @param module
    -506          */
    -507         getPath : function( module ) {
    -508 
    -509             // endsWith
    -510             if ( module.endsWith(".js") ) {
    -511                 if ( module.charAt(0)!=="/" ) {
    -512                     module= ModuleManager.baseURL+module;
    -513                 } else {
    -514                     module= module.substring(1);
    -515                 }
    -516                 return module;
    -517             }
    -518 
    -519             var i, symbol;
    +498         },
    +499 
    +500         /**
    +501          * Resolve a module name.
    +502          *
    +503          *  + if the module ends with .js
    +504          *    if starts with /, return as is.
    +505          *    else reppend baseURL and return.
    +506          *
    +507          * @param module
    +508          */
    +509         getPath : function( module ) {
    +510 
    +511             // endsWith
    +512             if ( module.endsWith(".js") ) {
    +513                 if ( module.charAt(0)!=="/" ) {
    +514                     module= ModuleManager.baseURL+module;
    +515                 } else {
    +516                     module= module.substring(1);
    +517                 }
    +518                 return module;
    +519             }
     520 
    -521             for( symbol in ModuleManager.symbol ) {
    -522                 if ( module===symbol ) {
    -523                     return  ModuleManager.baseURL + ModuleManager.symbol[symbol];
    -524                 }
    -525             }
    -526 
    -527             //for( var modulename in ModuleManager.modulePath ) {
    -528             for( i=0; i<ModuleManager.sortedModulePath.length; i++ ) {
    -529                 var modulename= ModuleManager.sortedModulePath[i];
    -530 
    -531                 if ( ModuleManager.modulePath.hasOwnProperty(modulename) ) {
    -532                     var path= ModuleManager.modulePath[modulename];
    -533 
    -534                     // startsWith
    -535                     if ( module.indexOf(modulename)===0 ) {
    -536                         // +1 to skip '.' class separator.
    -537                         var nmodule= module.substring(modulename.length + 1);
    -538 
    -539                         /**
    -540                          * Avoid name clash:
    -541                          * CAAT.Foundation and CAAT.Foundation.Timer will both be valid for
    -542                          * CAAT.Foundation.Timer.TimerManager module.
    -543                          * So in the end, the module name can't have '.' after chopping the class
    -544                          * namespace.
    -545                          */
    -546 
    -547                         nmodule= nmodule.replace(/\./g,"/");
    +521             var i, symbol;
    +522 
    +523             for( symbol in ModuleManager.symbol ) {
    +524                 if ( module===symbol ) {
    +525                     return  ModuleManager.baseURL + ModuleManager.symbol[symbol];
    +526                 }
    +527             }
    +528 
    +529             //for( var modulename in ModuleManager.modulePath ) {
    +530             for( i=0; i<ModuleManager.sortedModulePath.length; i++ ) {
    +531                 var modulename= ModuleManager.sortedModulePath[i];
    +532 
    +533                 if ( ModuleManager.modulePath.hasOwnProperty(modulename) ) {
    +534                     var path= ModuleManager.modulePath[modulename];
    +535 
    +536                     // startsWith
    +537                     if ( module.indexOf(modulename)===0 ) {
    +538                         // +1 to skip '.' class separator.
    +539                         var nmodule= module.substring(modulename.length + 1);
    +540 
    +541                         /**
    +542                          * Avoid name clash:
    +543                          * CAAT.Foundation and CAAT.Foundation.Timer will both be valid for
    +544                          * CAAT.Foundation.Timer.TimerManager module.
    +545                          * So in the end, the module name can't have '.' after chopping the class
    +546                          * namespace.
    +547                          */
     548 
    -549                         //if ( nmodule.indexOf(".")===-1 ) {
    -550                             nmodule= path+nmodule+".js";
    -551                             return ModuleManager.baseURL + nmodule;
    -552                         //}
    -553                     }
    -554                 }
    -555             }
    -556 
    -557             // what's that ??!?!?!?
    -558             return ModuleManager.baseURL + module.replace(/\./g,"/") + ".js";
    -559         },
    -560 
    -561         isModuleScheduledToSolve : function( name ) {
    -562             for( var i=0; i<this.nodes.length; i++ ) {
    -563                 if ( this.nodes[i].name===name ) {
    -564                     return true;
    -565                 }
    -566             }
    -567             return false;
    -568         },
    -569 
    -570         moduleLoaded : function(e) {
    -571             if (e.type==="load") {
    -572 
    -573                 var node = e.currentTarget || e.srcElement || e.target;
    -574                 var mod= node.getAttribute("module-name");
    -575 
    -576                 // marcar fichero de modulo como procesado.
    -577                 for( var i=0; i<this.loadedFiles.length; i++ ) {
    -578                     if ( this.loadedFiles[i].module===mod ) {
    -579                         this.loadedFiles[i].setProcessed();
    -580                         break;
    -581                     }
    -582                 }
    -583 
    -584                 for( var i=0; i<this.nodes.length; i++ ) {
    -585                     this.nodes[i].removeDependency( mod );
    -586                 }
    -587 
    -588                 for( var i=0; i<this.nodes.length; i++ ) {
    -589                     for( var j=0; j<this.nodes.length; j++ ) {
    -590                         this.nodes[j].visited= false;
    -591                     }
    -592                     this.nodes[i].solveDeep();
    -593                 }
    -594 
    -595                 /**
    -596                  * Despues de cargar un fichero, este puede contener un modulo o no.
    -597                  * Si todos los ficheros que se cargan fueran bibliotecas, nunca se pasaria de aqui porque
    -598                  * no se hace una llamada a solveDeep, y notificacion a solved, y de ahí a notifyReady.
    -599                  * Por eso se hace aqui una llamada a notifyReady, aunque pueda ser redundante.
    -600                  */
    -601                 var me= this;
    -602                 setTimeout(function() {
    -603                     me.notifyReady();
    -604                 }, 0 );
    -605             }
    -606         },
    -607 
    -608         moduleErrored : function(e) {
    -609             var node = e.currentTarget || e.srcElement;
    -610             console.log("Error loading module: "+ node.getAttribute("module-name") );
    -611         },
    -612 
    -613         solvedInOrder : function() {
    -614             for( var i=0; i<this.orderedSolvedModules.length; i++ ) {
    -615                 console.log(this.orderedSolvedModules[i].name);
    -616             }
    -617         },
    -618 
    -619         solveAll : function() {
    -620             for( var i=0; i<this.nodes.length; i++ ) {
    -621                 this.nodes[i].solveDeep();
    -622             }
    -623         },
    -624 
    -625         onReady : function( f ) {
    -626             this.readyListener.push(f);
    -627         }
    -628 
    -629     };
    +549                         nmodule= nmodule.replace(/\./g,"/");
    +550 
    +551                         //if ( nmodule.indexOf(".")===-1 ) {
    +552                             nmodule= path+nmodule+".js";
    +553                             return ModuleManager.baseURL + nmodule;
    +554                         //}
    +555                     }
    +556                 }
    +557             }
    +558 
    +559             // what's that ??!?!?!?
    +560             return ModuleManager.baseURL + module.replace(/\./g,"/") + ".js";
    +561         },
    +562 
    +563         isModuleScheduledToSolve : function( name ) {
    +564             for( var i=0; i<this.nodes.length; i++ ) {
    +565                 if ( this.nodes[i].name===name ) {
    +566                     return true;
    +567                 }
    +568             }
    +569             return false;
    +570         },
    +571 
    +572         moduleLoaded : function(e) {
    +573             if (e.type==="load") {
    +574 
    +575                 var node = e.currentTarget || e.srcElement || e.target;
    +576                 var mod= node.getAttribute("module-name");
    +577 
    +578                 // marcar fichero de modulo como procesado.
    +579                 for( var i=0; i<this.loadedFiles.length; i++ ) {
    +580                     if ( this.loadedFiles[i].module===mod ) {
    +581                         this.loadedFiles[i].setProcessed();
    +582                         break;
    +583                     }
    +584                 }
    +585 
    +586                 for( var i=0; i<this.nodes.length; i++ ) {
    +587                     this.nodes[i].removeDependency( mod );
    +588                 }
    +589 
    +590                 for( var i=0; i<this.nodes.length; i++ ) {
    +591                     for( var j=0; j<this.nodes.length; j++ ) {
    +592                         this.nodes[j].visited= false;
    +593                     }
    +594                     this.nodes[i].solveDeep();
    +595                 }
    +596 
    +597                 /**
    +598                  * Despues de cargar un fichero, este puede contener un modulo o no.
    +599                  * Si todos los ficheros que se cargan fueran bibliotecas, nunca se pasaria de aqui porque
    +600                  * no se hace una llamada a solveDeep, y notificacion a solved, y de ahí a notifyReady.
    +601                  * Por eso se hace aqui una llamada a notifyReady, aunque pueda ser redundante.
    +602                  */
    +603                 var me= this;
    +604                 setTimeout(function() {
    +605                     me.notifyReady();
    +606                 }, 0 );
    +607             }
    +608         },
    +609 
    +610         moduleErrored : function(e) {
    +611             var node = e.currentTarget || e.srcElement;
    +612             console.log("Error loading module: "+ node.getAttribute("module-name") );
    +613         },
    +614 
    +615         solvedInOrder : function() {
    +616             for( var i=0; i<this.orderedSolvedModules.length; i++ ) {
    +617                 console.log(this.orderedSolvedModules[i].name);
    +618             }
    +619         },
    +620 
    +621         solveAll : function() {
    +622             for( var i=0; i<this.nodes.length; i++ ) {
    +623                 this.nodes[i].solveDeep();
    +624             }
    +625         },
    +626 
    +627         onReady : function( f ) {
    +628             this.readyListener.push(f);
    +629         }
     630 
    -631     function ensureNamespace( qualifiedClassName ) {
    -632         var ns= qualifiedClassName.split(".");
    -633         var _global= global;
    -634         for( var i=0; i<ns.length-1; i++ ) {
    -635             if ( !_global[ns[i]] ) {
    -636                 _global[ns[i]]= {};
    -637             }
    -638             _global= _global[ns[i]];
    -639         }
    -640     }
    -641 
    -642     /**
    -643      *
    -644      * Create a namespace object from a string.
    -645      *
    -646      * @param namespace {string}
    -647      * @param obj {object}
    -648      * @return {object} the namespace object
    -649      */
    -650     function assignNamespace( namespace, obj ) {
    -651         var ns= namespace.split(".");
    -652         var _global= global;
    -653         for( var i=0; i<ns.length-1; i++ ) {
    -654             if ( !_global[ns[i]] ) {
    -655                 console.log("    Error assigning value to namespace :"+namespace+". '"+ns[i]+"' does not exist.");
    -656                 return null;
    -657             }
    -658 
    -659             _global= _global[ns[i]];
    -660         }
    -661 
    -662         _global[ ns[ns.length-1] ]= obj;
    -663 
    -664         return _global[ ns[ns.length-1] ];
    -665     }
    -666 
    -667     function findClass( qualifiedClassName ) {
    -668         var ns= qualifiedClassName.split(".");
    -669         var _global= global;
    -670         for( var i=0; i<ns.length; i++ ) {
    -671             if ( !_global[ns[i]] ) {
    -672                 return null;
    -673             }
    -674 
    -675             _global= _global[ns[i]];
    -676         }
    -677 
    -678         return _global;
    -679     }
    +631     };
    +632 
    +633     function ensureNamespace( qualifiedClassName ) {
    +634         var ns= qualifiedClassName.split(".");
    +635         var _global= global;
    +636         var ret= null;
    +637         for( var i=0; i<ns.length-1; i++ ) {
    +638             if ( !_global[ns[i]] ) {
    +639                 _global[ns[i]]= {};
    +640             }
    +641             _global= _global[ns[i]];
    +642             ret= _global;
    +643         }
    +644 
    +645         return ret;
    +646     }
    +647 
    +648     /**
    +649      *
    +650      * Create a namespace object from a string.
    +651      *
    +652      * @param namespace {string}
    +653      * @param obj {object}
    +654      * @return {object} the namespace object
    +655      */
    +656     function assignNamespace( namespace, obj ) {
    +657         var ns= namespace.split(".");
    +658         var _global= global;
    +659         for( var i=0; i<ns.length-1; i++ ) {
    +660             if ( !_global[ns[i]] ) {
    +661                 console.log("    Error assigning value to namespace :"+namespace+". '"+ns[i]+"' does not exist.");
    +662                 return null;
    +663             }
    +664 
    +665             _global= _global[ns[i]];
    +666         }
    +667 
    +668         _global[ ns[ns.length-1] ]= obj;
    +669 
    +670         return _global[ ns[ns.length-1] ];
    +671     }
    +672 
    +673     function findClass( qualifiedClassName ) {
    +674         var ns= qualifiedClassName.split(".");
    +675         var _global= global;
    +676         for( var i=0; i<ns.length; i++ ) {
    +677             if ( !_global[ns[i]] ) {
    +678                 return null;
    +679             }
     680 
    -681     var mm= new ModuleManager();
    -682     var DEBUG= false;
    +681             _global= _global[ns[i]];
    +682         }
     683 
    -684 
    -685     /**
    -686      * CAAT is the namespace for all CAAT gaming engine object classes.
    -687      *
    -688      * @name CAAT
    -689      * @namespace
    -690      */
    -691 
    -692     global.CAAT= global.CAAT || {};
    -693 
    -694     /**
    -695      *
    -696      * This function defines CAAT modules, and creates Constructor Class objects.
    -697      *
    -698      * obj parameter has the following structure:
    -699      * {
    -700      *   defines{string},             // class name
    -701      *   depends{Array<string>=},   // dependencies class names
    -702      *   extendsClass{string},            // class to extend from
    -703      *   extensdWith{object},        // actual prototype to extend
    -704      *   aliases{Array<string>},    // other class names
    -705      *   onCreation{function=}        // optional callback to call after class creation.
    -706      *   onPreCreation{function=}        // optional callback to call after namespace class creation.
    -707      * }
    -708      *
    -709      * @param obj {object}
    -710      * @private
    -711      */
    -712     CAAT.Module= function loadModule(obj) {
    -713 
    -714         if (!obj.defines) {
    -715             console.error("Bad module definition: "+obj);
    -716             return;
    -717         }
    -718 
    -719         ensureNamespace(obj.defines);
    -720 
    -721         mm.module( obj );
    -722 
    -723     };
    -724 
    -725     /**
    -726      * @name ModuleManager
    -727      * @memberOf CAAT
    -728      * @namespace
    -729      */
    -730     CAAT.ModuleManager= {};
    +684         return _global;
    +685     }
    +686 
    +687     var mm= new ModuleManager();
    +688     var DEBUG= false;
    +689 
    +690 
    +691     /**
    +692      * CAAT is the namespace for all CAAT gaming engine object classes.
    +693      *
    +694      * @name CAAT
    +695      * @namespace
    +696      */
    +697 
    +698     if ( typeof(__obj_namespace)==="undefined" ) {
    +699         __obj_namespace= (window.CAAT = window.CAAT || {} );
    +700     }
    +701 
    +702     NS= __obj_namespace;
    +703 
    +704 //    global.CAAT= global.CAAT || {};
    +705 
    +706     /**
    +707      *
    +708      * This function defines CAAT modules, and creates Constructor Class objects.
    +709      *
    +710      * obj parameter has the following structure:
    +711      * {
    +712      *   defines{string},           // class name
    +713      *   depends{Array<string>=},   // dependencies class names
    +714      *   extendsClass{string},      // class to extend from
    +715      *   extensdWith{object},       // actual prototype to extend
    +716      *   aliases{Array<string>}     // other class names
    +717      * }
    +718      *
    +719      * @name Module
    +720      * @memberof CAAT
    +721      * @static
    +722      *
    +723      * @param obj {object}
    +724      */
    +725     NS.Module= function loadModule(obj) {
    +726 
    +727         if (!obj.defines) {
    +728             console.error("Bad module definition: "+obj);
    +729             return;
    +730         }
     731 
    -732     /**
    -733      * Define global base position for modules structure.
    -734      * @param baseURL {string}
    -735      * @return {*}
    -736      */
    -737     CAAT.ModuleManager.baseURL= function(baseURL) {
    -738 
    -739         if ( !baseURL ) {
    -740             return CAAT.Module;
    -741         }
    -742 
    -743         if (!baseURL.endsWith("/") ) {
    -744             baseURL= baseURL + "/";
    -745         }
    -746 
    -747         ModuleManager.baseURL= baseURL;
    -748         return CAAT.ModuleManager;
    -749     };
    -750 
    -751     /**
    -752      * Define a module path. Multiple module paths can be specified.
    -753      * @param module {string}
    -754      * @param path {string}
    -755      */
    -756     CAAT.ModuleManager.setModulePath= function( module, path ) {
    -757 
    -758         if ( !path.endsWith("/") ) {
    -759             path= path + "/";
    -760         }
    -761 
    -762         if ( !ModuleManager.modulePath[module] ) {
    -763             ModuleManager.modulePath[ module ]= path;
    -764 
    -765             ModuleManager.sortedModulePath.push( module );
    -766 
    -767             /**
    -768              * Sort function so that CAAT.AB is below CAAT.AB.CD
    -769              */
    -770             ModuleManager.sortedModulePath.sort( function(a,b) {
    -771                 if (a==b) {
    -772                     return 0;
    -773                 }
    -774                 return a<b ? 1 : -1;
    -775             } );
    -776         }
    -777         return CAAT.ModuleManager;
    -778     };
    +732         ensureNamespace(obj.defines);
    +733 
    +734         mm.module( obj );
    +735 
    +736     };
    +737 
    +738     /**
    +739      * @name ModuleManager
    +740      * @memberOf CAAT
    +741      * @namespace
    +742      */
    +743     NS.ModuleManager= {};
    +744 
    +745     /**
    +746      * Define global base position for modules structure.
    +747      * @param baseURL {string}
    +748      * @return {*}
    +749      */
    +750     NS.ModuleManager.baseURL= function(baseURL) {
    +751 
    +752         if ( !baseURL ) {
    +753             return NS.Module;
    +754         }
    +755 
    +756         if (!baseURL.endsWith("/") ) {
    +757             baseURL= baseURL + "/";
    +758         }
    +759 
    +760         ModuleManager.baseURL= baseURL;
    +761         return NS.ModuleManager;
    +762     };
    +763 
    +764     /**
    +765      * Define a module path. Multiple module paths can be specified.
    +766      * @param module {string}
    +767      * @param path {string}
    +768      */
    +769     NS.ModuleManager.setModulePath= function( module, path ) {
    +770 
    +771         if ( !path.endsWith("/") ) {
    +772             path= path + "/";
    +773         }
    +774 
    +775         if ( !ModuleManager.modulePath[module] ) {
    +776             ModuleManager.modulePath[ module ]= path;
    +777 
    +778             ModuleManager.sortedModulePath.push( module );
     779 
    -780     /**
    -781      * Define a symbol, or file to be loaded and checked dependencies against.
    -782      * @param symbol {string}
    -783      * @param path {string}
    -784      * @return {*}
    -785      */
    -786     CAAT.ModuleManager.symbol= function( symbol, path ) {
    -787 
    -788         if ( !ModuleManager.symbol[symbol] ) {
    -789             ModuleManager.symbol[symbol]= path;
    -790         }
    -791 
    -792         return CAAT.ModuleManager;
    -793     };
    -794 
    -795     /**
    -796      * Bring the given object, and if no present, start solving and loading dependencies.
    -797      * @param file {string}
    -798      * @return {*}
    -799      */
    -800     CAAT.ModuleManager.bring= function( file ) {
    -801 
    -802         if ( !isArray(file) ) {
    -803             file= [file];
    -804         }
    -805 
    -806         for( var i=0; i<file.length; i++ ) {
    -807             mm.loadFile( file[i] );
    -808         }
    -809 
    -810         return CAAT.ModuleManager;
    -811     };
    -812 
    -813     /**
    -814      * Get CAAT´s module manager status.
    -815      */
    -816     CAAT.ModuleManager.status= function() {
    -817         mm.status();
    -818     }
    -819 
    -820     /**
    -821      * Add an observer for a given module load event.
    -822      * @param modulename {string}
    -823      * @param callback {function()}
    -824      * @return {*}
    -825      */
    -826     CAAT.ModuleManager.addModuleSolvedListener= function(modulename,callback) {
    -827         mm.addSolveListener( modulename, callback );
    -828         return CAAT.ModuleManager;
    -829     }
    -830 
    -831     /**
    -832      * Load a javascript file.
    -833      * @param file {string}
    -834      * @param onload {function()}
    -835      * @param onerror {function()}
    -836      */
    -837     CAAT.ModuleManager.load= function(file, onload, onerror) {
    -838         var node= document.createElement("script");
    -839         node.type = 'text/javascript';
    -840         node.charset = 'utf-8';
    -841         node.async = true;
    -842         if ( onload ) {
    -843             node.addEventListener('load', onload, false);
    -844         }
    -845         if ( onerror ) {
    -846             node.addEventListener('error', onerror, false);
    -847         }
    -848 
    -849         node.addEventListener("load", function( ) {
    -850             mm.solveAll();
    -851         }, false);
    -852 
    -853         node.src = file+(!DEBUG ? "?"+(new Date().getTime()) : "");
    -854 
    -855         document.getElementsByTagName('head')[0].appendChild( node );
    -856 
    -857         // maybe this file has all the modules needed so no more file loading/module resolution must be performed.
    -858 
    -859     }
    -860 
    -861     /**
    -862      * Dump solved modules and get them sorted in the order they were resolved.
    -863      */
    -864     CAAT.ModuleManager.solvedInOrder= function() {
    -865         mm.solvedInOrder();
    -866     }
    +780             /**
    +781              * Sort function so that CAAT.AB is below CAAT.AB.CD
    +782              */
    +783             ModuleManager.sortedModulePath.sort( function(a,b) {
    +784                 if (a==b) {
    +785                     return 0;
    +786                 }
    +787                 return a<b ? 1 : -1;
    +788             } );
    +789         }
    +790         return NS.ModuleManager;
    +791     };
    +792 
    +793     /**
    +794      * Define a symbol, or file to be loaded and checked dependencies against.
    +795      * @param symbol {string}
    +796      * @param path {string}
    +797      * @return {*}
    +798      */
    +799     NS.ModuleManager.symbol= function( symbol, path ) {
    +800 
    +801         if ( !ModuleManager.symbol[symbol] ) {
    +802             ModuleManager.symbol[symbol]= path;
    +803         }
    +804 
    +805         return NS.ModuleManager;
    +806     };
    +807 
    +808     /**
    +809      * Bring the given object, and if no present, start solving and loading dependencies.
    +810      * @param file {string}
    +811      * @return {*}
    +812      */
    +813     NS.ModuleManager.bring= function( file ) {
    +814 
    +815         if ( !isArray(file) ) {
    +816             file= [file];
    +817         }
    +818 
    +819         for( var i=0; i<file.length; i++ ) {
    +820             mm.loadFile( file[i] );
    +821         }
    +822 
    +823         return NS.ModuleManager;
    +824     };
    +825 
    +826     /**
    +827      * Get CAAT´s module manager status.
    +828      */
    +829     NS.ModuleManager.status= function() {
    +830         mm.status();
    +831     }
    +832 
    +833     /**
    +834      * Add an observer for a given module load event.
    +835      * @param modulename {string}
    +836      * @param callback {function()}
    +837      * @return {*}
    +838      */
    +839     NS.ModuleManager.addModuleSolvedListener= function(modulename,callback) {
    +840         mm.addSolveListener( modulename, callback );
    +841         return NS.ModuleManager;
    +842     }
    +843 
    +844     /**
    +845      * Load a javascript file.
    +846      * @param file {string}
    +847      * @param onload {function()}
    +848      * @param onerror {function()}
    +849      */
    +850     NS.ModuleManager.load= function(file, onload, onerror) {
    +851         var node= document.createElement("script");
    +852         node.type = 'text/javascript';
    +853         node.charset = 'utf-8';
    +854         node.async = true;
    +855         if ( onload ) {
    +856             node.addEventListener('load', onload, false);
    +857         }
    +858         if ( onerror ) {
    +859             node.addEventListener('error', onerror, false);
    +860         }
    +861 
    +862         node.addEventListener("load", function( ) {
    +863             mm.solveAll();
    +864         }, false);
    +865 
    +866         node.src = file+(!DEBUG ? "?"+(new Date().getTime()) : "");
     867 
    -868     /**
    -869      * This method will be called everytime all the specified to-be-brought dependencies have been solved.
    -870      * @param f
    -871      * @return {*}
    -872      */
    -873     CAAT.ModuleManager.onReady= function(f) {
    -874         mm.onReady(f);
    -875         return CAAT.ModuleManager;
    -876     }
    -877 
    -878     /**
    -879      * Solve all elements specified in the module loaded.
    -880      * It is useful when minimizing a file.
    -881      */
    -882     CAAT.ModuleManager.solveAll= function() {
    -883         mm.solveAll();
    -884     }
    -885 
    -886     /**
    -887      * Enable debug capabilities for the loaded modules.
    -888      * Otherwise, the modules will have cache invalidation features.
    -889      * @param d {boolean}
    -890      * @return {*}
    -891      */
    -892     CAAT.ModuleManager.debug= function(d) {
    -893         DEBUG= d;
    -894         return CAAT.ModuleManager;
    -895     }
    -896 
    -897     CAAT.Class= Class;
    +868         document.getElementsByTagName('head')[0].appendChild( node );
    +869 
    +870         // maybe this file has all the modules needed so no more file loading/module resolution must be performed.
    +871 
    +872     }
    +873 
    +874     /**
    +875      * Dump solved modules and get them sorted in the order they were resolved.
    +876      */
    +877     NS.ModuleManager.solvedInOrder= function() {
    +878         mm.solvedInOrder();
    +879     }
    +880 
    +881     /**
    +882      * This method will be called everytime all the specified to-be-brought dependencies have been solved.
    +883      * @param f
    +884      * @return {*}
    +885      */
    +886     NS.ModuleManager.onReady= function(f) {
    +887         mm.onReady(f);
    +888         return NS.ModuleManager;
    +889     }
    +890 
    +891     /**
    +892      * Solve all elements specified in the module loaded.
    +893      * It is useful when minimizing a file.
    +894      */
    +895     NS.ModuleManager.solveAll= function() {
    +896         mm.solveAll();
    +897     }
     898 
    -899 })(this);
    -900 
    \ No newline at end of file +899
    /** +900 * Enable debug capabilities for the loaded modules. +901 * Otherwise, the modules will have cache invalidation features. +902 * @param d {boolean} +903 * @return {*} +904 */ +905 NS.ModuleManager.debug= function(d) { +906 DEBUG= d; +907 return NS.ModuleManager; +908 } +909 +910 /** +911 * @name Class +912 * @memberOf CAAT +913 * @constructor +914 */ +915 NS.Class= Class; +916 +917 })(this, undefined); +918
    \ No newline at end of file diff --git a/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_Foundation_Actor.js.html b/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_Foundation_Actor.js.html index fec1f83e..87a810bd 100644 --- a/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_Foundation_Actor.js.html +++ b/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_Foundation_Actor.js.html @@ -57,904 +57,904 @@ 50 defines:"CAAT.Foundation.Actor", 51 aliases: [ "CAAT.Actor" ], 52 depends: [ - 53 "CAAT.Event.AnimationLoop", - 54 "CAAT.Foundation.SpriteImage", - 55 "CAAT.Core.Constants", - 56 "CAAT.Behavior.PathBehavior", - 57 "CAAT.Behavior.RotateBehavior", - 58 "CAAT.Behavior.ScaleBehavior", - 59 "CAAT.Behavior.Scale1Behavior", - 60 "CAAT.PathUtil.LinearPath", - 61 "CAAT.Event.AnimationLoop" - 62 ], - 63 constants : { - 64 /** - 65 * @lends CAAT.Foundation.Actor - 66 */ - 67 - 68 /** @const @type {number} */ ANCHOR_CENTER:0, // constant values to determine different affine transform - 69 /** @const @type {number} */ ANCHOR_TOP:1, // anchors. - 70 /** @const @type {number} */ ANCHOR_BOTTOM:2, - 71 /** @const @type {number} */ ANCHOR_LEFT:3, - 72 /** @const @type {number} */ ANCHOR_RIGHT:4, - 73 /** @const @type {number} */ ANCHOR_TOP_LEFT:5, - 74 /** @const @type {number} */ ANCHOR_TOP_RIGHT:6, - 75 /** @const @type {number} */ ANCHOR_BOTTOM_LEFT:7, - 76 /** @const @type {number} */ ANCHOR_BOTTOM_RIGHT:8, - 77 /** @const @type {number} */ ANCHOR_CUSTOM:9, - 78 - 79 /** @const @type {number} */ CACHE_NONE:0, - 80 /** @const @type {number} */ CACHE_SIMPLE:1, - 81 /** @const @type {number} */ CACHE_DEEP:2 - 82 }, - 83 - 84 extendsWith : function () { - 85 - 86 var __index = 0; - 87 - 88 return { - 89 - 90 /** - 91 * @lends CAAT.Foundation.Actor.prototype - 92 */ - 93 - 94 __init:function () { - 95 this.behaviorList = []; - 96 this.lifecycleListenerList = []; - 97 this.AABB = new CAAT.Math.Rectangle(); - 98 this.viewVertices = [ - 99 new CAAT.Math.Point(0, 0, 0), + 53 "CAAT.Math.Dimension", + 54 "CAAT.Event.AnimationLoop", + 55 "CAAT.Foundation.SpriteImage", + 56 "CAAT.Core.Constants", + 57 "CAAT.Behavior.PathBehavior", + 58 "CAAT.Behavior.RotateBehavior", + 59 "CAAT.Behavior.ScaleBehavior", + 60 "CAAT.Behavior.Scale1Behavior", + 61 "CAAT.PathUtil.LinearPath", + 62 "CAAT.Event.AnimationLoop" + 63 ], + 64 constants : { + 65 /** + 66 * @lends CAAT.Foundation.Actor + 67 */ + 68 + 69 /** @const @type {number} */ ANCHOR_CENTER:0, // constant values to determine different affine transform + 70 /** @const @type {number} */ ANCHOR_TOP:1, // anchors. + 71 /** @const @type {number} */ ANCHOR_BOTTOM:2, + 72 /** @const @type {number} */ ANCHOR_LEFT:3, + 73 /** @const @type {number} */ ANCHOR_RIGHT:4, + 74 /** @const @type {number} */ ANCHOR_TOP_LEFT:5, + 75 /** @const @type {number} */ ANCHOR_TOP_RIGHT:6, + 76 /** @const @type {number} */ ANCHOR_BOTTOM_LEFT:7, + 77 /** @const @type {number} */ ANCHOR_BOTTOM_RIGHT:8, + 78 /** @const @type {number} */ ANCHOR_CUSTOM:9, + 79 + 80 /** @const @type {number} */ CACHE_NONE:0, + 81 /** @const @type {number} */ CACHE_SIMPLE:1, + 82 /** @const @type {number} */ CACHE_DEEP:2 + 83 }, + 84 + 85 extendsWith : function () { + 86 + 87 var __index = 0; + 88 + 89 return { + 90 + 91 /** + 92 * @lends CAAT.Foundation.Actor.prototype + 93 */ + 94 + 95 __init:function () { + 96 this.behaviorList = []; + 97 this.lifecycleListenerList = []; + 98 this.AABB = new CAAT.Math.Rectangle(); + 99 this.viewVertices = [ 100 new CAAT.Math.Point(0, 0, 0), 101 new CAAT.Math.Point(0, 0, 0), -102 new CAAT.Math.Point(0, 0, 0) -103 ]; -104 -105 this.scaleAnchor = CAAT.Foundation.Actor.ANCHOR_CENTER; -106 -107 this.modelViewMatrix = new CAAT.Math.Matrix(); -108 this.worldModelViewMatrix = new CAAT.Math.Matrix(); -109 -110 this.resetTransform(); -111 this.setScale(1, 1); -112 this.setRotation(0); -113 -114 this.id = __index++; -115 -116 return this; -117 }, -118 -119 /** -120 * @type {object} -121 */ -122 __super : null, -123 -124 /** -125 * A collection of this Actors lifecycle observers. -126 * @type { Array.<{actorLifeCycleEvent : function( CAAT.Foundation.Actor, string, number ) }> } -127 */ -128 lifecycleListenerList:null, -129 -130 /** -131 * A collection of behaviors to modify this actor´s properties. -132 * @type { Array.<CAAT.Behavior.Behavior> } -133 */ -134 behaviorList:null, -135 -136 /** -137 * This actor's parent container. -138 * @type { CAAT.Foundation.ActorContainer } -139 */ -140 parent:null, // Parent of this Actor. May be Scene. -141 -142 /** -143 * x position on parent. In parent's local coord. system. -144 * @type {number} -145 */ -146 x:0, -147 /** -148 * y position on parent. In parent's local coord. system. -149 * @type {number} -150 */ -151 y:0, -152 -153 /** -154 * Actor's width. In parent's local coord. system. -155 * @type {number} -156 */ -157 width:0, -158 -159 /** -160 * Actor's height. In parent's local coord. system. -161 * @type {number} -162 */ -163 height:0, -164 -165 /** -166 * actor´s layout preferred size. -167 * @type {CAAT.Math.Dimension} -168 */ -169 preferredSize:null, -170 -171 /** -172 * actor's layout minimum size. -173 * @type {CAAT.Math.Dimension} -174 */ -175 minimumSize:null, -176 -177 /** -178 * Marks since when this actor, relative to scene time, is going to be animated/drawn. -179 * @type {number} -180 */ -181 start_time:0, -182 -183 /** -184 * Marks from the time this actor is going to be animated, during how much time. -185 * Forever by default. -186 * @type {number} -187 */ -188 duration:Number.MAX_VALUE, -189 -190 /** -191 * Will this actor be clipped before being drawn on screen ? -192 * @type {boolean} -193 */ -194 clip:false, -195 -196 /** -197 * If this.clip and this.clipPath===null, a rectangle will be used as clip area. Otherwise, -198 * clipPath contains a reference to a CAAT.PathUtil.Path object. -199 * @type {CAAT.PathUtil.Path} -200 */ -201 clipPath:null, -202 -203 /** -204 * Translation x anchor. 0..1 -205 * @type {number} -206 */ -207 tAnchorX:0, -208 -209 /** -210 * Translation y anchor. 0..1 -211 * @type {number} -212 */ -213 tAnchorY:0, -214 -215 /** -216 * ScaleX value. -217 * @type {number} -218 */ -219 scaleX:1, // transformation. width scale parameter -220 -221 /** -222 * ScaleY value. -223 * @type {number} -224 */ -225 scaleY:1, // transformation. height scale parameter -226 -227 /** -228 * Scale Anchor X. Value 0-1 -229 * @type {number} -230 */ -231 scaleTX:.50, // transformation. scale anchor x position -232 -233 /** -234 * Scale Anchor Y. Value 0-1 -235 * @type {number} -236 */ -237 scaleTY:.50, // transformation. scale anchor y position -238 -239 /** -240 * A value that corresponds to any CAAT.Foundation.Actor.ANCHOR_* value. -241 * @type {CAAT.Foundation.Actor.ANCHOR_*} -242 */ -243 scaleAnchor:0, // transformation. scale anchor -244 -245 /** -246 * This actor´s rotation angle in radians. -247 * @type {number} -248 */ -249 rotationAngle:0, // transformation. rotation angle in radians -250 -251 /** -252 * Rotation Anchor X. CAAT uses different Anchors for position, rotation and scale. Value 0-1. -253 * @type {number} -254 */ -255 rotationY:.50, // transformation. rotation center y -256 -257 /** -258 * Rotation Anchor Y. CAAT uses different Anchors for position, rotation and scale. Value 0-1. -259 * @type {number} -260 */ -261 rotationX:.50, // transformation. rotation center x -262 -263 /** -264 * Transparency value. 0 is totally transparent, 1 is totally opaque. -265 * @type {number} -266 */ -267 alpha:1, // alpha transparency value -268 -269 /** -270 * true to make all children transparent, false, only this actor/container will be transparent. -271 * @type {boolean} -272 */ -273 isGlobalAlpha:false, // is this a global alpha -274 -275 /** -276 * @type {number} -277 * @private -278 */ -279 frameAlpha:1, // hierarchically calculated alpha for this Actor. -280 -281 /** -282 * Mark this actor as expired, or out of the scene time. -283 * @type {boolean} -284 */ -285 expired:false, -286 -287 /** -288 * Mark this actor as discardable. If an actor is expired and mark as discardable, if will be -289 * removed from its parent. -290 * @type {boolean} -291 */ -292 discardable:false, // set when you want this actor to be removed if expired -293 -294 /** -295 * @type {boolean} -296 */ -297 pointed:false, // is the mouse pointer inside this actor -298 -299 /** -300 * Enable or disable input on this actor. By default, all actors receive input. -301 * See also priority lists. -302 * see demo4 for an example of input and priority lists. -303 * @type {boolean} -304 */ -305 mouseEnabled:true, // events enabled ? -306 -307 /** -308 * Make this actor visible or not. -309 * An invisible actor avoids making any calculation, applying any behavior on it. -310 * @type {boolean} -311 */ -312 visible:true, -313 -314 /** -315 * any canvas rendering valid fill style. -316 * @type {string} -317 */ -318 fillStyle:null, -319 -320 /** -321 * any canvas rendering valid stroke style. -322 * @type {string} -323 */ -324 strokeStyle:null, -325 -326 /** -327 * This actor´s scene time. -328 * @type {number} -329 */ -330 time:0, // Cache Scene time. -331 -332 /** -333 * This rectangle keeps the axis aligned bounding box in screen coords of this actor. -334 * In can be used, among other uses, to realize whether two given actors collide regardless -335 * the affine transformation is being applied on them. -336 * @type {CAAT.Math.Rectangle} -337 */ -338 AABB:null, -339 -340 /** -341 * These 4 CAAT.Math.Point objects are the vertices of this actor´s non axis aligned bounding -342 * box. If the actor is not rotated, viewVertices and AABB define the same bounding box. -343 * @type {Array.<CAAT.Math.Point>} -344 */ -345 viewVertices:null, // model to view transformed vertices. -346 -347 /** -348 * Is this actor processed in the last frame ? -349 * @type {boolean} -350 */ -351 inFrame:false, // boolean indicating whether this Actor was present on last frame. -352 -353 /** -354 * Local matrix dirtyness flag. -355 * @type {boolean} -356 * @private -357 */ -358 dirty:true, // model view is dirty ? -359 -360 /** -361 * Global matrix dirtyness flag. -362 * @type {boolean} -363 * @private -364 */ -365 wdirty:true, // world model view is dirty ? -366 -367 /** -368 * @type {number} -369 * @private -370 */ -371 oldX:-1, -372 -373 /** -374 * @type {number} -375 * @private -376 */ -377 oldY:-1, -378 -379 /** -380 * This actor´s affine transformation matrix. -381 * @type {CAAT.Math.Matrix} -382 */ -383 modelViewMatrix:null, // model view matrix. -384 -385 /** -386 * This actor´s world affine transformation matrix. -387 * @type {CAAT.Math.Matrix} -388 */ -389 worldModelViewMatrix:null, // world model view matrix. -390 -391 /** -392 * @type {CAAT.Math.Matrix} -393 */ -394 modelViewMatrixI:null, // model view matrix. -395 -396 /** -397 * @type {CAAT.Math.Matrix} -398 */ -399 worldModelViewMatrixI:null, // world model view matrix. -400 -401 /** -402 * Is this actor enabled on WebGL ? -403 * @type {boolean} -404 */ -405 glEnabled:false, -406 -407 /** -408 * Define this actor´s background image. -409 * See SpriteImage object. -410 * @type {CAAT.Foundation.SpriteImage} -411 */ -412 backgroundImage:null, -413 -414 /** -415 * Set this actor´ id so that it can be later identified easily. -416 * @type {object} -417 */ -418 id:null, -419 -420 /** -421 * debug info. -422 * @type {number} -423 */ -424 size_active:1, // number of animated children -425 -426 /** -427 * debug info. -428 * @type {number} -429 */ -430 size_total:1, -431 -432 __d_ax:-1, // for drag-enabled actors. -433 __d_ay:-1, -434 -435 /** -436 * Is gesture recognition enabled on this actor ?? -437 * @type {boolean} -438 */ -439 gestureEnabled:false, -440 -441 /** -442 * If dirty rects are enabled, this flag indicates the rendering engine to invalidate this -443 * actor´s screen area. -444 * @type {boolean} -445 */ -446 invalid:true, -447 -448 /** -449 * Caching as bitmap strategy. Suitable to cache very complex actors. -450 * -451 * 0 : no cache. -452 * CACHE_SIMPLE : if a container, only cache the container. -453 * CACHE_DEEP : if a container, cache the container and recursively all of its children. -454 * -455 * @type {number} -456 */ -457 cached:0, // 0 no, CACHE_SIMPLE | CACHE_DEEP -458 -459 /** -460 * Exclude this actor from automatic layout on its parent. -461 * @type {boolean} -462 */ -463 preventLayout : false, -464 -465 /** -466 * is this actor/container Axis aligned ? if so, much faster inverse matrices can be calculated. -467 * @type {boolean} -468 * @private -469 */ -470 isAA:true, -471 -472 /** -473 * Make this actor not be laid out. -474 */ -475 setPreventLayout : function(b) { -476 this.preventLayout= b; -477 return this; -478 }, -479 -480 invalidateLayout:function () { -481 if (this.parent && !this.parent.layoutInvalidated) { -482 this.parent.invalidateLayout(); -483 } -484 -485 return this; -486 }, -487 -488 __validateLayout:function () { -489 +102 new CAAT.Math.Point(0, 0, 0), +103 new CAAT.Math.Point(0, 0, 0) +104 ]; +105 +106 this.scaleAnchor = CAAT.Foundation.Actor.ANCHOR_CENTER; +107 +108 this.modelViewMatrix = new CAAT.Math.Matrix(); +109 this.worldModelViewMatrix = new CAAT.Math.Matrix(); +110 +111 this.resetTransform(); +112 this.setScale(1, 1); +113 this.setRotation(0); +114 +115 this.id = __index++; +116 +117 return this; +118 }, +119 +120 /** +121 * @type {object} +122 */ +123 __super : null, +124 +125 /** +126 * A collection of this Actors lifecycle observers. +127 * @type { Array.<{actorLifeCycleEvent : function( CAAT.Foundation.Actor, string, number ) }> } +128 */ +129 lifecycleListenerList:null, +130 +131 /** +132 * A collection of behaviors to modify this actor´s properties. +133 * @type { Array.<CAAT.Behavior.Behavior> } +134 */ +135 behaviorList:null, +136 +137 /** +138 * This actor's parent container. +139 * @type { CAAT.Foundation.ActorContainer } +140 */ +141 parent:null, // Parent of this Actor. May be Scene. +142 +143 /** +144 * x position on parent. In parent's local coord. system. +145 * @type {number} +146 */ +147 x:0, +148 /** +149 * y position on parent. In parent's local coord. system. +150 * @type {number} +151 */ +152 y:0, +153 +154 /** +155 * Actor's width. In parent's local coord. system. +156 * @type {number} +157 */ +158 width:0, +159 +160 /** +161 * Actor's height. In parent's local coord. system. +162 * @type {number} +163 */ +164 height:0, +165 +166 /** +167 * actor´s layout preferred size. +168 * @type {CAAT.Math.Dimension} +169 */ +170 preferredSize:null, +171 +172 /** +173 * actor's layout minimum size. +174 * @type {CAAT.Math.Dimension} +175 */ +176 minimumSize:null, +177 +178 /** +179 * Marks since when this actor, relative to scene time, is going to be animated/drawn. +180 * @type {number} +181 */ +182 start_time:0, +183 +184 /** +185 * Marks from the time this actor is going to be animated, during how much time. +186 * Forever by default. +187 * @type {number} +188 */ +189 duration:Number.MAX_VALUE, +190 +191 /** +192 * Will this actor be clipped before being drawn on screen ? +193 * @type {boolean} +194 */ +195 clip:false, +196 +197 /** +198 * If this.clip and this.clipPath===null, a rectangle will be used as clip area. Otherwise, +199 * clipPath contains a reference to a CAAT.PathUtil.Path object. +200 * @type {CAAT.PathUtil.Path} +201 */ +202 clipPath:null, +203 +204 /** +205 * Translation x anchor. 0..1 +206 * @type {number} +207 */ +208 tAnchorX:0, +209 +210 /** +211 * Translation y anchor. 0..1 +212 * @type {number} +213 */ +214 tAnchorY:0, +215 +216 /** +217 * ScaleX value. +218 * @type {number} +219 */ +220 scaleX:1, // transformation. width scale parameter +221 +222 /** +223 * ScaleY value. +224 * @type {number} +225 */ +226 scaleY:1, // transformation. height scale parameter +227 +228 /** +229 * Scale Anchor X. Value 0-1 +230 * @type {number} +231 */ +232 scaleTX:.50, // transformation. scale anchor x position +233 +234 /** +235 * Scale Anchor Y. Value 0-1 +236 * @type {number} +237 */ +238 scaleTY:.50, // transformation. scale anchor y position +239 +240 /** +241 * A value that corresponds to any CAAT.Foundation.Actor.ANCHOR_* value. +242 * @type {CAAT.Foundation.Actor.ANCHOR_*} +243 */ +244 scaleAnchor:0, // transformation. scale anchor +245 +246 /** +247 * This actor´s rotation angle in radians. +248 * @type {number} +249 */ +250 rotationAngle:0, // transformation. rotation angle in radians +251 +252 /** +253 * Rotation Anchor X. CAAT uses different Anchors for position, rotation and scale. Value 0-1. +254 * @type {number} +255 */ +256 rotationY:.50, // transformation. rotation center y +257 +258 /** +259 * Rotation Anchor Y. CAAT uses different Anchors for position, rotation and scale. Value 0-1. +260 * @type {number} +261 */ +262 rotationX:.50, // transformation. rotation center x +263 +264 /** +265 * Transparency value. 0 is totally transparent, 1 is totally opaque. +266 * @type {number} +267 */ +268 alpha:1, // alpha transparency value +269 +270 /** +271 * true to make all children transparent, false, only this actor/container will be transparent. +272 * @type {boolean} +273 */ +274 isGlobalAlpha:false, // is this a global alpha +275 +276 /** +277 * @type {number} +278 * @private +279 */ +280 frameAlpha:1, // hierarchically calculated alpha for this Actor. +281 +282 /** +283 * Mark this actor as expired, or out of the scene time. +284 * @type {boolean} +285 */ +286 expired:false, +287 +288 /** +289 * Mark this actor as discardable. If an actor is expired and mark as discardable, if will be +290 * removed from its parent. +291 * @type {boolean} +292 */ +293 discardable:false, // set when you want this actor to be removed if expired +294 +295 /** +296 * @type {boolean} +297 */ +298 pointed:false, // is the mouse pointer inside this actor +299 +300 /** +301 * Enable or disable input on this actor. By default, all actors receive input. +302 * See also priority lists. +303 * see demo4 for an example of input and priority lists. +304 * @type {boolean} +305 */ +306 mouseEnabled:true, // events enabled ? +307 +308 /** +309 * Make this actor visible or not. +310 * An invisible actor avoids making any calculation, applying any behavior on it. +311 * @type {boolean} +312 */ +313 visible:true, +314 +315 /** +316 * any canvas rendering valid fill style. +317 * @type {string} +318 */ +319 fillStyle:null, +320 +321 /** +322 * any canvas rendering valid stroke style. +323 * @type {string} +324 */ +325 strokeStyle:null, +326 +327 /** +328 * This actor´s scene time. +329 * @type {number} +330 */ +331 time:0, // Cache Scene time. +332 +333 /** +334 * This rectangle keeps the axis aligned bounding box in screen coords of this actor. +335 * In can be used, among other uses, to realize whether two given actors collide regardless +336 * the affine transformation is being applied on them. +337 * @type {CAAT.Math.Rectangle} +338 */ +339 AABB:null, +340 +341 /** +342 * These 4 CAAT.Math.Point objects are the vertices of this actor´s non axis aligned bounding +343 * box. If the actor is not rotated, viewVertices and AABB define the same bounding box. +344 * @type {Array.<CAAT.Math.Point>} +345 */ +346 viewVertices:null, // model to view transformed vertices. +347 +348 /** +349 * Is this actor processed in the last frame ? +350 * @type {boolean} +351 */ +352 inFrame:false, // boolean indicating whether this Actor was present on last frame. +353 +354 /** +355 * Local matrix dirtyness flag. +356 * @type {boolean} +357 * @private +358 */ +359 dirty:true, // model view is dirty ? +360 +361 /** +362 * Global matrix dirtyness flag. +363 * @type {boolean} +364 * @private +365 */ +366 wdirty:true, // world model view is dirty ? +367 +368 /** +369 * @type {number} +370 * @private +371 */ +372 oldX:-1, +373 +374 /** +375 * @type {number} +376 * @private +377 */ +378 oldY:-1, +379 +380 /** +381 * This actor´s affine transformation matrix. +382 * @type {CAAT.Math.Matrix} +383 */ +384 modelViewMatrix:null, // model view matrix. +385 +386 /** +387 * This actor´s world affine transformation matrix. +388 * @type {CAAT.Math.Matrix} +389 */ +390 worldModelViewMatrix:null, // world model view matrix. +391 +392 /** +393 * @type {CAAT.Math.Matrix} +394 */ +395 modelViewMatrixI:null, // model view matrix. +396 +397 /** +398 * @type {CAAT.Math.Matrix} +399 */ +400 worldModelViewMatrixI:null, // world model view matrix. +401 +402 /** +403 * Is this actor enabled on WebGL ? +404 * @type {boolean} +405 */ +406 glEnabled:false, +407 +408 /** +409 * Define this actor´s background image. +410 * See SpriteImage object. +411 * @type {CAAT.Foundation.SpriteImage} +412 */ +413 backgroundImage:null, +414 +415 /** +416 * Set this actor´ id so that it can be later identified easily. +417 * @type {object} +418 */ +419 id:null, +420 +421 /** +422 * debug info. +423 * @type {number} +424 */ +425 size_active:1, // number of animated children +426 +427 /** +428 * debug info. +429 * @type {number} +430 */ +431 size_total:1, +432 +433 __d_ax:-1, // for drag-enabled actors. +434 __d_ay:-1, +435 +436 /** +437 * Is gesture recognition enabled on this actor ?? +438 * @type {boolean} +439 */ +440 gestureEnabled:false, +441 +442 /** +443 * If dirty rects are enabled, this flag indicates the rendering engine to invalidate this +444 * actor´s screen area. +445 * @type {boolean} +446 */ +447 invalid:true, +448 +449 /** +450 * Caching as bitmap strategy. Suitable to cache very complex actors. +451 * +452 * 0 : no cache. +453 * CACHE_SIMPLE : if a container, only cache the container. +454 * CACHE_DEEP : if a container, cache the container and recursively all of its children. +455 * +456 * @type {number} +457 */ +458 cached:0, // 0 no, CACHE_SIMPLE | CACHE_DEEP +459 +460 /** +461 * Exclude this actor from automatic layout on its parent. +462 * @type {boolean} +463 */ +464 preventLayout : false, +465 +466 /** +467 * is this actor/container Axis aligned ? if so, much faster inverse matrices can be calculated. +468 * @type {boolean} +469 * @private +470 */ +471 isAA:true, +472 +473 /** +474 * if this actor is cached, when destroy is called, it does not call 'clean' method, which clears some +475 * internal properties. +476 */ +477 isCachedActor : false, +478 +479 setCachedActor : function(cached) { +480 this.isCachedActor= cached; +481 return this; +482 }, +483 +484 /** +485 * Make this actor not be laid out. +486 */ +487 setPreventLayout : function(b) { +488 this.preventLayout= b; +489 return this; 490 }, 491 -492 /** -493 * Set this actors preferred layout size. -494 * -495 * @param pw {number} -496 * @param ph {number} -497 * @return {*} -498 */ -499 setPreferredSize:function (pw, ph) { -500 if (!this.preferredSize) { -501 this.preferredSize = new CAAT.Math.Dimension(); -502 } -503 this.preferredSize.width = pw; -504 this.preferredSize.height = ph; -505 return this; -506 }, -507 -508 getPreferredSize:function () { -509 return this.preferredSize ? this.preferredSize : -510 this.getMinimumSize(); -511 }, -512 -513 /** -514 * Set this actors minimum layout size. -515 * -516 * @param pw {number} -517 * @param ph {number} -518 * @return {*} -519 */ -520 setMinimumSize:function (pw, ph) { -521 if (!this.minimumSize) { -522 this.minimumSize = new CAAT.Math.Dimension(); -523 } +492 invalidateLayout:function () { +493 if (this.parent && !this.parent.layoutInvalidated) { +494 this.parent.invalidateLayout(); +495 } +496 +497 return this; +498 }, +499 +500 __validateLayout:function () { +501 +502 }, +503 +504 /** +505 * Set this actors preferred layout size. +506 * +507 * @param pw {number} +508 * @param ph {number} +509 * @return {*} +510 */ +511 setPreferredSize:function (pw, ph) { +512 if (!this.preferredSize) { +513 this.preferredSize = new CAAT.Math.Dimension(); +514 } +515 this.preferredSize.width = pw; +516 this.preferredSize.height = ph; +517 return this; +518 }, +519 +520 getPreferredSize:function () { +521 return this.preferredSize ? this.preferredSize : +522 this.getMinimumSize(); +523 }, 524 -525 this.minimumSize.width = pw; -526 this.minimumSize.height = ph; -527 return this; -528 }, -529 -530 getMinimumSize:function () { -531 return this.minimumSize ? this.minimumSize : -532 new CAAT.Math.Dimension(this.width, this.height); -533 }, -534 -535 /** -536 * @deprecated -537 * @return {*} -538 */ -539 create:function () { -540 return this; -541 }, -542 /** -543 * Move this actor to a position. -544 * It creates and adds a new PathBehavior. -545 * @param x {number} new x position -546 * @param y {number} new y position -547 * @param duration {number} time to take to get to new position -548 * @param delay {=number} time to wait before start moving -549 * @param interpolator {=CAAT.Behavior.Interpolator} a CAAT.Behavior.Interpolator instance +525 /** +526 * Set this actors minimum layout size. +527 * +528 * @param pw {number} +529 * @param ph {number} +530 * @return {*} +531 */ +532 setMinimumSize:function (pw, ph) { +533 if (!this.minimumSize) { +534 this.minimumSize = new CAAT.Math.Dimension(); +535 } +536 +537 this.minimumSize.width = pw; +538 this.minimumSize.height = ph; +539 return this; +540 }, +541 +542 getMinimumSize:function () { +543 return this.minimumSize ? this.minimumSize : +544 new CAAT.Math.Dimension(this.width, this.height); +545 }, +546 +547 /** +548 * @deprecated +549 * @return {*} 550 */ -551 moveTo:function (x, y, duration, delay, interpolator, callback) { -552 -553 if (x === this.x && y === this.y) { -554 return; -555 } -556 -557 var id = '__moveTo'; -558 var b = this.getBehavior(id); -559 if (!b) { -560 b = new CAAT.Behavior.PathBehavior(). -561 setId(id). -562 setValues(new CAAT.PathUtil.LinearPath()); -563 this.addBehavior(b); -564 } -565 -566 b.path.setInitialPosition(this.x, this.y).setFinalPosition(x, y); -567 b.setDelayTime(delay ? delay : 0, duration); -568 if (interpolator) { -569 b.setInterpolator(interpolator); -570 } -571 -572 if (callback) { -573 b.lifecycleListenerList = []; -574 b.addListener({ -575 behaviorExpired:function (behavior, time, actor) { -576 callback(behavior, time, actor); -577 } -578 }); -579 } -580 -581 return this; -582 }, +551 create:function () { +552 return this; +553 }, +554 /** +555 * Move this actor to a position. +556 * It creates and adds a new PathBehavior. +557 * @param x {number} new x position +558 * @param y {number} new y position +559 * @param duration {number} time to take to get to new position +560 * @param delay {=number} time to wait before start moving +561 * @param interpolator {=CAAT.Behavior.Interpolator} a CAAT.Behavior.Interpolator instance +562 */ +563 moveTo:function (x, y, duration, delay, interpolator, callback) { +564 +565 if (x === this.x && y === this.y) { +566 return; +567 } +568 +569 var id = '__moveTo'; +570 var b = this.getBehavior(id); +571 if (!b) { +572 b = new CAAT.Behavior.PathBehavior(). +573 setId(id). +574 setValues(new CAAT.PathUtil.LinearPath()); +575 this.addBehavior(b); +576 } +577 +578 b.path.setInitialPosition(this.x, this.y).setFinalPosition(x, y); +579 b.setDelayTime(delay ? delay : 0, duration); +580 if (interpolator) { +581 b.setInterpolator(interpolator); +582 } 583 -584 /** -585 * -586 * @param angle {number} new rotation angle -587 * @param duration {number} time to rotate -588 * @param delay {number=} millis to start rotation -589 * @param anchorX {number=} rotation anchor x -590 * @param anchorY {number=} rotation anchor y -591 * @param interpolator {CAAT.Behavior.Interpolator=} -592 * @return {*} -593 */ -594 rotateTo:function (angle, duration, delay, anchorX, anchorY, interpolator) { +584 if (callback) { +585 b.lifecycleListenerList = []; +586 b.addListener({ +587 behaviorExpired:function (behavior, time, actor) { +588 callback(behavior, time, actor); +589 } +590 }); +591 } +592 +593 return this; +594 }, 595 -596 if (angle === this.rotationAngle) { -597 return; -598 } -599 -600 var id = '__rotateTo'; -601 var b = this.getBehavior(id); -602 if (!b) { -603 b = new CAAT.Behavior.RotateBehavior(). -604 setId(id). -605 setValues(0, 0, .5, .5); -606 this.addBehavior(b); -607 } -608 -609 b.setValues(this.rotationAngle, angle, anchorX, anchorY). -610 setDelayTime(delay ? delay : 0, duration); +596 /** +597 * +598 * @param angle {number} new rotation angle +599 * @param duration {number} time to rotate +600 * @param delay {number=} millis to start rotation +601 * @param anchorX {number=} rotation anchor x +602 * @param anchorY {number=} rotation anchor y +603 * @param interpolator {CAAT.Behavior.Interpolator=} +604 * @return {*} +605 */ +606 rotateTo:function (angle, duration, delay, anchorX, anchorY, interpolator) { +607 +608 if (angle === this.rotationAngle) { +609 return; +610 } 611 -612 if (interpolator) { -613 b.setInterpolator(interpolator); -614 } -615 -616 return this; -617 }, -618 -619 /** -620 * -621 * @param scaleX {number} new X scale -622 * @param scaleY {number} new Y scale -623 * @param duration {number} time to rotate -624 * @param delay {=number} millis to start rotation -625 * @param anchorX {=number} rotation anchor x -626 * @param anchorY {=number} rotation anchor y -627 * @param interpolator {=CAAT.Behavior.Interpolator} -628 * @return {*} -629 */ -630 scaleTo:function (scaleX, scaleY, duration, delay, anchorX, anchorY, interpolator) { -631 -632 if (this.scaleX === scaleX && this.scaleY === scaleY) { -633 return; -634 } -635 -636 var id = '__scaleTo'; -637 var b = this.getBehavior(id); -638 if (!b) { -639 b = new CAAT.Behavior.ScaleBehavior(). -640 setId(id). -641 setValues(1, 1, 1, 1, .5, .5); -642 this.addBehavior(b); -643 } -644 -645 b.setValues(this.scaleX, scaleX, this.scaleY, scaleY, anchorX, anchorY). -646 setDelayTime(delay ? delay : 0, duration); +612 var id = '__rotateTo'; +613 var b = this.getBehavior(id); +614 if (!b) { +615 b = new CAAT.Behavior.RotateBehavior(). +616 setId(id). +617 setValues(0, 0, .5, .5); +618 this.addBehavior(b); +619 } +620 +621 b.setValues(this.rotationAngle, angle, anchorX, anchorY). +622 setDelayTime(delay ? delay : 0, duration); +623 +624 if (interpolator) { +625 b.setInterpolator(interpolator); +626 } +627 +628 return this; +629 }, +630 +631 /** +632 * +633 * @param scaleX {number} new X scale +634 * @param scaleY {number} new Y scale +635 * @param duration {number} time to rotate +636 * @param delay {=number} millis to start rotation +637 * @param anchorX {=number} rotation anchor x +638 * @param anchorY {=number} rotation anchor y +639 * @param interpolator {=CAAT.Behavior.Interpolator} +640 * @return {*} +641 */ +642 scaleTo:function (scaleX, scaleY, duration, delay, anchorX, anchorY, interpolator) { +643 +644 if (this.scaleX === scaleX && this.scaleY === scaleY) { +645 return; +646 } 647 -648 if (interpolator) { -649 b.setInterpolator(interpolator); -650 } -651 -652 return this; -653 }, -654 -655 /** -656 * -657 * @param scaleX {number} new X scale -658 * @param duration {number} time to rotate -659 * @param delay {=number} millis to start rotation -660 * @param anchorX {=number} rotation anchor x -661 * @param anchorY {=number} rotation anchor y -662 * @param interpolator {=CAAT.Behavior.Interpolator} -663 * @return {*} -664 */ -665 scaleXTo:function (scaleX, duration, delay, anchorX, anchorY, interpolator) { -666 return this.__scale1To( -667 CAAT.Behavior.Scale1Behavior.AXIS_X, -668 scaleX, -669 duration, -670 delay, -671 anchorX, -672 anchorY, -673 interpolator -674 ); -675 }, -676 -677 /** -678 * -679 * @param scaleY {number} new Y scale -680 * @param duration {number} time to rotate -681 * @param delay {=number} millis to start rotation -682 * @param anchorX {=number} rotation anchor x -683 * @param anchorY {=number} rotation anchor y -684 * @param interpolator {=CAAT.Behavior.Interpolator} -685 * @return {*} -686 */ -687 scaleYTo:function (scaleY, duration, delay, anchorX, anchorY, interpolator) { -688 return this.__scale1To( -689 CAAT.Behavior.Scale1Behavior.AXIS_Y, -690 scaleY, -691 duration, -692 delay, -693 anchorX, -694 anchorY, -695 interpolator -696 ); -697 }, -698 -699 /** -700 * @param axis {CAAT.Scale1Behavior.AXIS_X|CAAT.Scale1Behavior.AXIS_Y} scale application axis -701 * @param scale {number} new Y scale -702 * @param duration {number} time to rotate -703 * @param delay {=number} millis to start rotation -704 * @param anchorX {=number} rotation anchor x -705 * @param anchorY {=number} rotation anchor y -706 * @param interpolator {=CAAT.Bahavior.Interpolator} -707 * @return {*} -708 */ -709 __scale1To:function (axis, scale, duration, delay, anchorX, anchorY, interpolator) { +648 var id = '__scaleTo'; +649 var b = this.getBehavior(id); +650 if (!b) { +651 b = new CAAT.Behavior.ScaleBehavior(). +652 setId(id). +653 setValues(1, 1, 1, 1, .5, .5); +654 this.addBehavior(b); +655 } +656 +657 b.setValues(this.scaleX, scaleX, this.scaleY, scaleY, anchorX, anchorY). +658 setDelayTime(delay ? delay : 0, duration); +659 +660 if (interpolator) { +661 b.setInterpolator(interpolator); +662 } +663 +664 return this; +665 }, +666 +667 /** +668 * +669 * @param scaleX {number} new X scale +670 * @param duration {number} time to rotate +671 * @param delay {=number} millis to start rotation +672 * @param anchorX {=number} rotation anchor x +673 * @param anchorY {=number} rotation anchor y +674 * @param interpolator {=CAAT.Behavior.Interpolator} +675 * @return {*} +676 */ +677 scaleXTo:function (scaleX, duration, delay, anchorX, anchorY, interpolator) { +678 return this.__scale1To( +679 CAAT.Behavior.Scale1Behavior.AXIS_X, +680 scaleX, +681 duration, +682 delay, +683 anchorX, +684 anchorY, +685 interpolator +686 ); +687 }, +688 +689 /** +690 * +691 * @param scaleY {number} new Y scale +692 * @param duration {number} time to rotate +693 * @param delay {=number} millis to start rotation +694 * @param anchorX {=number} rotation anchor x +695 * @param anchorY {=number} rotation anchor y +696 * @param interpolator {=CAAT.Behavior.Interpolator} +697 * @return {*} +698 */ +699 scaleYTo:function (scaleY, duration, delay, anchorX, anchorY, interpolator) { +700 return this.__scale1To( +701 CAAT.Behavior.Scale1Behavior.AXIS_Y, +702 scaleY, +703 duration, +704 delay, +705 anchorX, +706 anchorY, +707 interpolator +708 ); +709 }, 710 -711 if (( axis === CAAT.Behavior.Scale1Behavior.AXIS_X && scale === this.scaleX) || -712 ( axis === CAAT.Behavior.Scale1Behavior.AXIS_Y && scale === this.scaleY)) { -713 -714 return; -715 } -716 -717 var id = '__scaleXTo'; -718 var b = this.getBehavior(id); -719 if (!b) { -720 b = new CAAT.Behavior.Scale1Behavior(). -721 setId(id). -722 setValues(1, 1, axis === CAAT.Behavior.Scale1Behavior.AXIS_X, .5, .5); -723 this.addBehavior(b); -724 } +711 /** +712 * @param axis {CAAT.Scale1Behavior.AXIS_X|CAAT.Scale1Behavior.AXIS_Y} scale application axis +713 * @param scale {number} new Y scale +714 * @param duration {number} time to rotate +715 * @param delay {=number} millis to start rotation +716 * @param anchorX {=number} rotation anchor x +717 * @param anchorY {=number} rotation anchor y +718 * @param interpolator {=CAAT.Bahavior.Interpolator} +719 * @return {*} +720 */ +721 __scale1To:function (axis, scale, duration, delay, anchorX, anchorY, interpolator) { +722 +723 if (( axis === CAAT.Behavior.Scale1Behavior.AXIS_X && scale === this.scaleX) || +724 ( axis === CAAT.Behavior.Scale1Behavior.AXIS_Y && scale === this.scaleY)) { 725 -726 b.setValues( -727 axis ? this.scaleX : this.scaleY, -728 scale, -729 anchorX, -730 anchorY). -731 setDelayTime(delay ? delay : 0, duration); -732 -733 if (interpolator) { -734 b.setInterpolator(interpolator); -735 } -736 -737 return this; -738 }, -739 -740 /** -741 * Touch Start only received when CAAT.TOUCH_BEHAVIOR= CAAT.TOUCH_AS_MULTITOUCH -742 * @param e <CAAT.TouchEvent> -743 */ -744 touchStart:function (e) { -745 }, -746 touchMove:function (e) { -747 }, -748 touchEnd:function (e) { -749 }, -750 gestureStart:function (rotation, scaleX, scaleY) { -751 }, -752 gestureChange:function (rotation, scaleX, scaleY) { -753 if (this.gestureEnabled) { -754 this.setRotation(rotation); -755 this.setScale(scaleX, scaleY); -756 } -757 return this; -758 }, -759 gestureEnd:function (rotation, scaleX, scaleY) { -760 }, -761 -762 isVisible:function () { -763 return this.visible; -764 }, -765 -766 invalidate:function () { -767 this.invalid = true; -768 return this; -769 }, -770 setGestureEnabled:function (enable) { -771 this.gestureEnabled = !!enable; -772 return this; -773 }, -774 isGestureEnabled:function () { -775 return this.gestureEnabled; +726 return; +727 } +728 +729 var id = '__scaleXTo'; +730 var b = this.getBehavior(id); +731 if (!b) { +732 b = new CAAT.Behavior.Scale1Behavior(). +733 setId(id). +734 setValues(1, 1, axis === CAAT.Behavior.Scale1Behavior.AXIS_X, .5, .5); +735 this.addBehavior(b); +736 } +737 +738 b.setValues( +739 axis ? this.scaleX : this.scaleY, +740 scale, +741 anchorX, +742 anchorY). +743 setDelayTime(delay ? delay : 0, duration); +744 +745 if (interpolator) { +746 b.setInterpolator(interpolator); +747 } +748 +749 return this; +750 }, +751 +752 /** +753 * Touch Start only received when CAAT.TOUCH_BEHAVIOR= CAAT.TOUCH_AS_MULTITOUCH +754 * @param e <CAAT.TouchEvent> +755 */ +756 touchStart:function (e) { +757 }, +758 touchMove:function (e) { +759 }, +760 touchEnd:function (e) { +761 }, +762 gestureStart:function (rotation, scaleX, scaleY) { +763 }, +764 gestureChange:function (rotation, scaleX, scaleY) { +765 if (this.gestureEnabled) { +766 this.setRotation(rotation); +767 this.setScale(scaleX, scaleY); +768 } +769 return this; +770 }, +771 gestureEnd:function (rotation, scaleX, scaleY) { +772 }, +773 +774 isVisible:function () { +775 return this.visible; 776 }, -777 getId:function () { -778 return this.id; -779 }, -780 setId:function (id) { -781 this.id = id; -782 return this; -783 }, -784 /** -785 * Set this actor's parent. -786 * @param parent {CAAT.Foundation.ActorContainer} -787 * @return this -788 */ -789 setParent:function (parent) { -790 this.parent = parent; -791 return this; -792 }, -793 /** -794 * Set this actor's background image. -795 * The need of a background image is to kept compatibility with the new CSSDirector class. -796 * The image parameter can be either an Image/Canvas or a CAAT.Foundation.SpriteImage instance. If an image -797 * is supplied, it will be wrapped into a CAAT.Foundation.SriteImage instance of 1 row by 1 column. -798 * If the actor has set an image in the background, the paint method will draw the image, otherwise -799 * and if set, will fill its background with a solid color. -800 * If adjust_size_to_image is true, the host actor will be redimensioned to the size of one -801 * single image from the SpriteImage (either supplied or generated because of passing an Image or -802 * Canvas to the function). That means the size will be set to [width:SpriteImage.singleWidth, -803 * height:singleHeight]. -804 * -805 * WARN: if using a CSS renderer, the image supplied MUST be a HTMLImageElement instance. -806 * -807 * @see CAAT.Foundation.SpriteImage -808 * -809 * @param image {Image|HTMLCanvasElement|CAAT.Foundation.SpriteImage} -810 * @param adjust_size_to_image {boolean} whether to set this actor's size based on image parameter. -811 * -812 * @return this -813 */ -814 setBackgroundImage:function (image, adjust_size_to_image) { -815 if (image) { -816 if (!(image instanceof CAAT.Foundation.SpriteImage)) { -817 if ( isString(image) ) { -818 image = new CAAT.Foundation.SpriteImage().initialize(CAAT.currentDirector.getImage(image), 1, 1); -819 } else { -820 image = new CAAT.Foundation.SpriteImage().initialize(image, 1, 1); -821 } -822 } else { -823 image= image.getRef(); -824 } -825 -826 image.setOwner(this); -827 this.backgroundImage = image; -828 if (typeof adjust_size_to_image === 'undefined' || adjust_size_to_image) { -829 this.width = image.getWidth(); -830 this.height = image.getHeight(); -831 } -832 -833 this.glEnabled = true; -834 -835 this.invalidate(); -836 -837 } else { -838 this.backgroundImage = null; -839 } -840 -841 return this; -842 }, -843 /** -844 * Set the actor's SpriteImage index from animation sheet. -845 * @see CAAT.Foundation.SpriteImage -846 * @param index {number} -847 * -848 * @return this -849 */ -850 setSpriteIndex:function (index) { -851 if (this.backgroundImage) { -852 this.backgroundImage.setSpriteIndex(index); -853 this.invalidate(); -854 } -855 -856 return this; -857 -858 }, -859 /** -860 * Set this actor's background SpriteImage offset displacement. -861 * The values can be either positive or negative meaning the texture space of this background -862 * image does not start at (0,0) but at the desired position. -863 * @see CAAT.Foundation.SpriteImage -864 * @param ox {number} horizontal offset -865 * @param oy {number} vertical offset -866 * -867 * @return this -868 */ -869 setBackgroundImageOffset:function (ox, oy) { -870 if (this.backgroundImage) { -871 this.backgroundImage.setOffset(ox, oy); -872 } -873 -874 return this; -875 }, -876 /** -877 * Set this actor's background SpriteImage its animation sequence. -878 * In its simplet's form a SpriteImage treats a given image as an array of rows by columns -879 * subimages. If you define d Sprite Image of 2x2, you'll be able to draw any of the 4 subimages. -880 * This method defines the animation sequence so that it could be set [0,2,1,3,2,1] as the -881 * animation sequence -882 * @param ii {Array<number>} an array of integers. -883 */ -884 setAnimationImageIndex:function (ii) { -885 if (this.backgroundImage) { -886 this.backgroundImage.resetAnimationTime(); -887 this.backgroundImage.setAnimationImageIndex(ii); -888 this.invalidate(); -889 } -890 return this; -891 }, -892 -893 addAnimation : function( name, array, time, callback ) { -894 if (this.backgroundImage) { -895 this.backgroundImage.addAnimation(name, array, time, callback); -896 } -897 return this; -898 }, -899 -900 playAnimation : function(name) { -901 if (this.backgroundImage) { -902 this.backgroundImage.playAnimation(name); -903 } -904 return this; -905 }, -906 -907 setAnimationEndCallback : function(f) { -908 if (this.backgroundImage) { -909 this.backgroundImage.setAnimationEndCallback(f); -910 } -911 return this; -912 }, -913 -914 resetAnimationTime:function () { -915 if (this.backgroundImage) { -916 this.backgroundImage.resetAnimationTime(); -917 this.invalidate(); -918 } -919 return this; -920 }, -921 -922 setChangeFPS:function (time) { -923 if (this.backgroundImage) { -924 this.backgroundImage.setChangeFPS(time); -925 } -926 return this; -927 -928 }, -929 /** -930 * Set this background image transformation. -931 * If GL is enabled, this parameter has no effect. -932 * @param it any value from CAAT.Foundation.SpriteImage.TR_* -933 * @return this -934 */ -935 setImageTransformation:function (it) { -936 if (this.backgroundImage) { -937 this.backgroundImage.setSpriteTransformation(it); -938 } -939 return this; +777 +778 invalidate:function () { +779 this.invalid = true; +780 return this; +781 }, +782 setGestureEnabled:function (enable) { +783 this.gestureEnabled = !!enable; +784 return this; +785 }, +786 isGestureEnabled:function () { +787 return this.gestureEnabled; +788 }, +789 getId:function () { +790 return this.id; +791 }, +792 setId:function (id) { +793 this.id = id; +794 return this; +795 }, +796 /** +797 * Set this actor's parent. +798 * @param parent {CAAT.Foundation.ActorContainer} +799 * @return this +800 */ +801 setParent:function (parent) { +802 this.parent = parent; +803 return this; +804 }, +805 /** +806 * Set this actor's background image. +807 * The need of a background image is to kept compatibility with the new CSSDirector class. +808 * The image parameter can be either an Image/Canvas or a CAAT.Foundation.SpriteImage instance. If an image +809 * is supplied, it will be wrapped into a CAAT.Foundation.SriteImage instance of 1 row by 1 column. +810 * If the actor has set an image in the background, the paint method will draw the image, otherwise +811 * and if set, will fill its background with a solid color. +812 * If adjust_size_to_image is true, the host actor will be redimensioned to the size of one +813 * single image from the SpriteImage (either supplied or generated because of passing an Image or +814 * Canvas to the function). That means the size will be set to [width:SpriteImage.singleWidth, +815 * height:singleHeight]. +816 * +817 * WARN: if using a CSS renderer, the image supplied MUST be a HTMLImageElement instance. +818 * +819 * @see CAAT.Foundation.SpriteImage +820 * +821 * @param image {Image|HTMLCanvasElement|CAAT.Foundation.SpriteImage} +822 * @param adjust_size_to_image {boolean} whether to set this actor's size based on image parameter. +823 * +824 * @return this +825 */ +826 setBackgroundImage:function (image, adjust_size_to_image) { +827 if (image) { +828 if (!(image instanceof CAAT.Foundation.SpriteImage)) { +829 if ( isString(image) ) { +830 image = new CAAT.Foundation.SpriteImage().initialize(CAAT.currentDirector.getImage(image), 1, 1); +831 } else { +832 image = new CAAT.Foundation.SpriteImage().initialize(image, 1, 1); +833 } +834 } else { +835 image= image.getRef(); +836 } +837 +838 image.setOwner(this); +839 this.backgroundImage = image; +840 if (typeof adjust_size_to_image === 'undefined' || adjust_size_to_image) { +841 this.width = image.getWidth(); +842 this.height = image.getHeight(); +843 } +844 +845 this.glEnabled = true; +846 +847 this.invalidate(); +848 +849 } else { +850 this.backgroundImage = null; +851 } +852 +853 return this; +854 }, +855 /** +856 * Set the actor's SpriteImage index from animation sheet. +857 * @see CAAT.Foundation.SpriteImage +858 * @param index {number} +859 * +860 * @return this +861 */ +862 setSpriteIndex:function (index) { +863 if (this.backgroundImage) { +864 this.backgroundImage.setSpriteIndex(index); +865 this.invalidate(); +866 } +867 +868 return this; +869 +870 }, +871 /** +872 * Set this actor's background SpriteImage offset displacement. +873 * The values can be either positive or negative meaning the texture space of this background +874 * image does not start at (0,0) but at the desired position. +875 * @see CAAT.Foundation.SpriteImage +876 * @param ox {number} horizontal offset +877 * @param oy {number} vertical offset +878 * +879 * @return this +880 */ +881 setBackgroundImageOffset:function (ox, oy) { +882 if (this.backgroundImage) { +883 this.backgroundImage.setOffset(ox, oy); +884 } +885 +886 return this; +887 }, +888 /** +889 * Set this actor's background SpriteImage its animation sequence. +890 * In its simplet's form a SpriteImage treats a given image as an array of rows by columns +891 * subimages. If you define d Sprite Image of 2x2, you'll be able to draw any of the 4 subimages. +892 * This method defines the animation sequence so that it could be set [0,2,1,3,2,1] as the +893 * animation sequence +894 * @param ii {Array<number>} an array of integers. +895 */ +896 setAnimationImageIndex:function (ii) { +897 if (this.backgroundImage) { +898 this.backgroundImage.resetAnimationTime(); +899 this.backgroundImage.setAnimationImageIndex(ii); +900 this.invalidate(); +901 } +902 return this; +903 }, +904 +905 addAnimation : function( name, array, time, callback ) { +906 if (this.backgroundImage) { +907 this.backgroundImage.addAnimation(name, array, time, callback); +908 } +909 return this; +910 }, +911 +912 playAnimation : function(name) { +913 if (this.backgroundImage) { +914 this.backgroundImage.playAnimation(name); +915 } +916 return this; +917 }, +918 +919 setAnimationEndCallback : function(f) { +920 if (this.backgroundImage) { +921 this.backgroundImage.setAnimationEndCallback(f); +922 } +923 return this; +924 }, +925 +926 resetAnimationTime:function () { +927 if (this.backgroundImage) { +928 this.backgroundImage.resetAnimationTime(); +929 this.invalidate(); +930 } +931 return this; +932 }, +933 +934 setChangeFPS:function (time) { +935 if (this.backgroundImage) { +936 this.backgroundImage.setChangeFPS(time); +937 } +938 return this; +939 940 }, 941 /** -942 * Center this actor at position (x,y). -943 * @param x {number} x position -944 * @param y {number} y position -945 * -946 * @return this -947 * @deprecated -948 */ -949 centerOn:function (x, y) { -950 this.setPosition(x - this.width / 2, y - this.height / 2); +942 * Set this background image transformation. +943 * If GL is enabled, this parameter has no effect. +944 * @param it any value from CAAT.Foundation.SpriteImage.TR_* +945 * @return this +946 */ +947 setImageTransformation:function (it) { +948 if (this.backgroundImage) { +949 this.backgroundImage.setSpriteTransformation(it); +950 } 951 return this; 952 }, 953 /** @@ -963,1616 +963,1635 @@ 956 * @param y {number} y position 957 * 958 * @return this -959 */ -960 centerAt:function (x, y) { -961 this.setPosition( -962 x - this.width * (.5 - this.tAnchorX ), -963 y - this.height * (.5 - this.tAnchorY ) ); -964 return this; -965 }, -966 /** -967 * If GL is enables, get this background image's texture page, otherwise it will fail. -968 * @return {CAAT.GLTexturePage} -969 */ -970 getTextureGLPage:function () { -971 return this.backgroundImage.image.__texturePage; -972 }, -973 /** -974 * Set this actor invisible. -975 * The actor is animated but not visible. -976 * A container won't show any of its children if set visible to false. -977 * -978 * @param visible {boolean} set this actor visible or not. -979 * @return this -980 */ -981 setVisible:function (visible) { -982 this.invalidate(); -983 // si estoy visible y quiero hacerme no visible -984 if (CAAT.currentDirector && CAAT.currentDirector.dirtyRectsEnabled && !visible && this.visible) { -985 // if dirty rects, add this actor -986 CAAT.currentDirector.scheduleDirtyRect(this.AABB); -987 } -988 -989 if ( visible && !this.visible) { -990 this.dirty= true; -991 } -992 -993 this.visible = visible; -994 return this; -995 }, -996 /** -997 * Puts an Actor out of time line, that is, won't be transformed nor rendered. -998 * @return this -999 */ -1000 setOutOfFrameTime:function () { -1001 this.setFrameTime(-1, 0); -1002 return this; -1003 }, -1004 /** -1005 * Adds an Actor's life cycle listener. -1006 * The developer must ensure the actorListener is not already a listener, otherwise -1007 * it will notified more than once. -1008 * @param actorListener {object} an object with at least a method of the form: -1009 * <code>actorLyfeCycleEvent( actor, string_event_type, long_time )</code> -1010 */ -1011 addListener:function (actorListener) { -1012 this.lifecycleListenerList.push(actorListener); -1013 return this; -1014 }, -1015 /** -1016 * Removes an Actor's life cycle listener. -1017 * It will only remove the first occurrence of the given actorListener. -1018 * @param actorListener {object} an Actor's life cycle listener. -1019 */ -1020 removeListener:function (actorListener) { -1021 var n = this.lifecycleListenerList.length; -1022 while (n--) { -1023 if (this.lifecycleListenerList[n] === actorListener) { -1024 // remove the nth element. -1025 this.lifecycleListenerList.splice(n, 1); -1026 return; -1027 } -1028 } -1029 }, -1030 /** -1031 * Set alpha composition scope. global will mean this alpha value will be its children maximum. -1032 * If set to false, only this actor will have this alpha value. -1033 * @param global {boolean} whether the alpha value should be propagated to children. -1034 */ -1035 setGlobalAlpha:function (global) { -1036 this.isGlobalAlpha = global; -1037 return this; -1038 }, -1039 /** -1040 * Notifies the registered Actor's life cycle listener about some event. -1041 * @param sEventType an string indicating the type of event being notified. -1042 * @param time an integer indicating the time related to Scene's timeline when the event -1043 * is being notified. -1044 */ -1045 fireEvent:function (sEventType, time) { -1046 for (var i = 0; i < this.lifecycleListenerList.length; i++) { -1047 this.lifecycleListenerList[i].actorLifeCycleEvent(this, sEventType, time); -1048 } -1049 }, -1050 /** -1051 * Sets this Actor as Expired. -1052 * If this is a Container, all the contained Actors won't be nor drawn nor will receive -1053 * any event. That is, expiring an Actor means totally taking it out the Scene's timeline. -1054 * @param time {number} an integer indicating the time the Actor was expired at. -1055 * @return this. +959 * @deprecated +960 */ +961 centerOn:function (x, y) { +962 this.setPosition(x - this.width / 2, y - this.height / 2); +963 return this; +964 }, +965 /** +966 * Center this actor at position (x,y). +967 * @param x {number} x position +968 * @param y {number} y position +969 * +970 * @return this +971 */ +972 centerAt:function (x, y) { +973 this.setPosition( +974 x - this.width * (.5 - this.tAnchorX ), +975 y - this.height * (.5 - this.tAnchorY ) ); +976 return this; +977 }, +978 /** +979 * If GL is enables, get this background image's texture page, otherwise it will fail. +980 * @return {CAAT.GLTexturePage} +981 */ +982 getTextureGLPage:function () { +983 return this.backgroundImage.image.__texturePage; +984 }, +985 /** +986 * Set this actor invisible. +987 * The actor is animated but not visible. +988 * A container won't show any of its children if set visible to false. +989 * +990 * @param visible {boolean} set this actor visible or not. +991 * @return this +992 */ +993 setVisible:function (visible) { +994 this.invalidate(); +995 // si estoy visible y quiero hacerme no visible +996 if (CAAT.currentDirector && CAAT.currentDirector.dirtyRectsEnabled && !visible && this.visible) { +997 // if dirty rects, add this actor +998 CAAT.currentDirector.scheduleDirtyRect(this.AABB); +999 } +1000 +1001 if ( visible && !this.visible) { +1002 this.dirty= true; +1003 } +1004 +1005 this.visible = visible; +1006 return this; +1007 }, +1008 /** +1009 * Puts an Actor out of time line, that is, won't be transformed nor rendered. +1010 * @return this +1011 */ +1012 setOutOfFrameTime:function () { +1013 this.setFrameTime(-1, 0); +1014 return this; +1015 }, +1016 /** +1017 * Adds an Actor's life cycle listener. +1018 * The developer must ensure the actorListener is not already a listener, otherwise +1019 * it will notified more than once. +1020 * @param actorListener {object} an object with at least a method of the form: +1021 * <code>actorLyfeCycleEvent( actor, string_event_type, long_time )</code> +1022 */ +1023 addListener:function (actorListener) { +1024 this.lifecycleListenerList.push(actorListener); +1025 return this; +1026 }, +1027 /** +1028 * Removes an Actor's life cycle listener. +1029 * It will only remove the first occurrence of the given actorListener. +1030 * @param actorListener {object} an Actor's life cycle listener. +1031 */ +1032 removeListener:function (actorListener) { +1033 var n = this.lifecycleListenerList.length; +1034 while (n--) { +1035 if (this.lifecycleListenerList[n] === actorListener) { +1036 // remove the nth element. +1037 this.lifecycleListenerList.splice(n, 1); +1038 return; +1039 } +1040 } +1041 }, +1042 /** +1043 * Set alpha composition scope. global will mean this alpha value will be its children maximum. +1044 * If set to false, only this actor will have this alpha value. +1045 * @param global {boolean} whether the alpha value should be propagated to children. +1046 */ +1047 setGlobalAlpha:function (global) { +1048 this.isGlobalAlpha = global; +1049 return this; +1050 }, +1051 /** +1052 * Notifies the registered Actor's life cycle listener about some event. +1053 * @param sEventType an string indicating the type of event being notified. +1054 * @param time an integer indicating the time related to Scene's timeline when the event +1055 * is being notified. 1056 */ -1057 setExpired:function (time) { -1058 this.expired = true; -1059 this.fireEvent('expired', time); -1060 return this; +1057 fireEvent:function (sEventType, time) { +1058 for (var i = 0; i < this.lifecycleListenerList.length; i++) { +1059 this.lifecycleListenerList[i].actorLifeCycleEvent(this, sEventType, time); +1060 } 1061 }, 1062 /** -1063 * Enable or disable the event bubbling for this Actor. -1064 * @param enable {boolean} a boolean indicating whether the event bubbling is enabled. -1065 * @return this -1066 */ -1067 enableEvents:function (enable) { -1068 this.mouseEnabled = enable; -1069 return this; -1070 }, -1071 /** -1072 * Removes all behaviors from an Actor. -1073 * @return this -1074 */ -1075 emptyBehaviorList:function () { -1076 this.behaviorList = []; -1077 return this; -1078 }, -1079 /** -1080 * Caches a fillStyle in the Actor. -1081 * @param style a valid Canvas rendering context fillStyle. -1082 * @return this -1083 */ -1084 setFillStyle:function (style) { -1085 this.fillStyle = style; -1086 this.invalidate(); -1087 return this; -1088 }, -1089 /** -1090 * Caches a stroke style in the Actor. -1091 * @param style a valid canvas rendering context stroke style. -1092 * @return this -1093 */ -1094 setStrokeStyle:function (style) { -1095 this.strokeStyle = style; -1096 this.invalidate(); -1097 return this; -1098 }, -1099 /** -1100 * @deprecated -1101 * @param paint -1102 */ -1103 setPaint:function (paint) { -1104 return this.setFillStyle(paint); -1105 }, -1106 /** -1107 * Stablishes the Alpha transparency for the Actor. -1108 * If it globalAlpha enabled, this alpha will the maximum alpha for every contained actors. -1109 * The alpha must be between 0 and 1. -1110 * @param alpha a float indicating the alpha value. -1111 * @return this -1112 */ -1113 setAlpha:function (alpha) { -1114 this.alpha = alpha; -1115 this.invalidate(); -1116 return this; +1063 * Sets this Actor as Expired. +1064 * If this is a Container, all the contained Actors won't be nor drawn nor will receive +1065 * any event. That is, expiring an Actor means totally taking it out the Scene's timeline. +1066 * @param time {number} an integer indicating the time the Actor was expired at. +1067 * @return this. +1068 */ +1069 setExpired:function (time) { +1070 this.expired = true; +1071 this.fireEvent('expired', time); +1072 return this; +1073 }, +1074 /** +1075 * Enable or disable the event bubbling for this Actor. +1076 * @param enable {boolean} a boolean indicating whether the event bubbling is enabled. +1077 * @return this +1078 */ +1079 enableEvents:function (enable) { +1080 this.mouseEnabled = enable; +1081 return this; +1082 }, +1083 /** +1084 * Removes all behaviors from an Actor. +1085 * @return this +1086 */ +1087 emptyBehaviorList:function () { +1088 this.behaviorList = []; +1089 return this; +1090 }, +1091 /** +1092 * Caches a fillStyle in the Actor. +1093 * @param style a valid Canvas rendering context fillStyle. +1094 * @return this +1095 */ +1096 setFillStyle:function (style) { +1097 this.fillStyle = style; +1098 this.invalidate(); +1099 return this; +1100 }, +1101 /** +1102 * Caches a stroke style in the Actor. +1103 * @param style a valid canvas rendering context stroke style. +1104 * @return this +1105 */ +1106 setStrokeStyle:function (style) { +1107 this.strokeStyle = style; +1108 this.invalidate(); +1109 return this; +1110 }, +1111 /** +1112 * @deprecated +1113 * @param paint +1114 */ +1115 setPaint:function (paint) { +1116 return this.setFillStyle(paint); 1117 }, 1118 /** -1119 * Remove all transformation values for the Actor. -1120 * @return this -1121 */ -1122 resetTransform:function () { -1123 this.rotationAngle = 0; -1124 this.rotationX = .5; -1125 this.rotationY = .5; -1126 this.scaleX = 1; -1127 this.scaleY = 1; -1128 this.scaleTX = .5; -1129 this.scaleTY = .5; -1130 this.scaleAnchor = 0; -1131 this.oldX = -1; -1132 this.oldY = -1; -1133 this.dirty = true; -1134 -1135 return this; -1136 }, -1137 /** -1138 * Sets the time life cycle for an Actor. -1139 * These values are related to Scene time. -1140 * @param startTime an integer indicating the time until which the Actor won't be visible on the Scene. -1141 * @param duration an integer indicating how much the Actor will last once visible. -1142 * @return this -1143 */ -1144 setFrameTime:function (startTime, duration) { -1145 this.start_time = startTime; -1146 this.duration = duration; -1147 this.expired = false; -1148 this.dirty = true; -1149 -1150 return this; -1151 }, -1152 /** -1153 * This method should me overriden by every custom Actor. -1154 * It will be the drawing routine called by the Director to show every Actor. -1155 * @param director {CAAT.Foundation.Director} instance that contains the Scene the Actor is in. -1156 * @param time {number} indicating the Scene time in which the drawing is performed. -1157 */ -1158 paint:function (director, time) { -1159 if (this.backgroundImage) { -1160 this.backgroundImage.paint(director, time, 0, 0); -1161 } else if (this.fillStyle) { -1162 var ctx = director.ctx; -1163 ctx.fillStyle = this.fillStyle; -1164 ctx.fillRect(0, 0, this.width, this.height); -1165 } -1166 -1167 }, -1168 /** -1169 * A helper method to setScaleAnchored with an anchor of ANCHOR_CENTER -1170 * -1171 * @see setScaleAnchored -1172 * -1173 * @param sx a float indicating a width size multiplier. -1174 * @param sy a float indicating a height size multiplier. -1175 * @return this -1176 */ -1177 setScale:function (sx, sy) { -1178 this.scaleX = sx; -1179 this.scaleY = sy; -1180 this.dirty = true; -1181 return this; -1182 }, -1183 getAnchorPercent:function (anchor) { -1184 -1185 var anchors = [ -1186 .50, .50, .50, 0, .50, 1.00, -1187 0, .50, 1.00, .50, 0, 0, -1188 1.00, 0, 0, 1.00, 1.00, 1.00 -1189 ]; -1190 -1191 return { x:anchors[anchor * 2], y:anchors[anchor * 2 + 1] }; -1192 }, -1193 /** -1194 * Private. -1195 * Gets a given anchor position referred to the Actor. -1196 * @param anchor -1197 * @return an object of the form { x: float, y: float } -1198 */ -1199 getAnchor:function (anchor) { -1200 var tx = 0, ty = 0; -1201 -1202 var A= CAAT.Foundation.Actor; -1203 -1204 switch (anchor) { -1205 case A.ANCHOR_CENTER: -1206 tx = .5; -1207 ty = .5; -1208 break; -1209 case A.ANCHOR_TOP: -1210 tx = .5; -1211 ty = 0; -1212 break; -1213 case A.ANCHOR_BOTTOM: -1214 tx = .5; -1215 ty = 1; -1216 break; -1217 case A.ANCHOR_LEFT: -1218 tx = 0; +1119 * Stablishes the Alpha transparency for the Actor. +1120 * If it globalAlpha enabled, this alpha will the maximum alpha for every contained actors. +1121 * The alpha must be between 0 and 1. +1122 * @param alpha a float indicating the alpha value. +1123 * @return this +1124 */ +1125 setAlpha:function (alpha) { +1126 this.alpha = alpha; +1127 this.invalidate(); +1128 return this; +1129 }, +1130 /** +1131 * Remove all transformation values for the Actor. +1132 * @return this +1133 */ +1134 resetTransform:function () { +1135 this.rotationAngle = 0; +1136 this.rotationX = .5; +1137 this.rotationY = .5; +1138 this.scaleX = 1; +1139 this.scaleY = 1; +1140 this.scaleTX = .5; +1141 this.scaleTY = .5; +1142 this.scaleAnchor = 0; +1143 this.oldX = -1; +1144 this.oldY = -1; +1145 this.dirty = true; +1146 +1147 return this; +1148 }, +1149 /** +1150 * Sets the time life cycle for an Actor. +1151 * These values are related to Scene time. +1152 * @param startTime an integer indicating the time until which the Actor won't be visible on the Scene. +1153 * @param duration an integer indicating how much the Actor will last once visible. +1154 * @return this +1155 */ +1156 setFrameTime:function (startTime, duration) { +1157 this.start_time = startTime; +1158 this.duration = duration; +1159 this.expired = false; +1160 this.dirty = true; +1161 +1162 return this; +1163 }, +1164 /** +1165 * This method should me overriden by every custom Actor. +1166 * It will be the drawing routine called by the Director to show every Actor. +1167 * @param director {CAAT.Foundation.Director} instance that contains the Scene the Actor is in. +1168 * @param time {number} indicating the Scene time in which the drawing is performed. +1169 */ +1170 paint:function (director, time) { +1171 if (this.backgroundImage) { +1172 this.backgroundImage.paint(director, time, 0, 0); +1173 } else if (this.fillStyle) { +1174 var ctx = director.ctx; +1175 ctx.fillStyle = this.fillStyle; +1176 ctx.fillRect(0, 0, this.width, this.height); +1177 } +1178 +1179 }, +1180 /** +1181 * A helper method to setScaleAnchored with an anchor of ANCHOR_CENTER +1182 * +1183 * @see setScaleAnchored +1184 * +1185 * @param sx a float indicating a width size multiplier. +1186 * @param sy a float indicating a height size multiplier. +1187 * @return this +1188 */ +1189 setScale:function (sx, sy) { +1190 this.scaleX = sx; +1191 this.scaleY = sy; +1192 this.dirty = true; +1193 return this; +1194 }, +1195 getAnchorPercent:function (anchor) { +1196 +1197 var anchors = [ +1198 .50, .50, .50, 0, .50, 1.00, +1199 0, .50, 1.00, .50, 0, 0, +1200 1.00, 0, 0, 1.00, 1.00, 1.00 +1201 ]; +1202 +1203 return { x:anchors[anchor * 2], y:anchors[anchor * 2 + 1] }; +1204 }, +1205 /** +1206 * Private. +1207 * Gets a given anchor position referred to the Actor. +1208 * @param anchor +1209 * @return an object of the form { x: float, y: float } +1210 */ +1211 getAnchor:function (anchor) { +1212 var tx = 0, ty = 0; +1213 +1214 var A= CAAT.Foundation.Actor; +1215 +1216 switch (anchor) { +1217 case A.ANCHOR_CENTER: +1218 tx = .5; 1219 ty = .5; 1220 break; -1221 case A.ANCHOR_RIGHT: -1222 tx = 1; -1223 ty = .5; +1221 case A.ANCHOR_TOP: +1222 tx = .5; +1223 ty = 0; 1224 break; -1225 case A.ANCHOR_TOP_RIGHT: -1226 tx = 1; -1227 ty = 0; +1225 case A.ANCHOR_BOTTOM: +1226 tx = .5; +1227 ty = 1; 1228 break; -1229 case A.ANCHOR_BOTTOM_LEFT: +1229 case A.ANCHOR_LEFT: 1230 tx = 0; -1231 ty = 1; +1231 ty = .5; 1232 break; -1233 case A.ANCHOR_BOTTOM_RIGHT: +1233 case A.ANCHOR_RIGHT: 1234 tx = 1; -1235 ty = 1; +1235 ty = .5; 1236 break; -1237 case A.ANCHOR_TOP_LEFT: -1238 tx = 0; +1237 case A.ANCHOR_TOP_RIGHT: +1238 tx = 1; 1239 ty = 0; 1240 break; -1241 } -1242 -1243 return {x:tx, y:ty}; -1244 }, -1245 -1246 setGlobalAnchor:function (ax, ay) { -1247 this.tAnchorX = ax; -1248 this.rotationX = ax; -1249 this.scaleTX = ax; -1250 -1251 this.tAnchorY = ay; -1252 this.rotationY = ay; -1253 this.scaleTY = ay; +1241 case A.ANCHOR_BOTTOM_LEFT: +1242 tx = 0; +1243 ty = 1; +1244 break; +1245 case A.ANCHOR_BOTTOM_RIGHT: +1246 tx = 1; +1247 ty = 1; +1248 break; +1249 case A.ANCHOR_TOP_LEFT: +1250 tx = 0; +1251 ty = 0; +1252 break; +1253 } 1254 -1255 this.dirty = true; -1256 return this; -1257 }, -1258 -1259 setScaleAnchor:function (sax, say) { -1260 this.scaleTX = sax; -1261 this.scaleTY = say; -1262 this.dirty = true; -1263 return this; -1264 }, -1265 /** -1266 * Modify the dimensions on an Actor. -1267 * The dimension will not affect the local coordinates system in opposition -1268 * to setSize or setBounds. -1269 * -1270 * @param sx {number} width scale. -1271 * @param sy {number} height scale. -1272 * @param anchorx {number} x anchor to perform the Scale operation. -1273 * @param anchory {number} y anchor to perform the Scale operation. -1274 * -1275 * @return this; -1276 */ -1277 setScaleAnchored:function (sx, sy, anchorx, anchory) { -1278 this.scaleTX = anchorx; -1279 this.scaleTY = anchory; -1280 -1281 this.scaleX = sx; -1282 this.scaleY = sy; -1283 -1284 this.dirty = true; -1285 -1286 return this; -1287 }, -1288 -1289 setRotationAnchor:function (rax, ray) { -1290 this.rotationX = ray; -1291 this.rotationY = rax; -1292 this.dirty = true; -1293 return this; -1294 }, -1295 /** -1296 * A helper method for setRotationAnchored. This methods stablishes the center -1297 * of rotation to be the center of the Actor. -1298 * -1299 * @param angle a float indicating the angle in radians to rotate the Actor. -1300 * @return this -1301 */ -1302 setRotation:function (angle) { -1303 this.rotationAngle = angle; +1255 return {x:tx, y:ty}; +1256 }, +1257 +1258 setGlobalAnchor:function (ax, ay) { +1259 this.tAnchorX = ax; +1260 this.rotationX = ax; +1261 this.scaleTX = ax; +1262 +1263 this.tAnchorY = ay; +1264 this.rotationY = ay; +1265 this.scaleTY = ay; +1266 +1267 this.dirty = true; +1268 return this; +1269 }, +1270 +1271 setScaleAnchor:function (sax, say) { +1272 this.scaleTX = sax; +1273 this.scaleTY = say; +1274 this.dirty = true; +1275 return this; +1276 }, +1277 /** +1278 * Modify the dimensions on an Actor. +1279 * The dimension will not affect the local coordinates system in opposition +1280 * to setSize or setBounds. +1281 * +1282 * @param sx {number} width scale. +1283 * @param sy {number} height scale. +1284 * @param anchorx {number} x anchor to perform the Scale operation. +1285 * @param anchory {number} y anchor to perform the Scale operation. +1286 * +1287 * @return this; +1288 */ +1289 setScaleAnchored:function (sx, sy, anchorx, anchory) { +1290 this.scaleTX = anchorx; +1291 this.scaleTY = anchory; +1292 +1293 this.scaleX = sx; +1294 this.scaleY = sy; +1295 +1296 this.dirty = true; +1297 +1298 return this; +1299 }, +1300 +1301 setRotationAnchor:function (rax, ray) { +1302 this.rotationX = ray; +1303 this.rotationY = rax; 1304 this.dirty = true; 1305 return this; 1306 }, 1307 /** -1308 * This method sets Actor rotation around a given position. -1309 * @param angle {number} indicating the angle in radians to rotate the Actor. -1310 * @param rx {number} value in the range 0..1 -1311 * @param ry {number} value in the range 0..1 -1312 * @return this; +1308 * A helper method for setRotationAnchored. This methods stablishes the center +1309 * of rotation to be the center of the Actor. +1310 * +1311 * @param angle a float indicating the angle in radians to rotate the Actor. +1312 * @return this 1313 */ -1314 setRotationAnchored:function (angle, rx, ry) { +1314 setRotation:function (angle) { 1315 this.rotationAngle = angle; -1316 this.rotationX = rx; -1317 this.rotationY = ry; -1318 this.dirty = true; -1319 return this; -1320 }, -1321 /** -1322 * Sets an Actor's dimension -1323 * @param w a float indicating Actor's width. -1324 * @param h a float indicating Actor's height. -1325 * @return this -1326 */ -1327 setSize:function (w, h) { -1328 -1329 this.width = w; -1330 this.height = h; -1331 -1332 this.dirty = true; -1333 -1334 return this; -1335 }, -1336 /** -1337 * Set location and dimension of an Actor at once. -1338 * -1339 * @param x{number} a float indicating Actor's x position. -1340 * @param y{number} a float indicating Actor's y position -1341 * @param w{number} a float indicating Actor's width -1342 * @param h{number} a float indicating Actor's height -1343 * @return this -1344 */ -1345 setBounds:function (x, y, w, h) { -1346 -1347 this.x = x; -1348 this.y = y; -1349 this.width = w; -1350 this.height = h; -1351 -1352 this.dirty = true; -1353 -1354 return this; -1355 }, -1356 /** -1357 * This method sets the position of an Actor inside its parent. -1358 * -1359 * @param x{number} a float indicating Actor's x position -1360 * @param y{number} a float indicating Actor's y position -1361 * @return this -1362 * -1363 * @deprecated -1364 */ -1365 setLocation:function (x, y) { -1366 this.x = x; -1367 this.y = y; -1368 this.oldX = x; -1369 this.oldY = y; -1370 -1371 this.dirty = true; -1372 -1373 return this; -1374 }, -1375 -1376 setPosition:function (x, y) { -1377 return this.setLocation(x, y); -1378 }, -1379 -1380 setPositionAnchor:function (pax, pay) { -1381 this.tAnchorX = pax; -1382 this.tAnchorY = pay; -1383 return this; -1384 }, -1385 -1386 setPositionAnchored:function (x, y, pax, pay) { -1387 this.setLocation(x, y); -1388 this.tAnchorX = pax; -1389 this.tAnchorY = pay; -1390 return this; -1391 }, -1392 -1393 -1394 /** -1395 * This method is called by the Director to know whether the actor is on Scene time. -1396 * In case it was necessary, this method will notify any life cycle behaviors about -1397 * an Actor expiration. -1398 * @param time {number} time indicating the Scene time. -1399 * -1400 * @private -1401 * -1402 */ -1403 isInAnimationFrame:function (time) { -1404 if (this.expired) { -1405 return false; -1406 } -1407 -1408 if (this.duration === Number.MAX_VALUE) { -1409 return this.start_time <= time; -1410 } -1411 -1412 if (time >= this.start_time + this.duration) { -1413 if (!this.expired) { -1414 this.setExpired(time); -1415 } -1416 +1316 this.dirty = true; +1317 return this; +1318 }, +1319 /** +1320 * This method sets Actor rotation around a given position. +1321 * @param angle {number} indicating the angle in radians to rotate the Actor. +1322 * @param rx {number} value in the range 0..1 +1323 * @param ry {number} value in the range 0..1 +1324 * @return this; +1325 */ +1326 setRotationAnchored:function (angle, rx, ry) { +1327 this.rotationAngle = angle; +1328 this.rotationX = rx; +1329 this.rotationY = ry; +1330 this.dirty = true; +1331 return this; +1332 }, +1333 /** +1334 * Sets an Actor's dimension +1335 * @param w a float indicating Actor's width. +1336 * @param h a float indicating Actor's height. +1337 * @return this +1338 */ +1339 setSize:function (w, h) { +1340 +1341 this.width = w; +1342 this.height = h; +1343 +1344 this.dirty = true; +1345 +1346 return this; +1347 }, +1348 /** +1349 * Set location and dimension of an Actor at once. +1350 * +1351 * @param x{number} a float indicating Actor's x position. +1352 * @param y{number} a float indicating Actor's y position +1353 * @param w{number} a float indicating Actor's width +1354 * @param h{number} a float indicating Actor's height +1355 * @return this +1356 */ +1357 setBounds:function (x, y, w, h) { +1358 +1359 this.x = x; +1360 this.y = y; +1361 this.width = w; +1362 this.height = h; +1363 +1364 this.dirty = true; +1365 +1366 return this; +1367 }, +1368 /** +1369 * This method sets the position of an Actor inside its parent. +1370 * +1371 * @param x{number} a float indicating Actor's x position +1372 * @param y{number} a float indicating Actor's y position +1373 * @return this +1374 * +1375 * @deprecated +1376 */ +1377 setLocation:function (x, y) { +1378 this.x = x; +1379 this.y = y; +1380 this.oldX = x; +1381 this.oldY = y; +1382 +1383 this.dirty = true; +1384 +1385 return this; +1386 }, +1387 +1388 setPosition:function (x, y) { +1389 return this.setLocation(x, y); +1390 }, +1391 +1392 setPositionAnchor:function (pax, pay) { +1393 this.tAnchorX = pax; +1394 this.tAnchorY = pay; +1395 return this; +1396 }, +1397 +1398 setPositionAnchored:function (x, y, pax, pay) { +1399 this.setLocation(x, y); +1400 this.tAnchorX = pax; +1401 this.tAnchorY = pay; +1402 return this; +1403 }, +1404 +1405 +1406 /** +1407 * This method is called by the Director to know whether the actor is on Scene time. +1408 * In case it was necessary, this method will notify any life cycle behaviors about +1409 * an Actor expiration. +1410 * @param time {number} time indicating the Scene time. +1411 * +1412 * @private +1413 * +1414 */ +1415 isInAnimationFrame:function (time) { +1416 if (this.expired) { 1417 return false; 1418 } 1419 -1420 return this.start_time <= time && time < this.start_time + this.duration; -1421 }, -1422 /** -1423 * Checks whether a coordinate is inside the Actor's bounding box. -1424 * @param x {number} a float -1425 * @param y {number} a float -1426 * -1427 * @return boolean indicating whether it is inside. -1428 */ -1429 contains:function (x, y) { -1430 return x >= 0 && y >= 0 && x < this.width && y < this.height; -1431 }, -1432 -1433 /** -1434 * Add a Behavior to the Actor. -1435 * An Actor accepts an undefined number of Behaviors. -1436 * -1437 * @param behavior {CAAT.Behavior.BaseBehavior} -1438 * @return this -1439 */ -1440 addBehavior:function (behavior) { -1441 this.behaviorList.push(behavior); -1442 return this; +1420 if (this.duration === Number.MAX_VALUE) { +1421 return this.start_time <= time; +1422 } +1423 +1424 if (time >= this.start_time + this.duration) { +1425 if (!this.expired) { +1426 this.setExpired(time); +1427 } +1428 +1429 return false; +1430 } +1431 +1432 return this.start_time <= time && time < this.start_time + this.duration; +1433 }, +1434 /** +1435 * Checks whether a coordinate is inside the Actor's bounding box. +1436 * @param x {number} a float +1437 * @param y {number} a float +1438 * +1439 * @return boolean indicating whether it is inside. +1440 */ +1441 contains:function (x, y) { +1442 return x >= 0 && y >= 0 && x < this.width && y < this.height; 1443 }, 1444 1445 /** -1446 * Remove a Behavior from the Actor. -1447 * If the Behavior is not present at the actor behavior collection nothing happends. +1446 * Add a Behavior to the Actor. +1447 * An Actor accepts an undefined number of Behaviors. 1448 * 1449 * @param behavior {CAAT.Behavior.BaseBehavior} -1450 */ -1451 removeBehaviour:function (behavior) { -1452 var c = this.behaviorList; -1453 var n = c.length - 1; -1454 while (n) { -1455 if (c[n] === behavior) { -1456 c.splice(n, 1); -1457 return this; -1458 } -1459 } -1460 return this; -1461 }, -1462 /** -1463 * Remove a Behavior with id param as behavior identifier from this actor. -1464 * This function will remove ALL behavior instances with the given id. -1465 * -1466 * @param id {number} an integer. -1467 * return this; -1468 */ -1469 removeBehaviorById:function (id) { -1470 var c = this.behaviorList; -1471 for (var n = 0; n < c.length; n++) { -1472 if (c[n].id === id) { -1473 c.splice(n, 1); -1474 } -1475 } -1476 -1477 return this; -1478 -1479 }, -1480 getBehavior:function (id) { -1481 var c = this.behaviorList; -1482 for (var n = 0; n < c.length; n++) { -1483 var cc = c[n]; -1484 if (cc.id === id) { -1485 return cc; +1450 * @return this +1451 */ +1452 addBehavior:function (behavior) { +1453 this.behaviorList.push(behavior); +1454 return this; +1455 }, +1456 +1457 /** +1458 * Remove a Behavior from the Actor. +1459 * If the Behavior is not present at the actor behavior collection nothing happends. +1460 * +1461 * @param behavior {CAAT.Behavior.BaseBehavior} +1462 */ +1463 removeBehaviour:function (behavior) { +1464 var c = this.behaviorList; +1465 var n = c.length - 1; +1466 while (n) { +1467 if (c[n] === behavior) { +1468 c.splice(n, 1); +1469 return this; +1470 } +1471 } +1472 return this; +1473 }, +1474 /** +1475 * Remove a Behavior with id param as behavior identifier from this actor. +1476 * This function will remove ALL behavior instances with the given id. +1477 * +1478 * @param id {number} an integer. +1479 * return this; +1480 */ +1481 removeBehaviorById:function (id) { +1482 var c = this.behaviorList; +1483 for (var n = 0; n < c.length; n++) { +1484 if (c[n].id === id) { +1485 c.splice(n, 1); 1486 } 1487 } -1488 return null; -1489 }, -1490 /** -1491 * Set discardable property. If an actor is discardable, upon expiration will be removed from -1492 * scene graph and hence deleted. -1493 * @param discardable {boolean} a boolean indicating whether the Actor is discardable. -1494 * @return this -1495 */ -1496 setDiscardable:function (discardable) { -1497 this.discardable = discardable; -1498 return this; -1499 }, -1500 /** -1501 * This method will be called internally by CAAT when an Actor is expired, and at the -1502 * same time, is flagged as discardable. -1503 * It notifies the Actor life cycle listeners about the destruction event. -1504 * -1505 * @param time an integer indicating the time at wich the Actor has been destroyed. -1506 * -1507 * @private -1508 * -1509 */ -1510 destroy:function (time) { -1511 if (this.parent) { -1512 this.parent.removeChild(this); -1513 } -1514 -1515 this.backgroundImage= null; -1516 this.emptyBehaviorList(); -1517 this.fireEvent('destroyed', time); -1518 this.lifecycleListenerList= []; -1519 -1520 }, -1521 /** -1522 * Transform a point or array of points in model space to view space. -1523 * -1524 * @param point {CAAT.Math.Point|Array} an object of the form {x : float, y: float} -1525 * -1526 * @return the source transformed elements. -1527 * -1528 * @private -1529 * -1530 */ -1531 modelToView:function (point) { -1532 var x, y, pt, tm; +1488 +1489 return this; +1490 +1491 }, +1492 getBehavior:function (id) { +1493 var c = this.behaviorList; +1494 for (var n = 0; n < c.length; n++) { +1495 var cc = c[n]; +1496 if (cc.id === id) { +1497 return cc; +1498 } +1499 } +1500 return null; +1501 }, +1502 /** +1503 * Set discardable property. If an actor is discardable, upon expiration will be removed from +1504 * scene graph and hence deleted. +1505 * @param discardable {boolean} a boolean indicating whether the Actor is discardable. +1506 * @return this +1507 */ +1508 setDiscardable:function (discardable) { +1509 this.discardable = discardable; +1510 return this; +1511 }, +1512 /** +1513 * This method will be called internally by CAAT when an Actor is expired, and at the +1514 * same time, is flagged as discardable. +1515 * It notifies the Actor life cycle listeners about the destruction event. +1516 * +1517 * @param time an integer indicating the time at wich the Actor has been destroyed. +1518 * +1519 * @private +1520 * +1521 */ +1522 destroy:function (time) { +1523 if (this.parent) { +1524 this.parent.removeChild(this); +1525 } +1526 +1527 this.fireEvent('destroyed', time); +1528 if ( !this.isCachedActor ) { +1529 this.clean(); +1530 } +1531 +1532 }, 1533 -1534 if (this.dirty) { -1535 this.setModelViewMatrix(); -1536 } -1537 -1538 tm = this.worldModelViewMatrix.matrix; +1534 clean : function() { +1535 this.backgroundImage= null; +1536 this.emptyBehaviorList(); +1537 this.lifecycleListenerList= []; +1538 }, 1539 -1540 if (point instanceof Array) { -1541 for (var i = 0; i < point.length; i++) { -1542 //this.worldModelViewMatrix.transformCoord(point[i]); -1543 pt = point[i]; -1544 x = pt.x; -1545 y = pt.y; -1546 pt.x = x * tm[0] + y * tm[1] + tm[2]; -1547 pt.y = x * tm[3] + y * tm[4] + tm[5]; -1548 } -1549 } -1550 else { -1551 // this.worldModelViewMatrix.transformCoord(point); -1552 x = point.x; -1553 y = point.y; -1554 point.x = x * tm[0] + y * tm[1] + tm[2]; -1555 point.y = x * tm[3] + y * tm[4] + tm[5]; -1556 } -1557 -1558 return point; -1559 }, -1560 /** -1561 * Transform a local coordinate point on this Actor's coordinate system into -1562 * another point in otherActor's coordinate system. -1563 * @param point {CAAT.Math.Point} -1564 * @param otherActor {CAAT.Math.Actor} -1565 */ -1566 modelToModel:function (point, otherActor) { -1567 if (this.dirty) { -1568 this.setModelViewMatrix(); -1569 } -1570 -1571 return otherActor.viewToModel(this.modelToView(point)); -1572 }, -1573 /** -1574 * Transform a point from model to view space. -1575 * <p> -1576 * WARNING: every call to this method calculates -1577 * actor's world model view matrix. -1578 * -1579 * @param point {CAAT.Math.Point} a point in screen space to be transformed to model space. -1580 * -1581 * @return the source point object -1582 * -1583 * +1540 /** +1541 * Transform a point or array of points in model space to view space. +1542 * +1543 * @param point {CAAT.Math.Point|Array} an object of the form {x : float, y: float} +1544 * +1545 * @return the source transformed elements. +1546 * +1547 * @private +1548 * +1549 */ +1550 modelToView:function (point) { +1551 var x, y, pt, tm; +1552 +1553 if (this.dirty) { +1554 this.setModelViewMatrix(); +1555 } +1556 +1557 tm = this.worldModelViewMatrix.matrix; +1558 +1559 if (point instanceof Array) { +1560 for (var i = 0; i < point.length; i++) { +1561 //this.worldModelViewMatrix.transformCoord(point[i]); +1562 pt = point[i]; +1563 x = pt.x; +1564 y = pt.y; +1565 pt.x = x * tm[0] + y * tm[1] + tm[2]; +1566 pt.y = x * tm[3] + y * tm[4] + tm[5]; +1567 } +1568 } +1569 else { +1570 // this.worldModelViewMatrix.transformCoord(point); +1571 x = point.x; +1572 y = point.y; +1573 point.x = x * tm[0] + y * tm[1] + tm[2]; +1574 point.y = x * tm[3] + y * tm[4] + tm[5]; +1575 } +1576 +1577 return point; +1578 }, +1579 /** +1580 * Transform a local coordinate point on this Actor's coordinate system into +1581 * another point in otherActor's coordinate system. +1582 * @param point {CAAT.Math.Point} +1583 * @param otherActor {CAAT.Math.Actor} 1584 */ -1585 viewToModel:function (point) { +1585 modelToModel:function (point, otherActor) { 1586 if (this.dirty) { 1587 this.setModelViewMatrix(); 1588 } -1589 this.worldModelViewMatrixI = this.worldModelViewMatrix.getInverse(); -1590 this.worldModelViewMatrixI.transformCoord(point); -1591 return point; -1592 }, -1593 /** -1594 * Private -1595 * This method does the needed point transformations across an Actor hierarchy to devise -1596 * whether the parameter point coordinate lies inside the Actor. -1597 * @param point {CAAT.Math.Point} -1598 * -1599 * @return null if the point is not inside the Actor. The Actor otherwise. -1600 */ -1601 findActorAtPosition:function (point) { -1602 if (this.scaleX===0 || this.scaleY===0) { -1603 return null; -1604 } -1605 if (!this.visible || !this.mouseEnabled || !this.isInAnimationFrame(this.time)) { -1606 return null; +1589 +1590 return otherActor.viewToModel(this.modelToView(point)); +1591 }, +1592 /** +1593 * Transform a point from model to view space. +1594 * <p> +1595 * WARNING: every call to this method calculates +1596 * actor's world model view matrix. +1597 * +1598 * @param point {CAAT.Math.Point} a point in screen space to be transformed to model space. +1599 * +1600 * @return the source point object +1601 * +1602 * +1603 */ +1604 viewToModel:function (point) { +1605 if (this.dirty) { +1606 this.setModelViewMatrix(); 1607 } -1608 -1609 this.modelViewMatrixI = this.modelViewMatrix.getInverse(); -1610 this.modelViewMatrixI.transformCoord(point); -1611 return this.contains(point.x, point.y) ? this : null; -1612 }, -1613 /** -1614 * Enables a default dragging routine for the Actor. -1615 * This default dragging routine allows to: -1616 * <li>scale the Actor by pressing shift+drag -1617 * <li>rotate the Actor by pressing control+drag -1618 * <li>scale non uniformly by pressing alt+shift+drag -1619 * -1620 * @return this -1621 */ -1622 enableDrag:function () { -1623 -1624 this.ax = 0; -1625 this.ay = 0; -1626 this.asx = 1; -1627 this.asy = 1; -1628 this.ara = 0; -1629 this.screenx = 0; -1630 this.screeny = 0; -1631 -1632 /** -1633 * Mouse enter handler for default drag behavior. -1634 * @param mouseEvent {CAAT.Event.MouseEvent} -1635 * -1636 * @ignore -1637 */ -1638 this.mouseEnter = function (mouseEvent) { -1639 this.__d_ax = -1; -1640 this.__d_ay = -1; -1641 this.pointed = true; -1642 CAAT.setCursor('move'); -1643 }; -1644 -1645 /** -1646 * Mouse exit handler for default drag behavior. -1647 * @param mouseEvent {CAAT.Event.MouseEvent} -1648 * -1649 * @ignore -1650 */ -1651 this.mouseExit = function (mouseEvent) { -1652 this.__d_ax = -1; -1653 this.__d_ay = -1; -1654 this.pointed = false; -1655 CAAT.setCursor('default'); -1656 }; -1657 -1658 /** -1659 * Mouse move handler for default drag behavior. -1660 * @param mouseEvent {CAAT.Event.MouseEvent} -1661 * -1662 * @ignore -1663 */ -1664 this.mouseMove = function (mouseEvent) { -1665 }; -1666 -1667 /** -1668 * Mouse up handler for default drag behavior. -1669 * @param mouseEvent {CAAT.Event.MouseEvent} -1670 * -1671 * @ignore -1672 */ -1673 this.mouseUp = function (mouseEvent) { -1674 this.__d_ax = -1; -1675 this.__d_ay = -1; -1676 }; -1677 -1678 /** -1679 * Mouse drag handler for default drag behavior. -1680 * @param mouseEvent {CAAT.Event.MouseEvent} -1681 * -1682 * @ignore -1683 */ -1684 this.mouseDrag = function (mouseEvent) { +1608 this.worldModelViewMatrixI = this.worldModelViewMatrix.getInverse(); +1609 this.worldModelViewMatrixI.transformCoord(point); +1610 return point; +1611 }, +1612 /** +1613 * Private +1614 * This method does the needed point transformations across an Actor hierarchy to devise +1615 * whether the parameter point coordinate lies inside the Actor. +1616 * @param point {CAAT.Math.Point} +1617 * +1618 * @return null if the point is not inside the Actor. The Actor otherwise. +1619 */ +1620 findActorAtPosition:function (point) { +1621 if (this.scaleX===0 || this.scaleY===0) { +1622 return null; +1623 } +1624 if (!this.visible || !this.mouseEnabled || !this.isInAnimationFrame(this.time)) { +1625 return null; +1626 } +1627 +1628 this.modelViewMatrixI = this.modelViewMatrix.getInverse(); +1629 this.modelViewMatrixI.transformCoord(point); +1630 return this.contains(point.x, point.y) ? this : null; +1631 }, +1632 /** +1633 * Enables a default dragging routine for the Actor. +1634 * This default dragging routine allows to: +1635 * <li>scale the Actor by pressing shift+drag +1636 * <li>rotate the Actor by pressing control+drag +1637 * <li>scale non uniformly by pressing alt+shift+drag +1638 * +1639 * @return this +1640 */ +1641 enableDrag:function () { +1642 +1643 this.ax = 0; +1644 this.ay = 0; +1645 this.asx = 1; +1646 this.asy = 1; +1647 this.ara = 0; +1648 this.screenx = 0; +1649 this.screeny = 0; +1650 +1651 /** +1652 * Mouse enter handler for default drag behavior. +1653 * @param mouseEvent {CAAT.Event.MouseEvent} +1654 * +1655 * @ignore +1656 */ +1657 this.mouseEnter = function (mouseEvent) { +1658 this.__d_ax = -1; +1659 this.__d_ay = -1; +1660 this.pointed = true; +1661 CAAT.setCursor('move'); +1662 }; +1663 +1664 /** +1665 * Mouse exit handler for default drag behavior. +1666 * @param mouseEvent {CAAT.Event.MouseEvent} +1667 * +1668 * @ignore +1669 */ +1670 this.mouseExit = function (mouseEvent) { +1671 this.__d_ax = -1; +1672 this.__d_ay = -1; +1673 this.pointed = false; +1674 CAAT.setCursor('default'); +1675 }; +1676 +1677 /** +1678 * Mouse move handler for default drag behavior. +1679 * @param mouseEvent {CAAT.Event.MouseEvent} +1680 * +1681 * @ignore +1682 */ +1683 this.mouseMove = function (mouseEvent) { +1684 }; 1685 -1686 var pt; -1687 -1688 pt = this.modelToView(new CAAT.Math.Point(mouseEvent.x, mouseEvent.y)); -1689 this.parent.viewToModel(pt); -1690 -1691 if (this.__d_ax === -1 || this.__d_ay === -1) { -1692 this.__d_ax = pt.x; -1693 this.__d_ay = pt.y; -1694 this.__d_asx = this.scaleX; -1695 this.__d_asy = this.scaleY; -1696 this.__d_ara = this.rotationAngle; -1697 this.__d_screenx = mouseEvent.screenPoint.x; -1698 this.__d_screeny = mouseEvent.screenPoint.y; -1699 } -1700 -1701 if (mouseEvent.isShiftDown()) { -1702 var scx = (mouseEvent.screenPoint.x - this.__d_screenx) / 100; -1703 var scy = (mouseEvent.screenPoint.y - this.__d_screeny) / 100; -1704 if (!mouseEvent.isAltDown()) { -1705 var sc = Math.max(scx, scy); -1706 scx = sc; -1707 scy = sc; -1708 } -1709 this.setScale(scx + this.__d_asx, scy + this.__d_asy); -1710 -1711 } else if (mouseEvent.isControlDown()) { -1712 var vx = mouseEvent.screenPoint.x - this.__d_screenx; -1713 var vy = mouseEvent.screenPoint.y - this.__d_screeny; -1714 this.setRotation(-Math.atan2(vx, vy) + this.__d_ara); -1715 } else { -1716 this.x += pt.x - this.__d_ax; -1717 this.y += pt.y - this.__d_ay; +1686 /** +1687 * Mouse up handler for default drag behavior. +1688 * @param mouseEvent {CAAT.Event.MouseEvent} +1689 * +1690 * @ignore +1691 */ +1692 this.mouseUp = function (mouseEvent) { +1693 this.__d_ax = -1; +1694 this.__d_ay = -1; +1695 }; +1696 +1697 /** +1698 * Mouse drag handler for default drag behavior. +1699 * @param mouseEvent {CAAT.Event.MouseEvent} +1700 * +1701 * @ignore +1702 */ +1703 this.mouseDrag = function (mouseEvent) { +1704 +1705 var pt; +1706 +1707 pt = this.modelToView(new CAAT.Math.Point(mouseEvent.x, mouseEvent.y)); +1708 this.parent.viewToModel(pt); +1709 +1710 if (this.__d_ax === -1 || this.__d_ay === -1) { +1711 this.__d_ax = pt.x; +1712 this.__d_ay = pt.y; +1713 this.__d_asx = this.scaleX; +1714 this.__d_asy = this.scaleY; +1715 this.__d_ara = this.rotationAngle; +1716 this.__d_screenx = mouseEvent.screenPoint.x; +1717 this.__d_screeny = mouseEvent.screenPoint.y; 1718 } 1719 -1720 this.__d_ax = pt.x; -1721 this.__d_ay = pt.y; -1722 }; -1723 -1724 return this; -1725 }, -1726 disableDrag:function () { -1727 -1728 this.mouseEnter = function (mouseEvent) { -1729 }; -1730 this.mouseExit = function (mouseEvent) { -1731 }; -1732 this.mouseMove = function (mouseEvent) { -1733 }; -1734 this.mouseUp = function (mouseEvent) { -1735 }; -1736 this.mouseDrag = function (mouseEvent) { -1737 }; +1720 if (mouseEvent.isShiftDown()) { +1721 var scx = (mouseEvent.screenPoint.x - this.__d_screenx) / 100; +1722 var scy = (mouseEvent.screenPoint.y - this.__d_screeny) / 100; +1723 if (!mouseEvent.isAltDown()) { +1724 var sc = Math.max(scx, scy); +1725 scx = sc; +1726 scy = sc; +1727 } +1728 this.setScale(scx + this.__d_asx, scy + this.__d_asy); +1729 +1730 } else if (mouseEvent.isControlDown()) { +1731 var vx = mouseEvent.screenPoint.x - this.__d_screenx; +1732 var vy = mouseEvent.screenPoint.y - this.__d_screeny; +1733 this.setRotation(-Math.atan2(vx, vy) + this.__d_ara); +1734 } else { +1735 this.x += pt.x - this.__d_ax; +1736 this.y += pt.y - this.__d_ay; +1737 } 1738 -1739 return this; -1740 }, -1741 /** -1742 * Default mouseClick handler. -1743 * Mouse click events are received after a call to mouseUp method if no dragging was in progress. -1744 * -1745 * @param mouseEvent {CAAT.Event.MouseEvent} -1746 */ -1747 mouseClick:function (mouseEvent) { -1748 }, -1749 /** -1750 * Default double click handler -1751 * -1752 * @param mouseEvent {CAAT.Event.MouseEvent} -1753 */ -1754 mouseDblClick:function (mouseEvent) { -1755 }, -1756 /** -1757 * Default mouse enter on Actor handler. -1758 * @param mouseEvent {CAAT.Event.MouseEvent} -1759 */ -1760 mouseEnter:function (mouseEvent) { -1761 this.pointed = true; -1762 }, -1763 /** -1764 * Default mouse exit on Actor handler. -1765 * -1766 * @param mouseEvent {CAAT.Event.MouseEvent} -1767 */ -1768 mouseExit:function (mouseEvent) { -1769 this.pointed = false; -1770 }, -1771 /** -1772 * Default mouse move inside Actor handler. -1773 * -1774 * @param mouseEvent {CAAT.Event.MouseEvent} -1775 */ -1776 mouseMove:function (mouseEvent) { -1777 }, -1778 /** -1779 * default mouse press in Actor handler. -1780 * -1781 * @param mouseEvent {CAAT.Event.MouseEvent} -1782 */ -1783 mouseDown:function (mouseEvent) { -1784 }, -1785 /** -1786 * default mouse release in Actor handler. -1787 * -1788 * @param mouseEvent {CAAT.Event.MouseEvent} -1789 */ -1790 mouseUp:function (mouseEvent) { -1791 }, -1792 mouseOut:function (mouseEvent) { -1793 }, -1794 mouseOver:function (mouseEvent) { -1795 }, -1796 /** -1797 * default Actor mouse drag handler. -1798 * -1799 * @param mouseEvent {CAAT.Event.MouseEvent} -1800 */ -1801 mouseDrag:function (mouseEvent) { -1802 }, -1803 /** -1804 * Draw a bounding box with on-screen coordinates regardless of the transformations -1805 * applied to the Actor. +1739 this.__d_ax = pt.x; +1740 this.__d_ay = pt.y; +1741 }; +1742 +1743 return this; +1744 }, +1745 disableDrag:function () { +1746 +1747 this.mouseEnter = function (mouseEvent) { +1748 }; +1749 this.mouseExit = function (mouseEvent) { +1750 }; +1751 this.mouseMove = function (mouseEvent) { +1752 }; +1753 this.mouseUp = function (mouseEvent) { +1754 }; +1755 this.mouseDrag = function (mouseEvent) { +1756 }; +1757 +1758 return this; +1759 }, +1760 /** +1761 * Default mouseClick handler. +1762 * Mouse click events are received after a call to mouseUp method if no dragging was in progress. +1763 * +1764 * @param mouseEvent {CAAT.Event.MouseEvent} +1765 */ +1766 mouseClick:function (mouseEvent) { +1767 }, +1768 /** +1769 * Default double click handler +1770 * +1771 * @param mouseEvent {CAAT.Event.MouseEvent} +1772 */ +1773 mouseDblClick:function (mouseEvent) { +1774 }, +1775 /** +1776 * Default mouse enter on Actor handler. +1777 * @param mouseEvent {CAAT.Event.MouseEvent} +1778 */ +1779 mouseEnter:function (mouseEvent) { +1780 this.pointed = true; +1781 }, +1782 /** +1783 * Default mouse exit on Actor handler. +1784 * +1785 * @param mouseEvent {CAAT.Event.MouseEvent} +1786 */ +1787 mouseExit:function (mouseEvent) { +1788 this.pointed = false; +1789 }, +1790 /** +1791 * Default mouse move inside Actor handler. +1792 * +1793 * @param mouseEvent {CAAT.Event.MouseEvent} +1794 */ +1795 mouseMove:function (mouseEvent) { +1796 }, +1797 /** +1798 * default mouse press in Actor handler. +1799 * +1800 * @param mouseEvent {CAAT.Event.MouseEvent} +1801 */ +1802 mouseDown:function (mouseEvent) { +1803 }, +1804 /** +1805 * default mouse release in Actor handler. 1806 * -1807 * @param director {CAAT.Foundations.Director} object instance that contains the Scene the Actor is in. -1808 * @param time {number} integer indicating the Scene time when the bounding box is to be drawn. -1809 */ -1810 drawScreenBoundingBox:function (director, time) { -1811 if (null !== this.AABB && this.inFrame) { -1812 var s = this.AABB; -1813 var ctx = director.ctx; -1814 ctx.strokeStyle = CAAT.DEBUGAABBCOLOR; -1815 ctx.strokeRect(.5 + (s.x | 0), .5 + (s.y | 0), s.width | 0, s.height | 0); -1816 if (CAAT.DEBUGBB) { -1817 var vv = this.viewVertices; -1818 ctx.beginPath(); -1819 ctx.lineTo(vv[0].x, vv[0].y); -1820 ctx.lineTo(vv[1].x, vv[1].y); -1821 ctx.lineTo(vv[2].x, vv[2].y); -1822 ctx.lineTo(vv[3].x, vv[3].y); -1823 ctx.closePath(); -1824 ctx.strokeStyle = CAAT.DEBUGBBCOLOR; -1825 ctx.stroke(); -1826 } -1827 } -1828 }, -1829 /** -1830 * Private -1831 * This method is called by the Director instance. -1832 * It applies the list of behaviors the Actor has registered. -1833 * -1834 * @param director the CAAT.Foundation.Director object instance that contains the Scene the Actor is in. -1835 * @param time an integer indicating the Scene time when the bounding box is to be drawn. -1836 */ -1837 animate:function (director, time) { -1838 -1839 if (!this.visible) { -1840 return false; -1841 } -1842 -1843 var i; -1844 -1845 if (!this.isInAnimationFrame(time)) { -1846 this.inFrame = false; -1847 this.dirty = true; -1848 return false; -1849 } -1850 -1851 if (this.x !== this.oldX || this.y !== this.oldY) { -1852 this.dirty = true; -1853 this.oldX = this.x; -1854 this.oldY = this.y; -1855 } -1856 -1857 for (i = 0; i < this.behaviorList.length; i++) { -1858 this.behaviorList[i].apply(time, this); -1859 } -1860 -1861 if (this.clipPath) { -1862 this.clipPath.applyBehaviors(time); -1863 } -1864 -1865 // transformation stuff. -1866 this.setModelViewMatrix(); -1867 -1868 if (this.dirty || this.wdirty || this.invalid) { -1869 if (director.dirtyRectsEnabled) { -1870 director.addDirtyRect(this.AABB); -1871 } -1872 this.setScreenBounds(); -1873 if (director.dirtyRectsEnabled) { -1874 director.addDirtyRect(this.AABB); -1875 } -1876 } -1877 this.dirty = false; -1878 this.invalid = false; +1807 * @param mouseEvent {CAAT.Event.MouseEvent} +1808 */ +1809 mouseUp:function (mouseEvent) { +1810 }, +1811 mouseOut:function (mouseEvent) { +1812 }, +1813 mouseOver:function (mouseEvent) { +1814 }, +1815 /** +1816 * default Actor mouse drag handler. +1817 * +1818 * @param mouseEvent {CAAT.Event.MouseEvent} +1819 */ +1820 mouseDrag:function (mouseEvent) { +1821 }, +1822 /** +1823 * Draw a bounding box with on-screen coordinates regardless of the transformations +1824 * applied to the Actor. +1825 * +1826 * @param director {CAAT.Foundations.Director} object instance that contains the Scene the Actor is in. +1827 * @param time {number} integer indicating the Scene time when the bounding box is to be drawn. +1828 */ +1829 drawScreenBoundingBox:function (director, time) { +1830 if (null !== this.AABB && this.inFrame) { +1831 var s = this.AABB; +1832 var ctx = director.ctx; +1833 ctx.strokeStyle = CAAT.DEBUGAABBCOLOR; +1834 ctx.strokeRect(.5 + (s.x | 0), .5 + (s.y | 0), s.width | 0, s.height | 0); +1835 if (CAAT.DEBUGBB) { +1836 var vv = this.viewVertices; +1837 ctx.beginPath(); +1838 ctx.lineTo(vv[0].x, vv[0].y); +1839 ctx.lineTo(vv[1].x, vv[1].y); +1840 ctx.lineTo(vv[2].x, vv[2].y); +1841 ctx.lineTo(vv[3].x, vv[3].y); +1842 ctx.closePath(); +1843 ctx.strokeStyle = CAAT.DEBUGBBCOLOR; +1844 ctx.stroke(); +1845 } +1846 } +1847 }, +1848 /** +1849 * Private +1850 * This method is called by the Director instance. +1851 * It applies the list of behaviors the Actor has registered. +1852 * +1853 * @param director the CAAT.Foundation.Director object instance that contains the Scene the Actor is in. +1854 * @param time an integer indicating the Scene time when the bounding box is to be drawn. +1855 */ +1856 animate:function (director, time) { +1857 +1858 if (!this.visible) { +1859 return false; +1860 } +1861 +1862 var i; +1863 +1864 if (!this.isInAnimationFrame(time)) { +1865 this.inFrame = false; +1866 this.dirty = true; +1867 return false; +1868 } +1869 +1870 if (this.x !== this.oldX || this.y !== this.oldY) { +1871 this.dirty = true; +1872 this.oldX = this.x; +1873 this.oldY = this.y; +1874 } +1875 +1876 for (i = 0; i < this.behaviorList.length; i++) { +1877 this.behaviorList[i].apply(time, this); +1878 } 1879 -1880 this.inFrame = true; -1881 -1882 if ( this.backgroundImage ) { -1883 this.backgroundImage.setSpriteIndexAtTime(time); -1884 } -1885 -1886 return this.AABB.intersects(director.AABB); -1887 //return true; -1888 }, -1889 /** -1890 * Set this model view matrix if the actor is Dirty. -1891 * -1892 mm[2]+= this.x; -1893 mm[5]+= this.y; -1894 if ( this.rotationAngle ) { -1895 this.modelViewMatrix.multiply( m.setTranslate( this.rotationX, this.rotationY) ); -1896 this.modelViewMatrix.multiply( m.setRotation( this.rotationAngle ) ); -1897 this.modelViewMatrix.multiply( m.setTranslate( -this.rotationX, -this.rotationY) ); c= Math.cos( this.rotationAngle ); -1898 } -1899 if ( this.scaleX!=1 || this.scaleY!=1 && (this.scaleTX || this.scaleTY )) { -1900 this.modelViewMatrix.multiply( m.setTranslate( this.scaleTX , this.scaleTY ) ); -1901 this.modelViewMatrix.multiply( m.setScale( this.scaleX, this.scaleY ) ); -1902 this.modelViewMatrix.multiply( m.setTranslate( -this.scaleTX , -this.scaleTY ) ); -1903 } -1904 * -1905 * @return this -1906 */ -1907 setModelViewMatrix:function () { -1908 var c, s, _m00, _m01, _m10, _m11; -1909 var mm0, mm1, mm2, mm3, mm4, mm5; -1910 var mm; -1911 -1912 this.wdirty = false; -1913 mm = this.modelViewMatrix.matrix; -1914 -1915 if (this.dirty) { -1916 -1917 mm0 = 1; -1918 mm1 = 0; -1919 //mm2= mm[2]; -1920 mm3 = 0; -1921 mm4 = 1; -1922 //mm5= mm[5]; -1923 -1924 mm2 = this.x - this.tAnchorX * this.width; -1925 mm5 = this.y - this.tAnchorY * this.height; -1926 -1927 if (this.rotationAngle) { -1928 -1929 var rx = this.rotationX * this.width; -1930 var ry = this.rotationY * this.height; -1931 -1932 mm2 += mm0 * rx + mm1 * ry; -1933 mm5 += mm3 * rx + mm4 * ry; -1934 -1935 c = Math.cos(this.rotationAngle); -1936 s = Math.sin(this.rotationAngle); -1937 _m00 = mm0; -1938 _m01 = mm1; -1939 _m10 = mm3; -1940 _m11 = mm4; -1941 mm0 = _m00 * c + _m01 * s; -1942 mm1 = -_m00 * s + _m01 * c; -1943 mm3 = _m10 * c + _m11 * s; -1944 mm4 = -_m10 * s + _m11 * c; +1880 if (this.clipPath) { +1881 this.clipPath.applyBehaviors(time); +1882 } +1883 +1884 // transformation stuff. +1885 this.setModelViewMatrix(); +1886 +1887 if (this.dirty || this.wdirty || this.invalid) { +1888 if (director.dirtyRectsEnabled) { +1889 director.addDirtyRect(this.AABB); +1890 } +1891 this.setScreenBounds(); +1892 if (director.dirtyRectsEnabled) { +1893 director.addDirtyRect(this.AABB); +1894 } +1895 } +1896 this.dirty = false; +1897 this.invalid = false; +1898 +1899 this.inFrame = true; +1900 +1901 if ( this.backgroundImage ) { +1902 this.backgroundImage.setSpriteIndexAtTime(time); +1903 } +1904 +1905 return this.AABB.intersects(director.AABB); +1906 //return true; +1907 }, +1908 /** +1909 * Set this model view matrix if the actor is Dirty. +1910 * +1911 mm[2]+= this.x; +1912 mm[5]+= this.y; +1913 if ( this.rotationAngle ) { +1914 this.modelViewMatrix.multiply( m.setTranslate( this.rotationX, this.rotationY) ); +1915 this.modelViewMatrix.multiply( m.setRotation( this.rotationAngle ) ); +1916 this.modelViewMatrix.multiply( m.setTranslate( -this.rotationX, -this.rotationY) ); c= Math.cos( this.rotationAngle ); +1917 } +1918 if ( this.scaleX!=1 || this.scaleY!=1 && (this.scaleTX || this.scaleTY )) { +1919 this.modelViewMatrix.multiply( m.setTranslate( this.scaleTX , this.scaleTY ) ); +1920 this.modelViewMatrix.multiply( m.setScale( this.scaleX, this.scaleY ) ); +1921 this.modelViewMatrix.multiply( m.setTranslate( -this.scaleTX , -this.scaleTY ) ); +1922 } +1923 * +1924 * @return this +1925 */ +1926 setModelViewMatrix:function () { +1927 var c, s, _m00, _m01, _m10, _m11; +1928 var mm0, mm1, mm2, mm3, mm4, mm5; +1929 var mm; +1930 +1931 this.wdirty = false; +1932 mm = this.modelViewMatrix.matrix; +1933 +1934 if (this.dirty) { +1935 +1936 mm0 = 1; +1937 mm1 = 0; +1938 //mm2= mm[2]; +1939 mm3 = 0; +1940 mm4 = 1; +1941 //mm5= mm[5]; +1942 +1943 mm2 = this.x - this.tAnchorX * this.width; +1944 mm5 = this.y - this.tAnchorY * this.height; 1945 -1946 mm2 += -mm0 * rx - mm1 * ry; -1947 mm5 += -mm3 * rx - mm4 * ry; -1948 } -1949 if (this.scaleX != 1 || this.scaleY != 1) { +1946 if (this.rotationAngle) { +1947 +1948 var rx = this.rotationX * this.width; +1949 var ry = this.rotationY * this.height; 1950 -1951 var sx = this.scaleTX * this.width; -1952 var sy = this.scaleTY * this.height; +1951 mm2 += mm0 * rx + mm1 * ry; +1952 mm5 += mm3 * rx + mm4 * ry; 1953 -1954 mm2 += mm0 * sx + mm1 * sy; -1955 mm5 += mm3 * sx + mm4 * sy; -1956 -1957 mm0 = mm0 * this.scaleX; -1958 mm1 = mm1 * this.scaleY; -1959 mm3 = mm3 * this.scaleX; -1960 mm4 = mm4 * this.scaleY; -1961 -1962 mm2 += -mm0 * sx - mm1 * sy; -1963 mm5 += -mm3 * sx - mm4 * sy; -1964 } -1965 -1966 mm[0] = mm0; -1967 mm[1] = mm1; -1968 mm[2] = mm2; -1969 mm[3] = mm3; -1970 mm[4] = mm4; -1971 mm[5] = mm5; -1972 } -1973 -1974 if (this.parent) { +1954 c = Math.cos(this.rotationAngle); +1955 s = Math.sin(this.rotationAngle); +1956 _m00 = mm0; +1957 _m01 = mm1; +1958 _m10 = mm3; +1959 _m11 = mm4; +1960 mm0 = _m00 * c + _m01 * s; +1961 mm1 = -_m00 * s + _m01 * c; +1962 mm3 = _m10 * c + _m11 * s; +1963 mm4 = -_m10 * s + _m11 * c; +1964 +1965 mm2 += -mm0 * rx - mm1 * ry; +1966 mm5 += -mm3 * rx - mm4 * ry; +1967 } +1968 if (this.scaleX != 1 || this.scaleY != 1) { +1969 +1970 var sx = this.scaleTX * this.width; +1971 var sy = this.scaleTY * this.height; +1972 +1973 mm2 += mm0 * sx + mm1 * sy; +1974 mm5 += mm3 * sx + mm4 * sy; 1975 -1976 -1977 this.isAA = this.rotationAngle === 0 && this.scaleX === 1 && this.scaleY === 1 && this.parent.isAA; -1978 -1979 if (this.dirty || this.parent.wdirty) { -1980 this.worldModelViewMatrix.copy(this.parent.worldModelViewMatrix); -1981 if (this.isAA) { -1982 var mmm = this.worldModelViewMatrix.matrix; -1983 mmm[2] += mm[2]; -1984 mmm[5] += mm[5]; -1985 } else { -1986 this.worldModelViewMatrix.multiply(this.modelViewMatrix); -1987 } -1988 this.wdirty = true; -1989 } -1990 -1991 } else { -1992 if (this.dirty) { -1993 this.wdirty = true; -1994 } +1976 mm0 = mm0 * this.scaleX; +1977 mm1 = mm1 * this.scaleY; +1978 mm3 = mm3 * this.scaleX; +1979 mm4 = mm4 * this.scaleY; +1980 +1981 mm2 += -mm0 * sx - mm1 * sy; +1982 mm5 += -mm3 * sx - mm4 * sy; +1983 } +1984 +1985 mm[0] = mm0; +1986 mm[1] = mm1; +1987 mm[2] = mm2; +1988 mm[3] = mm3; +1989 mm[4] = mm4; +1990 mm[5] = mm5; +1991 } +1992 +1993 if (this.parent) { +1994 1995 -1996 this.worldModelViewMatrix.identity(); -1997 this.isAA = this.rotationAngle === 0 && this.scaleX === 1 && this.scaleY === 1; -1998 } -1999 -2000 -2001 //if ( (CAAT.DEBUGAABB || glEnabled) && (this.dirty || this.wdirty ) ) { -2002 // screen bounding boxes will always be calculated. -2003 /* -2004 if ( this.dirty || this.wdirty || this.invalid ) { -2005 if ( director.dirtyRectsEnabled ) { -2006 director.addDirtyRect( this.AABB ); -2007 } -2008 this.setScreenBounds(); -2009 if ( director.dirtyRectsEnabled ) { -2010 director.addDirtyRect( this.AABB ); -2011 } -2012 } -2013 this.dirty= false; -2014 this.invalid= false; -2015 */ -2016 }, -2017 /** -2018 * Calculates the 2D bounding box in canvas coordinates of the Actor. -2019 * This bounding box takes into account the transformations applied hierarchically for -2020 * each Scene Actor. -2021 * -2022 * @private -2023 * -2024 */ -2025 setScreenBounds:function () { -2026 -2027 var AABB = this.AABB; -2028 var vv = this.viewVertices; -2029 var vvv, m, x, y, w, h; -2030 -2031 if (this.isAA) { -2032 m = this.worldModelViewMatrix.matrix; -2033 x = m[2]; -2034 y = m[5]; -2035 w = this.width; -2036 h = this.height; -2037 AABB.x = x; -2038 AABB.y = y; -2039 AABB.x1 = x + w; -2040 AABB.y1 = y + h; -2041 AABB.width = w; -2042 AABB.height = h; -2043 -2044 if (CAAT.GLRENDER) { -2045 vvv = vv[0]; -2046 vvv.x = x; -2047 vvv.y = y; -2048 vvv = vv[1]; -2049 vvv.x = x + w; -2050 vvv.y = y; -2051 vvv = vv[2]; -2052 vvv.x = x + w; -2053 vvv.y = y + h; -2054 vvv = vv[3]; -2055 vvv.x = x; -2056 vvv.y = y + h; -2057 } -2058 -2059 return this; -2060 } -2061 -2062 vvv = vv[0]; -2063 vvv.x = 0; -2064 vvv.y = 0; -2065 vvv = vv[1]; -2066 vvv.x = this.width; -2067 vvv.y = 0; -2068 vvv = vv[2]; -2069 vvv.x = this.width; -2070 vvv.y = this.height; -2071 vvv = vv[3]; -2072 vvv.x = 0; -2073 vvv.y = this.height; -2074 -2075 this.modelToView(this.viewVertices); -2076 -2077 var xmin = Number.MAX_VALUE, xmax = -Number.MAX_VALUE; -2078 var ymin = Number.MAX_VALUE, ymax = -Number.MAX_VALUE; -2079 -2080 vvv = vv[0]; -2081 if (vvv.x < xmin) { -2082 xmin = vvv.x; -2083 } -2084 if (vvv.x > xmax) { -2085 xmax = vvv.x; -2086 } -2087 if (vvv.y < ymin) { -2088 ymin = vvv.y; -2089 } -2090 if (vvv.y > ymax) { -2091 ymax = vvv.y; -2092 } -2093 vvv = vv[1]; -2094 if (vvv.x < xmin) { -2095 xmin = vvv.x; -2096 } -2097 if (vvv.x > xmax) { -2098 xmax = vvv.x; -2099 } -2100 if (vvv.y < ymin) { -2101 ymin = vvv.y; +1996 this.isAA = this.rotationAngle === 0 && this.scaleX === 1 && this.scaleY === 1 && this.parent.isAA; +1997 +1998 if (this.dirty || this.parent.wdirty) { +1999 this.worldModelViewMatrix.copy(this.parent.worldModelViewMatrix); +2000 if (this.isAA) { +2001 var mmm = this.worldModelViewMatrix.matrix; +2002 mmm[2] += mm[2]; +2003 mmm[5] += mm[5]; +2004 } else { +2005 this.worldModelViewMatrix.multiply(this.modelViewMatrix); +2006 } +2007 this.wdirty = true; +2008 } +2009 +2010 } else { +2011 if (this.dirty) { +2012 this.wdirty = true; +2013 } +2014 +2015 this.worldModelViewMatrix.identity(); +2016 this.isAA = this.rotationAngle === 0 && this.scaleX === 1 && this.scaleY === 1; +2017 } +2018 +2019 +2020 //if ( (CAAT.DEBUGAABB || glEnabled) && (this.dirty || this.wdirty ) ) { +2021 // screen bounding boxes will always be calculated. +2022 /* +2023 if ( this.dirty || this.wdirty || this.invalid ) { +2024 if ( director.dirtyRectsEnabled ) { +2025 director.addDirtyRect( this.AABB ); +2026 } +2027 this.setScreenBounds(); +2028 if ( director.dirtyRectsEnabled ) { +2029 director.addDirtyRect( this.AABB ); +2030 } +2031 } +2032 this.dirty= false; +2033 this.invalid= false; +2034 */ +2035 }, +2036 /** +2037 * Calculates the 2D bounding box in canvas coordinates of the Actor. +2038 * This bounding box takes into account the transformations applied hierarchically for +2039 * each Scene Actor. +2040 * +2041 * @private +2042 * +2043 */ +2044 setScreenBounds:function () { +2045 +2046 var AABB = this.AABB; +2047 var vv = this.viewVertices; +2048 var vvv, m, x, y, w, h; +2049 +2050 if (this.isAA) { +2051 m = this.worldModelViewMatrix.matrix; +2052 x = m[2]; +2053 y = m[5]; +2054 w = this.width; +2055 h = this.height; +2056 AABB.x = x; +2057 AABB.y = y; +2058 AABB.x1 = x + w; +2059 AABB.y1 = y + h; +2060 AABB.width = w; +2061 AABB.height = h; +2062 +2063 if (CAAT.GLRENDER) { +2064 vvv = vv[0]; +2065 vvv.x = x; +2066 vvv.y = y; +2067 vvv = vv[1]; +2068 vvv.x = x + w; +2069 vvv.y = y; +2070 vvv = vv[2]; +2071 vvv.x = x + w; +2072 vvv.y = y + h; +2073 vvv = vv[3]; +2074 vvv.x = x; +2075 vvv.y = y + h; +2076 } +2077 +2078 return this; +2079 } +2080 +2081 vvv = vv[0]; +2082 vvv.x = 0; +2083 vvv.y = 0; +2084 vvv = vv[1]; +2085 vvv.x = this.width; +2086 vvv.y = 0; +2087 vvv = vv[2]; +2088 vvv.x = this.width; +2089 vvv.y = this.height; +2090 vvv = vv[3]; +2091 vvv.x = 0; +2092 vvv.y = this.height; +2093 +2094 this.modelToView(this.viewVertices); +2095 +2096 var xmin = Number.MAX_VALUE, xmax = -Number.MAX_VALUE; +2097 var ymin = Number.MAX_VALUE, ymax = -Number.MAX_VALUE; +2098 +2099 vvv = vv[0]; +2100 if (vvv.x < xmin) { +2101 xmin = vvv.x; 2102 } -2103 if (vvv.y > ymax) { -2104 ymax = vvv.y; +2103 if (vvv.x > xmax) { +2104 xmax = vvv.x; 2105 } -2106 vvv = vv[2]; -2107 if (vvv.x < xmin) { -2108 xmin = vvv.x; -2109 } -2110 if (vvv.x > xmax) { -2111 xmax = vvv.x; -2112 } -2113 if (vvv.y < ymin) { -2114 ymin = vvv.y; +2106 if (vvv.y < ymin) { +2107 ymin = vvv.y; +2108 } +2109 if (vvv.y > ymax) { +2110 ymax = vvv.y; +2111 } +2112 vvv = vv[1]; +2113 if (vvv.x < xmin) { +2114 xmin = vvv.x; 2115 } -2116 if (vvv.y > ymax) { -2117 ymax = vvv.y; +2116 if (vvv.x > xmax) { +2117 xmax = vvv.x; 2118 } -2119 vvv = vv[3]; -2120 if (vvv.x < xmin) { -2121 xmin = vvv.x; -2122 } -2123 if (vvv.x > xmax) { -2124 xmax = vvv.x; -2125 } -2126 if (vvv.y < ymin) { -2127 ymin = vvv.y; +2119 if (vvv.y < ymin) { +2120 ymin = vvv.y; +2121 } +2122 if (vvv.y > ymax) { +2123 ymax = vvv.y; +2124 } +2125 vvv = vv[2]; +2126 if (vvv.x < xmin) { +2127 xmin = vvv.x; 2128 } -2129 if (vvv.y > ymax) { -2130 ymax = vvv.y; +2129 if (vvv.x > xmax) { +2130 xmax = vvv.x; 2131 } -2132 -2133 AABB.x = xmin; -2134 AABB.y = ymin; -2135 AABB.x1 = xmax; -2136 AABB.y1 = ymax; -2137 AABB.width = (xmax - xmin); -2138 AABB.height = (ymax - ymin); -2139 -2140 return this; -2141 }, -2142 /** -2143 * @private. -2144 * This method will be called by the Director to set the whole Actor pre-render process. -2145 * -2146 * @param director the CAAT.Foundation.Director object instance that contains the Scene the Actor is in. -2147 * @param time an integer indicating the Scene time when the bounding box is to be drawn. -2148 * -2149 * @return boolean indicating whether the Actor isInFrameTime -2150 */ -2151 paintActor:function (director, time) { -2152 -2153 if (!this.visible || !director.inDirtyRect(this)) { -2154 return true; -2155 } -2156 -2157 var ctx = director.ctx; +2132 if (vvv.y < ymin) { +2133 ymin = vvv.y; +2134 } +2135 if (vvv.y > ymax) { +2136 ymax = vvv.y; +2137 } +2138 vvv = vv[3]; +2139 if (vvv.x < xmin) { +2140 xmin = vvv.x; +2141 } +2142 if (vvv.x > xmax) { +2143 xmax = vvv.x; +2144 } +2145 if (vvv.y < ymin) { +2146 ymin = vvv.y; +2147 } +2148 if (vvv.y > ymax) { +2149 ymax = vvv.y; +2150 } +2151 +2152 AABB.x = xmin; +2153 AABB.y = ymin; +2154 AABB.x1 = xmax; +2155 AABB.y1 = ymax; +2156 AABB.width = (xmax - xmin); +2157 AABB.height = (ymax - ymin); 2158 -2159 this.frameAlpha = this.parent ? this.parent.frameAlpha * this.alpha : 1; -2160 ctx.globalAlpha = this.frameAlpha; -2161 -2162 director.modelViewMatrix.transformRenderingContextSet(ctx); -2163 this.worldModelViewMatrix.transformRenderingContext(ctx); -2164 -2165 if (this.clip) { -2166 ctx.beginPath(); -2167 if (!this.clipPath) { -2168 ctx.rect(0, 0, this.width, this.height); -2169 } else { -2170 this.clipPath.applyAsPath(director); -2171 } -2172 ctx.clip(); -2173 } -2174 -2175 this.paint(director, time); -2176 -2177 return true; -2178 }, -2179 /** -2180 * for js2native -2181 * @param director -2182 * @param time -2183 */ -2184 __paintActor:function (director, time) { -2185 if (!this.visible) { -2186 return true; -2187 } -2188 var ctx = director.ctx; -2189 -2190 // global opt: set alpha as owns alpha, not take globalAlpha procedure. -2191 this.frameAlpha = this.alpha; -2192 -2193 var m = this.worldModelViewMatrix.matrix; -2194 ctx.setTransform(m[0], m[3], m[1], m[4], m[2], m[5], this.frameAlpha); -2195 this.paint(director, time); +2159 return this; +2160 }, +2161 /** +2162 * @private. +2163 * This method will be called by the Director to set the whole Actor pre-render process. +2164 * +2165 * @param director the CAAT.Foundation.Director object instance that contains the Scene the Actor is in. +2166 * @param time an integer indicating the Scene time when the bounding box is to be drawn. +2167 * +2168 * @return boolean indicating whether the Actor isInFrameTime +2169 */ +2170 paintActor:function (director, time) { +2171 +2172 if (!this.visible || !director.inDirtyRect(this)) { +2173 return true; +2174 } +2175 +2176 var ctx = director.ctx; +2177 +2178 this.frameAlpha = this.parent ? this.parent.frameAlpha * this.alpha : 1; +2179 ctx.globalAlpha = this.frameAlpha; +2180 +2181 director.modelViewMatrix.transformRenderingContextSet(ctx); +2182 this.worldModelViewMatrix.transformRenderingContext(ctx); +2183 +2184 if (this.clip) { +2185 ctx.beginPath(); +2186 if (!this.clipPath) { +2187 ctx.rect(0, 0, this.width, this.height); +2188 } else { +2189 this.clipPath.applyAsPath(director); +2190 } +2191 ctx.clip(); +2192 } +2193 +2194 this.paint(director, time); +2195 2196 return true; 2197 }, -2198 -2199 /** -2200 * Set coordinates and uv values for this actor. -2201 * This function uses Director's coords and indexCoords values. -2202 * @param director -2203 * @param time -2204 */ -2205 paintActorGL:function (director, time) { -2206 -2207 this.frameAlpha = this.parent.frameAlpha * this.alpha; +2198 /** +2199 * for js2native +2200 * @param director +2201 * @param time +2202 */ +2203 __paintActor:function (director, time) { +2204 if (!this.visible) { +2205 return true; +2206 } +2207 var ctx = director.ctx; 2208 -2209 if (!this.glEnabled || !this.visible) { -2210 return; -2211 } -2212 -2213 if (this.glNeedsFlush(director)) { -2214 director.glFlush(); -2215 this.glSetShader(director); -2216 -2217 if (!this.__uv) { -2218 this.__uv = new Float32Array(8); -2219 } -2220 if (!this.__vv) { -2221 this.__vv = new Float32Array(12); -2222 } -2223 -2224 this.setGLCoords(this.__vv, 0); -2225 this.setUV(this.__uv, 0); -2226 director.glRender(this.__vv, 12, this.__uv); +2209 // global opt: set alpha as owns alpha, not take globalAlpha procedure. +2210 this.frameAlpha = this.alpha; +2211 +2212 var m = this.worldModelViewMatrix.matrix; +2213 ctx.setTransform(m[0], m[3], m[1], m[4], m[2], m[5], this.frameAlpha); +2214 this.paint(director, time); +2215 return true; +2216 }, +2217 +2218 /** +2219 * Set coordinates and uv values for this actor. +2220 * This function uses Director's coords and indexCoords values. +2221 * @param director +2222 * @param time +2223 */ +2224 paintActorGL:function (director, time) { +2225 +2226 this.frameAlpha = this.parent.frameAlpha * this.alpha; 2227 -2228 return; -2229 } -2230 -2231 var glCoords = director.coords; -2232 var glCoordsIndex = director.coordsIndex; -2233 -2234 ////////////////// XYZ -2235 this.setGLCoords(glCoords, glCoordsIndex); -2236 director.coordsIndex = glCoordsIndex + 12; -2237 -2238 ////////////////// UV -2239 this.setUV(director.uv, director.uvIndex); -2240 director.uvIndex += 8; -2241 }, -2242 /** -2243 * TODO: set GLcoords for different image transformations. -2244 * -2245 * @param glCoords -2246 * @param glCoordsIndex -2247 */ -2248 setGLCoords:function (glCoords, glCoordsIndex) { +2228 if (!this.glEnabled || !this.visible) { +2229 return; +2230 } +2231 +2232 if (this.glNeedsFlush(director)) { +2233 director.glFlush(); +2234 this.glSetShader(director); +2235 +2236 if (!this.__uv) { +2237 this.__uv = new Float32Array(8); +2238 } +2239 if (!this.__vv) { +2240 this.__vv = new Float32Array(12); +2241 } +2242 +2243 this.setGLCoords(this.__vv, 0); +2244 this.setUV(this.__uv, 0); +2245 director.glRender(this.__vv, 12, this.__uv); +2246 +2247 return; +2248 } 2249 -2250 var vv = this.viewVertices; -2251 glCoords[glCoordsIndex++] = vv[0].x; -2252 glCoords[glCoordsIndex++] = vv[0].y; -2253 glCoords[glCoordsIndex++] = 0; -2254 -2255 glCoords[glCoordsIndex++] = vv[1].x; -2256 glCoords[glCoordsIndex++] = vv[1].y; -2257 glCoords[glCoordsIndex++] = 0; -2258 -2259 glCoords[glCoordsIndex++] = vv[2].x; -2260 glCoords[glCoordsIndex++] = vv[2].y; -2261 glCoords[glCoordsIndex++] = 0; -2262 -2263 glCoords[glCoordsIndex++] = vv[3].x; -2264 glCoords[glCoordsIndex++] = vv[3].y; -2265 glCoords[glCoordsIndex ] = 0; -2266 -2267 }, -2268 /** -2269 * Set UV for this actor's quad. -2270 * -2271 * @param uvBuffer {Float32Array} -2272 * @param uvIndex {number} -2273 */ -2274 setUV:function (uvBuffer, uvIndex) { -2275 this.backgroundImage.setUV(uvBuffer, uvIndex); -2276 }, -2277 /** -2278 * Test for compulsory gl flushing: -2279 * 1.- opacity has changed. -2280 * 2.- texture page has changed. -2281 * -2282 */ -2283 glNeedsFlush:function (director) { -2284 if (this.getTextureGLPage() !== director.currentTexturePage) { -2285 return true; -2286 } -2287 if (this.frameAlpha !== director.currentOpacity) { -2288 return true; -2289 } -2290 return false; -2291 }, -2292 /** -2293 * Change texture shader program parameters. -2294 * @param director -2295 */ -2296 glSetShader:function (director) { -2297 -2298 var tp = this.getTextureGLPage(); -2299 if (tp !== director.currentTexturePage) { -2300 director.setGLTexturePage(tp); -2301 } -2302 -2303 if (this.frameAlpha !== director.currentOpacity) { -2304 director.setGLCurrentOpacity(this.frameAlpha); +2250 var glCoords = director.coords; +2251 var glCoordsIndex = director.coordsIndex; +2252 +2253 ////////////////// XYZ +2254 this.setGLCoords(glCoords, glCoordsIndex); +2255 director.coordsIndex = glCoordsIndex + 12; +2256 +2257 ////////////////// UV +2258 this.setUV(director.uv, director.uvIndex); +2259 director.uvIndex += 8; +2260 }, +2261 /** +2262 * TODO: set GLcoords for different image transformations. +2263 * +2264 * @param glCoords +2265 * @param glCoordsIndex +2266 */ +2267 setGLCoords:function (glCoords, glCoordsIndex) { +2268 +2269 var vv = this.viewVertices; +2270 glCoords[glCoordsIndex++] = vv[0].x; +2271 glCoords[glCoordsIndex++] = vv[0].y; +2272 glCoords[glCoordsIndex++] = 0; +2273 +2274 glCoords[glCoordsIndex++] = vv[1].x; +2275 glCoords[glCoordsIndex++] = vv[1].y; +2276 glCoords[glCoordsIndex++] = 0; +2277 +2278 glCoords[glCoordsIndex++] = vv[2].x; +2279 glCoords[glCoordsIndex++] = vv[2].y; +2280 glCoords[glCoordsIndex++] = 0; +2281 +2282 glCoords[glCoordsIndex++] = vv[3].x; +2283 glCoords[glCoordsIndex++] = vv[3].y; +2284 glCoords[glCoordsIndex ] = 0; +2285 +2286 }, +2287 /** +2288 * Set UV for this actor's quad. +2289 * +2290 * @param uvBuffer {Float32Array} +2291 * @param uvIndex {number} +2292 */ +2293 setUV:function (uvBuffer, uvIndex) { +2294 this.backgroundImage.setUV(uvBuffer, uvIndex); +2295 }, +2296 /** +2297 * Test for compulsory gl flushing: +2298 * 1.- opacity has changed. +2299 * 2.- texture page has changed. +2300 * +2301 */ +2302 glNeedsFlush:function (director) { +2303 if (this.getTextureGLPage() !== director.currentTexturePage) { +2304 return true; 2305 } -2306 }, -2307 /** -2308 * @private. -2309 * This method is called after the Director has transformed and drawn a whole frame. -2310 * -2311 * @param director the CAAT.Foundation.Director object instance that contains the Scene the Actor is in. -2312 * @param time an integer indicating the Scene time when the bounding box is to be drawn. -2313 * @return this -2314 * -2315 * @deprecated -2316 */ -2317 endAnimate:function (director, time) { -2318 return this; -2319 }, -2320 initialize:function (overrides) { -2321 if (overrides) { -2322 for (var i in overrides) { -2323 this[i] = overrides[i]; -2324 } -2325 } -2326 -2327 return this; -2328 }, -2329 /** -2330 * Set this Actor's clipping area. -2331 * @param enable {boolean} enable clip area. -2332 * @param clipPath {CAAT.Path.Path=} An optional path to apply clip with. If enabled and clipPath is not set, -2333 * a rectangle will be used. -2334 */ -2335 setClip:function (enable, clipPath) { -2336 this.clip = enable; -2337 this.clipPath = clipPath; -2338 return this; -2339 }, -2340 -2341 isCached : function() { -2342 return this.cached; -2343 }, -2344 -2345 stopCacheAsBitmap:function () { -2346 if (this.cached) { -2347 this.backgroundImage = null; -2348 this.cached = CAAT.Foundation.Actor.CACHE_NONE; -2349 } -2350 }, -2351 -2352 /** -2353 * -2354 * @param time {Number=} -2355 * @param stragegy {CAAT.Foundation.Actor.CACHE_SIMPLE | CAAT.Foundation.Actor.CACHE_DEEP} -2356 * @return this -2357 */ -2358 cacheAsBitmap:function (time, strategy) { +2306 if (this.frameAlpha !== director.currentOpacity) { +2307 return true; +2308 } +2309 return false; +2310 }, +2311 /** +2312 * Change texture shader program parameters. +2313 * @param director +2314 */ +2315 glSetShader:function (director) { +2316 +2317 var tp = this.getTextureGLPage(); +2318 if (tp !== director.currentTexturePage) { +2319 director.setGLTexturePage(tp); +2320 } +2321 +2322 if (this.frameAlpha !== director.currentOpacity) { +2323 director.setGLCurrentOpacity(this.frameAlpha); +2324 } +2325 }, +2326 /** +2327 * @private. +2328 * This method is called after the Director has transformed and drawn a whole frame. +2329 * +2330 * @param director the CAAT.Foundation.Director object instance that contains the Scene the Actor is in. +2331 * @param time an integer indicating the Scene time when the bounding box is to be drawn. +2332 * @return this +2333 * +2334 * @deprecated +2335 */ +2336 endAnimate:function (director, time) { +2337 return this; +2338 }, +2339 initialize:function (overrides) { +2340 if (overrides) { +2341 for (var i in overrides) { +2342 this[i] = overrides[i]; +2343 } +2344 } +2345 +2346 return this; +2347 }, +2348 /** +2349 * Set this Actor's clipping area. +2350 * @param enable {boolean} enable clip area. +2351 * @param clipPath {CAAT.Path.Path=} An optional path to apply clip with. If enabled and clipPath is not set, +2352 * a rectangle will be used. +2353 */ +2354 setClip:function (enable, clipPath) { +2355 this.clip = enable; +2356 this.clipPath = clipPath; +2357 return this; +2358 }, 2359 -2360 if (this.width<=0 || this.height<=0 ) { -2361 return this; -2362 } +2360 isCached : function() { +2361 return this.cached; +2362 }, 2363 -2364 time = time || 0; -2365 var canvas = document.createElement('canvas'); -2366 canvas.width = this.width; -2367 canvas.height = this.height; -2368 var ctx = canvas.getContext('2d'); -2369 -2370 CAAT.Foundation.Actor.prototype.animate.call(this,CAAT.currentDirector,time); -2371 -2372 var director = { -2373 ctx:ctx, -2374 modelViewMatrix: new CAAT.Math.Matrix(), -2375 worldModelViewMatrix: new CAAT.Math.Matrix(), -2376 dirtyRectsEnabled:false, -2377 inDirtyRect:function () { -2378 return true; -2379 }, -2380 AABB : new CAAT.Math.Rectangle(0,0,this.width,this.height) -2381 }; +2364 stopCacheAsBitmap:function () { +2365 if (this.cached) { +2366 this.backgroundImage = null; +2367 this.cached = CAAT.Foundation.Actor.CACHE_NONE; +2368 } +2369 }, +2370 +2371 /** +2372 * +2373 * @param time {Number=} +2374 * @param stragegy {CAAT.Foundation.Actor.CACHE_SIMPLE | CAAT.Foundation.Actor.CACHE_DEEP} +2375 * @return this +2376 */ +2377 cacheAsBitmap:function (time, strategy) { +2378 +2379 if (this.width<=0 || this.height<=0 ) { +2380 return this; +2381 } 2382 -2383 var pmv = this.modelViewMatrix; -2384 var pwmv = this.worldModelViewMatrix; -2385 -2386 this.modelViewMatrix = new CAAT.Math.Matrix(); -2387 this.worldModelViewMatrix = new CAAT.Math.Matrix(); +2383 time = time || 0; +2384 var canvas = document.createElement('canvas'); +2385 canvas.width = this.width; +2386 canvas.height = this.height; +2387 var ctx = canvas.getContext('2d'); 2388 -2389 this.cached = CAAT.Foundation.Actor.CACHE_NONE; +2389 CAAT.Foundation.Actor.prototype.animate.call(this,CAAT.currentDirector,time); 2390 -2391 if ( typeof strategy==="undefined" ) { -2392 strategy= CAAT.Foundation.Actor.CACHE_SIMPLE; -2393 } -2394 if ( strategy===CAAT.Foundation.Actor.CACHE_DEEP ) { -2395 this.animate(director, time ); -2396 this.paintActor(director, time); -2397 } else { -2398 if ( this instanceof CAAT.Foundation.ActorContainer || this instanceof CAAT.ActorContainer ) { -2399 CAAT.Foundation.ActorContainer.superclass.paintActor.call(this, director, time); -2400 } else { -2401 this.animate(director, time ); -2402 this.paintActor(director, time); -2403 } -2404 } -2405 this.setBackgroundImage(canvas); -2406 -2407 this.cached = strategy; -2408 -2409 this.modelViewMatrix = pmv; -2410 this.worldModelViewMatrix = pwmv; -2411 -2412 return this; -2413 }, -2414 resetAsButton : function() { -2415 this.actionPerformed= null; -2416 this.mouseEnter= function() {}; -2417 this.mouseExit= function() {}; -2418 this.mouseDown= function() {}; -2419 this.mouseUp= function() {}; -2420 this.mouseClick= function() {}; -2421 this.mouseDrag= function() {}; -2422 return this; -2423 }, -2424 /** -2425 * Set this actor behavior as if it were a Button. The actor size will be set as SpriteImage's -2426 * single size. -2427 * -2428 * @param buttonImage {CAAT.Foundation.SpriteImage} sprite image with button's state images. -2429 * @param iNormal {number} button's normal state image index -2430 * @param iOver {number} button's mouse over state image index -2431 * @param iPress {number} button's pressed state image index -2432 * @param iDisabled {number} button's disabled state image index -2433 * @param fn {function(button{CAAT.Foundation.Actor})} callback function -2434 */ -2435 setAsButton:function (buttonImage, iNormal, iOver, iPress, iDisabled, fn) { -2436 -2437 var me = this; -2438 -2439 this.setBackgroundImage(buttonImage, true); -2440 -2441 this.iNormal = iNormal || 0; -2442 this.iOver = iOver || this.iNormal; -2443 this.iPress = iPress || this.iNormal; -2444 this.iDisabled = iDisabled || this.iNormal; -2445 this.fnOnClick = fn; -2446 this.enabled = true; -2447 -2448 this.setSpriteIndex(iNormal); -2449 -2450 /** -2451 * Enable or disable the button. -2452 * @param enabled {boolean} -2453 * @ignore -2454 */ -2455 this.setEnabled = function (enabled) { -2456 this.enabled = enabled; -2457 this.setSpriteIndex(this.enabled ? this.iNormal : this.iDisabled); -2458 return this; -2459 }; -2460 -2461 /** -2462 * This method will be called by CAAT *before* the mouseUp event is fired. -2463 * @param event {CAAT.Event.MouseEvent} -2464 * @ignore -2465 */ -2466 this.actionPerformed = function (event) { -2467 if (this.enabled && this.fnOnClick) { -2468 this.fnOnClick(this); -2469 } -2470 }; -2471 -2472 /** -2473 * Button's mouse enter handler. It makes the button provide visual feedback -2474 * @param mouseEvent {CAAT.Event.MouseEvent} -2475 * @ignore -2476 */ -2477 this.mouseEnter = function (mouseEvent) { -2478 if (!this.enabled) { -2479 return; -2480 } -2481 -2482 if (this.dragging) { -2483 this.setSpriteIndex(this.iPress); -2484 } else { -2485 this.setSpriteIndex(this.iOver); -2486 } -2487 CAAT.setCursor('pointer'); -2488 }; -2489 -2490 /** -2491 * Button's mouse exit handler. Release visual apperance. -2492 * @param mouseEvent {CAAT.MouseEvent} -2493 * @ignore -2494 */ -2495 this.mouseExit = function (mouseEvent) { -2496 if (!this.enabled) { -2497 return; -2498 } -2499 -2500 this.setSpriteIndex(this.iNormal); -2501 CAAT.setCursor('default'); -2502 }; -2503 -2504 /** -2505 * Button's mouse down handler. -2506 * @param mouseEvent {CAAT.MouseEvent} -2507 * @ignore -2508 */ -2509 this.mouseDown = function (mouseEvent) { -2510 if (!this.enabled) { -2511 return; -2512 } -2513 -2514 this.setSpriteIndex(this.iPress); -2515 }; -2516 -2517 /** -2518 * Button's mouse up handler. -2519 * @param mouseEvent {CAAT.MouseEvent} -2520 * @ignore -2521 */ -2522 this.mouseUp = function (mouseEvent) { -2523 if (!this.enabled) { -2524 return; -2525 } -2526 -2527 this.setSpriteIndex(this.iNormal); -2528 this.dragging = false; -2529 }; -2530 -2531 /** -2532 * Button's mouse click handler. Do nothing by default. This event handler will be -2533 * called ONLY if it has not been drag on the button. -2534 * @param mouseEvent {CAAT.MouseEvent} -2535 * @ignore -2536 */ -2537 this.mouseClick = function (mouseEvent) { -2538 }; -2539 -2540 /** -2541 * Button's mouse drag handler. -2542 * @param mouseEvent {CAAT.MouseEvent} -2543 * @ignore -2544 */ -2545 this.mouseDrag = function (mouseEvent) { -2546 if (!this.enabled) { -2547 return; -2548 } +2391 var director = { +2392 ctx:ctx, +2393 modelViewMatrix: new CAAT.Math.Matrix(), +2394 worldModelViewMatrix: new CAAT.Math.Matrix(), +2395 dirtyRectsEnabled:false, +2396 inDirtyRect:function () { +2397 return true; +2398 }, +2399 AABB : new CAAT.Math.Rectangle(0,0,this.width,this.height) +2400 }; +2401 +2402 var pmv = this.modelViewMatrix; +2403 var pwmv = this.worldModelViewMatrix; +2404 +2405 this.modelViewMatrix = new CAAT.Math.Matrix(); +2406 this.worldModelViewMatrix = new CAAT.Math.Matrix(); +2407 +2408 this.cached = CAAT.Foundation.Actor.CACHE_NONE; +2409 +2410 if ( typeof strategy==="undefined" ) { +2411 strategy= CAAT.Foundation.Actor.CACHE_SIMPLE; +2412 } +2413 if ( strategy===CAAT.Foundation.Actor.CACHE_DEEP ) { +2414 this.animate(director, time ); +2415 this.paintActor(director, time); +2416 } else { +2417 if ( this instanceof CAAT.Foundation.ActorContainer || this instanceof CAAT.ActorContainer ) { +2418 CAAT.Foundation.ActorContainer.superclass.paintActor.call(this, director, time); +2419 } else { +2420 this.animate(director, time ); +2421 this.paintActor(director, time); +2422 } +2423 } +2424 this.setBackgroundImage(canvas); +2425 +2426 this.cached = strategy; +2427 +2428 this.modelViewMatrix = pmv; +2429 this.worldModelViewMatrix = pwmv; +2430 +2431 return this; +2432 }, +2433 resetAsButton : function() { +2434 this.actionPerformed= null; +2435 this.mouseEnter= function() {}; +2436 this.mouseExit= function() {}; +2437 this.mouseDown= function() {}; +2438 this.mouseUp= function() {}; +2439 this.mouseClick= function() {}; +2440 this.mouseDrag= function() {}; +2441 return this; +2442 }, +2443 /** +2444 * Set this actor behavior as if it were a Button. The actor size will be set as SpriteImage's +2445 * single size. +2446 * +2447 * @param buttonImage {CAAT.Foundation.SpriteImage} sprite image with button's state images. +2448 * @param iNormal {number} button's normal state image index +2449 * @param iOver {number} button's mouse over state image index +2450 * @param iPress {number} button's pressed state image index +2451 * @param iDisabled {number} button's disabled state image index +2452 * @param fn {function(button{CAAT.Foundation.Actor})} callback function +2453 */ +2454 setAsButton:function (buttonImage, iNormal, iOver, iPress, iDisabled, fn) { +2455 +2456 var me = this; +2457 +2458 this.setBackgroundImage(buttonImage, true); +2459 +2460 this.iNormal = iNormal || 0; +2461 this.iOver = iOver || this.iNormal; +2462 this.iPress = iPress || this.iNormal; +2463 this.iDisabled = iDisabled || this.iNormal; +2464 this.fnOnClick = fn; +2465 this.enabled = true; +2466 +2467 this.setSpriteIndex(iNormal); +2468 +2469 /** +2470 * Enable or disable the button. +2471 * @param enabled {boolean} +2472 * @ignore +2473 */ +2474 this.setEnabled = function (enabled) { +2475 this.enabled = enabled; +2476 this.setSpriteIndex(this.enabled ? this.iNormal : this.iDisabled); +2477 return this; +2478 }; +2479 +2480 /** +2481 * This method will be called by CAAT *before* the mouseUp event is fired. +2482 * @param event {CAAT.Event.MouseEvent} +2483 * @ignore +2484 */ +2485 this.actionPerformed = function (event) { +2486 if (this.enabled && this.fnOnClick) { +2487 this.fnOnClick(this); +2488 } +2489 }; +2490 +2491 /** +2492 * Button's mouse enter handler. It makes the button provide visual feedback +2493 * @param mouseEvent {CAAT.Event.MouseEvent} +2494 * @ignore +2495 */ +2496 this.mouseEnter = function (mouseEvent) { +2497 if (!this.enabled) { +2498 return; +2499 } +2500 +2501 if (this.dragging) { +2502 this.setSpriteIndex(this.iPress); +2503 } else { +2504 this.setSpriteIndex(this.iOver); +2505 } +2506 CAAT.setCursor('pointer'); +2507 }; +2508 +2509 /** +2510 * Button's mouse exit handler. Release visual apperance. +2511 * @param mouseEvent {CAAT.MouseEvent} +2512 * @ignore +2513 */ +2514 this.mouseExit = function (mouseEvent) { +2515 if (!this.enabled) { +2516 return; +2517 } +2518 +2519 this.setSpriteIndex(this.iNormal); +2520 CAAT.setCursor('default'); +2521 }; +2522 +2523 /** +2524 * Button's mouse down handler. +2525 * @param mouseEvent {CAAT.MouseEvent} +2526 * @ignore +2527 */ +2528 this.mouseDown = function (mouseEvent) { +2529 if (!this.enabled) { +2530 return; +2531 } +2532 +2533 this.setSpriteIndex(this.iPress); +2534 }; +2535 +2536 /** +2537 * Button's mouse up handler. +2538 * @param mouseEvent {CAAT.MouseEvent} +2539 * @ignore +2540 */ +2541 this.mouseUp = function (mouseEvent) { +2542 if (!this.enabled) { +2543 return; +2544 } +2545 +2546 this.setSpriteIndex(this.iNormal); +2547 this.dragging = false; +2548 }; 2549 -2550 this.dragging = true; -2551 }; -2552 -2553 this.setButtonImageIndex = function (_normal, _over, _press, _disabled) { -2554 this.iNormal = _normal || 0; -2555 this.iOver = _over || this.iNormal; -2556 this.iPress = _press || this.iNormal; -2557 this.iDisabled = _disabled || this.iNormal; -2558 this.setSpriteIndex(this.iNormal); -2559 return this; -2560 }; -2561 -2562 return this; -2563 }, -2564 -2565 findActorById : function(id) { -2566 return this.id===id ? this : null; -2567 } -2568 } -2569 } -2570 }); -2571 \ No newline at end of file +2550 /** +2551 * Button's mouse click handler. Do nothing by default. This event handler will be +2552 * called ONLY if it has not been drag on the button. +2553 * @param mouseEvent {CAAT.MouseEvent} +2554 * @ignore +2555 */ +2556 this.mouseClick = function (mouseEvent) { +2557 }; +2558 +2559 /** +2560 * Button's mouse drag handler. +2561 * @param mouseEvent {CAAT.MouseEvent} +2562 * @ignore +2563 */ +2564 this.mouseDrag = function (mouseEvent) { +2565 if (!this.enabled) { +2566 return; +2567 } +2568 +2569 this.dragging = true; +2570 }; +2571 +2572 this.setButtonImageIndex = function (_normal, _over, _press, _disabled) { +2573 this.iNormal = _normal || 0; +2574 this.iOver = _over || this.iNormal; +2575 this.iPress = _press || this.iNormal; +2576 this.iDisabled = _disabled || this.iNormal; +2577 this.setSpriteIndex(this.iNormal); +2578 return this; +2579 }; +2580 +2581 return this; +2582 }, +2583 +2584 findActorById : function(id) { +2585 return this.id===id ? this : null; +2586 } +2587 } +2588 } +2589 }); +2590 \ No newline at end of file diff --git a/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_Foundation_ActorContainer.js.html b/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_Foundation_ActorContainer.js.html index da11c0b0..a315e517 100644 --- a/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_Foundation_ActorContainer.js.html +++ b/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_Foundation_ActorContainer.js.html @@ -270,440 +270,453 @@ 263 } 264 } 265 -266 ctx.restore(); -267 -268 return true; -269 }, -270 __paintActor:function (director, time) { -271 if (!this.visible) { -272 return true; -273 } -274 -275 var ctx = director.ctx; -276 -277 this.frameAlpha = this.parent ? this.parent.frameAlpha * this.alpha : 1; -278 var m = this.worldModelViewMatrix.matrix; -279 ctx.setTransform(m[0], m[3], m[1], m[4], m[2], m[5], this.frameAlpha); -280 this.paint(director, time); -281 -282 if (!this.isGlobalAlpha) { -283 this.frameAlpha = this.parent ? this.parent.frameAlpha : 1; -284 } +266 if (this.postPaint) { +267 this.postPaint( director, time ); +268 } +269 +270 ctx.restore(); +271 +272 return true; +273 }, +274 __paintActor:function (director, time) { +275 if (!this.visible) { +276 return true; +277 } +278 +279 var ctx = director.ctx; +280 +281 this.frameAlpha = this.parent ? this.parent.frameAlpha * this.alpha : 1; +282 var m = this.worldModelViewMatrix.matrix; +283 ctx.setTransform(m[0], m[3], m[1], m[4], m[2], m[5], this.frameAlpha); +284 this.paint(director, time); 285 -286 for (var i = 0, l = this.activeChildren.length; i < l; ++i) { -287 var actor = this.activeChildren[i]; -288 actor.paintActor(director, time); -289 } -290 return true; -291 }, -292 paintActorGL:function (director, time) { -293 -294 var i, l, c; -295 -296 if (!this.visible) { -297 return true; -298 } +286 if (!this.isGlobalAlpha) { +287 this.frameAlpha = this.parent ? this.parent.frameAlpha : 1; +288 } +289 +290 for (var i = 0, l = this.activeChildren.length; i < l; ++i) { +291 var actor = this.activeChildren[i]; +292 actor.paintActor(director, time); +293 } +294 return true; +295 }, +296 paintActorGL:function (director, time) { +297 +298 var i, l, c; 299 -300 sc_paintActorGL.call(this, director, time); -301 -302 if (!this.isGlobalAlpha) { -303 this.frameAlpha = this.parent.frameAlpha; -304 } +300 if (!this.visible) { +301 return true; +302 } +303 +304 sc_paintActorGL.call(this, director, time); 305 -306 for (i = 0, l = this.activeChildren.length; i < l; ++i) { -307 c = this.activeChildren[i]; -308 c.paintActorGL(director, time); -309 } -310 -311 }, -312 /** -313 * Private. -314 * Performs the animate method for this ActorContainer and every contained Actor. -315 * -316 * @param director the CAAT.Foundation.Director object instance that contains the Scene the Actor is in. -317 * @param time an integer indicating the Scene time when the bounding box is to be drawn. -318 * -319 * @return {boolean} is this actor in active children list ?? -320 */ -321 animate:function (director, time) { -322 -323 if (!this.visible) { -324 return false; -325 } +306 if (!this.isGlobalAlpha) { +307 this.frameAlpha = this.parent.frameAlpha; +308 } +309 +310 for (i = 0, l = this.activeChildren.length; i < l; ++i) { +311 c = this.activeChildren[i]; +312 c.paintActorGL(director, time); +313 } +314 +315 }, +316 /** +317 * Private. +318 * Performs the animate method for this ActorContainer and every contained Actor. +319 * +320 * @param director the CAAT.Foundation.Director object instance that contains the Scene the Actor is in. +321 * @param time an integer indicating the Scene time when the bounding box is to be drawn. +322 * +323 * @return {boolean} is this actor in active children list ?? +324 */ +325 animate:function (director, time) { 326 -327 this.activeChildren = []; -328 var last = null; -329 -330 if (false === sc_animate.call(this, director, time)) { -331 return false; -332 } +327 if (!this.visible) { +328 return false; +329 } +330 +331 this.activeChildren = []; +332 var last = null; 333 -334 if (this.cached === __CD) { -335 return true; +334 if (false === sc_animate.call(this, director, time)) { +335 return false; 336 } 337 -338 this.__validateLayout(); -339 CAAT.currentDirector.inValidation = false; -340 -341 var i, l; -342 -343 /** -344 * Incluir los actores pendientes. -345 * El momento es ahora, antes de procesar ninguno del contenedor. -346 */ -347 var pcl = this.pendingChildrenList; -348 for (i = 0; i < pcl.length; i++) { -349 var child = pcl[i]; -350 this.addChildImmediately(child.child, child.constraint); -351 } -352 -353 this.pendingChildrenList = []; -354 var markDelete = []; -355 -356 var cl = this.childrenList; -357 this.size_active = 1; -358 this.size_total = 1; -359 for (i = 0; i < cl.length; i++) { -360 var actor = cl[i]; -361 actor.time = time; -362 this.size_total += actor.size_total; -363 if (actor.animate(director, time)) { -364 this.activeChildren.push(actor); -365 this.size_active += actor.size_active; -366 } else { -367 if (actor.expired && actor.discardable) { -368 markDelete.push(actor); -369 } -370 } -371 } -372 -373 for (i = 0, l = markDelete.length; i < l; i++) { -374 var md = markDelete[i]; -375 md.destroy(time); -376 if (director.dirtyRectsEnabled) { -377 director.addDirtyRect(md.AABB); -378 } -379 } -380 -381 return true; -382 }, -383 /** -384 * Removes Actors from this ActorContainer which are expired and flagged as Discardable. -385 * -386 * @param director the CAAT.Foundation.Director object instance that contains the Scene the Actor is in. -387 * @param time an integer indicating the Scene time when the bounding box is to be drawn. -388 * -389 * @deprecated -390 */ -391 endAnimate:function (director, time) { -392 }, -393 /** -394 * Adds an Actor to this Container. -395 * The Actor will be added ON METHOD CALL, despite the rendering pipeline stage being executed at -396 * the time of method call. -397 * -398 * This method is only used by director's transitionScene. -399 * -400 * @param child {CAAT.Foundation.Actor} -401 * @param constraint {object} -402 * @return this. -403 */ -404 addChildImmediately:function (child, constraint) { -405 return this.addChild(child, constraint); -406 }, -407 /** -408 * Adds an Actor to this ActorContainer. -409 * The Actor will be added to the container AFTER frame animation, and not on method call time. -410 * Except the Director and in orther to avoid visual artifacts, the developer SHOULD NOT call this -411 * method directly. -412 * -413 * If the container has addingHint as CAAT.Foundation.ActorContainer.AddHint.CONFORM, new continer size will be -414 * calculated by summing up the union of every client actor bounding box. -415 * This method will not take into acount actor's affine transformations, so the bounding box will be -416 * AABB. -417 * -418 * @param child {CAAT.Foundation.Actor} object instance. -419 * @param constraint {object} -420 * @return this -421 */ -422 addChild:function (child, constraint) { -423 -424 if (child.parent != null) { -425 throw('adding to a container an element with parent.'); -426 } -427 -428 child.parent = this; -429 this.childrenList.push(child); -430 child.dirty = true; -431 -432 if (this.layoutManager) { -433 this.layoutManager.addChild(child, constraint); -434 this.invalidateLayout(); -435 } else { -436 /** -437 * if Conforming size, recalc new bountainer size. -438 */ -439 if (this.addHint === CAAT.Foundation.ActorContainer.AddHint.CONFORM) { -440 this.recalcSize(); -441 } -442 } -443 -444 return this; -445 }, -446 -447 /** -448 * Recalc this container size by computing the union of every children bounding box. -449 */ -450 recalcSize:function () { -451 var bb = this.boundingBox; -452 bb.setEmpty(); -453 var cl = this.childrenList; -454 var ac; -455 for (var i = 0; i < cl.length; i++) { -456 ac = cl[i]; -457 this.runion.setBounds( -458 ac.x < 0 ? 0 : ac.x, -459 ac.y < 0 ? 0 : ac.y, -460 ac.width, -461 ac.height); -462 bb.unionRectangle(this.runion); -463 } -464 this.setSize(bb.x1, bb.y1); -465 -466 return this; -467 }, -468 -469 /** -470 * Add a child element and make it active in the next frame. -471 * @param child {CAAT.Foundation.Actor} -472 */ -473 addChildDelayed:function (child, constraint) { -474 this.pendingChildrenList.push({ child:child, constraint: constraint }); -475 return this; -476 }, -477 /** -478 * Adds an Actor to this ActorContainer. -479 * -480 * @param child {CAAT.Foundation.Actor}. -481 * @param index {number} -482 * -483 * @return this -484 */ -485 addChildAt:function (child, index) { -486 -487 if (index <= 0) { -488 child.parent = this; -489 child.dirty = true; -490 this.childrenList.splice(0, 0, child); -491 this.invalidateLayout(); -492 return this; -493 } else { -494 if (index >= this.childrenList.length) { -495 index = this.childrenList.length; -496 } -497 } -498 -499 child.parent = this; -500 child.dirty = true; -501 this.childrenList.splice(index, 0, child); -502 this.invalidateLayout(); -503 -504 return this; -505 }, -506 /** -507 * Find the first actor with the supplied ID. -508 * This method is not recommended to be used since executes a linear search. -509 * @param id -510 */ -511 findActorById:function (id) { -512 -513 if ( CAAT.Foundation.ActorContainer.superclass.findActorById.call(this,id) ) { -514 return this; -515 } +338 if (this.cached === __CD) { +339 return true; +340 } +341 +342 this.__validateLayout(); +343 CAAT.currentDirector.inValidation = false; +344 +345 var i, l; +346 +347 /** +348 * Incluir los actores pendientes. +349 * El momento es ahora, antes de procesar ninguno del contenedor. +350 */ +351 var pcl = this.pendingChildrenList; +352 for (i = 0; i < pcl.length; i++) { +353 var child = pcl[i]; +354 this.addChildImmediately(child.child, child.constraint); +355 } +356 +357 this.pendingChildrenList = []; +358 var markDelete = []; +359 +360 var cl = this.childrenList; +361 this.size_active = 1; +362 this.size_total = 1; +363 for (i = 0; i < cl.length; i++) { +364 var actor = cl[i]; +365 actor.time = time; +366 this.size_total += actor.size_total; +367 if (actor.animate(director, time)) { +368 this.activeChildren.push(actor); +369 this.size_active += actor.size_active; +370 } else { +371 if (actor.expired && actor.discardable) { +372 markDelete.push(actor); +373 } +374 } +375 } +376 +377 for (i = 0, l = markDelete.length; i < l; i++) { +378 var md = markDelete[i]; +379 md.destroy(time); +380 if (director.dirtyRectsEnabled) { +381 director.addDirtyRect(md.AABB); +382 } +383 } +384 +385 return true; +386 }, +387 /** +388 * Removes Actors from this ActorContainer which are expired and flagged as Discardable. +389 * +390 * @param director the CAAT.Foundation.Director object instance that contains the Scene the Actor is in. +391 * @param time an integer indicating the Scene time when the bounding box is to be drawn. +392 * +393 * @deprecated +394 */ +395 endAnimate:function (director, time) { +396 }, +397 /** +398 * Adds an Actor to this Container. +399 * The Actor will be added ON METHOD CALL, despite the rendering pipeline stage being executed at +400 * the time of method call. +401 * +402 * This method is only used by director's transitionScene. +403 * +404 * @param child {CAAT.Foundation.Actor} +405 * @param constraint {object} +406 * @return this. +407 */ +408 addChildImmediately:function (child, constraint) { +409 return this.addChild(child, constraint); +410 }, +411 +412 addActorImmediately: function(child,constraint) { +413 return this.addChildImmediately(child,constraint); +414 }, +415 +416 addActor : function( child, constraint ) { +417 return this.addChild(child,constraint); +418 }, +419 +420 /** +421 * Adds an Actor to this ActorContainer. +422 * The Actor will be added to the container AFTER frame animation, and not on method call time. +423 * Except the Director and in orther to avoid visual artifacts, the developer SHOULD NOT call this +424 * method directly. +425 * +426 * If the container has addingHint as CAAT.Foundation.ActorContainer.AddHint.CONFORM, new continer size will be +427 * calculated by summing up the union of every client actor bounding box. +428 * This method will not take into acount actor's affine transformations, so the bounding box will be +429 * AABB. +430 * +431 * @param child {CAAT.Foundation.Actor} object instance. +432 * @param constraint {object} +433 * @return this +434 */ +435 addChild:function (child, constraint) { +436 +437 if (child.parent != null) { +438 throw('adding to a container an element with parent.'); +439 } +440 +441 child.parent = this; +442 this.childrenList.push(child); +443 child.dirty = true; +444 +445 if (this.layoutManager) { +446 this.layoutManager.addChild(child, constraint); +447 this.invalidateLayout(); +448 } else { +449 /** +450 * if Conforming size, recalc new bountainer size. +451 */ +452 if (this.addHint === CAAT.Foundation.ActorContainer.AddHint.CONFORM) { +453 this.recalcSize(); +454 } +455 } +456 +457 return this; +458 }, +459 +460 /** +461 * Recalc this container size by computing the union of every children bounding box. +462 */ +463 recalcSize:function () { +464 var bb = this.boundingBox; +465 bb.setEmpty(); +466 var cl = this.childrenList; +467 var ac; +468 for (var i = 0; i < cl.length; i++) { +469 ac = cl[i]; +470 this.runion.setBounds( +471 ac.x < 0 ? 0 : ac.x, +472 ac.y < 0 ? 0 : ac.y, +473 ac.width, +474 ac.height); +475 bb.unionRectangle(this.runion); +476 } +477 this.setSize(bb.x1, bb.y1); +478 +479 return this; +480 }, +481 +482 /** +483 * Add a child element and make it active in the next frame. +484 * @param child {CAAT.Foundation.Actor} +485 */ +486 addChildDelayed:function (child, constraint) { +487 this.pendingChildrenList.push({ child:child, constraint: constraint }); +488 return this; +489 }, +490 /** +491 * Adds an Actor to this ActorContainer. +492 * +493 * @param child {CAAT.Foundation.Actor}. +494 * @param index {number} +495 * +496 * @return this +497 */ +498 addChildAt:function (child, index) { +499 +500 if (index <= 0) { +501 child.parent = this; +502 child.dirty = true; +503 this.childrenList.splice(0, 0, child); +504 this.invalidateLayout(); +505 return this; +506 } else { +507 if (index >= this.childrenList.length) { +508 index = this.childrenList.length; +509 } +510 } +511 +512 child.parent = this; +513 child.dirty = true; +514 this.childrenList.splice(index, 0, child); +515 this.invalidateLayout(); 516 -517 var cl = this.childrenList; -518 for (var i = 0, l = cl.length; i < l; i++) { -519 var ret= cl[i].findActorById(id); -520 if (null!=ret) { -521 return ret; -522 } -523 } -524 -525 return null; -526 }, -527 /** -528 * Private -529 * Gets a contained Actor z-index on this ActorContainer. -530 * -531 * @param child a CAAT.Foundation.Actor object instance. -532 * -533 * @return {number} -534 */ -535 findChild:function (child) { -536 var cl = this.childrenList; -537 var i; -538 var len = cl.length; -539 -540 for (i = 0; i < len; i++) { -541 if (cl[i] === child) { -542 return i; -543 } -544 } -545 return -1; -546 }, -547 removeChildAt:function (pos) { -548 var cl = this.childrenList; -549 var rm; -550 if (-1 !== pos && pos>=0 && pos<this.childrenList.length) { -551 cl[pos].setParent(null); -552 rm = cl.splice(pos, 1); -553 if (rm[0].isVisible() && CAAT.currentDirector.dirtyRectsEnabled) { -554 CAAT.currentDirector.scheduleDirtyRect(rm[0].AABB); -555 } -556 -557 this.invalidateLayout(); -558 return rm[0]; -559 } -560 -561 return null; -562 }, -563 /** -564 * Removed an Actor form this ActorContainer. -565 * If the Actor is not contained into this Container, nothing happends. -566 * -567 * @param child a CAAT.Foundation.Actor object instance. -568 * -569 * @return this -570 */ -571 removeChild:function (child) { -572 var pos = this.findChild(child); -573 var ret = this.removeChildAt(pos); -574 -575 return ret; -576 }, -577 removeFirstChild:function () { -578 var first = this.childrenList.shift(); -579 first.parent = null; -580 if (first.isVisible() && CAAT.currentDirector.dirtyRectsEnabled) { -581 CAAT.currentDirector.scheduleDirtyRect(first.AABB); -582 } -583 -584 this.invalidateLayout(); -585 -586 return first; -587 }, -588 removeLastChild:function () { -589 if (this.childrenList.length) { -590 var last = this.childrenList.pop(); -591 last.parent = null; -592 if (last.isVisible() && CAAT.currentDirector.dirtyRectsEnabled) { -593 CAAT.currentDirector.scheduleDirtyRect(last.AABB); -594 } -595 -596 this.invalidateLayout(); -597 -598 return last; -599 } -600 -601 return null; -602 }, -603 /** -604 * @private -605 * -606 * Gets the Actor inside this ActorContainer at a given Screen coordinate. -607 * -608 * @param point an object of the form { x: float, y: float } -609 * -610 * @return the Actor contained inside this ActorContainer if found, or the ActorContainer itself. -611 */ -612 findActorAtPosition:function (point) { +517 return this; +518 }, +519 /** +520 * Find the first actor with the supplied ID. +521 * This method is not recommended to be used since executes a linear search. +522 * @param id +523 */ +524 findActorById:function (id) { +525 +526 if ( CAAT.Foundation.ActorContainer.superclass.findActorById.call(this,id) ) { +527 return this; +528 } +529 +530 var cl = this.childrenList; +531 for (var i = 0, l = cl.length; i < l; i++) { +532 var ret= cl[i].findActorById(id); +533 if (null!=ret) { +534 return ret; +535 } +536 } +537 +538 return null; +539 }, +540 /** +541 * Private +542 * Gets a contained Actor z-index on this ActorContainer. +543 * +544 * @param child a CAAT.Foundation.Actor object instance. +545 * +546 * @return {number} +547 */ +548 findChild:function (child) { +549 var cl = this.childrenList; +550 var i; +551 var len = cl.length; +552 +553 for (i = 0; i < len; i++) { +554 if (cl[i] === child) { +555 return i; +556 } +557 } +558 return -1; +559 }, +560 removeChildAt:function (pos) { +561 var cl = this.childrenList; +562 var rm; +563 if (-1 !== pos && pos>=0 && pos<this.childrenList.length) { +564 cl[pos].setParent(null); +565 rm = cl.splice(pos, 1); +566 if (rm[0].isVisible() && CAAT.currentDirector.dirtyRectsEnabled) { +567 CAAT.currentDirector.scheduleDirtyRect(rm[0].AABB); +568 } +569 +570 this.invalidateLayout(); +571 return rm[0]; +572 } +573 +574 return null; +575 }, +576 /** +577 * Removed an Actor form this ActorContainer. +578 * If the Actor is not contained into this Container, nothing happends. +579 * +580 * @param child a CAAT.Foundation.Actor object instance. +581 * +582 * @return this +583 */ +584 removeChild:function (child) { +585 var pos = this.findChild(child); +586 var ret = this.removeChildAt(pos); +587 +588 return ret; +589 }, +590 removeFirstChild:function () { +591 var first = this.childrenList.shift(); +592 first.parent = null; +593 if (first.isVisible() && CAAT.currentDirector.dirtyRectsEnabled) { +594 CAAT.currentDirector.scheduleDirtyRect(first.AABB); +595 } +596 +597 this.invalidateLayout(); +598 +599 return first; +600 }, +601 removeLastChild:function () { +602 if (this.childrenList.length) { +603 var last = this.childrenList.pop(); +604 last.parent = null; +605 if (last.isVisible() && CAAT.currentDirector.dirtyRectsEnabled) { +606 CAAT.currentDirector.scheduleDirtyRect(last.AABB); +607 } +608 +609 this.invalidateLayout(); +610 +611 return last; +612 } 613 -614 if (null === sc_findActorAtPosition.call(this, point)) { -615 return null; -616 } -617 -618 // z-order -619 var cl = this.childrenList; -620 for (var i = cl.length - 1; i >= 0; i--) { -621 var child = this.childrenList[i]; -622 -623 var np = new CAAT.Math.Point(point.x, point.y, 0); -624 var contained = child.findActorAtPosition(np); -625 if (null !== contained) { -626 return contained; -627 } -628 } -629 -630 return this; -631 }, -632 /** -633 * Destroys this ActorContainer. -634 * The process falls down recursively for each contained Actor into this ActorContainer. -635 * -636 * @return this -637 */ -638 destroy:function () { -639 var cl = this.childrenList; -640 for (var i = cl.length - 1; i >= 0; i--) { -641 cl[i].destroy(); -642 } -643 sc_destroy.call(this); -644 -645 return this; -646 }, -647 /** -648 * Get number of Actors into this container. -649 * @return integer indicating the number of children. +614 return null; +615 }, +616 /** +617 * @private +618 * +619 * Gets the Actor inside this ActorContainer at a given Screen coordinate. +620 * +621 * @param point an object of the form { x: float, y: float } +622 * +623 * @return the Actor contained inside this ActorContainer if found, or the ActorContainer itself. +624 */ +625 findActorAtPosition:function (point) { +626 +627 if (null === sc_findActorAtPosition.call(this, point)) { +628 return null; +629 } +630 +631 // z-order +632 var cl = this.childrenList; +633 for (var i = cl.length - 1; i >= 0; i--) { +634 var child = this.childrenList[i]; +635 +636 var np = new CAAT.Math.Point(point.x, point.y, 0); +637 var contained = child.findActorAtPosition(np); +638 if (null !== contained) { +639 return contained; +640 } +641 } +642 +643 return this; +644 }, +645 /** +646 * Destroys this ActorContainer. +647 * The process falls down recursively for each contained Actor into this ActorContainer. +648 * +649 * @return this 650 */ -651 getNumChildren:function () { -652 return this.childrenList.length; -653 }, -654 getNumActiveChildren:function () { -655 return this.activeChildren.length; -656 }, -657 /** -658 * Returns the Actor at the iPosition(th) position. -659 * @param iPosition an integer indicating the position array. -660 * @return the CAAT.Foundation.Actor object at position. -661 */ -662 getChildAt:function (iPosition) { -663 return this.childrenList[ iPosition ]; -664 }, -665 /** -666 * Changes an actor's ZOrder. -667 * @param actor the actor to change ZOrder for -668 * @param index an integer indicating the new ZOrder. a value greater than children list size means to be the -669 * last ZOrder Actor. -670 */ -671 setZOrder:function (actor, index) { -672 var actorPos = this.findChild(actor); -673 // the actor is present -674 if (-1 !== actorPos) { -675 var cl = this.childrenList; -676 // trivial reject. -677 if (index === actorPos) { -678 return; -679 } -680 -681 if (index >= cl.length) { -682 cl.splice(actorPos, 1); -683 cl.push(actor); -684 } else { -685 var nActor = cl.splice(actorPos, 1); -686 if (index < 0) { -687 index = 0; -688 } else if (index > cl.length) { -689 index = cl.length; -690 } -691 -692 cl.splice(index, 0, nActor[0]); -693 } -694 -695 this.invalidateLayout(); -696 } -697 } -698 } -699 -700 } -701 }); -702 \ No newline at end of file +651 destroy:function () { +652 var cl = this.childrenList; +653 for (var i = cl.length - 1; i >= 0; i--) { +654 cl[i].destroy(); +655 } +656 sc_destroy.call(this); +657 +658 return this; +659 }, +660 /** +661 * Get number of Actors into this container. +662 * @return integer indicating the number of children. +663 */ +664 getNumChildren:function () { +665 return this.childrenList.length; +666 }, +667 getNumActiveChildren:function () { +668 return this.activeChildren.length; +669 }, +670 /** +671 * Returns the Actor at the iPosition(th) position. +672 * @param iPosition an integer indicating the position array. +673 * @return the CAAT.Foundation.Actor object at position. +674 */ +675 getChildAt:function (iPosition) { +676 return this.childrenList[ iPosition ]; +677 }, +678 /** +679 * Changes an actor's ZOrder. +680 * @param actor the actor to change ZOrder for +681 * @param index an integer indicating the new ZOrder. a value greater than children list size means to be the +682 * last ZOrder Actor. +683 */ +684 setZOrder:function (actor, index) { +685 var actorPos = this.findChild(actor); +686 // the actor is present +687 if (-1 !== actorPos) { +688 var cl = this.childrenList; +689 // trivial reject. +690 if (index === actorPos) { +691 return; +692 } +693 +694 if (index >= cl.length) { +695 cl.splice(actorPos, 1); +696 cl.push(actor); +697 } else { +698 var nActor = cl.splice(actorPos, 1); +699 if (index < 0) { +700 index = 0; +701 } else if (index > cl.length) { +702 index = cl.length; +703 } +704 +705 cl.splice(index, 0, nActor[0]); +706 } +707 +708 this.invalidateLayout(); +709 } +710 } +711 } +712 +713 } +714 }); +715 \ No newline at end of file diff --git a/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_Foundation_Director.js.html b/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_Foundation_Director.js.html index a87e74bb..1929ae1e 100644 --- a/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_Foundation_Director.js.html +++ b/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_Foundation_Director.js.html @@ -81,2081 +81,2081 @@ 74 this.browserInfo = CAAT.Module.Runtime.BrowserInfo; 75 this.audioManager = new CAAT.Module.Audio.AudioManager().initialize(8); 76 this.scenes = []; - 77 - 78 // input related variables initialization - 79 this.mousePoint = new CAAT.Math.Point(0, 0, 0); - 80 this.prevMousePoint = new CAAT.Math.Point(0, 0, 0); - 81 this.screenMousePoint = new CAAT.Math.Point(0, 0, 0); - 82 this.isMouseDown = false; - 83 this.lastSelectedActor = null; - 84 this.dragging = false; - 85 - 86 this.cDirtyRects = []; - 87 this.sDirtyRects = []; - 88 this.dirtyRects = []; - 89 for (var i = 0; i < 64; i++) { - 90 this.dirtyRects.push(new CAAT.Math.Rectangle()); - 91 } - 92 this.dirtyRectsIndex = 0; - 93 this.touches = {}; - 94 - 95 this.timerManager = new CAAT.Foundation.Timer.TimerManager(); - 96 this.__map= {}; - 97 - 98 return this; - 99 }, -100 -101 /** -102 * flag indicating debug mode. It will draw affedted screen areas. -103 * @type {boolean} -104 */ -105 debug:false, -106 -107 /** -108 * Set CAAT render mode. Right now, this takes no effect. -109 */ -110 renderMode:CAAT.Foundation.Director.RENDER_MODE_CONTINUOUS, -111 -112 /** -113 * This method will be called before rendering any director scene. -114 * Use this method to calculate your physics for example. -115 * @private -116 */ -117 onRenderStart:null, -118 -119 /** -120 * This method will be called after rendering any director scene. -121 * Use this method to clean your physics forces for example. -122 * @private -123 */ -124 onRenderEnd:null, -125 -126 // input related attributes -127 /** -128 * mouse coordinate related to canvas 0,0 coord. -129 * @private -130 */ -131 mousePoint:null, -132 -133 /** -134 * previous mouse position cache. Needed for drag events. -135 * @private -136 */ -137 prevMousePoint:null, -138 -139 /** -140 * screen mouse coordinates. -141 * @private -142 */ -143 screenMousePoint:null, -144 -145 /** -146 * is the left mouse button pressed ?. -147 * Needed to handle dragging. -148 */ -149 isMouseDown:false, -150 -151 /** -152 * director's last actor receiving input. -153 * Needed to set capture for dragging events. -154 */ -155 lastSelectedActor:null, -156 -157 /** -158 * is input in drag mode ? -159 */ -160 dragging:false, -161 -162 // other attributes -163 -164 /** -165 * This director scene collection. -166 * @type {Array.<CAAT.Foundation.Scene>} -167 */ -168 scenes:null, -169 -170 /** -171 * The current Scene. This and only this will receive events. -172 */ -173 currentScene:null, -174 -175 /** -176 * The canvas the Director draws on. -177 * @private -178 */ -179 canvas:null, -180 -181 /** -182 * This director´s canvas rendering context. -183 */ -184 ctx:null, -185 -186 /** -187 * director time. -188 * @private -189 */ -190 time:0, -191 -192 /** -193 * global director timeline. -194 * @private -195 */ -196 timeline:0, -197 -198 /** -199 * An array of JSON elements of the form { id:string, image:Image } -200 */ -201 imagesCache:null, -202 -203 /** -204 * this director´s audio manager. -205 * @private -206 */ -207 audioManager:null, -208 -209 /** -210 * Clear screen strategy: -211 * CAAT.Foundation.Director.CLEAR_NONE : director won´t clear the background. -212 * CAAT.Foundation.Director.CLEAR_DIRTY_RECTS : clear only affected actors screen area. -213 * CAAT.Foundation.Director.CLEAR_ALL : clear the whole canvas object. -214 */ -215 clear: CAAT.Foundation.Director.CLEAR_ALL, -216 -217 /** -218 * if CAAT.CACHE_SCENE_ON_CHANGE is set, this scene will hold a cached copy of the exiting scene. -219 * @private -220 */ -221 transitionScene:null, -222 -223 /** -224 * Some browser related information. -225 */ -226 browserInfo:null, -227 -228 /** -229 * 3d context -230 * @private -231 */ -232 gl:null, -233 -234 /** -235 * is WebGL enabled as renderer ? -236 * @private -237 */ -238 glEnabled:false, -239 -240 /** -241 * if webGL is on, CAAT will texture pack all images transparently. -242 * @private -243 */ -244 glTextureManager:null, -245 -246 /** -247 * The only GLSL program for webGL -248 * @private -249 */ -250 glTtextureProgram:null, -251 glColorProgram:null, -252 -253 /** -254 * webGL projection matrix -255 * @private -256 */ -257 pMatrix:null, // projection matrix -258 -259 /** -260 * webGL vertex array -261 * @private -262 */ -263 coords:null, // Float32Array -264 -265 /** -266 * webGL vertex indices. -267 * @private -268 */ -269 coordsIndex:0, -270 -271 /** -272 * webGL uv texture indices -273 * @private -274 */ -275 uv:null, -276 uvIndex:0, -277 -278 /** -279 * draw tris front_to_back or back_to_front ? -280 * @private -281 */ -282 front_to_back:false, -283 -284 /** -285 * statistics object -286 */ -287 statistics:{ -288 size_total:0, -289 size_active:0, -290 size_dirtyRects:0, -291 draws:0, -292 size_discarded_by_dirty_rects:0 -293 }, -294 -295 /** -296 * webGL current texture page. This minimizes webGL context changes. -297 * @private -298 */ -299 currentTexturePage:0, -300 -301 /** -302 * webGL current shader opacity. -303 * BUGBUG: change this by vertex colors. -304 * @private -305 */ -306 currentOpacity:1, -307 -308 /** -309 * if CAAT.NO_RAF is set (no request animation frame), this value is the setInterval returned -310 * id. -311 * @private -312 */ -313 intervalId:null, -314 -315 /** -316 * Rendered frames counter. -317 */ -318 frameCounter:0, -319 -320 /** -321 * Window resize strategy. -322 * see CAAT.Foundation.Director.RESIZE_* constants. -323 * @private -324 */ -325 resize:1, -326 -327 /** -328 * Callback when the window is resized. -329 */ -330 onResizeCallback:null, -331 -332 /** -333 * Calculated gesture event scale. -334 * @private -335 */ -336 __gestureScale:0, -337 -338 /** -339 * Calculated gesture event rotation. -340 * @private -341 */ -342 __gestureRotation:0, -343 -344 /** -345 * Dirty rects cache. -346 * An array of CAAT.Math.Rectangle object. -347 * @private -348 */ -349 dirtyRects:null, // dirty rects cache. -350 -351 /** -352 * current dirty rects. -353 * @private -354 */ -355 cDirtyRects:null, // dirty rects cache. -356 -357 /** -358 * Currently used dirty rects. -359 * @private -360 */ -361 sDirtyRects:null, // scheduled dirty rects. -362 -363 /** -364 * Number of currently allocated dirty rects. -365 * @private -366 */ -367 dirtyRectsIndex:0, -368 -369 /** -370 * Dirty rects enabled ?? -371 * @private -372 */ -373 dirtyRectsEnabled:false, -374 -375 /** -376 * Number of dirty rects. -377 * @private -378 */ -379 nDirtyRects:0, -380 -381 /** -382 * Dirty rects count debug info. -383 * @private -384 */ -385 drDiscarded:0, // discarded by dirty rects. -386 -387 /** -388 * Is this director stopped ? -389 */ -390 stopped:false, // is stopped, this director will do nothing. -391 -392 /** -393 * currently unused. -394 * Intended to run caat in evented mode. -395 * @private -396 */ -397 needsRepaint:false, -398 -399 /** -400 * Touches information. Associate touch.id with an actor and original touch info. -401 * @private -402 */ -403 touches:null, -404 -405 /** -406 * Director´s timer manager. -407 * Each scene has a timerManager as well. -408 * The difference is the scope. Director´s timers will always be checked whereas scene´ timers -409 * will only be scheduled/checked when the scene is director´ current scene. -410 * @private -411 */ -412 timerManager:null, -413 -414 /** -415 * Retina display deicePixels/backingStorePixels ratio -416 * @private -417 */ -418 SCREEN_RATIO : 1, -419 -420 __map : null, -421 -422 clean:function () { -423 this.scenes = null; -424 this.currentScene = null; -425 this.imagesCache = null; -426 this.audioManager = null; -427 this.isMouseDown = false; -428 this.lastSelectedActor = null; -429 this.dragging = false; -430 this.__gestureScale = 0; -431 this.__gestureRotation = 0; -432 this.dirty = true; -433 this.dirtyRects = null; -434 this.cDirtyRects = null; -435 this.dirtyRectsIndex = 0; -436 this.dirtyRectsEnabled = false; -437 this.nDirtyRects = 0; -438 this.onResizeCallback = null; -439 this.__map= {}; -440 return this; -441 }, -442 -443 cancelPlay : function(id) { -444 return this.audioManager.cancelPlay(id); -445 }, -446 -447 cancelPlayByChannel : function(audioObject) { -448 return this.audioManager.cancelPlayByChannel(audioObject); -449 }, -450 -451 setValueForKey : function( key, value ) { -452 this.__map[key]= value; -453 return this; -454 }, -455 -456 getValueForKey : function( key ) { -457 return this.__map[key]; -458 return this; -459 }, -460 -461 createTimer:function (startTime, duration, callback_timeout, callback_tick, callback_cancel) { -462 return this.timerManager.createTimer(startTime, duration, callback_timeout, callback_tick, callback_cancel, this); -463 }, -464 -465 requestRepaint:function () { -466 this.needsRepaint = true; -467 }, -468 -469 getCurrentScene:function () { -470 return this.currentScene; -471 }, -472 -473 checkDebug:function () { -474 if (!navigator.isCocoonJS && CAAT.DEBUG) { -475 var dd = new CAAT.Module.Debug.Debug().initialize(this.width, 60); -476 this.debugInfo = dd.debugInfo.bind(dd); -477 } -478 }, -479 getRenderType:function () { -480 return this.glEnabled ? 'WEBGL' : 'CANVAS'; -481 }, -482 windowResized:function (w, h) { -483 var c = CAAT.Foundation.Director; -484 switch (this.resize) { -485 case c.RESIZE_WIDTH: -486 this.setBounds(0, 0, w, this.height); -487 break; -488 case c.RESIZE_HEIGHT: -489 this.setBounds(0, 0, this.width, h); -490 break; -491 case c.RESIZE_BOTH: -492 this.setBounds(0, 0, w, h); + 77 this.imagesCache= []; + 78 + 79 // input related variables initialization + 80 this.mousePoint = new CAAT.Math.Point(0, 0, 0); + 81 this.prevMousePoint = new CAAT.Math.Point(0, 0, 0); + 82 this.screenMousePoint = new CAAT.Math.Point(0, 0, 0); + 83 this.isMouseDown = false; + 84 this.lastSelectedActor = null; + 85 this.dragging = false; + 86 + 87 this.cDirtyRects = []; + 88 this.sDirtyRects = []; + 89 this.dirtyRects = []; + 90 for (var i = 0; i < 64; i++) { + 91 this.dirtyRects.push(new CAAT.Math.Rectangle()); + 92 } + 93 this.dirtyRectsIndex = 0; + 94 this.touches = {}; + 95 + 96 this.timerManager = new CAAT.Foundation.Timer.TimerManager(); + 97 this.__map= {}; + 98 + 99 return this; +100 }, +101 +102 /** +103 * flag indicating debug mode. It will draw affedted screen areas. +104 * @type {boolean} +105 */ +106 debug:false, +107 +108 /** +109 * Set CAAT render mode. Right now, this takes no effect. +110 */ +111 renderMode:CAAT.Foundation.Director.RENDER_MODE_CONTINUOUS, +112 +113 /** +114 * This method will be called before rendering any director scene. +115 * Use this method to calculate your physics for example. +116 * @private +117 */ +118 onRenderStart:null, +119 +120 /** +121 * This method will be called after rendering any director scene. +122 * Use this method to clean your physics forces for example. +123 * @private +124 */ +125 onRenderEnd:null, +126 +127 // input related attributes +128 /** +129 * mouse coordinate related to canvas 0,0 coord. +130 * @private +131 */ +132 mousePoint:null, +133 +134 /** +135 * previous mouse position cache. Needed for drag events. +136 * @private +137 */ +138 prevMousePoint:null, +139 +140 /** +141 * screen mouse coordinates. +142 * @private +143 */ +144 screenMousePoint:null, +145 +146 /** +147 * is the left mouse button pressed ?. +148 * Needed to handle dragging. +149 */ +150 isMouseDown:false, +151 +152 /** +153 * director's last actor receiving input. +154 * Needed to set capture for dragging events. +155 */ +156 lastSelectedActor:null, +157 +158 /** +159 * is input in drag mode ? +160 */ +161 dragging:false, +162 +163 // other attributes +164 +165 /** +166 * This director scene collection. +167 * @type {Array.<CAAT.Foundation.Scene>} +168 */ +169 scenes:null, +170 +171 /** +172 * The current Scene. This and only this will receive events. +173 */ +174 currentScene:null, +175 +176 /** +177 * The canvas the Director draws on. +178 * @private +179 */ +180 canvas:null, +181 +182 /** +183 * This director´s canvas rendering context. +184 */ +185 ctx:null, +186 +187 /** +188 * director time. +189 * @private +190 */ +191 time:0, +192 +193 /** +194 * global director timeline. +195 * @private +196 */ +197 timeline:0, +198 +199 /** +200 * An array of JSON elements of the form { id:string, image:Image } +201 */ +202 imagesCache:null, +203 +204 /** +205 * this director´s audio manager. +206 * @private +207 */ +208 audioManager:null, +209 +210 /** +211 * Clear screen strategy: +212 * CAAT.Foundation.Director.CLEAR_NONE : director won´t clear the background. +213 * CAAT.Foundation.Director.CLEAR_DIRTY_RECTS : clear only affected actors screen area. +214 * CAAT.Foundation.Director.CLEAR_ALL : clear the whole canvas object. +215 */ +216 clear: CAAT.Foundation.Director.CLEAR_ALL, +217 +218 /** +219 * if CAAT.CACHE_SCENE_ON_CHANGE is set, this scene will hold a cached copy of the exiting scene. +220 * @private +221 */ +222 transitionScene:null, +223 +224 /** +225 * Some browser related information. +226 */ +227 browserInfo:null, +228 +229 /** +230 * 3d context +231 * @private +232 */ +233 gl:null, +234 +235 /** +236 * is WebGL enabled as renderer ? +237 * @private +238 */ +239 glEnabled:false, +240 +241 /** +242 * if webGL is on, CAAT will texture pack all images transparently. +243 * @private +244 */ +245 glTextureManager:null, +246 +247 /** +248 * The only GLSL program for webGL +249 * @private +250 */ +251 glTtextureProgram:null, +252 glColorProgram:null, +253 +254 /** +255 * webGL projection matrix +256 * @private +257 */ +258 pMatrix:null, // projection matrix +259 +260 /** +261 * webGL vertex array +262 * @private +263 */ +264 coords:null, // Float32Array +265 +266 /** +267 * webGL vertex indices. +268 * @private +269 */ +270 coordsIndex:0, +271 +272 /** +273 * webGL uv texture indices +274 * @private +275 */ +276 uv:null, +277 uvIndex:0, +278 +279 /** +280 * draw tris front_to_back or back_to_front ? +281 * @private +282 */ +283 front_to_back:false, +284 +285 /** +286 * statistics object +287 */ +288 statistics:{ +289 size_total:0, +290 size_active:0, +291 size_dirtyRects:0, +292 draws:0, +293 size_discarded_by_dirty_rects:0 +294 }, +295 +296 /** +297 * webGL current texture page. This minimizes webGL context changes. +298 * @private +299 */ +300 currentTexturePage:0, +301 +302 /** +303 * webGL current shader opacity. +304 * BUGBUG: change this by vertex colors. +305 * @private +306 */ +307 currentOpacity:1, +308 +309 /** +310 * if CAAT.NO_RAF is set (no request animation frame), this value is the setInterval returned +311 * id. +312 * @private +313 */ +314 intervalId:null, +315 +316 /** +317 * Rendered frames counter. +318 */ +319 frameCounter:0, +320 +321 /** +322 * Window resize strategy. +323 * see CAAT.Foundation.Director.RESIZE_* constants. +324 * @private +325 */ +326 resize:1, +327 +328 /** +329 * Callback when the window is resized. +330 */ +331 onResizeCallback:null, +332 +333 /** +334 * Calculated gesture event scale. +335 * @private +336 */ +337 __gestureScale:0, +338 +339 /** +340 * Calculated gesture event rotation. +341 * @private +342 */ +343 __gestureRotation:0, +344 +345 /** +346 * Dirty rects cache. +347 * An array of CAAT.Math.Rectangle object. +348 * @private +349 */ +350 dirtyRects:null, // dirty rects cache. +351 +352 /** +353 * current dirty rects. +354 * @private +355 */ +356 cDirtyRects:null, // dirty rects cache. +357 +358 /** +359 * Currently used dirty rects. +360 * @private +361 */ +362 sDirtyRects:null, // scheduled dirty rects. +363 +364 /** +365 * Number of currently allocated dirty rects. +366 * @private +367 */ +368 dirtyRectsIndex:0, +369 +370 /** +371 * Dirty rects enabled ?? +372 * @private +373 */ +374 dirtyRectsEnabled:false, +375 +376 /** +377 * Number of dirty rects. +378 * @private +379 */ +380 nDirtyRects:0, +381 +382 /** +383 * Dirty rects count debug info. +384 * @private +385 */ +386 drDiscarded:0, // discarded by dirty rects. +387 +388 /** +389 * Is this director stopped ? +390 */ +391 stopped:false, // is stopped, this director will do nothing. +392 +393 /** +394 * currently unused. +395 * Intended to run caat in evented mode. +396 * @private +397 */ +398 needsRepaint:false, +399 +400 /** +401 * Touches information. Associate touch.id with an actor and original touch info. +402 * @private +403 */ +404 touches:null, +405 +406 /** +407 * Director´s timer manager. +408 * Each scene has a timerManager as well. +409 * The difference is the scope. Director´s timers will always be checked whereas scene´ timers +410 * will only be scheduled/checked when the scene is director´ current scene. +411 * @private +412 */ +413 timerManager:null, +414 +415 /** +416 * Retina display deicePixels/backingStorePixels ratio +417 * @private +418 */ +419 SCREEN_RATIO : 1, +420 +421 __map : null, +422 +423 clean:function () { +424 this.scenes = null; +425 this.currentScene = null; +426 this.imagesCache = null; +427 this.audioManager = null; +428 this.isMouseDown = false; +429 this.lastSelectedActor = null; +430 this.dragging = false; +431 this.__gestureScale = 0; +432 this.__gestureRotation = 0; +433 this.dirty = true; +434 this.dirtyRects = null; +435 this.cDirtyRects = null; +436 this.dirtyRectsIndex = 0; +437 this.dirtyRectsEnabled = false; +438 this.nDirtyRects = 0; +439 this.onResizeCallback = null; +440 this.__map= {}; +441 return this; +442 }, +443 +444 cancelPlay : function(id) { +445 return this.audioManager.cancelPlay(id); +446 }, +447 +448 cancelPlayByChannel : function(audioObject) { +449 return this.audioManager.cancelPlayByChannel(audioObject); +450 }, +451 +452 setAudioFormatExtensions : function( extensions ) { +453 this.audioManager.setAudioFormatExtensions(extensions); +454 return this; +455 }, +456 +457 setValueForKey : function( key, value ) { +458 this.__map[key]= value; +459 return this; +460 }, +461 +462 getValueForKey : function( key ) { +463 return this.__map[key]; +464 return this; +465 }, +466 +467 createTimer:function (startTime, duration, callback_timeout, callback_tick, callback_cancel) { +468 return this.timerManager.createTimer(startTime, duration, callback_timeout, callback_tick, callback_cancel, this); +469 }, +470 +471 requestRepaint:function () { +472 this.needsRepaint = true; +473 }, +474 +475 getCurrentScene:function () { +476 return this.currentScene; +477 }, +478 +479 checkDebug:function () { +480 if (!navigator.isCocoonJS && CAAT.DEBUG) { +481 var dd = new CAAT.Module.Debug.Debug().initialize(this.width, 60); +482 this.debugInfo = dd.debugInfo.bind(dd); +483 } +484 }, +485 getRenderType:function () { +486 return this.glEnabled ? 'WEBGL' : 'CANVAS'; +487 }, +488 windowResized:function (w, h) { +489 var c = CAAT.Foundation.Director; +490 switch (this.resize) { +491 case c.RESIZE_WIDTH: +492 this.setBounds(0, 0, w, this.height); 493 break; -494 case c.RESIZE_PROPORTIONAL: -495 this.setScaleProportional(w, h); +494 case c.RESIZE_HEIGHT: +495 this.setBounds(0, 0, this.width, h); 496 break; -497 } -498 -499 if (this.glEnabled) { -500 this.glReset(); -501 } -502 -503 if (this.onResizeCallback) { -504 this.onResizeCallback(this, w, h); -505 } -506 -507 }, -508 setScaleProportional:function (w, h) { -509 -510 var factor = Math.min(w / this.referenceWidth, h / this.referenceHeight); -511 -512 this.canvas.width = this.referenceWidth * factor; -513 this.canvas.height = this.referenceHeight * factor; -514 this.ctx = this.canvas.getContext(this.glEnabled ? 'experimental-webgl' : '2d'); +497 case c.RESIZE_BOTH: +498 this.setBounds(0, 0, w, h); +499 break; +500 case c.RESIZE_PROPORTIONAL: +501 this.setScaleProportional(w, h); +502 break; +503 } +504 +505 if (this.glEnabled) { +506 this.glReset(); +507 } +508 +509 if (this.onResizeCallback) { +510 this.onResizeCallback(this, w, h); +511 } +512 +513 }, +514 setScaleProportional:function (w, h) { 515 -516 this.__setupRetina(); +516 var factor = Math.min(w / this.referenceWidth, h / this.referenceHeight); 517 -518 this.setScaleAnchored(factor * this.scaleX, factor * this.scaleY, 0, 0); -519 // this.setScaleAnchored(factor, factor, 0, 0); -520 -521 if (this.glEnabled) { -522 this.glReset(); -523 } -524 }, -525 /** -526 * Enable window resize events and set redimension policy. A callback functio could be supplied -527 * to be notified on a Director redimension event. This is necessary in the case you set a redim -528 * policy not equal to RESIZE_PROPORTIONAL. In those redimension modes, director's area and their -529 * children scenes are resized to fit the new area. But scenes content is not resized, and have -530 * no option of knowing so uless an onResizeCallback function is supplied. -531 * -532 * @param mode {number} RESIZE_BOTH, RESIZE_WIDTH, RESIZE_HEIGHT, RESIZE_NONE. -533 * @param onResizeCallback {function(director{CAAT.Director}, width{integer}, height{integer})} a callback -534 * to notify on canvas resize. -535 */ -536 enableResizeEvents:function (mode, onResizeCallback) { -537 var dd= CAAT.Foundation.Director; -538 if (mode === dd.RESIZE_BOTH || mode === dd.RESIZE_WIDTH || mode === dd.RESIZE_HEIGHT || mode === dd.RESIZE_PROPORTIONAL) { -539 this.referenceWidth = this.width; -540 this.referenceHeight = this.height; -541 this.resize = mode; -542 CAAT.registerResizeListener(this); -543 this.onResizeCallback = onResizeCallback; -544 this.windowResized(window.innerWidth, window.innerHeight); -545 } else { -546 CAAT.unregisterResizeListener(this); -547 this.onResizeCallback = null; -548 } -549 -550 return this; -551 }, -552 -553 __setupRetina : function() { -554 -555 if ( CAAT.RETINA_DISPLAY_ENABLED ) { -556 -557 // The world is full of opensource awesomeness. -558 // -559 // Source: http://www.html5rocks.com/en/tutorials/canvas/hidpi/ -560 // -561 var devicePixelRatio= CAAT.Module.Runtime.BrowserInfo.DevicePixelRatio; -562 var backingStoreRatio = this.ctx.webkitBackingStorePixelRatio || -563 this.ctx.mozBackingStorePixelRatio || -564 this.ctx.msBackingStorePixelRatio || -565 this.ctx.oBackingStorePixelRatio || -566 this.ctx.backingStorePixelRatio || -567 1; -568 -569 var ratio = devicePixelRatio / backingStoreRatio; -570 -571 if (devicePixelRatio !== backingStoreRatio) { -572 -573 var oldWidth = this.canvas.width; -574 var oldHeight = this.canvas.height; -575 -576 this.canvas.width = oldWidth * ratio; -577 this.canvas.height = oldHeight * ratio; +518 this.canvas.width = this.referenceWidth * factor; +519 this.canvas.height = this.referenceHeight * factor; +520 this.ctx = this.canvas.getContext(this.glEnabled ? 'experimental-webgl' : '2d'); +521 +522 this.__setupRetina(); +523 +524 this.setScaleAnchored(factor * this.scaleX, factor * this.scaleY, 0, 0); +525 // this.setScaleAnchored(factor, factor, 0, 0); +526 +527 if (this.glEnabled) { +528 this.glReset(); +529 } +530 }, +531 /** +532 * Enable window resize events and set redimension policy. A callback functio could be supplied +533 * to be notified on a Director redimension event. This is necessary in the case you set a redim +534 * policy not equal to RESIZE_PROPORTIONAL. In those redimension modes, director's area and their +535 * children scenes are resized to fit the new area. But scenes content is not resized, and have +536 * no option of knowing so uless an onResizeCallback function is supplied. +537 * +538 * @param mode {number} RESIZE_BOTH, RESIZE_WIDTH, RESIZE_HEIGHT, RESIZE_NONE. +539 * @param onResizeCallback {function(director{CAAT.Director}, width{integer}, height{integer})} a callback +540 * to notify on canvas resize. +541 */ +542 enableResizeEvents:function (mode, onResizeCallback) { +543 var dd= CAAT.Foundation.Director; +544 if (mode === dd.RESIZE_BOTH || mode === dd.RESIZE_WIDTH || mode === dd.RESIZE_HEIGHT || mode === dd.RESIZE_PROPORTIONAL) { +545 this.referenceWidth = this.width; +546 this.referenceHeight = this.height; +547 this.resize = mode; +548 CAAT.registerResizeListener(this); +549 this.onResizeCallback = onResizeCallback; +550 this.windowResized(window.innerWidth, window.innerHeight); +551 } else { +552 CAAT.unregisterResizeListener(this); +553 this.onResizeCallback = null; +554 } +555 +556 return this; +557 }, +558 +559 __setupRetina : function() { +560 +561 if ( CAAT.RETINA_DISPLAY_ENABLED ) { +562 +563 // The world is full of opensource awesomeness. +564 // +565 // Source: http://www.html5rocks.com/en/tutorials/canvas/hidpi/ +566 // +567 var devicePixelRatio= CAAT.Module.Runtime.BrowserInfo.DevicePixelRatio; +568 var backingStoreRatio = this.ctx.webkitBackingStorePixelRatio || +569 this.ctx.mozBackingStorePixelRatio || +570 this.ctx.msBackingStorePixelRatio || +571 this.ctx.oBackingStorePixelRatio || +572 this.ctx.backingStorePixelRatio || +573 1; +574 +575 var ratio = devicePixelRatio / backingStoreRatio; +576 +577 if (devicePixelRatio !== backingStoreRatio) { 578 -579 this.canvas.style.width = oldWidth + 'px'; -580 this.canvas.style.height = oldHeight + 'px'; +579 var oldWidth = this.canvas.width; +580 var oldHeight = this.canvas.height; 581 -582 this.setScaleAnchored( ratio, ratio, 0, 0 ); -583 } else { -584 this.setScaleAnchored( 1, 1, 0, 0 ); -585 } -586 -587 this.SCREEN_RATIO= ratio; -588 } else { -589 this.setScaleAnchored( 1, 1, 0, 0 ); -590 } -591 -592 for (var i = 0; i < this.scenes.length; i++) { -593 this.scenes[i].setBounds(0, 0, this.width, this.height); -594 } -595 }, -596 -597 /** -598 * Set this director's bounds as well as its contained scenes. -599 * @param x {number} ignored, will be 0. -600 * @param y {number} ignored, will be 0. -601 * @param w {number} director width. -602 * @param h {number} director height. -603 * -604 * @return this -605 */ -606 setBounds:function (x, y, w, h) { -607 -608 CAAT.Foundation.Director.superclass.setBounds.call(this, x, y, w, h); -609 -610 if ( this.canvas.width!==w ) { -611 this.canvas.width = w; -612 } +582 this.canvas.width = oldWidth * ratio; +583 this.canvas.height = oldHeight * ratio; +584 +585 this.canvas.style.width = oldWidth + 'px'; +586 this.canvas.style.height = oldHeight + 'px'; +587 +588 this.setScaleAnchored( ratio, ratio, 0, 0 ); +589 } else { +590 this.setScaleAnchored( 1, 1, 0, 0 ); +591 } +592 +593 this.SCREEN_RATIO= ratio; +594 } else { +595 this.setScaleAnchored( 1, 1, 0, 0 ); +596 } +597 +598 for (var i = 0; i < this.scenes.length; i++) { +599 this.scenes[i].setBounds(0, 0, this.width, this.height); +600 } +601 }, +602 +603 /** +604 * Set this director's bounds as well as its contained scenes. +605 * @param x {number} ignored, will be 0. +606 * @param y {number} ignored, will be 0. +607 * @param w {number} director width. +608 * @param h {number} director height. +609 * +610 * @return this +611 */ +612 setBounds:function (x, y, w, h) { 613 -614 if ( this.canvas.height!==h ) { -615 this.canvas.height = h; -616 } -617 -618 this.ctx = this.canvas.getContext(this.glEnabled ? 'experimental-webgl' : '2d'); +614 CAAT.Foundation.Director.superclass.setBounds.call(this, x, y, w, h); +615 +616 if ( this.canvas.width!==w ) { +617 this.canvas.width = w; +618 } 619 -620 this.__setupRetina(); -621 -622 if (this.glEnabled) { -623 this.glReset(); -624 } +620 if ( this.canvas.height!==h ) { +621 this.canvas.height = h; +622 } +623 +624 this.ctx = this.canvas.getContext(this.glEnabled ? 'experimental-webgl' : '2d'); 625 -626 return this; -627 }, -628 /** -629 * This method performs Director initialization. Must be called once. -630 * If the canvas parameter is not set, it will create a Canvas itself, -631 * and the developer must explicitly add the canvas to the desired DOM position. -632 * This method will also set the Canvas dimension to the specified values -633 * by width and height parameters. -634 * -635 * @param width {number} a canvas width -636 * @param height {number} a canvas height -637 * @param canvas {HTMLCanvasElement=} An optional Canvas object. -638 * @param proxy {HTMLElement} this object can be an event proxy in case you'd like to layer different elements -639 * and want events delivered to the correct element. +626 this.__setupRetina(); +627 +628 if (this.glEnabled) { +629 this.glReset(); +630 } +631 +632 return this; +633 }, +634 /** +635 * This method performs Director initialization. Must be called once. +636 * If the canvas parameter is not set, it will create a Canvas itself, +637 * and the developer must explicitly add the canvas to the desired DOM position. +638 * This method will also set the Canvas dimension to the specified values +639 * by width and height parameters. 640 * -641 * @return this -642 */ -643 initialize:function (width, height, canvas, proxy) { -644 if ( typeof canvas!=="undefined" ) { -645 if ( isString(canvas) ) { -646 canvas= document.getElementById(canvas); -647 } else if ( !(canvas instanceof HTMLCanvasElement ) ) { -648 console.log("Canvas is a: "+canvas+" ???"); -649 } -650 } -651 -652 if (!canvas) { -653 canvas = document.createElement('canvas'); -654 document.body.appendChild(canvas); -655 } -656 -657 this.canvas = canvas; -658 -659 if (typeof proxy === 'undefined') { -660 proxy = canvas; +641 * @param width {number} a canvas width +642 * @param height {number} a canvas height +643 * @param canvas {HTMLCanvasElement=} An optional Canvas object. +644 * @param proxy {HTMLElement} this object can be an event proxy in case you'd like to layer different elements +645 * and want events delivered to the correct element. +646 * +647 * @return this +648 */ +649 initialize:function (width, height, canvas, proxy) { +650 if ( typeof canvas!=="undefined" ) { +651 if ( isString(canvas) ) { +652 canvas= document.getElementById(canvas); +653 } else if ( !(canvas instanceof HTMLCanvasElement ) ) { +654 console.log("Canvas is a: "+canvas+" ???"); +655 } +656 } +657 +658 if (!canvas) { +659 canvas = document.createElement('canvas'); +660 document.body.appendChild(canvas); 661 } 662 -663 this.setBounds(0, 0, width, height); -664 this.enableEvents(proxy); -665 -666 this.timeline = new Date().getTime(); -667 -668 // transition scene -669 if (CAAT.CACHE_SCENE_ON_CHANGE) { -670 this.transitionScene = new CAAT.Foundation.Scene().setBounds(0, 0, width, height); -671 var transitionCanvas = document.createElement('canvas'); -672 transitionCanvas.width = width; -673 transitionCanvas.height = height; -674 var transitionImageActor = new CAAT.Foundation.Actor().setBackgroundImage(transitionCanvas); -675 this.transitionScene.ctx = transitionCanvas.getContext('2d'); -676 this.transitionScene.addChildImmediately(transitionImageActor); -677 this.transitionScene.setEaseListener(this); -678 } -679 -680 this.checkDebug(); -681 -682 return this; -683 }, -684 glReset:function () { -685 this.pMatrix = CAAT.WebGL.GLU.makeOrtho(0, this.referenceWidth, this.referenceHeight, 0, -1, 1); -686 this.gl.viewport(0, 0, this.canvas.width, this.canvas.height); -687 this.glColorProgram.setMatrixUniform(this.pMatrix); -688 this.glTextureProgram.setMatrixUniform(this.pMatrix); -689 this.gl.viewportWidth = this.canvas.width; -690 this.gl.viewportHeight = this.canvas.height; -691 }, -692 /** -693 * Experimental. -694 * Initialize a gl enabled director. -695 */ -696 initializeGL:function (width, height, canvas, proxy) { -697 -698 if (!canvas) { -699 canvas = document.createElement('canvas'); -700 document.body.appendChild(canvas); -701 } -702 -703 canvas.width = width; -704 canvas.height = height; -705 -706 if (typeof proxy === 'undefined') { -707 proxy = canvas; -708 } -709 -710 this.referenceWidth = width; -711 this.referenceHeight = height; -712 -713 var i; -714 -715 try { -716 this.gl = canvas.getContext("experimental-webgl"/*, {antialias: false}*/); -717 this.gl.viewportWidth = width; -718 this.gl.viewportHeight = height; -719 CAAT.GLRENDER = true; -720 } catch (e) { -721 } -722 -723 if (this.gl) { -724 this.canvas = canvas; -725 this.setBounds(0, 0, width, height); -726 -727 this.enableEvents(canvas); -728 this.timeline = new Date().getTime(); -729 -730 this.glColorProgram = new CAAT.WebGL.ColorProgram(this.gl).create().initialize(); -731 this.glTextureProgram = new CAAT.WebGL.TextureProgram(this.gl).create().initialize(); -732 this.glTextureProgram.useProgram(); -733 this.glReset(); -734 -735 var maxTris = 512; -736 this.coords = new Float32Array(maxTris * 12); -737 this.uv = new Float32Array(maxTris * 8); -738 -739 this.gl.clearColor(0.0, 0.0, 0.0, 255); +663 this.canvas = canvas; +664 +665 if (typeof proxy === 'undefined') { +666 proxy = canvas; +667 } +668 +669 this.setBounds(0, 0, width, height); +670 this.enableEvents(proxy); +671 +672 this.timeline = new Date().getTime(); +673 +674 // transition scene +675 if (CAAT.CACHE_SCENE_ON_CHANGE) { +676 this.transitionScene = new CAAT.Foundation.Scene().setBounds(0, 0, width, height); +677 var transitionCanvas = document.createElement('canvas'); +678 transitionCanvas.width = width; +679 transitionCanvas.height = height; +680 var transitionImageActor = new CAAT.Foundation.Actor().setBackgroundImage(transitionCanvas); +681 this.transitionScene.ctx = transitionCanvas.getContext('2d'); +682 this.transitionScene.addChildImmediately(transitionImageActor); +683 this.transitionScene.setEaseListener(this); +684 } +685 +686 this.checkDebug(); +687 +688 return this; +689 }, +690 glReset:function () { +691 this.pMatrix = CAAT.WebGL.GLU.makeOrtho(0, this.referenceWidth, this.referenceHeight, 0, -1, 1); +692 this.gl.viewport(0, 0, this.canvas.width, this.canvas.height); +693 this.glColorProgram.setMatrixUniform(this.pMatrix); +694 this.glTextureProgram.setMatrixUniform(this.pMatrix); +695 this.gl.viewportWidth = this.canvas.width; +696 this.gl.viewportHeight = this.canvas.height; +697 }, +698 /** +699 * Experimental. +700 * Initialize a gl enabled director. +701 */ +702 initializeGL:function (width, height, canvas, proxy) { +703 +704 if (!canvas) { +705 canvas = document.createElement('canvas'); +706 document.body.appendChild(canvas); +707 } +708 +709 canvas.width = width; +710 canvas.height = height; +711 +712 if (typeof proxy === 'undefined') { +713 proxy = canvas; +714 } +715 +716 this.referenceWidth = width; +717 this.referenceHeight = height; +718 +719 var i; +720 +721 try { +722 this.gl = canvas.getContext("experimental-webgl"/*, {antialias: false}*/); +723 this.gl.viewportWidth = width; +724 this.gl.viewportHeight = height; +725 CAAT.GLRENDER = true; +726 } catch (e) { +727 } +728 +729 if (this.gl) { +730 this.canvas = canvas; +731 this.setBounds(0, 0, width, height); +732 +733 this.enableEvents(canvas); +734 this.timeline = new Date().getTime(); +735 +736 this.glColorProgram = new CAAT.WebGL.ColorProgram(this.gl).create().initialize(); +737 this.glTextureProgram = new CAAT.WebGL.TextureProgram(this.gl).create().initialize(); +738 this.glTextureProgram.useProgram(); +739 this.glReset(); 740 -741 if (this.front_to_back) { -742 this.gl.clearDepth(1.0); -743 this.gl.enable(this.gl.DEPTH_TEST); -744 this.gl.depthFunc(this.gl.LESS); -745 } else { -746 this.gl.disable(this.gl.DEPTH_TEST); -747 } -748 -749 this.gl.enable(this.gl.BLEND); -750 // Fix FF this.gl.blendFunc(this.gl.SRC_ALPHA, this.gl.ONE_MINUS_SRC_ALPHA); -751 this.gl.blendFunc(this.gl.ONE, this.gl.ONE_MINUS_SRC_ALPHA); -752 this.glEnabled = true; -753 -754 this.checkDebug(); -755 } else { -756 // fallback to non gl enabled canvas. -757 return this.initialize(width, height, canvas); -758 } +741 var maxTris = 512; +742 this.coords = new Float32Array(maxTris * 12); +743 this.uv = new Float32Array(maxTris * 8); +744 +745 this.gl.clearColor(0.0, 0.0, 0.0, 255); +746 +747 if (this.front_to_back) { +748 this.gl.clearDepth(1.0); +749 this.gl.enable(this.gl.DEPTH_TEST); +750 this.gl.depthFunc(this.gl.LESS); +751 } else { +752 this.gl.disable(this.gl.DEPTH_TEST); +753 } +754 +755 this.gl.enable(this.gl.BLEND); +756 // Fix FF this.gl.blendFunc(this.gl.SRC_ALPHA, this.gl.ONE_MINUS_SRC_ALPHA); +757 this.gl.blendFunc(this.gl.ONE, this.gl.ONE_MINUS_SRC_ALPHA); +758 this.glEnabled = true; 759 -760 return this; -761 }, -762 /** -763 * Creates an initializes a Scene object. -764 * @return {CAAT.Scene} -765 */ -766 createScene:function () { -767 var scene = new CAAT.Scene(); -768 this.addScene(scene); -769 return scene; -770 }, -771 setImagesCache:function (imagesCache, tpW, tpH) { -772 -773 var i; -774 -775 if (null !== this.glTextureManager) { -776 this.glTextureManager.deletePages(); -777 this.glTextureManager = null; -778 } -779 -780 // delete previous image identifiers -781 if (this.imagesCache) { -782 var ids = []; -783 for (i = 0; i < this.imagesCache.length; i++) { -784 ids.push(this.imagesCache[i].id); -785 } -786 -787 for (i = 0; i < ids.length; i++) { -788 delete this.imagesCache[ ids[i] ]; -789 } -790 } -791 -792 this.imagesCache = imagesCache; -793 -794 if (imagesCache) { -795 for (i = 0; i < imagesCache.length; i++) { -796 this.imagesCache[ imagesCache[i].id ] = imagesCache[i].image; -797 } -798 } -799 -800 this.tpW = tpW || 2048; -801 this.tpH = tpH || 2048; -802 -803 this.updateGLPages(); -804 -805 return this; -806 }, -807 updateGLPages:function () { -808 if (this.glEnabled) { +760 this.checkDebug(); +761 } else { +762 // fallback to non gl enabled canvas. +763 return this.initialize(width, height, canvas); +764 } +765 +766 return this; +767 }, +768 /** +769 * Creates an initializes a Scene object. +770 * @return {CAAT.Scene} +771 */ +772 createScene:function () { +773 var scene = new CAAT.Scene(); +774 this.addScene(scene); +775 return scene; +776 }, +777 setImagesCache:function (imagesCache, tpW, tpH) { +778 +779 if (!imagesCache || !imagesCache.length ) { +780 return this; +781 } +782 +783 var i; +784 +785 if (null !== this.glTextureManager) { +786 this.glTextureManager.deletePages(); +787 this.glTextureManager = null; +788 } +789 +790 // delete previous image identifiers +791 if (this.imagesCache) { +792 var ids = []; +793 for (i = 0; i < this.imagesCache.length; i++) { +794 ids.push(this.imagesCache[i].id); +795 } +796 +797 for (i = 0; i < ids.length; i++) { +798 delete this.imagesCache[ ids[i] ]; +799 } +800 } +801 +802 this.imagesCache = imagesCache; +803 +804 if (imagesCache) { +805 for (i = 0; i < imagesCache.length; i++) { +806 this.imagesCache[ imagesCache[i].id ] = imagesCache[i].image; +807 } +808 } 809 -810 this.glTextureManager = new CAAT.Module.TexturePacker.TexturePageManager(); -811 this.glTextureManager.createPages(this.gl, this.tpW, this.tpH, this.imagesCache); +810 this.tpW = tpW || 2048; +811 this.tpH = tpH || 2048; 812 -813 this.currentTexturePage = this.glTextureManager.pages[0]; -814 this.glTextureProgram.setTexture(this.currentTexturePage.texture); -815 } +813 this.updateGLPages(); +814 +815 return this; 816 }, -817 setGLTexturePage:function (tp) { -818 this.currentTexturePage = tp; -819 this.glTextureProgram.setTexture(tp.texture); -820 return this; -821 }, -822 /** -823 * Add a new image to director's image cache. If gl is enabled and the 'noUpdateGL' is not set to true this -824 * function will try to recreate the whole GL texture pages. -825 * If many handcrafted images are to be added to the director, some performance can be achieved by calling -826 * <code>director.addImage(id,image,false)</code> many times and a final call with -827 * <code>director.addImage(id,image,true)</code> to finally command the director to create texture pages. -828 * -829 * @param id {string|object} an identitifier to retrieve the image with -830 * @param image {Image|HTMLCanvasElement} image to add to cache -831 * @param noUpdateGL {!boolean} unless otherwise stated, the director will -832 * try to recreate the texture pages. -833 */ -834 addImage:function (id, image, noUpdateGL) { -835 if (this.getImage(id)) { -836 for (var i = 0; i < this.imagesCache.length; i++) { -837 if (this.imagesCache[i].id === id) { -838 this.imagesCache[i].image = image; -839 break; -840 } -841 } -842 this.imagesCache[ id ] = image; -843 } else { -844 this.imagesCache.push({ id:id, image:image }); -845 this.imagesCache[id] = image; -846 } -847 -848 if (!!!noUpdateGL) { -849 this.updateGLPages(); -850 } -851 }, -852 deleteImage:function (id, noUpdateGL) { -853 for (var i = 0; i < this.imagesCache.length; i++) { -854 if (this.imagesCache[i].id === id) { -855 delete this.imagesCache[id]; -856 this.imagesCache.splice(i, 1); -857 break; -858 } -859 } -860 if (!!!noUpdateGL) { -861 this.updateGLPages(); -862 } -863 }, -864 setGLCurrentOpacity:function (opacity) { -865 this.currentOpacity = opacity; -866 this.glTextureProgram.setAlpha(opacity); -867 }, -868 /** -869 * Render buffered elements. -870 * @param vertex -871 * @param coordsIndex -872 * @param uv -873 */ -874 glRender:function (vertex, coordsIndex, uv) { -875 -876 vertex = vertex || this.coords; -877 uv = uv || this.uv; -878 coordsIndex = coordsIndex || this.coordsIndex; -879 -880 var gl = this.gl; -881 -882 var numTris = coordsIndex / 12 * 2; -883 var numVertices = coordsIndex / 3; -884 -885 this.glTextureProgram.updateVertexBuffer(vertex); -886 this.glTextureProgram.updateUVBuffer(uv); -887 -888 gl.drawElements(gl.TRIANGLES, 3 * numTris, gl.UNSIGNED_SHORT, 0); -889 -890 }, -891 glFlush:function () { -892 if (this.coordsIndex !== 0) { -893 this.glRender(this.coords, this.coordsIndex, this.uv); -894 } -895 this.coordsIndex = 0; -896 this.uvIndex = 0; -897 -898 this.statistics.draws++; -899 }, +817 updateGLPages:function () { +818 if (this.glEnabled) { +819 +820 this.glTextureManager = new CAAT.Module.TexturePacker.TexturePageManager(); +821 this.glTextureManager.createPages(this.gl, this.tpW, this.tpH, this.imagesCache); +822 +823 this.currentTexturePage = this.glTextureManager.pages[0]; +824 this.glTextureProgram.setTexture(this.currentTexturePage.texture); +825 } +826 }, +827 setGLTexturePage:function (tp) { +828 this.currentTexturePage = tp; +829 this.glTextureProgram.setTexture(tp.texture); +830 return this; +831 }, +832 /** +833 * Add a new image to director's image cache. If gl is enabled and the 'noUpdateGL' is not set to true this +834 * function will try to recreate the whole GL texture pages. +835 * If many handcrafted images are to be added to the director, some performance can be achieved by calling +836 * <code>director.addImage(id,image,false)</code> many times and a final call with +837 * <code>director.addImage(id,image,true)</code> to finally command the director to create texture pages. +838 * +839 * @param id {string|object} an identitifier to retrieve the image with +840 * @param image {Image|HTMLCanvasElement} image to add to cache +841 * @param noUpdateGL {!boolean} unless otherwise stated, the director will +842 * try to recreate the texture pages. +843 */ +844 addImage:function (id, image, noUpdateGL) { +845 if (this.getImage(id)) { +846 // for (var i = 0; i < this.imagesCache.length; i++) { +847 for( var i in this.imagesCache ) { +848 if (this.imagesCache[i].id === id) { +849 this.imagesCache[i].image = image; +850 break; +851 } +852 } +853 this.imagesCache[ id ] = image; +854 } else { +855 this.imagesCache.push({ id:id, image:image }); +856 this.imagesCache[id] = image; +857 } +858 +859 if (!!!noUpdateGL) { +860 this.updateGLPages(); +861 } +862 }, +863 deleteImage:function (id, noUpdateGL) { +864 for (var i = 0; i < this.imagesCache.length; i++) { +865 if (this.imagesCache[i].id === id) { +866 delete this.imagesCache[id]; +867 this.imagesCache.splice(i, 1); +868 break; +869 } +870 } +871 if (!!!noUpdateGL) { +872 this.updateGLPages(); +873 } +874 }, +875 setGLCurrentOpacity:function (opacity) { +876 this.currentOpacity = opacity; +877 this.glTextureProgram.setAlpha(opacity); +878 }, +879 /** +880 * Render buffered elements. +881 * @param vertex +882 * @param coordsIndex +883 * @param uv +884 */ +885 glRender:function (vertex, coordsIndex, uv) { +886 +887 vertex = vertex || this.coords; +888 uv = uv || this.uv; +889 coordsIndex = coordsIndex || this.coordsIndex; +890 +891 var gl = this.gl; +892 +893 var numTris = coordsIndex / 12 * 2; +894 var numVertices = coordsIndex / 3; +895 +896 this.glTextureProgram.updateVertexBuffer(vertex); +897 this.glTextureProgram.updateUVBuffer(uv); +898 +899 gl.drawElements(gl.TRIANGLES, 3 * numTris, gl.UNSIGNED_SHORT, 0); 900 -901 findActorAtPosition:function (point) { -902 -903 // z-order -904 var cl = this.childrenList; -905 for (var i = cl.length - 1; i >= 0; i--) { -906 var child = this.childrenList[i]; -907 -908 var np = new CAAT.Math.Point(point.x, point.y, 0); -909 var contained = child.findActorAtPosition(np); -910 if (null !== contained) { -911 return contained; -912 } -913 } -914 -915 return this; -916 }, -917 -918 /** -919 * -920 * Reset statistics information. -921 * -922 * @private -923 */ -924 resetStats:function () { -925 this.statistics.size_total = 0; -926 this.statistics.size_active = 0; -927 this.statistics.draws = 0; -928 this.statistics.size_discarded_by_dirty_rects = 0; -929 }, -930 -931 /** -932 * This is the entry point for the animation system of the Director. -933 * The director is fed with the elapsed time value to maintain a virtual timeline. -934 * This virtual timeline will provide each Scene with its own virtual timeline, and will only -935 * feed time when the Scene is the current Scene, or is being switched. -936 * -937 * If dirty rectangles are enabled and canvas is used for rendering, the dirty rectangles will be -938 * set up as a single clip area. -939 * -940 * @param time {number} integer indicating the elapsed time between two consecutive frames of the -941 * Director. -942 */ -943 render:function (time) { -944 -945 if (this.currentScene && this.currentScene.isPaused()) { -946 return; -947 } -948 -949 this.time += time; -950 -951 for (i = 0, l = this.childrenList.length; i < l; i++) { -952 var c = this.childrenList[i]; -953 if (c.isInAnimationFrame(this.time) && !c.isPaused()) { -954 var tt = c.time - c.start_time; -955 c.timerManager.checkTimers(tt); -956 c.timerManager.removeExpiredTimers(); -957 } +901 }, +902 glFlush:function () { +903 if (this.coordsIndex !== 0) { +904 this.glRender(this.coords, this.coordsIndex, this.uv); +905 } +906 this.coordsIndex = 0; +907 this.uvIndex = 0; +908 +909 this.statistics.draws++; +910 }, +911 +912 findActorAtPosition:function (point) { +913 +914 // z-order +915 var cl = this.childrenList; +916 for (var i = cl.length - 1; i >= 0; i--) { +917 var child = this.childrenList[i]; +918 +919 var np = new CAAT.Math.Point(point.x, point.y, 0); +920 var contained = child.findActorAtPosition(np); +921 if (null !== contained) { +922 return contained; +923 } +924 } +925 +926 return this; +927 }, +928 +929 /** +930 * +931 * Reset statistics information. +932 * +933 * @private +934 */ +935 resetStats:function () { +936 this.statistics.size_total = 0; +937 this.statistics.size_active = 0; +938 this.statistics.draws = 0; +939 this.statistics.size_discarded_by_dirty_rects = 0; +940 }, +941 +942 /** +943 * This is the entry point for the animation system of the Director. +944 * The director is fed with the elapsed time value to maintain a virtual timeline. +945 * This virtual timeline will provide each Scene with its own virtual timeline, and will only +946 * feed time when the Scene is the current Scene, or is being switched. +947 * +948 * If dirty rectangles are enabled and canvas is used for rendering, the dirty rectangles will be +949 * set up as a single clip area. +950 * +951 * @param time {number} integer indicating the elapsed time between two consecutive frames of the +952 * Director. +953 */ +954 render:function (time) { +955 +956 if (this.currentScene && this.currentScene.isPaused()) { +957 return; 958 } 959 -960 -961 this.animate(this, this.time); -962 -963 if (!navigator.isCocoonJS && CAAT.DEBUG) { -964 this.resetStats(); -965 } -966 -967 /** -968 * draw director active scenes. -969 */ -970 var ne = this.childrenList.length; -971 var i, tt, c; -972 var ctx = this.ctx; +960 this.time += time; +961 +962 for (i = 0, l = this.childrenList.length; i < l; i++) { +963 var c = this.childrenList[i]; +964 if (c.isInAnimationFrame(this.time) && !c.isPaused()) { +965 var tt = c.time - c.start_time; +966 c.timerManager.checkTimers(tt); +967 c.timerManager.removeExpiredTimers(); +968 } +969 } +970 +971 +972 this.animate(this, this.time); 973 -974 if (this.glEnabled) { -975 -976 this.gl.clear(this.gl.COLOR_BUFFER_BIT | this.gl.DEPTH_BUFFER_BIT); -977 this.coordsIndex = 0; -978 this.uvIndex = 0; -979 -980 for (i = 0; i < ne; i++) { -981 c = this.childrenList[i]; -982 if (c.isInAnimationFrame(this.time)) { -983 tt = c.time - c.start_time; -984 if (c.onRenderStart) { -985 c.onRenderStart(tt); -986 } -987 c.paintActorGL(this, tt); -988 if (c.onRenderEnd) { -989 c.onRenderEnd(tt); -990 } -991 -992 if (!c.isPaused()) { -993 c.time += time; -994 } -995 -996 if (!navigator.isCocoonJS && CAAT.DEBUG) { -997 this.statistics.size_total += c.size_total; -998 this.statistics.size_active += c.size_active; -999 } -1000 -1001 } -1002 } -1003 -1004 this.glFlush(); -1005 -1006 } else { -1007 ctx.globalAlpha = 1; -1008 ctx.globalCompositeOperation = 'source-over'; -1009 -1010 ctx.save(); -1011 if (this.dirtyRectsEnabled) { -1012 this.modelViewMatrix.transformRenderingContext(ctx); -1013 -1014 if (!CAAT.DEBUG_DIRTYRECTS) { -1015 ctx.beginPath(); -1016 this.nDirtyRects = 0; -1017 var dr = this.cDirtyRects; -1018 for (i = 0; i < dr.length; i++) { -1019 var drr = dr[i]; -1020 if (!drr.isEmpty()) { -1021 ctx.rect(drr.x | 0, drr.y | 0, 1 + (drr.width | 0), 1 + (drr.height | 0)); -1022 this.nDirtyRects++; -1023 } -1024 } -1025 ctx.clip(); -1026 } else { -1027 ctx.clearRect(0, 0, this.canvas.width, this.canvas.height); -1028 } -1029 -1030 } else if (this.clear === CAAT.Foundation.Director.CLEAR_ALL) { -1031 ctx.clearRect(0, 0, this.canvas.width, this.canvas.height); -1032 } -1033 -1034 for (i = 0; i < ne; i++) { -1035 c = this.childrenList[i]; -1036 -1037 if (c.isInAnimationFrame(this.time)) { -1038 tt = c.time - c.start_time; -1039 ctx.save(); +974 if (!navigator.isCocoonJS && CAAT.DEBUG) { +975 this.resetStats(); +976 } +977 +978 /** +979 * draw director active scenes. +980 */ +981 var ne = this.childrenList.length; +982 var i, tt, c; +983 var ctx = this.ctx; +984 +985 if (this.glEnabled) { +986 +987 this.gl.clear(this.gl.COLOR_BUFFER_BIT | this.gl.DEPTH_BUFFER_BIT); +988 this.coordsIndex = 0; +989 this.uvIndex = 0; +990 +991 for (i = 0; i < ne; i++) { +992 c = this.childrenList[i]; +993 if (c.isInAnimationFrame(this.time)) { +994 tt = c.time - c.start_time; +995 if (c.onRenderStart) { +996 c.onRenderStart(tt); +997 } +998 c.paintActorGL(this, tt); +999 if (c.onRenderEnd) { +1000 c.onRenderEnd(tt); +1001 } +1002 +1003 if (!c.isPaused()) { +1004 c.time += time; +1005 } +1006 +1007 if (!navigator.isCocoonJS && CAAT.DEBUG) { +1008 this.statistics.size_total += c.size_total; +1009 this.statistics.size_active += c.size_active; +1010 } +1011 +1012 } +1013 } +1014 +1015 this.glFlush(); +1016 +1017 } else { +1018 ctx.globalAlpha = 1; +1019 ctx.globalCompositeOperation = 'source-over'; +1020 +1021 ctx.save(); +1022 if (this.dirtyRectsEnabled) { +1023 this.modelViewMatrix.transformRenderingContext(ctx); +1024 +1025 if (!CAAT.DEBUG_DIRTYRECTS) { +1026 ctx.beginPath(); +1027 this.nDirtyRects = 0; +1028 var dr = this.cDirtyRects; +1029 for (i = 0; i < dr.length; i++) { +1030 var drr = dr[i]; +1031 if (!drr.isEmpty()) { +1032 ctx.rect(drr.x | 0, drr.y | 0, 1 + (drr.width | 0), 1 + (drr.height | 0)); +1033 this.nDirtyRects++; +1034 } +1035 } +1036 ctx.clip(); +1037 } else { +1038 ctx.clearRect(0, 0, this.canvas.width, this.canvas.height); +1039 } 1040 -1041 if (c.onRenderStart) { -1042 c.onRenderStart(tt); -1043 } +1041 } else if (this.clear === CAAT.Foundation.Director.CLEAR_ALL) { +1042 ctx.clearRect(0, 0, this.canvas.width, this.canvas.height); +1043 } 1044 -1045 if (!CAAT.DEBUG_DIRTYRECTS && this.dirtyRectsEnabled) { -1046 if (this.nDirtyRects) { -1047 c.paintActor(this, tt); -1048 } -1049 } else { -1050 c.paintActor(this, tt); -1051 } -1052 -1053 if (c.onRenderEnd) { -1054 c.onRenderEnd(tt); -1055 } -1056 ctx.restore(); -1057 -1058 if (CAAT.DEBUGAABB) { -1059 ctx.globalAlpha = 1; -1060 ctx.globalCompositeOperation = 'source-over'; -1061 this.modelViewMatrix.transformRenderingContextSet(ctx); -1062 c.drawScreenBoundingBox(this, tt); -1063 } -1064 -1065 if (!c.isPaused()) { -1066 c.time += time; -1067 } +1045 for (i = 0; i < ne; i++) { +1046 c = this.childrenList[i]; +1047 +1048 if (c.isInAnimationFrame(this.time)) { +1049 tt = c.time - c.start_time; +1050 ctx.save(); +1051 +1052 if (c.onRenderStart) { +1053 c.onRenderStart(tt); +1054 } +1055 +1056 if (!CAAT.DEBUG_DIRTYRECTS && this.dirtyRectsEnabled) { +1057 if (this.nDirtyRects) { +1058 c.paintActor(this, tt); +1059 } +1060 } else { +1061 c.paintActor(this, tt); +1062 } +1063 +1064 if (c.onRenderEnd) { +1065 c.onRenderEnd(tt); +1066 } +1067 ctx.restore(); 1068 -1069 if (!navigator.isCocoonJS && CAAT.DEBUG) { -1070 this.statistics.size_total += c.size_total; -1071 this.statistics.size_active += c.size_active; -1072 this.statistics.size_dirtyRects = this.nDirtyRects; -1073 } -1074 -1075 } -1076 } -1077 -1078 if (this.nDirtyRects > 0 && (!navigator.isCocoonJS && CAAT.DEBUG) && CAAT.DEBUG_DIRTYRECTS) { -1079 ctx.beginPath(); -1080 this.nDirtyRects = 0; -1081 var dr = this.cDirtyRects; -1082 for (i = 0; i < dr.length; i++) { -1083 var drr = dr[i]; -1084 if (!drr.isEmpty()) { -1085 ctx.rect(drr.x | 0, drr.y | 0, 1 + (drr.width | 0), 1 + (drr.height | 0)); -1086 this.nDirtyRects++; -1087 } -1088 } -1089 -1090 ctx.clip(); -1091 ctx.fillStyle = 'rgba(160,255,150,.4)'; -1092 ctx.fillRect(0, 0, this.canvas.width, this.canvas.height); -1093 } -1094 -1095 ctx.restore(); -1096 } -1097 -1098 this.frameCounter++; -1099 }, +1069 if (CAAT.DEBUGAABB) { +1070 ctx.globalAlpha = 1; +1071 ctx.globalCompositeOperation = 'source-over'; +1072 this.modelViewMatrix.transformRenderingContextSet(ctx); +1073 c.drawScreenBoundingBox(this, tt); +1074 } +1075 +1076 if (!c.isPaused()) { +1077 c.time += time; +1078 } +1079 +1080 if (!navigator.isCocoonJS && CAAT.DEBUG) { +1081 this.statistics.size_total += c.size_total; +1082 this.statistics.size_active += c.size_active; +1083 this.statistics.size_dirtyRects = this.nDirtyRects; +1084 } +1085 +1086 } +1087 } +1088 +1089 if (this.nDirtyRects > 0 && (!navigator.isCocoonJS && CAAT.DEBUG) && CAAT.DEBUG_DIRTYRECTS) { +1090 ctx.beginPath(); +1091 this.nDirtyRects = 0; +1092 var dr = this.cDirtyRects; +1093 for (i = 0; i < dr.length; i++) { +1094 var drr = dr[i]; +1095 if (!drr.isEmpty()) { +1096 ctx.rect(drr.x | 0, drr.y | 0, 1 + (drr.width | 0), 1 + (drr.height | 0)); +1097 this.nDirtyRects++; +1098 } +1099 } 1100 -1101 inDirtyRect:function (actor) { -1102 -1103 if (!this.dirtyRectsEnabled || CAAT.DEBUG_DIRTYRECTS) { -1104 return true; -1105 } -1106 -1107 var dr = this.cDirtyRects; -1108 var i; -1109 var aabb = actor.AABB; -1110 -1111 for (i = 0; i < dr.length; i++) { -1112 if (dr[i].intersects(aabb)) { -1113 return true; -1114 } -1115 } -1116 -1117 this.statistics.size_discarded_by_dirty_rects += actor.size_total; -1118 return false; -1119 }, -1120 -1121 /** -1122 * A director is a very special kind of actor. -1123 * Its animation routine simple sets its modelViewMatrix in case some transformation's been -1124 * applied. -1125 * No behaviors are allowed for Director instances. -1126 * @param director {CAAT.Director} redundant reference to CAAT.Director itself -1127 * @param time {number} director time. -1128 */ -1129 animate:function (director, time) { -1130 -1131 this.timerManager.checkTimers(time); -1132 -1133 this.setModelViewMatrix(this); -1134 this.modelViewMatrixI = this.modelViewMatrix.getInverse(); -1135 this.setScreenBounds(); -1136 -1137 this.dirty = false; -1138 this.invalid = false; -1139 this.dirtyRectsIndex = -1; -1140 this.cDirtyRects= []; +1101 ctx.clip(); +1102 ctx.fillStyle = 'rgba(160,255,150,.4)'; +1103 ctx.fillRect(0, 0, this.canvas.width, this.canvas.height); +1104 } +1105 +1106 ctx.restore(); +1107 } +1108 +1109 this.frameCounter++; +1110 }, +1111 +1112 inDirtyRect:function (actor) { +1113 +1114 if (!this.dirtyRectsEnabled || CAAT.DEBUG_DIRTYRECTS) { +1115 return true; +1116 } +1117 +1118 var dr = this.cDirtyRects; +1119 var i; +1120 var aabb = actor.AABB; +1121 +1122 for (i = 0; i < dr.length; i++) { +1123 if (dr[i].intersects(aabb)) { +1124 return true; +1125 } +1126 } +1127 +1128 this.statistics.size_discarded_by_dirty_rects += actor.size_total; +1129 return false; +1130 }, +1131 +1132 /** +1133 * A director is a very special kind of actor. +1134 * Its animation routine simple sets its modelViewMatrix in case some transformation's been +1135 * applied. +1136 * No behaviors are allowed for Director instances. +1137 * @param director {CAAT.Director} redundant reference to CAAT.Director itself +1138 * @param time {number} director time. +1139 */ +1140 animate:function (director, time) { 1141 -1142 var cl = this.childrenList; -1143 var cli; -1144 var i, l; -1145 -1146 -1147 if (this.dirtyRectsEnabled) { -1148 var sdr = this.sDirtyRects; -1149 if (sdr.length) { -1150 for (i = 0, l = sdr.length; i < l; i++) { -1151 this.addDirtyRect(sdr[i]); -1152 } -1153 this.sDirtyRects = []; -1154 } -1155 } +1142 this.timerManager.checkTimers(time); +1143 +1144 this.setModelViewMatrix(this); +1145 this.modelViewMatrixI = this.modelViewMatrix.getInverse(); +1146 this.setScreenBounds(); +1147 +1148 this.dirty = false; +1149 this.invalid = false; +1150 this.dirtyRectsIndex = -1; +1151 this.cDirtyRects= []; +1152 +1153 var cl = this.childrenList; +1154 var cli; +1155 var i, l; 1156 -1157 for (i = 0; i < cl.length; i++) { -1158 cli = cl[i]; -1159 var tt = cli.time - cli.start_time; -1160 cli.animate(this, tt); -1161 } -1162 -1163 this.timerManager.removeExpiredTimers(); -1164 -1165 return this; -1166 }, +1157 +1158 if (this.dirtyRectsEnabled) { +1159 var sdr = this.sDirtyRects; +1160 if (sdr.length) { +1161 for (i = 0, l = sdr.length; i < l; i++) { +1162 this.addDirtyRect(sdr[i]); +1163 } +1164 this.sDirtyRects = []; +1165 } +1166 } 1167 -1168 /** -1169 * This method is used when asynchronous operations must produce some dirty rectangle painting. -1170 * This means that every operation out of the regular CAAT loop must add dirty rect operations -1171 * by calling this method. -1172 * For example setVisible() and remove. -1173 * @param rectangle -1174 */ -1175 scheduleDirtyRect:function (rectangle) { -1176 this.sDirtyRects.push(rectangle); +1168 for (i = 0; i < cl.length; i++) { +1169 cli = cl[i]; +1170 var tt = cli.time - cli.start_time; +1171 cli.animate(this, tt); +1172 } +1173 +1174 this.timerManager.removeExpiredTimers(); +1175 +1176 return this; 1177 }, -1178 /** -1179 * Add a rectangle to the list of dirty screen areas which should be redrawn. -1180 * This is the opposite method to clear the whole screen and repaint everything again. -1181 * Despite i'm not very fond of dirty rectangles because it needs some extra calculations, this -1182 * procedure has shown to be speeding things up under certain situations. Nevertheless it doesn't or -1183 * even lowers performance under others, so it is a developer choice to activate them via a call to -1184 * setClear( CAAT.Director.CLEAR_DIRTY_RECTS ). -1185 * -1186 * This function, not only tracks a list of dirty rectangles, but tries to optimize the list. Overlapping -1187 * rectangles will be removed and intersecting ones will be unioned. -1188 * -1189 * Before calling this method, check if this.dirtyRectsEnabled is true. -1190 * -1191 * @param rectangle {CAAT.Rectangle} -1192 */ -1193 addDirtyRect:function (rectangle) { -1194 -1195 if (rectangle.isEmpty()) { -1196 return; -1197 } -1198 -1199 var i, dr, j, drj; -1200 var cdr = this.cDirtyRects; -1201 -1202 for (i = 0; i < cdr.length; i++) { -1203 dr = cdr[i]; -1204 if (!dr.isEmpty() && dr.intersects(rectangle)) { -1205 var intersected = true; -1206 while (intersected) { -1207 dr.unionRectangle(rectangle); -1208 -1209 for (j = 0; j < cdr.length; j++) { -1210 if (j !== i) { -1211 drj = cdr[j]; -1212 if (!drj.isEmpty() && drj.intersects(dr)) { -1213 dr.unionRectangle(drj); -1214 drj.setEmpty(); -1215 break; -1216 } -1217 } -1218 } +1178 +1179 /** +1180 * This method is used when asynchronous operations must produce some dirty rectangle painting. +1181 * This means that every operation out of the regular CAAT loop must add dirty rect operations +1182 * by calling this method. +1183 * For example setVisible() and remove. +1184 * @param rectangle +1185 */ +1186 scheduleDirtyRect:function (rectangle) { +1187 this.sDirtyRects.push(rectangle); +1188 }, +1189 /** +1190 * Add a rectangle to the list of dirty screen areas which should be redrawn. +1191 * This is the opposite method to clear the whole screen and repaint everything again. +1192 * Despite i'm not very fond of dirty rectangles because it needs some extra calculations, this +1193 * procedure has shown to be speeding things up under certain situations. Nevertheless it doesn't or +1194 * even lowers performance under others, so it is a developer choice to activate them via a call to +1195 * setClear( CAAT.Director.CLEAR_DIRTY_RECTS ). +1196 * +1197 * This function, not only tracks a list of dirty rectangles, but tries to optimize the list. Overlapping +1198 * rectangles will be removed and intersecting ones will be unioned. +1199 * +1200 * Before calling this method, check if this.dirtyRectsEnabled is true. +1201 * +1202 * @param rectangle {CAAT.Rectangle} +1203 */ +1204 addDirtyRect:function (rectangle) { +1205 +1206 if (rectangle.isEmpty()) { +1207 return; +1208 } +1209 +1210 var i, dr, j, drj; +1211 var cdr = this.cDirtyRects; +1212 +1213 for (i = 0; i < cdr.length; i++) { +1214 dr = cdr[i]; +1215 if (!dr.isEmpty() && dr.intersects(rectangle)) { +1216 var intersected = true; +1217 while (intersected) { +1218 dr.unionRectangle(rectangle); 1219 -1220 if (j == cdr.length) { -1221 intersected = false; -1222 } -1223 } -1224 -1225 for (j = 0; j < cdr.length; j++) { -1226 if (cdr[j].isEmpty()) { -1227 cdr.splice(j, 1); -1228 } -1229 } +1220 for (j = 0; j < cdr.length; j++) { +1221 if (j !== i) { +1222 drj = cdr[j]; +1223 if (!drj.isEmpty() && drj.intersects(dr)) { +1224 dr.unionRectangle(drj); +1225 drj.setEmpty(); +1226 break; +1227 } +1228 } +1229 } 1230 -1231 return; -1232 } -1233 } -1234 -1235 this.dirtyRectsIndex++; -1236 -1237 if (this.dirtyRectsIndex >= this.dirtyRects.length) { -1238 for (i = 0; i < 32; i++) { -1239 this.dirtyRects.push(new CAAT.Math.Rectangle()); -1240 } -1241 } -1242 -1243 var r = this.dirtyRects[ this.dirtyRectsIndex ]; -1244 -1245 r.x = rectangle.x; -1246 r.y = rectangle.y; -1247 r.x1 = rectangle.x1; -1248 r.y1 = rectangle.y1; -1249 r.width = rectangle.width; -1250 r.height = rectangle.height; -1251 -1252 this.cDirtyRects.push(r); +1231 if (j == cdr.length) { +1232 intersected = false; +1233 } +1234 } +1235 +1236 for (j = 0; j < cdr.length; j++) { +1237 if (cdr[j].isEmpty()) { +1238 cdr.splice(j, 1); +1239 } +1240 } +1241 +1242 return; +1243 } +1244 } +1245 +1246 this.dirtyRectsIndex++; +1247 +1248 if (this.dirtyRectsIndex >= this.dirtyRects.length) { +1249 for (i = 0; i < 32; i++) { +1250 this.dirtyRects.push(new CAAT.Math.Rectangle()); +1251 } +1252 } 1253 -1254 }, -1255 /** -1256 * This method draws an Scene to an offscreen canvas. This offscreen canvas is also a child of -1257 * another Scene (transitionScene). So instead of drawing two scenes while transitioning from -1258 * one to another, first of all an scene is drawn to offscreen, and that image is translated. -1259 * <p> -1260 * Until the creation of this method, both scenes where drawn while transitioning with -1261 * its performance penalty since drawing two scenes could be twice as expensive than drawing -1262 * only one. -1263 * <p> -1264 * Though a high performance increase, we should keep an eye on memory consumption. -1265 * -1266 * @param ctx a <code>canvas.getContext('2d')</code> instnce. -1267 * @param scene {CAAT.Foundation.Scene} the scene to draw offscreen. -1268 */ -1269 renderToContext:function (ctx, scene) { -1270 /** -1271 * draw actors on scene. -1272 */ -1273 if (scene.isInAnimationFrame(this.time)) { -1274 ctx.setTransform(1, 0, 0, 1, 0, 0); -1275 -1276 ctx.globalAlpha = 1; -1277 ctx.globalCompositeOperation = 'source-over'; -1278 ctx.clearRect(0, 0, this.width, this.height); -1279 -1280 var octx = this.ctx; -1281 -1282 this.ctx = ctx; -1283 ctx.save(); -1284 -1285 /** -1286 * to draw an scene to an offscreen canvas, we have to: -1287 * 1.- save diector's world model view matrix -1288 * 2.- set no transformation on director since we want the offscreen to -1289 * be drawn 1:1. -1290 * 3.- set world dirty flag, so that the scene will recalculate its matrices -1291 * 4.- animate the scene -1292 * 5.- paint the scene -1293 * 6.- restore world model view matrix. -1294 */ -1295 var matmv = this.modelViewMatrix; -1296 var matwmv = this.worldModelViewMatrix; -1297 this.worldModelViewMatrix = new CAAT.Math.Matrix(); -1298 this.modelViewMatrix = this.worldModelViewMatrix; -1299 this.wdirty = true; -1300 scene.animate(this, scene.time); -1301 if (scene.onRenderStart) { -1302 scene.onRenderStart(scene.time); -1303 } -1304 scene.paintActor(this, scene.time); -1305 if (scene.onRenderEnd) { -1306 scene.onRenderEnd(scene.time); -1307 } -1308 this.worldModelViewMatrix = matwmv; -1309 this.modelViewMatrix = matmv; -1310 -1311 ctx.restore(); -1312 -1313 this.ctx = octx; -1314 } -1315 }, -1316 /** -1317 * Add a new Scene to Director's Scene list. By adding a Scene to the Director -1318 * does not mean it will be immediately visible, you should explicitly call either -1319 * <ul> -1320 * <li>easeIn -1321 * <li>easeInOut -1322 * <li>easeInOutRandom -1323 * <li>setScene -1324 * <li>or any of the scene switching methods -1325 * </ul> -1326 * -1327 * @param scene {CAAT.Foundation.Scene} -1328 */ -1329 addScene:function (scene) { -1330 scene.setBounds(0, 0, this.width, this.height); -1331 this.scenes.push(scene); -1332 scene.setEaseListener(this); -1333 if (null === this.currentScene) { -1334 this.setScene(0); -1335 } -1336 }, -1337 /** -1338 * Get the number of scenes contained in the Director. -1339 * @return {number} the number of scenes contained in the Director. -1340 */ -1341 getNumScenes:function () { -1342 return this.scenes.length; -1343 }, -1344 /** -1345 * This method offers full control over the process of switching between any given two Scenes. -1346 * To apply this method, you must specify the type of transition to apply for each Scene and -1347 * the anchor to keep the Scene pinned at. -1348 * <p> -1349 * The type of transition will be one of the following values defined in CAAT.Foundation.Scene.prototype: -1350 * <ul> -1351 * <li>EASE_ROTATION -1352 * <li>EASE_SCALE -1353 * <li>EASE_TRANSLATION -1354 * </ul> -1355 * -1356 * <p> -1357 * The anchor will be any of these values defined in CAAT.Foundation.Actor: -1358 * <ul> -1359 * <li>ANCHOR_CENTER -1360 * <li>ANCHOR_TOP -1361 * <li>ANCHOR_BOTTOM -1362 * <li>ANCHOR_LEFT -1363 * <li>ANCHOR_RIGHT -1364 * <li>ANCHOR_TOP_LEFT -1365 * <li>ANCHOR_TOP_RIGHT -1366 * <li>ANCHOR_BOTTOM_LEFT -1367 * <li>ANCHOR_BOTTOM_RIGHT -1368 * </ul> -1369 * -1370 * <p> -1371 * In example, for an entering scene performing a EASE_SCALE transition, the anchor is the -1372 * point by which the scene will scaled. -1373 * -1374 * @param inSceneIndex integer indicating the Scene index to bring in to the Director. -1375 * @param typein integer indicating the type of transition to apply to the bringing in Scene. -1376 * @param anchorin integer indicating the anchor of the bringing in Scene. -1377 * @param outSceneIndex integer indicating the Scene index to take away from the Director. -1378 * @param typeout integer indicating the type of transition to apply to the taking away in Scene. -1379 * @param anchorout integer indicating the anchor of the taking away Scene. -1380 * @param time inteter indicating the time to perform the process of switchihg between Scene object -1381 * in milliseconds. -1382 * @param alpha boolean boolean indicating whether alpha transparency fading will be applied to -1383 * the scenes. -1384 * @param interpolatorIn CAAT.Behavior.Interpolator object to apply to entering scene. -1385 * @param interpolatorOut CAAT.Behavior.Interpolator object to apply to exiting scene. -1386 */ -1387 easeInOut:function (inSceneIndex, typein, anchorin, outSceneIndex, typeout, anchorout, time, alpha, interpolatorIn, interpolatorOut) { -1388 -1389 if (inSceneIndex === this.getCurrentSceneIndex()) { -1390 return; -1391 } -1392 -1393 var ssin = this.scenes[ inSceneIndex ]; -1394 var sout = this.scenes[ outSceneIndex ]; -1395 -1396 if (!CAAT.__CSS__ && CAAT.CACHE_SCENE_ON_CHANGE) { -1397 this.renderToContext(this.transitionScene.ctx, sout); -1398 sout = this.transitionScene; -1399 } -1400 -1401 ssin.setExpired(false); -1402 sout.setExpired(false); +1254 var r = this.dirtyRects[ this.dirtyRectsIndex ]; +1255 +1256 r.x = rectangle.x; +1257 r.y = rectangle.y; +1258 r.x1 = rectangle.x1; +1259 r.y1 = rectangle.y1; +1260 r.width = rectangle.width; +1261 r.height = rectangle.height; +1262 +1263 this.cDirtyRects.push(r); +1264 +1265 }, +1266 /** +1267 * This method draws an Scene to an offscreen canvas. This offscreen canvas is also a child of +1268 * another Scene (transitionScene). So instead of drawing two scenes while transitioning from +1269 * one to another, first of all an scene is drawn to offscreen, and that image is translated. +1270 * <p> +1271 * Until the creation of this method, both scenes where drawn while transitioning with +1272 * its performance penalty since drawing two scenes could be twice as expensive than drawing +1273 * only one. +1274 * <p> +1275 * Though a high performance increase, we should keep an eye on memory consumption. +1276 * +1277 * @param ctx a <code>canvas.getContext('2d')</code> instnce. +1278 * @param scene {CAAT.Foundation.Scene} the scene to draw offscreen. +1279 */ +1280 renderToContext:function (ctx, scene) { +1281 /** +1282 * draw actors on scene. +1283 */ +1284 if (scene.isInAnimationFrame(this.time)) { +1285 ctx.setTransform(1, 0, 0, 1, 0, 0); +1286 +1287 ctx.globalAlpha = 1; +1288 ctx.globalCompositeOperation = 'source-over'; +1289 ctx.clearRect(0, 0, this.width, this.height); +1290 +1291 var octx = this.ctx; +1292 +1293 this.ctx = ctx; +1294 ctx.save(); +1295 +1296 /** +1297 * to draw an scene to an offscreen canvas, we have to: +1298 * 1.- save diector's world model view matrix +1299 * 2.- set no transformation on director since we want the offscreen to +1300 * be drawn 1:1. +1301 * 3.- set world dirty flag, so that the scene will recalculate its matrices +1302 * 4.- animate the scene +1303 * 5.- paint the scene +1304 * 6.- restore world model view matrix. +1305 */ +1306 var matmv = this.modelViewMatrix; +1307 var matwmv = this.worldModelViewMatrix; +1308 this.worldModelViewMatrix = new CAAT.Math.Matrix(); +1309 this.modelViewMatrix = this.worldModelViewMatrix; +1310 this.wdirty = true; +1311 scene.animate(this, scene.time); +1312 if (scene.onRenderStart) { +1313 scene.onRenderStart(scene.time); +1314 } +1315 scene.paintActor(this, scene.time); +1316 if (scene.onRenderEnd) { +1317 scene.onRenderEnd(scene.time); +1318 } +1319 this.worldModelViewMatrix = matwmv; +1320 this.modelViewMatrix = matmv; +1321 +1322 ctx.restore(); +1323 +1324 this.ctx = octx; +1325 } +1326 }, +1327 /** +1328 * Add a new Scene to Director's Scene list. By adding a Scene to the Director +1329 * does not mean it will be immediately visible, you should explicitly call either +1330 * <ul> +1331 * <li>easeIn +1332 * <li>easeInOut +1333 * <li>easeInOutRandom +1334 * <li>setScene +1335 * <li>or any of the scene switching methods +1336 * </ul> +1337 * +1338 * @param scene {CAAT.Foundation.Scene} +1339 */ +1340 addScene:function (scene) { +1341 scene.setBounds(0, 0, this.width, this.height); +1342 this.scenes.push(scene); +1343 scene.setEaseListener(this); +1344 if (null === this.currentScene) { +1345 this.setScene(0); +1346 } +1347 }, +1348 /** +1349 * Get the number of scenes contained in the Director. +1350 * @return {number} the number of scenes contained in the Director. +1351 */ +1352 getNumScenes:function () { +1353 return this.scenes.length; +1354 }, +1355 /** +1356 * This method offers full control over the process of switching between any given two Scenes. +1357 * To apply this method, you must specify the type of transition to apply for each Scene and +1358 * the anchor to keep the Scene pinned at. +1359 * <p> +1360 * The type of transition will be one of the following values defined in CAAT.Foundation.Scene.prototype: +1361 * <ul> +1362 * <li>EASE_ROTATION +1363 * <li>EASE_SCALE +1364 * <li>EASE_TRANSLATION +1365 * </ul> +1366 * +1367 * <p> +1368 * The anchor will be any of these values defined in CAAT.Foundation.Actor: +1369 * <ul> +1370 * <li>ANCHOR_CENTER +1371 * <li>ANCHOR_TOP +1372 * <li>ANCHOR_BOTTOM +1373 * <li>ANCHOR_LEFT +1374 * <li>ANCHOR_RIGHT +1375 * <li>ANCHOR_TOP_LEFT +1376 * <li>ANCHOR_TOP_RIGHT +1377 * <li>ANCHOR_BOTTOM_LEFT +1378 * <li>ANCHOR_BOTTOM_RIGHT +1379 * </ul> +1380 * +1381 * <p> +1382 * In example, for an entering scene performing a EASE_SCALE transition, the anchor is the +1383 * point by which the scene will scaled. +1384 * +1385 * @param inSceneIndex integer indicating the Scene index to bring in to the Director. +1386 * @param typein integer indicating the type of transition to apply to the bringing in Scene. +1387 * @param anchorin integer indicating the anchor of the bringing in Scene. +1388 * @param outSceneIndex integer indicating the Scene index to take away from the Director. +1389 * @param typeout integer indicating the type of transition to apply to the taking away in Scene. +1390 * @param anchorout integer indicating the anchor of the taking away Scene. +1391 * @param time inteter indicating the time to perform the process of switchihg between Scene object +1392 * in milliseconds. +1393 * @param alpha boolean boolean indicating whether alpha transparency fading will be applied to +1394 * the scenes. +1395 * @param interpolatorIn CAAT.Behavior.Interpolator object to apply to entering scene. +1396 * @param interpolatorOut CAAT.Behavior.Interpolator object to apply to exiting scene. +1397 */ +1398 easeInOut:function (inSceneIndex, typein, anchorin, outSceneIndex, typeout, anchorout, time, alpha, interpolatorIn, interpolatorOut) { +1399 +1400 if (inSceneIndex === this.getCurrentSceneIndex()) { +1401 return; +1402 } 1403 -1404 ssin.mouseEnabled = false; -1405 sout.mouseEnabled = false; +1404 var ssin = this.scenes[ inSceneIndex ]; +1405 var sout = this.scenes[ outSceneIndex ]; 1406 -1407 ssin.resetTransform(); -1408 sout.resetTransform(); -1409 -1410 ssin.setLocation(0, 0); -1411 sout.setLocation(0, 0); -1412 -1413 ssin.alpha = 1; -1414 sout.alpha = 1; -1415 -1416 if (typein === CAAT.Foundation.Scene.EASE_ROTATION) { -1417 ssin.easeRotationIn(time, alpha, anchorin, interpolatorIn); -1418 } else if (typein === CAAT.Foundation.Scene.EASE_SCALE) { -1419 ssin.easeScaleIn(0, time, alpha, anchorin, interpolatorIn); -1420 } else { -1421 ssin.easeTranslationIn(time, alpha, anchorin, interpolatorIn); -1422 } +1407 if (!CAAT.__CSS__ && CAAT.CACHE_SCENE_ON_CHANGE) { +1408 this.renderToContext(this.transitionScene.ctx, sout); +1409 sout = this.transitionScene; +1410 } +1411 +1412 ssin.setExpired(false); +1413 sout.setExpired(false); +1414 +1415 ssin.mouseEnabled = false; +1416 sout.mouseEnabled = false; +1417 +1418 ssin.resetTransform(); +1419 sout.resetTransform(); +1420 +1421 ssin.setLocation(0, 0); +1422 sout.setLocation(0, 0); 1423 -1424 if (typeout === CAAT.Foundation.Scene.EASE_ROTATION) { -1425 sout.easeRotationOut(time, alpha, anchorout, interpolatorOut); -1426 } else if (typeout === CAAT.Foundation.Scene.EASE_SCALE) { -1427 sout.easeScaleOut(0, time, alpha, anchorout, interpolatorOut); -1428 } else { -1429 sout.easeTranslationOut(time, alpha, anchorout, interpolatorOut); -1430 } -1431 -1432 this.childrenList = []; -1433 -1434 sout.goOut(ssin); -1435 ssin.getIn(sout); -1436 -1437 this.addChild(sout); -1438 this.addChild(ssin); -1439 }, -1440 /** -1441 * This method will switch between two given Scene indexes (ie, take away scene number 2, -1442 * and bring in scene number 5). -1443 * <p> -1444 * It will randomly choose for each Scene the type of transition to apply and the anchor -1445 * point of each transition type. -1446 * <p> -1447 * It will also set for different kind of transitions the following interpolators: -1448 * <ul> -1449 * <li>EASE_ROTATION -> ExponentialInOutInterpolator, exponent 4. -1450 * <li>EASE_SCALE -> ElasticOutInterpolator, 1.1 and .4 -1451 * <li>EASE_TRANSLATION -> BounceOutInterpolator -1452 * </ul> -1453 * +1424 ssin.alpha = 1; +1425 sout.alpha = 1; +1426 +1427 if (typein === CAAT.Foundation.Scene.EASE_ROTATION) { +1428 ssin.easeRotationIn(time, alpha, anchorin, interpolatorIn); +1429 } else if (typein === CAAT.Foundation.Scene.EASE_SCALE) { +1430 ssin.easeScaleIn(0, time, alpha, anchorin, interpolatorIn); +1431 } else { +1432 ssin.easeTranslationIn(time, alpha, anchorin, interpolatorIn); +1433 } +1434 +1435 if (typeout === CAAT.Foundation.Scene.EASE_ROTATION) { +1436 sout.easeRotationOut(time, alpha, anchorout, interpolatorOut); +1437 } else if (typeout === CAAT.Foundation.Scene.EASE_SCALE) { +1438 sout.easeScaleOut(0, time, alpha, anchorout, interpolatorOut); +1439 } else { +1440 sout.easeTranslationOut(time, alpha, anchorout, interpolatorOut); +1441 } +1442 +1443 this.childrenList = []; +1444 +1445 sout.goOut(ssin); +1446 ssin.getIn(sout); +1447 +1448 this.addChild(sout); +1449 this.addChild(ssin); +1450 }, +1451 /** +1452 * This method will switch between two given Scene indexes (ie, take away scene number 2, +1453 * and bring in scene number 5). 1454 * <p> -1455 * These are the default values, and could not be changed by now. -1456 * This method in final instance delegates the process to easeInOutMethod. -1457 * -1458 * @see easeInOutMethod. -1459 * -1460 * @param inIndex integer indicating the entering scene index. -1461 * @param outIndex integer indicating the exiting scene index. -1462 * @param time integer indicating the time to take for the process of Scene in/out in milliseconds. -1463 * @param alpha boolean indicating whether alpha transparency fading should be applied to transitions. -1464 */ -1465 easeInOutRandom:function (inIndex, outIndex, time, alpha) { -1466 -1467 var pin = Math.random(); -1468 var pout = Math.random(); -1469 -1470 var typeIn; -1471 var interpolatorIn; -1472 -1473 if (pin < 0.33) { -1474 typeIn = CAAT.Foundation.Scene.EASE_ROTATION; -1475 interpolatorIn = new CAAT.Behavior.Interpolator().createExponentialInOutInterpolator(4); -1476 } else if (pin < 0.66) { -1477 typeIn = CAAT.Foundation.Scene.EASE_SCALE; -1478 interpolatorIn = new CAAT.Behavior.Interpolator().createElasticOutInterpolator(1.1, 0.4); -1479 } else { -1480 typeIn = CAAT.Foundation.Scene.EASE_TRANSLATE; -1481 interpolatorIn = new CAAT.Behavior.Interpolator().createBounceOutInterpolator(); -1482 } +1455 * It will randomly choose for each Scene the type of transition to apply and the anchor +1456 * point of each transition type. +1457 * <p> +1458 * It will also set for different kind of transitions the following interpolators: +1459 * <ul> +1460 * <li>EASE_ROTATION -> ExponentialInOutInterpolator, exponent 4. +1461 * <li>EASE_SCALE -> ElasticOutInterpolator, 1.1 and .4 +1462 * <li>EASE_TRANSLATION -> BounceOutInterpolator +1463 * </ul> +1464 * +1465 * <p> +1466 * These are the default values, and could not be changed by now. +1467 * This method in final instance delegates the process to easeInOutMethod. +1468 * +1469 * @see easeInOutMethod. +1470 * +1471 * @param inIndex integer indicating the entering scene index. +1472 * @param outIndex integer indicating the exiting scene index. +1473 * @param time integer indicating the time to take for the process of Scene in/out in milliseconds. +1474 * @param alpha boolean indicating whether alpha transparency fading should be applied to transitions. +1475 */ +1476 easeInOutRandom:function (inIndex, outIndex, time, alpha) { +1477 +1478 var pin = Math.random(); +1479 var pout = Math.random(); +1480 +1481 var typeIn; +1482 var interpolatorIn; 1483 -1484 var typeOut; -1485 var interpolatorOut; -1486 -1487 if (pout < 0.33) { -1488 typeOut = CAAT.Foundation.Scene.EASE_ROTATION; -1489 interpolatorOut = new CAAT.Behavior.Interpolator().createExponentialInOutInterpolator(4); -1490 } else if (pout < 0.66) { -1491 typeOut = CAAT.Foundation.Scene.EASE_SCALE; -1492 interpolatorOut = new CAAT.Behavior.Interpolator().createExponentialOutInterpolator(4); -1493 } else { -1494 typeOut = CAAT.Foundation.Scene.EASE_TRANSLATE; -1495 interpolatorOut = new CAAT.Behavior.Interpolator().createBounceOutInterpolator(); -1496 } +1484 if (pin < 0.33) { +1485 typeIn = CAAT.Foundation.Scene.EASE_ROTATION; +1486 interpolatorIn = new CAAT.Behavior.Interpolator().createExponentialInOutInterpolator(4); +1487 } else if (pin < 0.66) { +1488 typeIn = CAAT.Foundation.Scene.EASE_SCALE; +1489 interpolatorIn = new CAAT.Behavior.Interpolator().createElasticOutInterpolator(1.1, 0.4); +1490 } else { +1491 typeIn = CAAT.Foundation.Scene.EASE_TRANSLATE; +1492 interpolatorIn = new CAAT.Behavior.Interpolator().createBounceOutInterpolator(); +1493 } +1494 +1495 var typeOut; +1496 var interpolatorOut; 1497 -1498 this.easeInOut( -1499 inIndex, -1500 typeIn, -1501 (Math.random() * 8.99) >> 0, -1502 -1503 outIndex, -1504 typeOut, -1505 (Math.random() * 8.99) >> 0, -1506 -1507 time, -1508 alpha, -1509 -1510 interpolatorIn, -1511 interpolatorOut); -1512 -1513 }, -1514 /** -1515 * This method changes Director's current Scene to the scene index indicated by -1516 * inSceneIndex parameter. The Scene running in the director won't be eased out. -1517 * -1518 * @see {CAAT.Interpolator} -1519 * @see {CAAT.Actor} -1520 * @see {CAAT.Scene} -1521 * -1522 * @param inSceneIndex integer indicating the new Scene to set as current. -1523 * @param type integer indicating the type of transition to apply to bring the new current -1524 * Scene to the Director. The values will be one of: CAAT.Scene.prototype.EASE_ROTATION, -1525 * CAAT.Scene.prototype.EASE_SCALE, CAAT.Scene.prototype.EASE_TRANSLATION. -1526 * @param time integer indicating how much time in milliseconds the Scene entrance will take. -1527 * @param alpha boolean indicating whether alpha transparency fading will be applied to the -1528 * entereing Scene. -1529 * @param anchor integer indicating the anchor to fix for Scene transition. It will be any of -1530 * CAAT.Actor.prototype.ANCHOR_* values. -1531 * @param interpolator an CAAT.Interpolator object indicating the interpolation function to -1532 * apply. -1533 */ -1534 easeIn:function (inSceneIndex, type, time, alpha, anchor, interpolator) { -1535 var sin = this.scenes[ inSceneIndex ]; -1536 if (type === CAAT.Foundation.Scene.EASE_ROTATION) { -1537 sin.easeRotationIn(time, alpha, anchor, interpolator); -1538 } else if (type === CAAT.Foundation.Scene.EASE_SCALE) { -1539 sin.easeScaleIn(0, time, alpha, anchor, interpolator); -1540 } else { -1541 sin.easeTranslationIn(time, alpha, anchor, interpolator); -1542 } -1543 this.childrenList = []; -1544 this.addChild(sin); -1545 -1546 sin.resetTransform(); -1547 sin.setLocation(0, 0); -1548 sin.alpha = 1; -1549 sin.mouseEnabled = false; -1550 sin.setExpired(false); -1551 }, -1552 /** -1553 * Changes (or sets) the current Director scene to the index -1554 * parameter. There will be no transition on scene change. -1555 * @param sceneIndex {number} an integer indicating the index of the target Scene -1556 * to be shown. -1557 */ -1558 setScene:function (sceneIndex) { -1559 var sin = this.scenes[ sceneIndex ]; -1560 this.childrenList = []; -1561 this.addChild(sin); -1562 this.currentScene = sin; -1563 -1564 sin.setExpired(false); -1565 sin.mouseEnabled = true; -1566 sin.resetTransform(); -1567 sin.setLocation(0, 0); -1568 sin.alpha = 1; -1569 -1570 sin.getIn(); -1571 sin.activated(); -1572 }, -1573 /** -1574 * This method will change the current Scene by the Scene indicated as parameter. -1575 * It will apply random values for anchor and transition type. -1576 * @see easeInOutRandom -1577 * -1578 * @param iNewSceneIndex {number} an integer indicating the index of the new scene to run on the Director. -1579 * @param time {number} an integer indicating the time the Scene transition will take. -1580 * @param alpha {boolean} a boolean indicating whether Scene transition should be fading. -1581 * @param transition {boolean} a boolean indicating whether the scene change must smoothly animated. -1582 */ -1583 switchToScene:function (iNewSceneIndex, time, alpha, transition) { -1584 var currentSceneIndex = this.getSceneIndex(this.currentScene); -1585 -1586 if (!transition) { -1587 this.setScene(iNewSceneIndex); -1588 } -1589 else { -1590 this.easeInOutRandom(iNewSceneIndex, currentSceneIndex, time, alpha); -1591 } -1592 }, -1593 /** -1594 * Sets the previous Scene in sequence as the current Scene. -1595 * @see switchToScene. -1596 * -1597 * @param time {number} integer indicating the time the Scene transition will take. -1598 * @param alpha {boolean} a boolean indicating whether Scene transition should be fading. -1599 * @param transition {boolean} a boolean indicating whether the scene change must smoothly animated. -1600 */ -1601 switchToPrevScene:function (time, alpha, transition) { -1602 -1603 var currentSceneIndex = this.getSceneIndex(this.currentScene); -1604 -1605 if (this.getNumScenes() <= 1 || currentSceneIndex === 0) { -1606 return; -1607 } -1608 -1609 if (!transition) { -1610 this.setScene(currentSceneIndex - 1); -1611 } -1612 else { -1613 this.easeInOutRandom(currentSceneIndex - 1, currentSceneIndex, time, alpha); -1614 } -1615 }, -1616 /** -1617 * Sets the previous Scene in sequence as the current Scene. -1618 * @see switchToScene. -1619 * -1620 * @param time {number} integer indicating the time the Scene transition will take. -1621 * @param alpha {boolean} a boolean indicating whether Scene transition should be fading. -1622 * @param transition {boolean} a boolean indicating whether the scene change must smoothly animated. -1623 */ -1624 switchToNextScene:function (time, alpha, transition) { -1625 -1626 var currentSceneIndex = this.getSceneIndex(this.currentScene); -1627 -1628 if (this.getNumScenes() <= 1 || currentSceneIndex === this.getNumScenes() - 1) { -1629 return; -1630 } -1631 -1632 if (!transition) { -1633 this.setScene(currentSceneIndex + 1); -1634 } -1635 else { -1636 this.easeInOutRandom(currentSceneIndex + 1, currentSceneIndex, time, alpha); -1637 } -1638 }, -1639 mouseEnter:function (mouseEvent) { -1640 }, -1641 mouseExit:function (mouseEvent) { -1642 }, -1643 mouseMove:function (mouseEvent) { -1644 }, -1645 mouseDown:function (mouseEvent) { -1646 }, -1647 mouseUp:function (mouseEvent) { -1648 }, -1649 mouseDrag:function (mouseEvent) { -1650 }, -1651 /** -1652 * Scene easing listener. Notifies scenes when they're about to be activated (set as current -1653 * director's scene). -1654 * -1655 * @param scene {CAAT.Foundation.Scene} the scene that has just been brought in or taken out of the director. -1656 * @param b_easeIn {boolean} scene enters or exits ? -1657 */ -1658 easeEnd:function (scene, b_easeIn) { -1659 // scene is going out -1660 if (!b_easeIn) { -1661 -1662 scene.setExpired(true); -1663 } else { -1664 this.currentScene = scene; -1665 this.currentScene.activated(); -1666 } -1667 -1668 scene.mouseEnabled = true; -1669 scene.emptyBehaviorList(); -1670 }, -1671 /** -1672 * Return the index for a given Scene object contained in the Director. -1673 * @param scene {CAAT.Foundation.Scene} -1674 */ -1675 getSceneIndex:function (scene) { -1676 for (var i = 0; i < this.scenes.length; i++) { -1677 if (this.scenes[i] === scene) { -1678 return i; -1679 } -1680 } -1681 return -1; -1682 }, -1683 /** -1684 * Get a concrete director's scene. -1685 * @param index {number} an integer indicating the scene index. -1686 * @return {CAAT.Foundation.Scene} a CAAT.Scene object instance or null if the index is oob. -1687 */ -1688 getScene:function (index) { -1689 return this.scenes[index]; -1690 }, -1691 getSceneById : function(id) { -1692 for( var i=0; i<this.scenes.length; i++ ) { -1693 if (this.scenes[i].id===id) { -1694 return this.scenes[i]; -1695 } -1696 } -1697 return null; -1698 }, -1699 /** -1700 * Return the index of the current scene in the Director's scene list. -1701 * @return {number} the current scene's index. -1702 */ -1703 getCurrentSceneIndex:function () { -1704 return this.getSceneIndex(this.currentScene); -1705 }, -1706 /** -1707 * Return the running browser name. -1708 * @return {string} the browser name. -1709 */ -1710 getBrowserName:function () { -1711 return this.browserInfo.browser; -1712 }, -1713 /** -1714 * Return the running browser version. -1715 * @return {string} the browser version. -1716 */ -1717 getBrowserVersion:function () { -1718 return this.browserInfo.version; -1719 }, -1720 /** -1721 * Return the operating system name. -1722 * @return {string} the os name. -1723 */ -1724 getOSName:function () { -1725 return this.browserInfo.OS; -1726 }, -1727 /** -1728 * Gets the resource with the specified resource name. -1729 * The Director holds a collection called <code>imagesCache</code> -1730 * where you can store a JSON of the form -1731 * <code>[ { id: imageId, image: imageObject } ]</code>. -1732 * This structure will be used as a resources cache. -1733 * There's a CAAT.Module.ImagePreloader class to preload resources and -1734 * generate this structure on loading finalization. -1735 * -1736 * @param sId {object} an String identifying a resource. -1737 */ -1738 getImage:function (sId) { -1739 var ret = this.imagesCache[sId]; -1740 if (ret) { -1741 return ret; -1742 } -1743 -1744 for (var i = 0; i < this.imagesCache.length; i++) { -1745 if (this.imagesCache[i].id === sId) { -1746 return this.imagesCache[i].image; -1747 } -1748 } -1749 -1750 return null; -1751 }, -1752 musicPlay: function(id) { -1753 return this.audioManager.playMusic(id); -1754 }, -1755 musicStop : function() { -1756 this.audioManager.stopMusic(); -1757 }, -1758 /** -1759 * Adds an audio to the cache. -1760 * -1761 * @see CAAT.Module.Audio.AudioManager.addAudio -1762 * @return this -1763 */ -1764 addAudio:function (id, url) { -1765 this.audioManager.addAudio(id, url); -1766 return this; -1767 }, -1768 /** -1769 * Plays the audio instance identified by the id. -1770 * @param id {object} the object used to store a sound in the audioCache. -1771 */ -1772 audioPlay:function (id) { -1773 return this.audioManager.play(id); -1774 }, -1775 /** -1776 * Loops an audio instance identified by the id. -1777 * @param id {object} the object used to store a sound in the audioCache. -1778 * -1779 * @return {HTMLElement|null} the value from audioManager.loop -1780 */ -1781 audioLoop:function (id) { -1782 return this.audioManager.loop(id); -1783 }, -1784 endSound:function () { -1785 return this.audioManager.endSound(); +1498 if (pout < 0.33) { +1499 typeOut = CAAT.Foundation.Scene.EASE_ROTATION; +1500 interpolatorOut = new CAAT.Behavior.Interpolator().createExponentialInOutInterpolator(4); +1501 } else if (pout < 0.66) { +1502 typeOut = CAAT.Foundation.Scene.EASE_SCALE; +1503 interpolatorOut = new CAAT.Behavior.Interpolator().createExponentialOutInterpolator(4); +1504 } else { +1505 typeOut = CAAT.Foundation.Scene.EASE_TRANSLATE; +1506 interpolatorOut = new CAAT.Behavior.Interpolator().createBounceOutInterpolator(); +1507 } +1508 +1509 this.easeInOut( +1510 inIndex, +1511 typeIn, +1512 (Math.random() * 8.99) >> 0, +1513 +1514 outIndex, +1515 typeOut, +1516 (Math.random() * 8.99) >> 0, +1517 +1518 time, +1519 alpha, +1520 +1521 interpolatorIn, +1522 interpolatorOut); +1523 +1524 }, +1525 /** +1526 * This method changes Director's current Scene to the scene index indicated by +1527 * inSceneIndex parameter. The Scene running in the director won't be eased out. +1528 * +1529 * @see {CAAT.Interpolator} +1530 * @see {CAAT.Actor} +1531 * @see {CAAT.Scene} +1532 * +1533 * @param inSceneIndex integer indicating the new Scene to set as current. +1534 * @param type integer indicating the type of transition to apply to bring the new current +1535 * Scene to the Director. The values will be one of: CAAT.Scene.prototype.EASE_ROTATION, +1536 * CAAT.Scene.prototype.EASE_SCALE, CAAT.Scene.prototype.EASE_TRANSLATION. +1537 * @param time integer indicating how much time in milliseconds the Scene entrance will take. +1538 * @param alpha boolean indicating whether alpha transparency fading will be applied to the +1539 * entereing Scene. +1540 * @param anchor integer indicating the anchor to fix for Scene transition. It will be any of +1541 * CAAT.Actor.prototype.ANCHOR_* values. +1542 * @param interpolator an CAAT.Interpolator object indicating the interpolation function to +1543 * apply. +1544 */ +1545 easeIn:function (inSceneIndex, type, time, alpha, anchor, interpolator) { +1546 var sin = this.scenes[ inSceneIndex ]; +1547 if (type === CAAT.Foundation.Scene.EASE_ROTATION) { +1548 sin.easeRotationIn(time, alpha, anchor, interpolator); +1549 } else if (type === CAAT.Foundation.Scene.EASE_SCALE) { +1550 sin.easeScaleIn(0, time, alpha, anchor, interpolator); +1551 } else { +1552 sin.easeTranslationIn(time, alpha, anchor, interpolator); +1553 } +1554 this.childrenList = []; +1555 this.addChild(sin); +1556 +1557 sin.resetTransform(); +1558 sin.setLocation(0, 0); +1559 sin.alpha = 1; +1560 sin.mouseEnabled = false; +1561 sin.setExpired(false); +1562 }, +1563 /** +1564 * Changes (or sets) the current Director scene to the index +1565 * parameter. There will be no transition on scene change. +1566 * @param sceneIndex {number} an integer indicating the index of the target Scene +1567 * to be shown. +1568 */ +1569 setScene:function (sceneIndex) { +1570 var sin = this.scenes[ sceneIndex ]; +1571 this.childrenList = []; +1572 this.addChild(sin); +1573 this.currentScene = sin; +1574 +1575 sin.setExpired(false); +1576 sin.mouseEnabled = true; +1577 sin.resetTransform(); +1578 sin.setLocation(0, 0); +1579 sin.alpha = 1; +1580 +1581 sin.getIn(); +1582 sin.activated(); +1583 }, +1584 /** +1585 * This method will change the current Scene by the Scene indicated as parameter. +1586 * It will apply random values for anchor and transition type. +1587 * @see easeInOutRandom +1588 * +1589 * @param iNewSceneIndex {number} an integer indicating the index of the new scene to run on the Director. +1590 * @param time {number} an integer indicating the time the Scene transition will take. +1591 * @param alpha {boolean} a boolean indicating whether Scene transition should be fading. +1592 * @param transition {boolean} a boolean indicating whether the scene change must smoothly animated. +1593 */ +1594 switchToScene:function (iNewSceneIndex, time, alpha, transition) { +1595 var currentSceneIndex = this.getSceneIndex(this.currentScene); +1596 +1597 if (!transition) { +1598 this.setScene(iNewSceneIndex); +1599 } +1600 else { +1601 this.easeInOutRandom(iNewSceneIndex, currentSceneIndex, time, alpha); +1602 } +1603 }, +1604 /** +1605 * Sets the previous Scene in sequence as the current Scene. +1606 * @see switchToScene. +1607 * +1608 * @param time {number} integer indicating the time the Scene transition will take. +1609 * @param alpha {boolean} a boolean indicating whether Scene transition should be fading. +1610 * @param transition {boolean} a boolean indicating whether the scene change must smoothly animated. +1611 */ +1612 switchToPrevScene:function (time, alpha, transition) { +1613 +1614 var currentSceneIndex = this.getSceneIndex(this.currentScene); +1615 +1616 if (this.getNumScenes() <= 1 || currentSceneIndex === 0) { +1617 return; +1618 } +1619 +1620 if (!transition) { +1621 this.setScene(currentSceneIndex - 1); +1622 } +1623 else { +1624 this.easeInOutRandom(currentSceneIndex - 1, currentSceneIndex, time, alpha); +1625 } +1626 }, +1627 /** +1628 * Sets the previous Scene in sequence as the current Scene. +1629 * @see switchToScene. +1630 * +1631 * @param time {number} integer indicating the time the Scene transition will take. +1632 * @param alpha {boolean} a boolean indicating whether Scene transition should be fading. +1633 * @param transition {boolean} a boolean indicating whether the scene change must smoothly animated. +1634 */ +1635 switchToNextScene:function (time, alpha, transition) { +1636 +1637 var currentSceneIndex = this.getSceneIndex(this.currentScene); +1638 +1639 if (this.getNumScenes() <= 1 || currentSceneIndex === this.getNumScenes() - 1) { +1640 return; +1641 } +1642 +1643 if (!transition) { +1644 this.setScene(currentSceneIndex + 1); +1645 } +1646 else { +1647 this.easeInOutRandom(currentSceneIndex + 1, currentSceneIndex, time, alpha); +1648 } +1649 }, +1650 mouseEnter:function (mouseEvent) { +1651 }, +1652 mouseExit:function (mouseEvent) { +1653 }, +1654 mouseMove:function (mouseEvent) { +1655 }, +1656 mouseDown:function (mouseEvent) { +1657 }, +1658 mouseUp:function (mouseEvent) { +1659 }, +1660 mouseDrag:function (mouseEvent) { +1661 }, +1662 /** +1663 * Scene easing listener. Notifies scenes when they're about to be activated (set as current +1664 * director's scene). +1665 * +1666 * @param scene {CAAT.Foundation.Scene} the scene that has just been brought in or taken out of the director. +1667 * @param b_easeIn {boolean} scene enters or exits ? +1668 */ +1669 easeEnd:function (scene, b_easeIn) { +1670 // scene is going out +1671 if (!b_easeIn) { +1672 +1673 scene.setExpired(true); +1674 } else { +1675 this.currentScene = scene; +1676 this.currentScene.activated(); +1677 } +1678 +1679 scene.mouseEnabled = true; +1680 scene.emptyBehaviorList(); +1681 }, +1682 /** +1683 * Return the index for a given Scene object contained in the Director. +1684 * @param scene {CAAT.Foundation.Scene} +1685 */ +1686 getSceneIndex:function (scene) { +1687 for (var i = 0; i < this.scenes.length; i++) { +1688 if (this.scenes[i] === scene) { +1689 return i; +1690 } +1691 } +1692 return -1; +1693 }, +1694 /** +1695 * Get a concrete director's scene. +1696 * @param index {number} an integer indicating the scene index. +1697 * @return {CAAT.Foundation.Scene} a CAAT.Scene object instance or null if the index is oob. +1698 */ +1699 getScene:function (index) { +1700 return this.scenes[index]; +1701 }, +1702 getSceneById : function(id) { +1703 for( var i=0; i<this.scenes.length; i++ ) { +1704 if (this.scenes[i].id===id) { +1705 return this.scenes[i]; +1706 } +1707 } +1708 return null; +1709 }, +1710 /** +1711 * Return the index of the current scene in the Director's scene list. +1712 * @return {number} the current scene's index. +1713 */ +1714 getCurrentSceneIndex:function () { +1715 return this.getSceneIndex(this.currentScene); +1716 }, +1717 /** +1718 * Return the running browser name. +1719 * @return {string} the browser name. +1720 */ +1721 getBrowserName:function () { +1722 return this.browserInfo.browser; +1723 }, +1724 /** +1725 * Return the running browser version. +1726 * @return {string} the browser version. +1727 */ +1728 getBrowserVersion:function () { +1729 return this.browserInfo.version; +1730 }, +1731 /** +1732 * Return the operating system name. +1733 * @return {string} the os name. +1734 */ +1735 getOSName:function () { +1736 return this.browserInfo.OS; +1737 }, +1738 /** +1739 * Gets the resource with the specified resource name. +1740 * The Director holds a collection called <code>imagesCache</code> +1741 * where you can store a JSON of the form +1742 * <code>[ { id: imageId, image: imageObject } ]</code>. +1743 * This structure will be used as a resources cache. +1744 * There's a CAAT.Module.ImagePreloader class to preload resources and +1745 * generate this structure on loading finalization. +1746 * +1747 * @param sId {object} an String identifying a resource. +1748 */ +1749 getImage:function (sId) { +1750 var ret = this.imagesCache[sId]; +1751 if (ret) { +1752 return ret; +1753 } +1754 +1755 //for (var i = 0; i < this.imagesCache.length; i++) { +1756 for( var i in this.imagesCache ) { +1757 if (this.imagesCache[i].id === sId) { +1758 return this.imagesCache[i].image; +1759 } +1760 } +1761 +1762 return null; +1763 }, +1764 musicPlay: function(id) { +1765 return this.audioManager.playMusic(id); +1766 }, +1767 musicStop : function() { +1768 this.audioManager.stopMusic(); +1769 }, +1770 /** +1771 * Adds an audio to the cache. +1772 * +1773 * @see CAAT.Module.Audio.AudioManager.addAudio +1774 * @return this +1775 */ +1776 addAudio:function (id, url) { +1777 this.audioManager.addAudio(id, url); +1778 return this; +1779 }, +1780 /** +1781 * Plays the audio instance identified by the id. +1782 * @param id {object} the object used to store a sound in the audioCache. +1783 */ +1784 audioPlay:function (id) { +1785 return this.audioManager.play(id); 1786 }, -1787 setSoundEffectsEnabled:function (enabled) { -1788 return this.audioManager.setSoundEffectsEnabled(enabled); -1789 }, -1790 setMusicEnabled:function (enabled) { -1791 return this.audioManager.setMusicEnabled(enabled); -1792 }, -1793 isMusicEnabled:function () { -1794 return this.audioManager.isMusicEnabled(); +1787 /** +1788 * Loops an audio instance identified by the id. +1789 * @param id {object} the object used to store a sound in the audioCache. +1790 * +1791 * @return {HTMLElement|null} the value from audioManager.loop +1792 */ +1793 audioLoop:function (id) { +1794 return this.audioManager.loop(id); 1795 }, -1796 isSoundEffectsEnabled:function () { -1797 return this.audioManager.isSoundEffectsEnabled(); +1796 endSound:function () { +1797 return this.audioManager.endSound(); 1798 }, -1799 setVolume:function (id, volume) { -1800 return this.audioManager.setVolume(id, volume); +1799 setSoundEffectsEnabled:function (enabled) { +1800 return this.audioManager.setSoundEffectsEnabled(enabled); 1801 }, -1802 /** -1803 * Removes Director's scenes. -1804 */ -1805 emptyScenes:function () { -1806 this.scenes = []; +1802 setMusicEnabled:function (enabled) { +1803 return this.audioManager.setMusicEnabled(enabled); +1804 }, +1805 isMusicEnabled:function () { +1806 return this.audioManager.isMusicEnabled(); 1807 }, -1808 /** -1809 * Adds an scene to this Director. -1810 * @param scene {CAAT.Foundation.Scene} a scene object. -1811 */ -1812 addChild:function (scene) { -1813 scene.parent = this; -1814 this.childrenList.push(scene); -1815 }, -1816 /** -1817 * @Deprecated use CAAT.loop instead. -1818 * @param fps -1819 * @param callback -1820 * @param callback2 -1821 */ -1822 loop:function (fps, callback, callback2) { -1823 if (callback2) { -1824 this.onRenderStart = callback; -1825 this.onRenderEnd = callback2; -1826 } else if (callback) { -1827 this.onRenderEnd = callback; -1828 } -1829 CAAT.loop(); -1830 }, -1831 /** -1832 * Starts the director animation.If no scene is explicitly selected, the current Scene will -1833 * be the first scene added to the Director. -1834 * <p> -1835 * The fps parameter will set the animation quality. Higher values, -1836 * means CAAT will try to render more frames in the same second (at the -1837 * expense of cpu power at least until hardware accelerated canvas rendering -1838 * context are available). A value of 60 is a high frame rate and should not be exceeded. -1839 * -1840 */ -1841 renderFrame:function () { -1842 -1843 CAAT.currentDirector = this; -1844 -1845 if (this.stopped) { -1846 return; -1847 } -1848 -1849 var t = new Date().getTime(), -1850 delta = t - this.timeline; -1851 -1852 /* -1853 check for massive frame time. if for example the current browser tab is minified or taken out of -1854 foreground, the system will account for a bit time interval. minify that impact by lowering down -1855 the elapsed time (virtual timelines FTW) -1856 */ -1857 if (delta > 500) { -1858 delta = 500; +1808 isSoundEffectsEnabled:function () { +1809 return this.audioManager.isSoundEffectsEnabled(); +1810 }, +1811 setVolume:function (id, volume) { +1812 return this.audioManager.setVolume(id, volume); +1813 }, +1814 /** +1815 * Removes Director's scenes. +1816 */ +1817 emptyScenes:function () { +1818 this.scenes = []; +1819 }, +1820 /** +1821 * Adds an scene to this Director. +1822 * @param scene {CAAT.Foundation.Scene} a scene object. +1823 */ +1824 addChild:function (scene) { +1825 scene.parent = this; +1826 this.childrenList.push(scene); +1827 }, +1828 /** +1829 * @Deprecated use CAAT.loop instead. +1830 * @param fps +1831 * @param callback +1832 * @param callback2 +1833 */ +1834 loop:function (fps, callback, callback2) { +1835 if (callback2) { +1836 this.onRenderStart = callback; +1837 this.onRenderEnd = callback2; +1838 } else if (callback) { +1839 this.onRenderEnd = callback; +1840 } +1841 CAAT.loop(); +1842 }, +1843 /** +1844 * Starts the director animation.If no scene is explicitly selected, the current Scene will +1845 * be the first scene added to the Director. +1846 * <p> +1847 * The fps parameter will set the animation quality. Higher values, +1848 * means CAAT will try to render more frames in the same second (at the +1849 * expense of cpu power at least until hardware accelerated canvas rendering +1850 * context are available). A value of 60 is a high frame rate and should not be exceeded. +1851 * +1852 */ +1853 renderFrame:function () { +1854 +1855 CAAT.currentDirector = this; +1856 +1857 if (this.stopped) { +1858 return; 1859 } 1860 -1861 if (this.onRenderStart) { -1862 this.onRenderStart(delta); -1863 } -1864 -1865 this.render(delta); -1866 -1867 if (this.debugInfo) { -1868 this.debugInfo(this.statistics); -1869 } -1870 -1871 this.timeline = t; +1861 var t = new Date().getTime(), +1862 delta = t - this.timeline; +1863 +1864 /* +1865 check for massive frame time. if for example the current browser tab is minified or taken out of +1866 foreground, the system will account for a bit time interval. minify that impact by lowering down +1867 the elapsed time (virtual timelines FTW) +1868 */ +1869 if (delta > 500) { +1870 delta = 500; +1871 } 1872 -1873 if (this.onRenderEnd) { -1874 this.onRenderEnd(delta); +1873 if (this.onRenderStart) { +1874 this.onRenderStart(delta); 1875 } 1876 -1877 this.needsRepaint = false; -1878 }, -1879 -1880 /** -1881 * If the director has renderingMode: DIRTY, the timeline must be reset to register accurate frame measurement. -1882 */ -1883 resetTimeline:function () { -1884 this.timeline = new Date().getTime(); -1885 }, -1886 -1887 endLoop:function () { -1888 }, -1889 /** -1890 * This method states whether the director must clear background before rendering -1891 * each frame. -1892 * -1893 * The clearing method could be: -1894 * + CAAT.Director.CLEAR_ALL. previous to draw anything on screen the canvas will have clearRect called on it. -1895 * + CAAT.Director.CLEAR_DIRTY_RECTS. Actors marked as invalid, or which have been moved, rotated or scaled -1896 * will have their areas redrawn. -1897 * + CAAT.Director.CLEAR_NONE. clears nothing. -1898 * -1899 * @param clear {CAAT.Director.CLEAR_ALL | CAAT.Director.CLEAR_NONE | CAAT.Director.CLEAR_DIRTY_RECTS} -1900 * @return this. -1901 */ -1902 setClear:function (clear) { -1903 this.clear = clear; -1904 if (this.clear === CAAT.Foundation.Director.CLEAR_DIRTY_RECTS) { -1905 this.dirtyRectsEnabled = true; -1906 } else { -1907 this.dirtyRectsEnabled= false; -1908 } -1909 return this; -1910 }, -1911 /** -1912 * Get this Director's AudioManager instance. -1913 * @return {CAAT.AudioManager} the AudioManager instance. -1914 */ -1915 getAudioManager:function () { -1916 return this.audioManager; -1917 }, -1918 /** -1919 * Acculumate dom elements position to properly offset on-screen mouse/touch events. -1920 * @param node -1921 */ -1922 cumulateOffset:function (node, parent, prop) { -1923 var left = prop + 'Left'; -1924 var top = prop + 'Top'; -1925 var x = 0, y = 0, style; -1926 -1927 while (navigator.browser !== 'iOS' && node && node.style) { -1928 if (node.currentStyle) { -1929 style = node.currentStyle['position']; -1930 } else { -1931 style = (node.ownerDocument.defaultView || node.ownerDocument.parentWindow).getComputedStyle(node, null); -1932 style = style ? style.getPropertyValue('position') : null; -1933 } -1934 -1935 // if (!/^(relative|absolute|fixed)$/.test(style)) { -1936 if (!/^(fixed)$/.test(style)) { -1937 x += node[left]; -1938 y += node[top]; -1939 node = node[parent]; -1940 } else { -1941 break; -1942 } -1943 } -1944 -1945 return { -1946 x:x, -1947 y:y, -1948 style:style -1949 }; -1950 }, -1951 getOffset:function (node) { -1952 var res = this.cumulateOffset(node, 'offsetParent', 'offset'); -1953 if (res.style === 'fixed') { -1954 var res2 = this.cumulateOffset(node, node.parentNode ? 'parentNode' : 'parentElement', 'scroll'); -1955 return { -1956 x:res.x + res2.x, -1957 y:res.y + res2.y -1958 }; -1959 } -1960 -1961 return { -1962 x:res.x, -1963 y:res.y -1964 }; -1965 }, -1966 /** -1967 * Normalize input event coordinates to be related to (0,0) canvas position. -1968 * @param point {CAAT.Math.Point} canvas coordinate. -1969 * @param e {MouseEvent} a mouse event from an input event. -1970 */ -1971 getCanvasCoord:function (point, e) { +1877 this.render(delta); +1878 +1879 if (this.debugInfo) { +1880 this.debugInfo(this.statistics); +1881 } +1882 +1883 this.timeline = t; +1884 +1885 if (this.onRenderEnd) { +1886 this.onRenderEnd(delta); +1887 } +1888 +1889 this.needsRepaint = false; +1890 }, +1891 +1892 /** +1893 * If the director has renderingMode: DIRTY, the timeline must be reset to register accurate frame measurement. +1894 */ +1895 resetTimeline:function () { +1896 this.timeline = new Date().getTime(); +1897 }, +1898 +1899 endLoop:function () { +1900 }, +1901 /** +1902 * This method states whether the director must clear background before rendering +1903 * each frame. +1904 * +1905 * The clearing method could be: +1906 * + CAAT.Director.CLEAR_ALL. previous to draw anything on screen the canvas will have clearRect called on it. +1907 * + CAAT.Director.CLEAR_DIRTY_RECTS. Actors marked as invalid, or which have been moved, rotated or scaled +1908 * will have their areas redrawn. +1909 * + CAAT.Director.CLEAR_NONE. clears nothing. +1910 * +1911 * @param clear {CAAT.Director.CLEAR_ALL | CAAT.Director.CLEAR_NONE | CAAT.Director.CLEAR_DIRTY_RECTS} +1912 * @return this. +1913 */ +1914 setClear:function (clear) { +1915 this.clear = clear; +1916 if (this.clear === CAAT.Foundation.Director.CLEAR_DIRTY_RECTS) { +1917 this.dirtyRectsEnabled = true; +1918 } else { +1919 this.dirtyRectsEnabled= false; +1920 } +1921 return this; +1922 }, +1923 /** +1924 * Get this Director's AudioManager instance. +1925 * @return {CAAT.AudioManager} the AudioManager instance. +1926 */ +1927 getAudioManager:function () { +1928 return this.audioManager; +1929 }, +1930 /** +1931 * Acculumate dom elements position to properly offset on-screen mouse/touch events. +1932 * @param node +1933 */ +1934 cumulateOffset:function (node, parent, prop) { +1935 var left = prop + 'Left'; +1936 var top = prop + 'Top'; +1937 var x = 0, y = 0, style; +1938 +1939 while (navigator.browser !== 'iOS' && node && node.style) { +1940 if (node.currentStyle) { +1941 style = node.currentStyle['position']; +1942 } else { +1943 style = (node.ownerDocument.defaultView || node.ownerDocument.parentWindow).getComputedStyle(node, null); +1944 style = style ? style.getPropertyValue('position') : null; +1945 } +1946 +1947 // if (!/^(relative|absolute|fixed)$/.test(style)) { +1948 if (!/^(fixed)$/.test(style)) { +1949 x += node[left]; +1950 y += node[top]; +1951 node = node[parent]; +1952 } else { +1953 break; +1954 } +1955 } +1956 +1957 return { +1958 x:x, +1959 y:y, +1960 style:style +1961 }; +1962 }, +1963 getOffset:function (node) { +1964 var res = this.cumulateOffset(node, 'offsetParent', 'offset'); +1965 if (res.style === 'fixed') { +1966 var res2 = this.cumulateOffset(node, node.parentNode ? 'parentNode' : 'parentElement', 'scroll'); +1967 return { +1968 x:res.x + res2.x, +1969 y:res.y + res2.y +1970 }; +1971 } 1972 -1973 var pt = new CAAT.Math.Point(); -1974 var posx = 0; -1975 var posy = 0; -1976 if (!e) e = window.event; -1977 -1978 if (e.pageX || e.pageY) { -1979 posx = e.pageX; -1980 posy = e.pageY; -1981 } -1982 else if (e.clientX || e.clientY) { -1983 posx = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft; -1984 posy = e.clientY + document.body.scrollTop + document.documentElement.scrollTop; -1985 } -1986 -1987 var offset = this.getOffset(this.canvas); -1988 -1989 posx -= offset.x; -1990 posy -= offset.y; -1991 -1992 posx*= this.SCREEN_RATIO; -1993 posy*= this.SCREEN_RATIO; -1994 -1995 ////////////// -1996 // transformar coordenada inversamente con affine transform de director. -1997 -1998 pt.x = posx; -1999 pt.y = posy; -2000 if (!this.modelViewMatrixI) { -2001 this.modelViewMatrixI = this.modelViewMatrix.getInverse(); -2002 } -2003 this.modelViewMatrixI.transformCoord(pt); -2004 posx = pt.x; -2005 posy = pt.y +1973 return { +1974 x:res.x, +1975 y:res.y +1976 }; +1977 }, +1978 /** +1979 * Normalize input event coordinates to be related to (0,0) canvas position. +1980 * @param point {CAAT.Math.Point} canvas coordinate. +1981 * @param e {MouseEvent} a mouse event from an input event. +1982 */ +1983 getCanvasCoord:function (point, e) { +1984 +1985 var pt = new CAAT.Math.Point(); +1986 var posx = 0; +1987 var posy = 0; +1988 if (!e) e = window.event; +1989 +1990 if (e.pageX || e.pageY) { +1991 posx = e.pageX; +1992 posy = e.pageY; +1993 } +1994 else if (e.clientX || e.clientY) { +1995 posx = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft; +1996 posy = e.clientY + document.body.scrollTop + document.documentElement.scrollTop; +1997 } +1998 +1999 var offset = this.getOffset(this.canvas); +2000 +2001 posx -= offset.x; +2002 posy -= offset.y; +2003 +2004 posx*= this.SCREEN_RATIO; +2005 posy*= this.SCREEN_RATIO; 2006 -2007 point.set(posx, posy); -2008 this.screenMousePoint.set(posx, posy); +2007 ////////////// +2008 // transformar coordenada inversamente con affine transform de director. 2009 -2010 }, -2011 -2012 __mouseDownHandler:function (e) { -2013 -2014 /* -2015 was dragging and mousedown detected, can only mean a mouseOut's been performed and on mouseOver, no -2016 button was presses. Then, send a mouseUp for the previos actor, and return; -2017 */ -2018 if (this.dragging && this.lastSelectedActor) { -2019 this.__mouseUpHandler(e); -2020 return; -2021 } -2022 -2023 this.getCanvasCoord(this.mousePoint, e); -2024 this.isMouseDown = true; -2025 var lactor = this.findActorAtPosition(this.mousePoint); -2026 -2027 if (null !== lactor) { -2028 -2029 var pos = lactor.viewToModel( -2030 new CAAT.Math.Point(this.screenMousePoint.x, this.screenMousePoint.y, 0)); -2031 -2032 lactor.mouseDown( -2033 new CAAT.Event.MouseEvent().init( -2034 pos.x, -2035 pos.y, -2036 e, -2037 lactor, -2038 new CAAT.Math.Point( -2039 this.screenMousePoint.x, -2040 this.screenMousePoint.y))); -2041 } -2042 -2043 this.lastSelectedActor = lactor; -2044 }, -2045 -2046 __mouseUpHandler:function (e) { -2047 -2048 this.isMouseDown = false; -2049 this.getCanvasCoord(this.mousePoint, e); -2050 -2051 var pos = null; -2052 var lactor = this.lastSelectedActor; -2053 -2054 if (null !== lactor) { -2055 pos = lactor.viewToModel( -2056 new CAAT.Math.Point(this.screenMousePoint.x, this.screenMousePoint.y, 0)); -2057 if (lactor.actionPerformed && lactor.contains(pos.x, pos.y)) { -2058 lactor.actionPerformed(e) -2059 } -2060 -2061 lactor.mouseUp( -2062 new CAAT.Event.MouseEvent().init( -2063 pos.x, -2064 pos.y, -2065 e, -2066 lactor, -2067 this.screenMousePoint, -2068 this.currentScene.time)); -2069 } -2070 -2071 if (!this.dragging && null !== lactor) { -2072 if (lactor.contains(pos.x, pos.y)) { -2073 lactor.mouseClick( -2074 new CAAT.Event.MouseEvent().init( -2075 pos.x, -2076 pos.y, -2077 e, -2078 lactor, -2079 this.screenMousePoint, -2080 this.currentScene.time)); -2081 } -2082 } -2083 -2084 this.dragging = false; -2085 this.in_ = false; -2086 // CAAT.setCursor('default'); -2087 }, -2088 -2089 __mouseMoveHandler:function (e) { -2090 //this.getCanvasCoord(this.mousePoint, e); -2091 -2092 var lactor; -2093 var pos; -2094 -2095 var ct = this.currentScene ? this.currentScene.time : 0; -2096 -2097 // drag -2098 -2099 if (this.isMouseDown && null!==this.lastSelectedActor) { +2010 pt.x = posx; +2011 pt.y = posy; +2012 if (!this.modelViewMatrixI) { +2013 this.modelViewMatrixI = this.modelViewMatrix.getInverse(); +2014 } +2015 this.modelViewMatrixI.transformCoord(pt); +2016 posx = pt.x; +2017 posy = pt.y +2018 +2019 point.set(posx, posy); +2020 this.screenMousePoint.set(posx, posy); +2021 +2022 }, +2023 +2024 __mouseDownHandler:function (e) { +2025 +2026 /* +2027 was dragging and mousedown detected, can only mean a mouseOut's been performed and on mouseOver, no +2028 button was presses. Then, send a mouseUp for the previos actor, and return; +2029 */ +2030 if (this.dragging && this.lastSelectedActor) { +2031 this.__mouseUpHandler(e); +2032 return; +2033 } +2034 +2035 this.getCanvasCoord(this.mousePoint, e); +2036 this.isMouseDown = true; +2037 var lactor = this.findActorAtPosition(this.mousePoint); +2038 +2039 if (null !== lactor) { +2040 +2041 var pos = lactor.viewToModel( +2042 new CAAT.Math.Point(this.screenMousePoint.x, this.screenMousePoint.y, 0)); +2043 +2044 lactor.mouseDown( +2045 new CAAT.Event.MouseEvent().init( +2046 pos.x, +2047 pos.y, +2048 e, +2049 lactor, +2050 new CAAT.Math.Point( +2051 this.screenMousePoint.x, +2052 this.screenMousePoint.y))); +2053 } +2054 +2055 this.lastSelectedActor = lactor; +2056 }, +2057 +2058 __mouseUpHandler:function (e) { +2059 +2060 this.isMouseDown = false; +2061 this.getCanvasCoord(this.mousePoint, e); +2062 +2063 var pos = null; +2064 var lactor = this.lastSelectedActor; +2065 +2066 if (null !== lactor) { +2067 pos = lactor.viewToModel( +2068 new CAAT.Math.Point(this.screenMousePoint.x, this.screenMousePoint.y, 0)); +2069 if (lactor.actionPerformed && lactor.contains(pos.x, pos.y)) { +2070 lactor.actionPerformed(e) +2071 } +2072 +2073 lactor.mouseUp( +2074 new CAAT.Event.MouseEvent().init( +2075 pos.x, +2076 pos.y, +2077 e, +2078 lactor, +2079 this.screenMousePoint, +2080 this.currentScene.time)); +2081 } +2082 +2083 if (!this.dragging && null !== lactor) { +2084 if (lactor.contains(pos.x, pos.y)) { +2085 lactor.mouseClick( +2086 new CAAT.Event.MouseEvent().init( +2087 pos.x, +2088 pos.y, +2089 e, +2090 lactor, +2091 this.screenMousePoint, +2092 this.currentScene.time)); +2093 } +2094 } +2095 +2096 this.dragging = false; +2097 this.in_ = false; +2098 // CAAT.setCursor('default'); +2099 }, 2100 -2101 lactor = this.lastSelectedActor; -2102 pos = lactor.viewToModel( -2103 new CAAT.Math.Point(this.screenMousePoint.x, this.screenMousePoint.y, 0)); -2104 -2105 // check for mouse move threshold. -2106 if (!this.dragging) { -2107 if (Math.abs(this.prevMousePoint.x - pos.x) < CAAT.DRAG_THRESHOLD_X || -2108 Math.abs(this.prevMousePoint.y - pos.y) < CAAT.DRAG_THRESHOLD_Y) { -2109 return; -2110 } -2111 } +2101 __mouseMoveHandler:function (e) { +2102 //this.getCanvasCoord(this.mousePoint, e); +2103 +2104 var lactor; +2105 var pos; +2106 +2107 var ct = this.currentScene ? this.currentScene.time : 0; +2108 +2109 // drag +2110 +2111 if (this.isMouseDown && null!==this.lastSelectedActor) { 2112 -2113 this.dragging = true; -2114 -2115 var px = lactor.x; -2116 var py = lactor.y; -2117 lactor.mouseDrag( -2118 new CAAT.Event.MouseEvent().init( -2119 pos.x, -2120 pos.y, -2121 e, -2122 lactor, -2123 new CAAT.Math.Point( -2124 this.screenMousePoint.x, -2125 this.screenMousePoint.y), -2126 ct)); -2127 -2128 this.prevMousePoint.x = pos.x; -2129 this.prevMousePoint.y = pos.y; -2130 -2131 /** -2132 * Element has not moved after drag, so treat it as a button. -2133 */ -2134 if (px === lactor.x && py === lactor.y) { -2135 -2136 var contains = lactor.contains(pos.x, pos.y); -2137 -2138 if (this.in_ && !contains) { -2139 lactor.mouseExit( -2140 new CAAT.Event.MouseEvent().init( -2141 pos.x, -2142 pos.y, -2143 e, -2144 lactor, -2145 this.screenMousePoint, -2146 ct)); -2147 this.in_ = false; -2148 } +2113 lactor = this.lastSelectedActor; +2114 pos = lactor.viewToModel( +2115 new CAAT.Math.Point(this.screenMousePoint.x, this.screenMousePoint.y, 0)); +2116 +2117 // check for mouse move threshold. +2118 if (!this.dragging) { +2119 if (Math.abs(this.prevMousePoint.x - pos.x) < CAAT.DRAG_THRESHOLD_X && +2120 Math.abs(this.prevMousePoint.y - pos.y) < CAAT.DRAG_THRESHOLD_Y) { +2121 return; +2122 } +2123 } +2124 +2125 this.dragging = true; +2126 +2127 var px = lactor.x; +2128 var py = lactor.y; +2129 lactor.mouseDrag( +2130 new CAAT.Event.MouseEvent().init( +2131 pos.x, +2132 pos.y, +2133 e, +2134 lactor, +2135 new CAAT.Math.Point( +2136 this.screenMousePoint.x, +2137 this.screenMousePoint.y), +2138 ct)); +2139 +2140 this.prevMousePoint.x = pos.x; +2141 this.prevMousePoint.y = pos.y; +2142 +2143 /** +2144 * Element has not moved after drag, so treat it as a button. +2145 */ +2146 if (px === lactor.x && py === lactor.y) { +2147 +2148 var contains = lactor.contains(pos.x, pos.y); 2149 -2150 if (!this.in_ && contains) { -2151 lactor.mouseEnter( +2150 if (this.in_ && !contains) { +2151 lactor.mouseExit( 2152 new CAAT.Event.MouseEvent().init( 2153 pos.x, 2154 pos.y, @@ -2163,846 +2163,858 @@ 2156 lactor, 2157 this.screenMousePoint, 2158 ct)); -2159 this.in_ = true; +2159 this.in_ = false; 2160 } -2161 } -2162 -2163 return; -2164 } -2165 -2166 // mouse move. -2167 this.in_ = true; -2168 -2169 lactor = this.findActorAtPosition(this.mousePoint); -2170 -2171 // cambiamos de actor. -2172 if (lactor !== this.lastSelectedActor) { -2173 if (null !== this.lastSelectedActor) { +2161 +2162 if (!this.in_ && contains) { +2163 lactor.mouseEnter( +2164 new CAAT.Event.MouseEvent().init( +2165 pos.x, +2166 pos.y, +2167 e, +2168 lactor, +2169 this.screenMousePoint, +2170 ct)); +2171 this.in_ = true; +2172 } +2173 } 2174 -2175 pos = this.lastSelectedActor.viewToModel( -2176 new CAAT.Math.Point(this.screenMousePoint.x, this.screenMousePoint.y, 0)); +2175 return; +2176 } 2177 -2178 this.lastSelectedActor.mouseExit( -2179 new CAAT.Event.MouseEvent().init( -2180 pos.x, -2181 pos.y, -2182 e, -2183 this.lastSelectedActor, -2184 this.screenMousePoint, -2185 ct)); -2186 } -2187 -2188 if (null !== lactor) { -2189 pos = lactor.viewToModel( -2190 new CAAT.Math.Point(this.screenMousePoint.x, this.screenMousePoint.y, 0)); -2191 -2192 lactor.mouseEnter( -2193 new CAAT.Event.MouseEvent().init( -2194 pos.x, -2195 pos.y, -2196 e, -2197 lactor, -2198 this.screenMousePoint, -2199 ct)); -2200 } -2201 } -2202 -2203 pos = lactor.viewToModel( -2204 new CAAT.Math.Point(this.screenMousePoint.x, this.screenMousePoint.y, 0)); -2205 -2206 if (null !== lactor) { -2207 -2208 lactor.mouseMove( -2209 new CAAT.Event.MouseEvent().init( -2210 pos.x, -2211 pos.y, -2212 e, -2213 lactor, -2214 this.screenMousePoint, -2215 ct)); -2216 } +2178 // mouse move. +2179 this.in_ = true; +2180 +2181 lactor = this.findActorAtPosition(this.mousePoint); +2182 +2183 // cambiamos de actor. +2184 if (lactor !== this.lastSelectedActor) { +2185 if (null !== this.lastSelectedActor) { +2186 +2187 pos = this.lastSelectedActor.viewToModel( +2188 new CAAT.Math.Point(this.screenMousePoint.x, this.screenMousePoint.y, 0)); +2189 +2190 this.lastSelectedActor.mouseExit( +2191 new CAAT.Event.MouseEvent().init( +2192 pos.x, +2193 pos.y, +2194 e, +2195 this.lastSelectedActor, +2196 this.screenMousePoint, +2197 ct)); +2198 } +2199 +2200 if (null !== lactor) { +2201 pos = lactor.viewToModel( +2202 new CAAT.Math.Point(this.screenMousePoint.x, this.screenMousePoint.y, 0)); +2203 +2204 lactor.mouseEnter( +2205 new CAAT.Event.MouseEvent().init( +2206 pos.x, +2207 pos.y, +2208 e, +2209 lactor, +2210 this.screenMousePoint, +2211 ct)); +2212 } +2213 } +2214 +2215 pos = lactor.viewToModel( +2216 new CAAT.Math.Point(this.screenMousePoint.x, this.screenMousePoint.y, 0)); 2217 -2218 this.prevMousePoint.x = pos.x; -2219 this.prevMousePoint.y = pos.y; -2220 -2221 this.lastSelectedActor = lactor; -2222 }, -2223 -2224 __mouseOutHandler:function (e) { -2225 -2226 if (this.dragging) { -2227 return; +2218 if (null !== lactor) { +2219 +2220 lactor.mouseMove( +2221 new CAAT.Event.MouseEvent().init( +2222 pos.x, +2223 pos.y, +2224 e, +2225 lactor, +2226 this.screenMousePoint, +2227 ct)); 2228 } 2229 -2230 if (null !== this.lastSelectedActor) { -2231 -2232 this.getCanvasCoord(this.mousePoint, e); -2233 var pos = new CAAT.Math.Point(this.mousePoint.x, this.mousePoint.y, 0); -2234 this.lastSelectedActor.viewToModel(pos); +2230 this.prevMousePoint.x = pos.x; +2231 this.prevMousePoint.y = pos.y; +2232 +2233 this.lastSelectedActor = lactor; +2234 }, 2235 -2236 var ev = new CAAT.Event.MouseEvent().init( -2237 pos.x, -2238 pos.y, -2239 e, -2240 this.lastSelectedActor, -2241 this.screenMousePoint, -2242 this.currentScene.time); +2236 __mouseOutHandler:function (e) { +2237 +2238 if (this.dragging) { +2239 return; +2240 } +2241 +2242 if (null !== this.lastSelectedActor) { 2243 -2244 this.lastSelectedActor.mouseExit(ev); -2245 this.lastSelectedActor.mouseOut(ev); -2246 if (!this.dragging) { -2247 this.lastSelectedActor = null; -2248 } -2249 } else { -2250 this.isMouseDown = false; -2251 this.in_ = false; -2252 -2253 } -2254 -2255 }, -2256 -2257 __mouseOverHandler:function (e) { -2258 -2259 if (this.dragging) { -2260 return; -2261 } -2262 -2263 var lactor; -2264 var pos, ev; -2265 -2266 if (null == this.lastSelectedActor) { -2267 lactor = this.findActorAtPosition(this.mousePoint); +2244 this.getCanvasCoord(this.mousePoint, e); +2245 var pos = new CAAT.Math.Point(this.mousePoint.x, this.mousePoint.y, 0); +2246 this.lastSelectedActor.viewToModel(pos); +2247 +2248 var ev = new CAAT.Event.MouseEvent().init( +2249 pos.x, +2250 pos.y, +2251 e, +2252 this.lastSelectedActor, +2253 this.screenMousePoint, +2254 this.currentScene.time); +2255 +2256 this.lastSelectedActor.mouseExit(ev); +2257 this.lastSelectedActor.mouseOut(ev); +2258 if (!this.dragging) { +2259 this.lastSelectedActor = null; +2260 } +2261 } else { +2262 this.isMouseDown = false; +2263 this.in_ = false; +2264 +2265 } +2266 +2267 }, 2268 -2269 if (null !== lactor) { +2269 __mouseOverHandler:function (e) { 2270 -2271 pos = lactor.viewToModel( -2272 new CAAT.Math.Point(this.screenMousePoint.x, this.screenMousePoint.y, 0)); -2273 -2274 ev = new CAAT.Event.MouseEvent().init( -2275 pos.x, -2276 pos.y, -2277 e, -2278 lactor, -2279 this.screenMousePoint, -2280 this.currentScene ? this.currentScene.time : 0); -2281 -2282 lactor.mouseOver(ev); -2283 lactor.mouseEnter(ev); -2284 } +2271 if (this.dragging) { +2272 return; +2273 } +2274 +2275 var lactor; +2276 var pos, ev; +2277 +2278 if (null == this.lastSelectedActor) { +2279 lactor = this.findActorAtPosition(this.mousePoint); +2280 +2281 if (null !== lactor) { +2282 +2283 pos = lactor.viewToModel( +2284 new CAAT.Math.Point(this.screenMousePoint.x, this.screenMousePoint.y, 0)); 2285 -2286 this.lastSelectedActor = lactor; -2287 } else { -2288 lactor = this.lastSelectedActor; -2289 pos = lactor.viewToModel( -2290 new CAAT.Math.Point(this.screenMousePoint.x, this.screenMousePoint.y, 0)); -2291 -2292 ev = new CAAT.Event.MouseEvent().init( -2293 pos.x, -2294 pos.y, -2295 e, -2296 lactor, -2297 this.screenMousePoint, -2298 this.currentScene.time); -2299 -2300 lactor.mouseOver(ev); -2301 lactor.mouseEnter(ev); -2302 -2303 } -2304 }, -2305 -2306 __mouseDBLClickHandler:function (e) { -2307 -2308 this.getCanvasCoord(this.mousePoint, e); -2309 if (null !== this.lastSelectedActor) { -2310 /* -2311 var pos = this.lastSelectedActor.viewToModel( -2312 new CAAT.Point(this.screenMousePoint.x, this.screenMousePoint.y, 0)); -2313 */ -2314 this.lastSelectedActor.mouseDblClick( -2315 new CAAT.Event.MouseEvent().init( -2316 this.mousePoint.x, -2317 this.mousePoint.y, -2318 e, -2319 this.lastSelectedActor, -2320 this.screenMousePoint, -2321 this.currentScene.time)); -2322 } -2323 }, -2324 -2325 /** -2326 * Same as mouseDown but not preventing event. -2327 * Will only take care of first touch. -2328 * @param e -2329 */ -2330 __touchStartHandler:function (e) { -2331 -2332 if (e.target === this.canvas) { -2333 e.preventDefault(); -2334 e.returnValue = false; -2335 -2336 e = e.targetTouches[0]; -2337 -2338 var mp = this.mousePoint; -2339 this.getCanvasCoord(mp, e); -2340 if (mp.x < 0 || mp.y < 0 || mp.x >= this.width || mp.y >= this.height) { -2341 return; -2342 } +2286 ev = new CAAT.Event.MouseEvent().init( +2287 pos.x, +2288 pos.y, +2289 e, +2290 lactor, +2291 this.screenMousePoint, +2292 this.currentScene ? this.currentScene.time : 0); +2293 +2294 lactor.mouseOver(ev); +2295 lactor.mouseEnter(ev); +2296 } +2297 +2298 this.lastSelectedActor = lactor; +2299 } else { +2300 lactor = this.lastSelectedActor; +2301 pos = lactor.viewToModel( +2302 new CAAT.Math.Point(this.screenMousePoint.x, this.screenMousePoint.y, 0)); +2303 +2304 ev = new CAAT.Event.MouseEvent().init( +2305 pos.x, +2306 pos.y, +2307 e, +2308 lactor, +2309 this.screenMousePoint, +2310 this.currentScene.time); +2311 +2312 lactor.mouseOver(ev); +2313 lactor.mouseEnter(ev); +2314 +2315 } +2316 }, +2317 +2318 __mouseDBLClickHandler:function (e) { +2319 +2320 this.getCanvasCoord(this.mousePoint, e); +2321 if (null !== this.lastSelectedActor) { +2322 /* +2323 var pos = this.lastSelectedActor.viewToModel( +2324 new CAAT.Point(this.screenMousePoint.x, this.screenMousePoint.y, 0)); +2325 */ +2326 this.lastSelectedActor.mouseDblClick( +2327 new CAAT.Event.MouseEvent().init( +2328 this.mousePoint.x, +2329 this.mousePoint.y, +2330 e, +2331 this.lastSelectedActor, +2332 this.screenMousePoint, +2333 this.currentScene.time)); +2334 } +2335 }, +2336 +2337 /** +2338 * Same as mouseDown but not preventing event. +2339 * Will only take care of first touch. +2340 * @param e +2341 */ +2342 __touchStartHandler:function (e) { 2343 -2344 this.touching = true; -2345 -2346 this.__mouseDownHandler(e); -2347 } -2348 }, +2344 if (e.target === this.canvas) { +2345 e.preventDefault(); +2346 e.returnValue = false; +2347 +2348 e = e.targetTouches[0]; 2349 -2350 __touchEndHandler:function (e) { -2351 -2352 if (this.touching) { -2353 e.preventDefault(); -2354 e.returnValue = false; +2350 var mp = this.mousePoint; +2351 this.getCanvasCoord(mp, e); +2352 if (mp.x < 0 || mp.y < 0 || mp.x >= this.width || mp.y >= this.height) { +2353 return; +2354 } 2355 -2356 e = e.changedTouches[0]; -2357 var mp = this.mousePoint; -2358 this.getCanvasCoord(mp, e); -2359 -2360 this.touching = false; +2356 this.touching = true; +2357 +2358 this.__mouseDownHandler(e); +2359 } +2360 }, 2361 -2362 this.__mouseUpHandler(e); -2363 } -2364 }, -2365 -2366 __touchMoveHandler:function (e) { +2362 __touchEndHandler:function (e) { +2363 +2364 if (this.touching) { +2365 e.preventDefault(); +2366 e.returnValue = false; 2367 -2368 if (this.touching) { -2369 e.preventDefault(); -2370 e.returnValue = false; +2368 e = e.changedTouches[0]; +2369 var mp = this.mousePoint; +2370 this.getCanvasCoord(mp, e); 2371 -2372 if (this.gesturing) { -2373 return; -2374 } -2375 -2376 for (var i = 0; i < e.targetTouches.length; i++) { -2377 var ee = e.targetTouches[i]; -2378 var mp = this.mousePoint; -2379 this.getCanvasCoord(mp, ee); -2380 this.__mouseMoveHandler(ee); -2381 } -2382 } -2383 }, -2384 -2385 __gestureStart:function (scale, rotation) { -2386 this.gesturing = true; -2387 this.__gestureRotation = this.lastSelectedActor.rotationAngle; -2388 this.__gestureSX = this.lastSelectedActor.scaleX - 1; -2389 this.__gestureSY = this.lastSelectedActor.scaleY - 1; -2390 }, -2391 -2392 __gestureChange:function (scale, rotation) { -2393 if (typeof scale === 'undefined' || typeof rotation === 'undefined') { -2394 return; -2395 } +2372 this.touching = false; +2373 +2374 this.__mouseUpHandler(e); +2375 } +2376 }, +2377 +2378 __touchMoveHandler:function (e) { +2379 +2380 if (this.touching) { +2381 e.preventDefault(); +2382 e.returnValue = false; +2383 +2384 if (this.gesturing) { +2385 return; +2386 } +2387 +2388 for (var i = 0; i < e.targetTouches.length; i++) { +2389 var ee = e.targetTouches[i]; +2390 var mp = this.mousePoint; +2391 this.getCanvasCoord(mp, ee); +2392 this.__mouseMoveHandler(ee); +2393 } +2394 } +2395 }, 2396 -2397 if (this.lastSelectedActor !== null && this.lastSelectedActor.isGestureEnabled()) { -2398 this.lastSelectedActor.setRotation(rotation * Math.PI / 180 + this.__gestureRotation); -2399 -2400 this.lastSelectedActor.setScale( -2401 this.__gestureSX + scale, -2402 this.__gestureSY + scale); -2403 } -2404 -2405 }, -2406 -2407 __gestureEnd:function (scale, rotation) { -2408 this.gesturing = false; -2409 this.__gestureRotation = 0; -2410 this.__gestureScale = 0; -2411 }, -2412 -2413 __touchEndHandlerMT:function (e) { -2414 -2415 e.preventDefault(); -2416 e.returnValue = false; -2417 -2418 var i, j; -2419 var recent = []; -2420 -2421 /** -2422 * extrae actores afectados, y coordenadas relativas para ellos. -2423 * crear una coleccion touch-id : { actor, touch-event } -2424 */ -2425 for (i = 0; i < e.changedTouches.length; i++) { -2426 var _touch = e.changedTouches[i]; -2427 var id = _touch.identifier; -2428 recent.push(id); -2429 } -2430 -2431 -2432 /** -2433 * para los touch identificados, extraer que actores se han afectado. -2434 * crear eventos con la info de touch para cada uno. -2435 */ -2436 -2437 var actors = {}; -2438 for (i = 0; i < recent.length; i++) { -2439 var touchId = recent[ i ]; -2440 if (this.touches[ touchId ]) { -2441 var actor = this.touches[ touchId ].actor; +2397 __gestureStart:function (scale, rotation) { +2398 this.gesturing = true; +2399 this.__gestureRotation = this.lastSelectedActor.rotationAngle; +2400 this.__gestureSX = this.lastSelectedActor.scaleX - 1; +2401 this.__gestureSY = this.lastSelectedActor.scaleY - 1; +2402 }, +2403 +2404 __gestureChange:function (scale, rotation) { +2405 if (typeof scale === 'undefined' || typeof rotation === 'undefined') { +2406 return; +2407 } +2408 +2409 if (this.lastSelectedActor !== null && this.lastSelectedActor.isGestureEnabled()) { +2410 this.lastSelectedActor.setRotation(rotation * Math.PI / 180 + this.__gestureRotation); +2411 +2412 this.lastSelectedActor.setScale( +2413 this.__gestureSX + scale, +2414 this.__gestureSY + scale); +2415 } +2416 +2417 }, +2418 +2419 __gestureEnd:function (scale, rotation) { +2420 this.gesturing = false; +2421 this.__gestureRotation = 0; +2422 this.__gestureScale = 0; +2423 }, +2424 +2425 __touchEndHandlerMT:function (e) { +2426 +2427 e.preventDefault(); +2428 e.returnValue = false; +2429 +2430 var i, j; +2431 var recent = []; +2432 +2433 /** +2434 * extrae actores afectados, y coordenadas relativas para ellos. +2435 * crear una coleccion touch-id : { actor, touch-event } +2436 */ +2437 for (i = 0; i < e.changedTouches.length; i++) { +2438 var _touch = e.changedTouches[i]; +2439 var id = _touch.identifier; +2440 recent.push(id); +2441 } 2442 -2443 if (!actors[actor.id]) { -2444 actors[actor.id] = { -2445 actor:actor, -2446 touch:new CAAT.Event.TouchEvent().init(e, actor, this.currentScene.time) -2447 }; -2448 } -2449 -2450 var ev = actors[ actor.id ].touch; -2451 ev.addChangedTouch(this.touches[ touchId ].touch); -2452 } -2453 } +2443 +2444 /** +2445 * para los touch identificados, extraer que actores se han afectado. +2446 * crear eventos con la info de touch para cada uno. +2447 */ +2448 +2449 var actors = {}; +2450 for (i = 0; i < recent.length; i++) { +2451 var touchId = recent[ i ]; +2452 if (this.touches[ touchId ]) { +2453 var actor = this.touches[ touchId ].actor; 2454 -2455 /** -2456 * remove ended touch info. -2457 */ -2458 for (i = 0; i < e.changedTouches.length; i++) { -2459 var touch = e.changedTouches[i]; -2460 var id = touch.identifier; -2461 delete this.touches[id]; -2462 } -2463 -2464 /** -2465 * notificar a todos los actores. -2466 */ -2467 for (var pr in actors) { -2468 var data = actors[pr]; -2469 var actor = data.actor; -2470 var touch = data.touch; -2471 -2472 for (var actorId in this.touches) { -2473 var tt = this.touches[actorId] -2474 if (tt.actor.id === actor.id) { -2475 touch.addTouch(tt.touch); -2476 } -2477 } -2478 -2479 actor.touchEnd(touch); -2480 } -2481 }, -2482 -2483 __touchMoveHandlerMT:function (e) { -2484 -2485 e.preventDefault(); -2486 e.returnValue = false; -2487 -2488 var i; -2489 var recent = []; +2455 if (!actors[actor.id]) { +2456 actors[actor.id] = { +2457 actor:actor, +2458 touch:new CAAT.Event.TouchEvent().init(e, actor, this.currentScene.time) +2459 }; +2460 } +2461 +2462 var ev = actors[ actor.id ].touch; +2463 ev.addChangedTouch(this.touches[ touchId ].touch); +2464 } +2465 } +2466 +2467 /** +2468 * remove ended touch info. +2469 */ +2470 for (i = 0; i < e.changedTouches.length; i++) { +2471 var touch = e.changedTouches[i]; +2472 var id = touch.identifier; +2473 delete this.touches[id]; +2474 } +2475 +2476 /** +2477 * notificar a todos los actores. +2478 */ +2479 for (var pr in actors) { +2480 var data = actors[pr]; +2481 var actor = data.actor; +2482 var touch = data.touch; +2483 +2484 for (var actorId in this.touches) { +2485 var tt = this.touches[actorId] +2486 if (tt.actor.id === actor.id) { +2487 touch.addTouch(tt.touch); +2488 } +2489 } 2490 -2491 /** -2492 * extrae actores afectados, y coordenadas relativas para ellos. -2493 * crear una coleccion touch-id : { actor, touch-event } -2494 */ -2495 for (i = 0; i < e.changedTouches.length; i++) { -2496 var touch = e.changedTouches[i]; -2497 var id = touch.identifier; -2498 -2499 if (this.touches[ id ]) { -2500 var mp = this.mousePoint; -2501 this.getCanvasCoord(mp, touch); +2491 actor.touchEnd(touch); +2492 } +2493 }, +2494 +2495 __touchMoveHandlerMT:function (e) { +2496 +2497 e.preventDefault(); +2498 e.returnValue = false; +2499 +2500 var i; +2501 var recent = []; 2502 -2503 var actor = this.touches[ id ].actor; -2504 mp = actor.viewToModel(mp); -2505 -2506 this.touches[ id ] = { -2507 actor:actor, -2508 touch:new CAAT.Event.TouchInfo(id, mp.x, mp.y, actor) -2509 }; +2503 /** +2504 * extrae actores afectados, y coordenadas relativas para ellos. +2505 * crear una coleccion touch-id : { actor, touch-event } +2506 */ +2507 for (i = 0; i < e.changedTouches.length; i++) { +2508 var touch = e.changedTouches[i]; +2509 var id = touch.identifier; 2510 -2511 recent.push(id); -2512 } -2513 } +2511 if (this.touches[ id ]) { +2512 var mp = this.mousePoint; +2513 this.getCanvasCoord(mp, touch); 2514 -2515 /** -2516 * para los touch identificados, extraer que actores se han afectado. -2517 * crear eventos con la info de touch para cada uno. -2518 */ -2519 -2520 var actors = {}; -2521 for (i = 0; i < recent.length; i++) { -2522 var touchId = recent[ i ]; -2523 var actor = this.touches[ touchId ].actor; -2524 -2525 if (!actors[actor.id]) { -2526 actors[actor.id] = { -2527 actor:actor, -2528 touch:new CAAT.Event.TouchEvent().init(e, actor, this.currentScene.time) -2529 }; -2530 } +2515 var actor = this.touches[ id ].actor; +2516 mp = actor.viewToModel(mp); +2517 +2518 this.touches[ id ] = { +2519 actor:actor, +2520 touch:new CAAT.Event.TouchInfo(id, mp.x, mp.y, actor) +2521 }; +2522 +2523 recent.push(id); +2524 } +2525 } +2526 +2527 /** +2528 * para los touch identificados, extraer que actores se han afectado. +2529 * crear eventos con la info de touch para cada uno. +2530 */ 2531 -2532 var ev = actors[ actor.id ].touch; -2533 ev.addTouch(this.touches[ touchId ].touch); -2534 ev.addChangedTouch(this.touches[ touchId ].touch); -2535 } +2532 var actors = {}; +2533 for (i = 0; i < recent.length; i++) { +2534 var touchId = recent[ i ]; +2535 var actor = this.touches[ touchId ].actor; 2536 -2537 /** -2538 * notificar a todos los actores. -2539 */ -2540 for (var pr in actors) { -2541 var data = actors[pr]; -2542 var actor = data.actor; -2543 var touch = data.touch; -2544 -2545 for (var actorId in this.touches) { -2546 var tt = this.touches[actorId] -2547 if (tt.actor.id === actor.id) { -2548 touch.addTouch(tt.touch); -2549 } -2550 } -2551 -2552 actor.touchMove(touch); -2553 } -2554 }, -2555 -2556 __touchCancelHandleMT:function (e) { -2557 this.__touchEndHandlerMT(e); -2558 }, -2559 -2560 __touchStartHandlerMT:function (e) { -2561 e.preventDefault(); -2562 e.returnValue = false; +2537 if (!actors[actor.id]) { +2538 actors[actor.id] = { +2539 actor:actor, +2540 touch:new CAAT.Event.TouchEvent().init(e, actor, this.currentScene.time) +2541 }; +2542 } +2543 +2544 var ev = actors[ actor.id ].touch; +2545 ev.addTouch(this.touches[ touchId ].touch); +2546 ev.addChangedTouch(this.touches[ touchId ].touch); +2547 } +2548 +2549 /** +2550 * notificar a todos los actores. +2551 */ +2552 for (var pr in actors) { +2553 var data = actors[pr]; +2554 var actor = data.actor; +2555 var touch = data.touch; +2556 +2557 for (var actorId in this.touches) { +2558 var tt = this.touches[actorId] +2559 if (tt.actor.id === actor.id) { +2560 touch.addTouch(tt.touch); +2561 } +2562 } 2563 -2564 var i; -2565 var recent = []; -2566 var allInCanvas = true; +2564 actor.touchMove(touch); +2565 } +2566 }, 2567 -2568 /** -2569 * extrae actores afectados, y coordenadas relativas para ellos. -2570 * crear una coleccion touch-id : { actor, touch-event } -2571 */ -2572 for (i = 0; i < e.changedTouches.length; i++) { -2573 var touch = e.changedTouches[i]; -2574 var id = touch.identifier; -2575 var mp = this.mousePoint; -2576 this.getCanvasCoord(mp, touch); -2577 if (mp.x < 0 || mp.y < 0 || mp.x >= this.width || mp.y >= this.height) { -2578 allInCanvas = false; -2579 continue; -2580 } -2581 -2582 var actor = this.findActorAtPosition(mp); -2583 if (actor !== null) { -2584 mp = actor.viewToModel(mp); -2585 -2586 if (!this.touches[ id ]) { -2587 -2588 this.touches[ id ] = { -2589 actor:actor, -2590 touch:new CAAT.Event.TouchInfo(id, mp.x, mp.y, actor) -2591 }; -2592 -2593 recent.push(id); -2594 } -2595 -2596 } -2597 } -2598 -2599 /** -2600 * para los touch identificados, extraer que actores se han afectado. -2601 * crear eventos con la info de touch para cada uno. -2602 */ -2603 -2604 var actors = {}; -2605 for (i = 0; i < recent.length; i++) { -2606 var touchId = recent[ i ]; -2607 var actor = this.touches[ touchId ].actor; -2608 -2609 if (!actors[actor.id]) { -2610 actors[actor.id] = { -2611 actor:actor, -2612 touch:new CAAT.Event.TouchEvent().init(e, actor, this.currentScene.time) -2613 }; -2614 } +2568 __touchCancelHandleMT:function (e) { +2569 this.__touchEndHandlerMT(e); +2570 }, +2571 +2572 __touchStartHandlerMT:function (e) { +2573 e.preventDefault(); +2574 e.returnValue = false; +2575 +2576 var i; +2577 var recent = []; +2578 var allInCanvas = true; +2579 +2580 /** +2581 * extrae actores afectados, y coordenadas relativas para ellos. +2582 * crear una coleccion touch-id : { actor, touch-event } +2583 */ +2584 for (i = 0; i < e.changedTouches.length; i++) { +2585 var touch = e.changedTouches[i]; +2586 var id = touch.identifier; +2587 var mp = this.mousePoint; +2588 this.getCanvasCoord(mp, touch); +2589 if (mp.x < 0 || mp.y < 0 || mp.x >= this.width || mp.y >= this.height) { +2590 allInCanvas = false; +2591 continue; +2592 } +2593 +2594 var actor = this.findActorAtPosition(mp); +2595 if (actor !== null) { +2596 mp = actor.viewToModel(mp); +2597 +2598 if (!this.touches[ id ]) { +2599 +2600 this.touches[ id ] = { +2601 actor:actor, +2602 touch:new CAAT.Event.TouchInfo(id, mp.x, mp.y, actor) +2603 }; +2604 +2605 recent.push(id); +2606 } +2607 +2608 } +2609 } +2610 +2611 /** +2612 * para los touch identificados, extraer que actores se han afectado. +2613 * crear eventos con la info de touch para cada uno. +2614 */ 2615 -2616 var ev = actors[ actor.id ].touch; -2617 ev.addTouch(this.touches[ touchId ].touch); -2618 ev.addChangedTouch(this.touches[ touchId ].touch); -2619 } +2616 var actors = {}; +2617 for (i = 0; i < recent.length; i++) { +2618 var touchId = recent[ i ]; +2619 var actor = this.touches[ touchId ].actor; 2620 -2621 /** -2622 * notificar a todos los actores. -2623 */ -2624 for (var pr in actors) { -2625 var data = actors[pr]; -2626 var actor = data.actor; -2627 var touch = data.touch; -2628 -2629 for (var actorId in this.touches) { -2630 var tt = this.touches[actorId] -2631 if (tt.actor.id === actor.id) { -2632 touch.addTouch(tt.touch); -2633 } -2634 } -2635 -2636 actor.touchStart(touch); -2637 } -2638 -2639 }, +2621 if (!actors[actor.id]) { +2622 actors[actor.id] = { +2623 actor:actor, +2624 touch:new CAAT.Event.TouchEvent().init(e, actor, this.currentScene.time) +2625 }; +2626 } +2627 +2628 var ev = actors[ actor.id ].touch; +2629 ev.addTouch(this.touches[ touchId ].touch); +2630 ev.addChangedTouch(this.touches[ touchId ].touch); +2631 } +2632 +2633 /** +2634 * notificar a todos los actores. +2635 */ +2636 for (var pr in actors) { +2637 var data = actors[pr]; +2638 var actor = data.actor; +2639 var touch = data.touch; 2640 -2641 __findTouchFirstActor:function () { -2642 -2643 var t = Number.MAX_VALUE; -2644 var actor = null; -2645 for (var pr in this.touches) { -2646 -2647 var touch = this.touches[pr]; -2648 -2649 if (touch.touch.time && touch.touch.time < t && touch.actor.isGestureEnabled()) { -2650 actor = touch.actor; -2651 t = touch.touch.time; -2652 } -2653 } -2654 return actor; -2655 }, -2656 -2657 __gesturedActor:null, -2658 __touchGestureStartHandleMT:function (e) { -2659 var actor = this.__findTouchFirstActor(); +2641 for (var actorId in this.touches) { +2642 var tt = this.touches[actorId] +2643 if (tt.actor.id === actor.id) { +2644 touch.addTouch(tt.touch); +2645 } +2646 } +2647 +2648 actor.touchStart(touch); +2649 } +2650 +2651 }, +2652 +2653 __findTouchFirstActor:function () { +2654 +2655 var t = Number.MAX_VALUE; +2656 var actor = null; +2657 for (var pr in this.touches) { +2658 +2659 var touch = this.touches[pr]; 2660 -2661 if (actor !== null && actor.isGestureEnabled()) { -2662 this.__gesturedActor = actor; -2663 this.__gestureRotation = actor.rotationAngle; -2664 this.__gestureSX = actor.scaleX - 1; -2665 this.__gestureSY = actor.scaleY - 1; -2666 -2667 -2668 actor.gestureStart( -2669 e.rotation * Math.PI / 180, -2670 e.scale + this.__gestureSX, -2671 e.scale + this.__gestureSY); -2672 } -2673 }, -2674 -2675 __touchGestureEndHandleMT:function (e) { -2676 -2677 if (null !== this.__gesturedActor && this.__gesturedActor.isGestureEnabled()) { -2678 this.__gesturedActor.gestureEnd( -2679 e.rotation * Math.PI / 180, -2680 e.scale + this.__gestureSX, -2681 e.scale + this.__gestureSY); -2682 } -2683 -2684 this.__gestureRotation = 0; -2685 this.__gestureScale = 0; +2661 if (touch.touch.time && touch.touch.time < t && touch.actor.isGestureEnabled()) { +2662 actor = touch.actor; +2663 t = touch.touch.time; +2664 } +2665 } +2666 return actor; +2667 }, +2668 +2669 __gesturedActor:null, +2670 __touchGestureStartHandleMT:function (e) { +2671 var actor = this.__findTouchFirstActor(); +2672 +2673 if (actor !== null && actor.isGestureEnabled()) { +2674 this.__gesturedActor = actor; +2675 this.__gestureRotation = actor.rotationAngle; +2676 this.__gestureSX = actor.scaleX - 1; +2677 this.__gestureSY = actor.scaleY - 1; +2678 +2679 +2680 actor.gestureStart( +2681 e.rotation * Math.PI / 180, +2682 e.scale + this.__gestureSX, +2683 e.scale + this.__gestureSY); +2684 } +2685 }, 2686 -2687 -2688 }, -2689 -2690 __touchGestureChangeHandleMT:function (e) { -2691 -2692 if (this.__gesturedActor !== null && this.__gesturedActor.isGestureEnabled()) { -2693 this.__gesturedActor.gestureChange( -2694 e.rotation * Math.PI / 180, -2695 this.__gestureSX + e.scale, -2696 this.__gestureSY + e.scale); -2697 } -2698 }, +2687 __touchGestureEndHandleMT:function (e) { +2688 +2689 if (null !== this.__gesturedActor && this.__gesturedActor.isGestureEnabled()) { +2690 this.__gesturedActor.gestureEnd( +2691 e.rotation * Math.PI / 180, +2692 e.scale + this.__gestureSX, +2693 e.scale + this.__gestureSY); +2694 } +2695 +2696 this.__gestureRotation = 0; +2697 this.__gestureScale = 0; +2698 2699 -2700 -2701 addHandlers:function (canvas) { -2702 -2703 var me = this; -2704 -2705 window.addEventListener('mouseup', function (e) { -2706 if (me.touching) { -2707 e.preventDefault(); -2708 e.cancelBubble = true; -2709 if (e.stopPropagation) e.stopPropagation(); -2710 -2711 var mp = me.mousePoint; -2712 me.getCanvasCoord(mp, e); -2713 me.__mouseUpHandler(e); +2700 }, +2701 +2702 __touchGestureChangeHandleMT:function (e) { +2703 +2704 if (this.__gesturedActor !== null && this.__gesturedActor.isGestureEnabled()) { +2705 this.__gesturedActor.gestureChange( +2706 e.rotation * Math.PI / 180, +2707 this.__gestureSX + e.scale, +2708 this.__gestureSY + e.scale); +2709 } +2710 }, +2711 +2712 +2713 addHandlers:function (canvas) { 2714 -2715 me.touching = false; -2716 } -2717 }, false); -2718 -2719 window.addEventListener('mousedown', function (e) { -2720 if (e.target === canvas) { -2721 e.preventDefault(); -2722 e.cancelBubble = true; -2723 if (e.stopPropagation) e.stopPropagation(); -2724 -2725 var mp = me.mousePoint; -2726 me.getCanvasCoord(mp, e); -2727 if (mp.x < 0 || mp.y < 0 || mp.x >= me.width || mp.y >= me.height) { -2728 return; -2729 } -2730 me.touching = true; -2731 -2732 me.__mouseDownHandler(e); -2733 } -2734 }, false); -2735 -2736 window.addEventListener('mouseover', function (e) { -2737 if (e.target === canvas && !me.dragging) { -2738 e.preventDefault(); -2739 e.cancelBubble = true; -2740 if (e.stopPropagation) e.stopPropagation(); -2741 -2742 var mp = me.mousePoint; -2743 me.getCanvasCoord(mp, e); -2744 if (mp.x < 0 || mp.y < 0 || mp.x >= me.width || mp.y >= me.height) { -2745 return; -2746 } +2715 var me = this; +2716 +2717 window.addEventListener('mouseup', function (e) { +2718 if (me.touching) { +2719 e.preventDefault(); +2720 e.cancelBubble = true; +2721 if (e.stopPropagation) e.stopPropagation(); +2722 +2723 var mp = me.mousePoint; +2724 me.getCanvasCoord(mp, e); +2725 me.__mouseUpHandler(e); +2726 +2727 me.touching = false; +2728 } +2729 }, false); +2730 +2731 window.addEventListener('mousedown', function (e) { +2732 if (e.target === canvas) { +2733 e.preventDefault(); +2734 e.cancelBubble = true; +2735 if (e.stopPropagation) e.stopPropagation(); +2736 +2737 var mp = me.mousePoint; +2738 me.getCanvasCoord(mp, e); +2739 if (mp.x < 0 || mp.y < 0 || mp.x >= me.width || mp.y >= me.height) { +2740 return; +2741 } +2742 me.touching = true; +2743 +2744 me.__mouseDownHandler(e); +2745 } +2746 }, false); 2747 -2748 me.__mouseOverHandler(e); -2749 } -2750 }, false); -2751 -2752 window.addEventListener('mouseout', function (e) { -2753 if (e.target === canvas && !me.dragging) { -2754 e.preventDefault(); -2755 e.cancelBubble = true; -2756 if (e.stopPropagation) e.stopPropagation(); -2757 -2758 var mp = me.mousePoint; -2759 me.getCanvasCoord(mp, e); -2760 me.__mouseOutHandler(e); +2748 window.addEventListener('mouseover', function (e) { +2749 if (e.target === canvas && !me.dragging) { +2750 e.preventDefault(); +2751 e.cancelBubble = true; +2752 if (e.stopPropagation) e.stopPropagation(); +2753 +2754 var mp = me.mousePoint; +2755 me.getCanvasCoord(mp, e); +2756 if (mp.x < 0 || mp.y < 0 || mp.x >= me.width || mp.y >= me.height) { +2757 return; +2758 } +2759 +2760 me.__mouseOverHandler(e); 2761 } 2762 }, false); 2763 -2764 window.addEventListener('mousemove', function (e) { -2765 e.preventDefault(); -2766 e.cancelBubble = true; -2767 if (e.stopPropagation) e.stopPropagation(); -2768 -2769 var mp = me.mousePoint; -2770 me.getCanvasCoord(mp, e); -2771 if (!me.dragging && ( mp.x < 0 || mp.y < 0 || mp.x >= me.width || mp.y >= me.height )) { -2772 return; +2764 window.addEventListener('mouseout', function (e) { +2765 if (e.target === canvas && !me.dragging) { +2766 e.preventDefault(); +2767 e.cancelBubble = true; +2768 if (e.stopPropagation) e.stopPropagation(); +2769 +2770 var mp = me.mousePoint; +2771 me.getCanvasCoord(mp, e); +2772 me.__mouseOutHandler(e); 2773 } -2774 me.__mouseMoveHandler(e); -2775 }, false); -2776 -2777 window.addEventListener("dblclick", function (e) { -2778 if (e.target === canvas) { -2779 e.preventDefault(); -2780 e.cancelBubble = true; -2781 if (e.stopPropagation) e.stopPropagation(); -2782 var mp = me.mousePoint; -2783 me.getCanvasCoord(mp, e); -2784 if (mp.x < 0 || mp.y < 0 || mp.x >= me.width || mp.y >= me.height) { -2785 return; -2786 } -2787 -2788 me.__mouseDBLClickHandler(e); -2789 } -2790 }, false); -2791 -2792 if (CAAT.TOUCH_BEHAVIOR === CAAT.TOUCH_AS_MOUSE) { -2793 canvas.addEventListener("touchstart", this.__touchStartHandler.bind(this), false); -2794 canvas.addEventListener("touchmove", this.__touchMoveHandler.bind(this), false); -2795 canvas.addEventListener("touchend", this.__touchEndHandler.bind(this), false); -2796 canvas.addEventListener("gesturestart", function (e) { -2797 if (e.target === canvas) { -2798 e.preventDefault(); -2799 e.returnValue = false; -2800 me.__gestureStart(e.scale, e.rotation); -2801 } -2802 }, false); -2803 canvas.addEventListener("gestureend", function (e) { -2804 if (e.target === canvas) { -2805 e.preventDefault(); -2806 e.returnValue = false; -2807 me.__gestureEnd(e.scale, e.rotation); -2808 } -2809 }, false); -2810 canvas.addEventListener("gesturechange", function (e) { -2811 if (e.target === canvas) { -2812 e.preventDefault(); -2813 e.returnValue = false; -2814 me.__gestureChange(e.scale, e.rotation); -2815 } -2816 }, false); -2817 } else if (CAAT.TOUCH_BEHAVIOR === CAAT.TOUCH_AS_MULTITOUCH) { -2818 canvas.addEventListener("touchstart", this.__touchStartHandlerMT.bind(this), false); -2819 canvas.addEventListener("touchmove", this.__touchMoveHandlerMT.bind(this), false); -2820 canvas.addEventListener("touchend", this.__touchEndHandlerMT.bind(this), false); -2821 canvas.addEventListener("touchcancel", this.__touchCancelHandleMT.bind(this), false); -2822 -2823 canvas.addEventListener("gesturestart", this.__touchGestureStartHandleMT.bind(this), false); -2824 canvas.addEventListener("gestureend", this.__touchGestureEndHandleMT.bind(this), false); -2825 canvas.addEventListener("gesturechange", this.__touchGestureChangeHandleMT.bind(this), false); -2826 } -2827 -2828 }, -2829 -2830 enableEvents:function (onElement) { -2831 CAAT.RegisterDirector(this); -2832 this.in_ = false; -2833 this.createEventHandler(onElement); -2834 }, -2835 -2836 createEventHandler:function (onElement) { -2837 //var canvas= this.canvas; -2838 this.in_ = false; -2839 //this.addHandlers(canvas); -2840 this.addHandlers(onElement); -2841 } -2842 } -2843 }, -2844 -2845 onCreate:function () { -2846 -2847 if (typeof CAAT.__CSS__!=="undefined") { -2848 -2849 CAAT.Foundation.Director.prototype.clip = true; -2850 CAAT.Foundation.Director.prototype.glEnabled = false; -2851 -2852 CAAT.Foundation.Director.prototype.getRenderType = function () { -2853 return 'CSS'; -2854 }; -2855 -2856 CAAT.Foundation.Director.prototype.setScaleProportional = function (w, h) { -2857 -2858 var factor = Math.min(w / this.referenceWidth, h / this.referenceHeight); -2859 this.setScaleAnchored(factor, factor, 0, 0); +2774 }, false); +2775 +2776 window.addEventListener('mousemove', function (e) { +2777 e.preventDefault(); +2778 e.cancelBubble = true; +2779 if (e.stopPropagation) e.stopPropagation(); +2780 +2781 var mp = me.mousePoint; +2782 me.getCanvasCoord(mp, e); +2783 if (!me.dragging && ( mp.x < 0 || mp.y < 0 || mp.x >= me.width || mp.y >= me.height )) { +2784 return; +2785 } +2786 me.__mouseMoveHandler(e); +2787 }, false); +2788 +2789 window.addEventListener("dblclick", function (e) { +2790 if (e.target === canvas) { +2791 e.preventDefault(); +2792 e.cancelBubble = true; +2793 if (e.stopPropagation) e.stopPropagation(); +2794 var mp = me.mousePoint; +2795 me.getCanvasCoord(mp, e); +2796 if (mp.x < 0 || mp.y < 0 || mp.x >= me.width || mp.y >= me.height) { +2797 return; +2798 } +2799 +2800 me.__mouseDBLClickHandler(e); +2801 } +2802 }, false); +2803 +2804 if (CAAT.TOUCH_BEHAVIOR === CAAT.TOUCH_AS_MOUSE) { +2805 canvas.addEventListener("touchstart", this.__touchStartHandler.bind(this), false); +2806 canvas.addEventListener("touchmove", this.__touchMoveHandler.bind(this), false); +2807 canvas.addEventListener("touchend", this.__touchEndHandler.bind(this), false); +2808 canvas.addEventListener("gesturestart", function (e) { +2809 if (e.target === canvas) { +2810 e.preventDefault(); +2811 e.returnValue = false; +2812 me.__gestureStart(e.scale, e.rotation); +2813 } +2814 }, false); +2815 canvas.addEventListener("gestureend", function (e) { +2816 if (e.target === canvas) { +2817 e.preventDefault(); +2818 e.returnValue = false; +2819 me.__gestureEnd(e.scale, e.rotation); +2820 } +2821 }, false); +2822 canvas.addEventListener("gesturechange", function (e) { +2823 if (e.target === canvas) { +2824 e.preventDefault(); +2825 e.returnValue = false; +2826 me.__gestureChange(e.scale, e.rotation); +2827 } +2828 }, false); +2829 } else if (CAAT.TOUCH_BEHAVIOR === CAAT.TOUCH_AS_MULTITOUCH) { +2830 canvas.addEventListener("touchstart", this.__touchStartHandlerMT.bind(this), false); +2831 canvas.addEventListener("touchmove", this.__touchMoveHandlerMT.bind(this), false); +2832 canvas.addEventListener("touchend", this.__touchEndHandlerMT.bind(this), false); +2833 canvas.addEventListener("touchcancel", this.__touchCancelHandleMT.bind(this), false); +2834 +2835 canvas.addEventListener("gesturestart", this.__touchGestureStartHandleMT.bind(this), false); +2836 canvas.addEventListener("gestureend", this.__touchGestureEndHandleMT.bind(this), false); +2837 canvas.addEventListener("gesturechange", this.__touchGestureChangeHandleMT.bind(this), false); +2838 } +2839 +2840 }, +2841 +2842 enableEvents:function (onElement) { +2843 CAAT.RegisterDirector(this); +2844 this.in_ = false; +2845 this.createEventHandler(onElement); +2846 }, +2847 +2848 createEventHandler:function (onElement) { +2849 //var canvas= this.canvas; +2850 this.in_ = false; +2851 //this.addHandlers(canvas); +2852 this.addHandlers(onElement); +2853 } +2854 } +2855 }, +2856 +2857 onCreate:function () { +2858 +2859 if (typeof CAAT.__CSS__!=="undefined") { 2860 -2861 this.eventHandler.style.width = '' + this.referenceWidth + 'px'; -2862 this.eventHandler.style.height = '' + this.referenceHeight + 'px'; -2863 }; -2864 -2865 CAAT.Foundation.Director.prototype.setBounds = function (x, y, w, h) { -2866 CAAT.Foundation.Director.superclass.setBounds.call(this, x, y, w, h); -2867 for (var i = 0; i < this.scenes.length; i++) { -2868 this.scenes[i].setBounds(0, 0, w, h); -2869 } -2870 this.eventHandler.style.width = w + 'px'; -2871 this.eventHandler.style.height = h + 'px'; +2861 CAAT.Foundation.Director.prototype.clip = true; +2862 CAAT.Foundation.Director.prototype.glEnabled = false; +2863 +2864 CAAT.Foundation.Director.prototype.getRenderType = function () { +2865 return 'CSS'; +2866 }; +2867 +2868 CAAT.Foundation.Director.prototype.setScaleProportional = function (w, h) { +2869 +2870 var factor = Math.min(w / this.referenceWidth, h / this.referenceHeight); +2871 this.setScaleAnchored(factor, factor, 0, 0); 2872 -2873 return this; -2874 }; -2875 -2876 /** -2877 * In this DOM/CSS implementation, proxy is not taken into account since the event router is a top most -2878 * div in the document hierarchy (z-index 999999). -2879 * @param width -2880 * @param height -2881 * @param domElement -2882 * @param proxy -2883 */ -2884 CAAT.Foundation.Director.prototype.initialize = function (width, height, domElement, proxy) { -2885 -2886 this.timeline = new Date().getTime(); -2887 this.domElement = domElement; -2888 this.style('position', 'absolute'); -2889 this.style('width', '' + width + 'px'); -2890 this.style('height', '' + height + 'px'); -2891 this.style('overflow', 'hidden'); -2892 -2893 this.enableEvents(domElement); -2894 -2895 this.setBounds(0, 0, width, height); -2896 -2897 this.checkDebug(); -2898 return this; -2899 }; -2900 -2901 CAAT.Foundation.Director.prototype.render = function (time) { -2902 -2903 this.time += time; -2904 this.animate(this, time); -2905 -2906 /** -2907 * draw director active scenes. -2908 */ -2909 var i, l, tt; -2910 -2911 if (!navigator.isCocoonJS && CAAT.DEBUG) { -2912 this.resetStats(); -2913 } +2873 this.eventHandler.style.width = '' + this.referenceWidth + 'px'; +2874 this.eventHandler.style.height = '' + this.referenceHeight + 'px'; +2875 }; +2876 +2877 CAAT.Foundation.Director.prototype.setBounds = function (x, y, w, h) { +2878 CAAT.Foundation.Director.superclass.setBounds.call(this, x, y, w, h); +2879 for (var i = 0; i < this.scenes.length; i++) { +2880 this.scenes[i].setBounds(0, 0, w, h); +2881 } +2882 this.eventHandler.style.width = w + 'px'; +2883 this.eventHandler.style.height = h + 'px'; +2884 +2885 return this; +2886 }; +2887 +2888 /** +2889 * In this DOM/CSS implementation, proxy is not taken into account since the event router is a top most +2890 * div in the document hierarchy (z-index 999999). +2891 * @param width +2892 * @param height +2893 * @param domElement +2894 * @param proxy +2895 */ +2896 CAAT.Foundation.Director.prototype.initialize = function (width, height, domElement, proxy) { +2897 +2898 this.timeline = new Date().getTime(); +2899 this.domElement = domElement; +2900 this.style('position', 'absolute'); +2901 this.style('width', '' + width + 'px'); +2902 this.style('height', '' + height + 'px'); +2903 this.style('overflow', 'hidden'); +2904 +2905 this.enableEvents(domElement); +2906 +2907 this.setBounds(0, 0, width, height); +2908 +2909 this.checkDebug(); +2910 return this; +2911 }; +2912 +2913 CAAT.Foundation.Director.prototype.render = function (time) { 2914 -2915 for (i = 0, l = this.childrenList.length; i < l; i++) { -2916 var c = this.childrenList[i]; -2917 if (c.isInAnimationFrame(this.time) && !c.isPaused()) { -2918 tt = c.time - c.start_time; -2919 c.timerManager.checkTimers(tt); -2920 c.timerManager.removeExpiredTimers(); -2921 } -2922 } -2923 -2924 for (i = 0, l = this.childrenList.length; i < l; i++) { -2925 var c = this.childrenList[i]; -2926 if (c.isInAnimationFrame(this.time)) { -2927 tt = c.time - c.start_time; -2928 if (c.onRenderStart) { -2929 c.onRenderStart(tt); -2930 } -2931 -2932 c.paintActor(this, tt); -2933 -2934 if (c.onRenderEnd) { -2935 c.onRenderEnd(tt); -2936 } -2937 -2938 if (!c.isPaused()) { -2939 c.time += time; -2940 } -2941 -2942 if (!navigator.isCocoonJS && CAAT.DEBUG) { -2943 this.statistics.size_discarded_by_dirtyRects += this.drDiscarded; -2944 this.statistics.size_total += c.size_total; -2945 this.statistics.size_active += c.size_active; -2946 this.statistics.size_dirtyRects = this.nDirtyRects; -2947 +2915 this.time += time; +2916 this.animate(this, time); +2917 +2918 /** +2919 * draw director active scenes. +2920 */ +2921 var i, l, tt; +2922 +2923 if (!navigator.isCocoonJS && CAAT.DEBUG) { +2924 this.resetStats(); +2925 } +2926 +2927 for (i = 0, l = this.childrenList.length; i < l; i++) { +2928 var c = this.childrenList[i]; +2929 if (c.isInAnimationFrame(this.time) && !c.isPaused()) { +2930 tt = c.time - c.start_time; +2931 c.timerManager.checkTimers(tt); +2932 c.timerManager.removeExpiredTimers(); +2933 } +2934 } +2935 +2936 for (i = 0, l = this.childrenList.length; i < l; i++) { +2937 var c = this.childrenList[i]; +2938 if (c.isInAnimationFrame(this.time)) { +2939 tt = c.time - c.start_time; +2940 if (c.onRenderStart) { +2941 c.onRenderStart(tt); +2942 } +2943 +2944 c.paintActor(this, tt); +2945 +2946 if (c.onRenderEnd) { +2947 c.onRenderEnd(tt); 2948 } 2949 -2950 } -2951 } -2952 -2953 this.frameCounter++; -2954 }; -2955 -2956 CAAT.Foundation.Director.prototype.addScene = function (scene) { -2957 scene.setVisible(true); -2958 scene.setBounds(0, 0, this.width, this.height); -2959 this.scenes.push(scene); -2960 scene.setEaseListener(this); -2961 if (null === this.currentScene) { -2962 this.setScene(0); +2950 if (!c.isPaused()) { +2951 c.time += time; +2952 } +2953 +2954 if (!navigator.isCocoonJS && CAAT.DEBUG) { +2955 this.statistics.size_discarded_by_dirtyRects += this.drDiscarded; +2956 this.statistics.size_total += c.size_total; +2957 this.statistics.size_active += c.size_active; +2958 this.statistics.size_dirtyRects = this.nDirtyRects; +2959 +2960 } +2961 +2962 } 2963 } 2964 -2965 this.domElement.appendChild(scene.domElement); +2965 this.frameCounter++; 2966 }; 2967 -2968 CAAT.Foundation.Director.prototype.emptyScenes = function () { -2969 this.scenes = []; -2970 this.domElement.innerHTML = ''; -2971 this.createEventHandler(); -2972 }; -2973 -2974 CAAT.Foundation.Director.prototype.setClear = function (clear) { -2975 return this; -2976 }; -2977 -2978 CAAT.Foundation.Director.prototype.createEventHandler = function () { -2979 this.eventHandler = document.createElement('div'); -2980 this.domElement.appendChild(this.eventHandler); -2981 -2982 this.eventHandler.style.position = 'absolute'; -2983 this.eventHandler.style.left = '0'; -2984 this.eventHandler.style.top = '0'; -2985 this.eventHandler.style.zIndex = 999999; -2986 this.eventHandler.style.width = '' + this.width + 'px'; -2987 this.eventHandler.style.height = '' + this.height + 'px'; -2988 -2989 this.canvas = this.eventHandler; -2990 this.in_ = false; -2991 -2992 this.addHandlers(this.canvas); -2993 }; -2994 -2995 CAAT.Foundation.Director.prototype.inDirtyRect = function () { -2996 return true; -2997 } -2998 } -2999 } -3000 }); -3001 \ No newline at end of file +2968 CAAT.Foundation.Director.prototype.addScene = function (scene) { +2969 scene.setVisible(true); +2970 scene.setBounds(0, 0, this.width, this.height); +2971 this.scenes.push(scene); +2972 scene.setEaseListener(this); +2973 if (null === this.currentScene) { +2974 this.setScene(0); +2975 } +2976 +2977 this.domElement.appendChild(scene.domElement); +2978 }; +2979 +2980 CAAT.Foundation.Director.prototype.emptyScenes = function () { +2981 this.scenes = []; +2982 this.domElement.innerHTML = ''; +2983 this.createEventHandler(); +2984 }; +2985 +2986 CAAT.Foundation.Director.prototype.setClear = function (clear) { +2987 return this; +2988 }; +2989 +2990 CAAT.Foundation.Director.prototype.createEventHandler = function () { +2991 this.eventHandler = document.createElement('div'); +2992 this.domElement.appendChild(this.eventHandler); +2993 +2994 this.eventHandler.style.position = 'absolute'; +2995 this.eventHandler.style.left = '0'; +2996 this.eventHandler.style.top = '0'; +2997 this.eventHandler.style.zIndex = 999999; +2998 this.eventHandler.style.width = '' + this.width + 'px'; +2999 this.eventHandler.style.height = '' + this.height + 'px'; +3000 +3001 this.canvas = this.eventHandler; +3002 this.in_ = false; +3003 +3004 this.addHandlers(this.canvas); +3005 }; +3006 +3007 CAAT.Foundation.Director.prototype.inDirtyRect = function () { +3008 return true; +3009 } +3010 } +3011 } +3012 }); +3013 \ No newline at end of file diff --git a/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_Foundation_SpriteImage.js.html b/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_Foundation_SpriteImage.js.html index e954cafe..4bdd1f11 100644 --- a/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_Foundation_SpriteImage.js.html +++ b/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_Foundation_SpriteImage.js.html @@ -55,556 +55,556 @@ 48 this.mapInfo = {}; 49 this.animationsMap= {}; 50 - 51 if ( arguments.length===3 ) { - 52 this.initialize.apply(this, arguments); - 53 } - 54 return this; - 55 }, - 56 - 57 /** - 58 * an Array defining the sprite frame sequence - 59 */ - 60 animationImageIndex:null, - 61 - 62 /** - 63 * Previous animation frame time. - 64 */ - 65 prevAnimationTime:-1, - 66 - 67 /** - 68 * how much Scene time to take before changing an Sprite frame. - 69 */ - 70 changeFPS:1000, - 71 - 72 /** - 73 * any of the TR_* constants. - 74 */ - 75 transformation:0, - 76 - 77 /** - 78 * the current sprite frame - 79 */ - 80 spriteIndex:0, - 81 - 82 /** - 83 * current index of sprite frames array. - 84 */ - 85 prevIndex:0, // - 86 - 87 /** - 88 * current animation name - 89 */ - 90 currentAnimation: null, - 91 - 92 /** - 93 * Image to get frames from. - 94 */ - 95 image:null, - 96 - 97 /** - 98 * Number of rows - 99 */ -100 rows:1, -101 -102 /** -103 * Number of columns. -104 */ -105 columns:1, -106 -107 /** -108 * This sprite image image´s width -109 */ -110 width:0, -111 -112 /** -113 * This sprite image image´s width -114 */ -115 height:0, -116 -117 /** -118 * For each element in the sprite image array, its size. -119 */ -120 singleWidth:0, -121 -122 /** -123 * For each element in the sprite image array, its height. -124 */ -125 singleHeight:0, -126 -127 scaleX:1, -128 scaleY:1, -129 -130 /** -131 * Displacement offset to get the sub image from. Useful to make images shift. -132 */ -133 offsetX:0, -134 -135 /** -136 * Displacement offset to get the sub image from. Useful to make images shift. -137 */ -138 offsetY:0, -139 -140 /** -141 * When nesting sprite images, this value is the star X position of this sprite image in the parent. -142 */ -143 parentOffsetX:0, // para especificar una subimagen dentro un textmap. -144 -145 /** -146 * When nesting sprite images, this value is the star Y position of this sprite image in the parent. -147 */ -148 parentOffsetY:0, -149 -150 /** -151 * The actor this sprite image belongs to. -152 */ -153 ownerActor:null, -154 -155 /** -156 * If the sprite image is defined out of a JSON object (sprite packer for example), this is -157 * the subimages calculated definition map. -158 */ -159 mapInfo:null, -160 -161 /** -162 * If the sprite image is defined out of a JSON object (sprite packer for example), this is -163 * the subimages original definition map. -164 */ -165 map:null, -166 -167 /** -168 * This property allows to have multiple different animations defined for one actor. -169 * see demo31 for a sample. -170 */ -171 animationsMap : null, -172 -173 /** -174 * When an animation sequence ends, this callback function will be called. -175 */ -176 callback : null, // on end animation callback -177 -178 /** -179 * pending: refactor -> font scale to a font object. -180 */ -181 fontScale : 1, -182 -183 getOwnerActor : function() { -184 return this.ownerActor; -185 }, -186 -187 /** -188 * Add an animation to this sprite image. -189 * An animation is defines by an array of pretend-to-be-played sprite sequence. -190 * -191 * @param name {string} animation name. -192 * @param array {Array<number|string>} the sprite animation sequence array. It can be defined -193 * as number array for Grid-like sprite images or strings for a map-like sprite -194 * image. -195 * @param time {number} change animation sequence every 'time' ms. -196 * @param callback {function({SpriteImage},{string}} a callback function to invoke when the sprite -197 * animation sequence has ended. -198 */ -199 addAnimation : function( name, array, time, callback ) { -200 this.animationsMap[name]= new CAAT.Foundation.SpriteImageAnimationHelper(array,time,callback); -201 return this; -202 }, -203 -204 setAnimationEndCallback : function(f) { -205 this.callback= f; -206 }, -207 -208 /** -209 * Start playing a SpriteImage animation. -210 * If it does not exist, nothing happens. -211 * @param name -212 */ -213 playAnimation : function(name) { -214 if (name===this.currentAnimation) { -215 return this; -216 } -217 -218 var animation= this.animationsMap[name]; -219 if ( !animation ) { -220 return this; -221 } -222 -223 this.currentAnimation= name; + 51 if ( arguments.length===1 ) { + 52 this.initialize.call(this, arguments[0], 1, 1); + 53 } else if ( arguments.length===3 ) { + 54 this.initialize.apply(this, arguments); + 55 } + 56 return this; + 57 }, + 58 + 59 /** + 60 * an Array defining the sprite frame sequence + 61 */ + 62 animationImageIndex:null, + 63 + 64 /** + 65 * Previous animation frame time. + 66 */ + 67 prevAnimationTime:-1, + 68 + 69 /** + 70 * how much Scene time to take before changing an Sprite frame. + 71 */ + 72 changeFPS:1000, + 73 + 74 /** + 75 * any of the TR_* constants. + 76 */ + 77 transformation:0, + 78 + 79 /** + 80 * the current sprite frame + 81 */ + 82 spriteIndex:0, + 83 + 84 /** + 85 * current index of sprite frames array. + 86 */ + 87 prevIndex:0, // + 88 + 89 /** + 90 * current animation name + 91 */ + 92 currentAnimation: null, + 93 + 94 /** + 95 * Image to get frames from. + 96 */ + 97 image:null, + 98 + 99 /** +100 * Number of rows +101 */ +102 rows:1, +103 +104 /** +105 * Number of columns. +106 */ +107 columns:1, +108 +109 /** +110 * This sprite image image´s width +111 */ +112 width:0, +113 +114 /** +115 * This sprite image image´s width +116 */ +117 height:0, +118 +119 /** +120 * For each element in the sprite image array, its size. +121 */ +122 singleWidth:0, +123 +124 /** +125 * For each element in the sprite image array, its height. +126 */ +127 singleHeight:0, +128 +129 scaleX:1, +130 scaleY:1, +131 +132 /** +133 * Displacement offset to get the sub image from. Useful to make images shift. +134 */ +135 offsetX:0, +136 +137 /** +138 * Displacement offset to get the sub image from. Useful to make images shift. +139 */ +140 offsetY:0, +141 +142 /** +143 * When nesting sprite images, this value is the star X position of this sprite image in the parent. +144 */ +145 parentOffsetX:0, // para especificar una subimagen dentro un textmap. +146 +147 /** +148 * When nesting sprite images, this value is the star Y position of this sprite image in the parent. +149 */ +150 parentOffsetY:0, +151 +152 /** +153 * The actor this sprite image belongs to. +154 */ +155 ownerActor:null, +156 +157 /** +158 * If the sprite image is defined out of a JSON object (sprite packer for example), this is +159 * the subimages calculated definition map. +160 */ +161 mapInfo:null, +162 +163 /** +164 * If the sprite image is defined out of a JSON object (sprite packer for example), this is +165 * the subimages original definition map. +166 */ +167 map:null, +168 +169 /** +170 * This property allows to have multiple different animations defined for one actor. +171 * see demo31 for a sample. +172 */ +173 animationsMap : null, +174 +175 /** +176 * When an animation sequence ends, this callback function will be called. +177 */ +178 callback : null, // on end animation callback +179 +180 /** +181 * pending: refactor -> font scale to a font object. +182 */ +183 fontScale : 1, +184 +185 getOwnerActor : function() { +186 return this.ownerActor; +187 }, +188 +189 /** +190 * Add an animation to this sprite image. +191 * An animation is defines by an array of pretend-to-be-played sprite sequence. +192 * +193 * @param name {string} animation name. +194 * @param array {Array<number|string>} the sprite animation sequence array. It can be defined +195 * as number array for Grid-like sprite images or strings for a map-like sprite +196 * image. +197 * @param time {number} change animation sequence every 'time' ms. +198 * @param callback {function({SpriteImage},{string}} a callback function to invoke when the sprite +199 * animation sequence has ended. +200 */ +201 addAnimation : function( name, array, time, callback ) { +202 this.animationsMap[name]= new CAAT.Foundation.SpriteImageAnimationHelper(array,time,callback); +203 return this; +204 }, +205 +206 setAnimationEndCallback : function(f) { +207 this.callback= f; +208 }, +209 +210 /** +211 * Start playing a SpriteImage animation. +212 * If it does not exist, nothing happens. +213 * @param name +214 */ +215 playAnimation : function(name) { +216 if (name===this.currentAnimation) { +217 return this; +218 } +219 +220 var animation= this.animationsMap[name]; +221 if ( !animation ) { +222 return this; +223 } 224 -225 this.setAnimationImageIndex( animation.animation ); -226 this.changeFPS= animation.time; -227 this.callback= animation.onEndPlayCallback; -228 -229 return this; -230 }, -231 -232 setOwner:function (actor) { -233 this.ownerActor = actor; -234 return this; -235 }, -236 getRows:function () { -237 return this.rows; -238 }, -239 getColumns:function () { -240 return this.columns; -241 }, -242 -243 getWidth:function () { -244 var el = this.mapInfo[this.spriteIndex]; -245 return el.width; -246 }, -247 -248 getHeight:function () { -249 var el = this.mapInfo[this.spriteIndex]; -250 return el.height; -251 }, -252 -253 getWrappedImageWidth:function () { -254 return this.image.width; -255 }, -256 -257 getWrappedImageHeight:function () { -258 return this.image.height; -259 }, -260 -261 /** -262 * Get a reference to the same image information (rows, columns, image and uv cache) of this -263 * SpriteImage. This means that re-initializing this objects image info (that is, calling initialize -264 * method) will change all reference's image information at the same time. -265 */ -266 getRef:function () { -267 var ret = new CAAT.Foundation.SpriteImage(); -268 ret.image = this.image; -269 ret.rows = this.rows; -270 ret.columns = this.columns; -271 ret.width = this.width; -272 ret.height = this.height; -273 ret.singleWidth = this.singleWidth; -274 ret.singleHeight = this.singleHeight; -275 ret.mapInfo = this.mapInfo; -276 ret.offsetX = this.offsetX; -277 ret.offsetY = this.offsetY; -278 ret.scaleX = this.scaleX; -279 ret.scaleY = this.scaleY; -280 ret.animationsMap= this.animationsMap; -281 ret.parentOffsetX= this.parentOffsetX; -282 ret.parentOffsetY= this.parentOffsetY; -283 -284 ret.scaleFont= this.scaleFont; +225 this.currentAnimation= name; +226 +227 this.setAnimationImageIndex( animation.animation ); +228 this.changeFPS= animation.time; +229 this.callback= animation.onEndPlayCallback; +230 +231 return this; +232 }, +233 +234 setOwner:function (actor) { +235 this.ownerActor = actor; +236 return this; +237 }, +238 getRows:function () { +239 return this.rows; +240 }, +241 getColumns:function () { +242 return this.columns; +243 }, +244 +245 getWidth:function () { +246 var el = this.mapInfo[this.spriteIndex]; +247 return el.width; +248 }, +249 +250 getHeight:function () { +251 var el = this.mapInfo[this.spriteIndex]; +252 return el.height; +253 }, +254 +255 getWrappedImageWidth:function () { +256 return this.image.width; +257 }, +258 +259 getWrappedImageHeight:function () { +260 return this.image.height; +261 }, +262 +263 /** +264 * Get a reference to the same image information (rows, columns, image and uv cache) of this +265 * SpriteImage. This means that re-initializing this objects image info (that is, calling initialize +266 * method) will change all reference's image information at the same time. +267 */ +268 getRef:function () { +269 var ret = new CAAT.Foundation.SpriteImage(); +270 ret.image = this.image; +271 ret.rows = this.rows; +272 ret.columns = this.columns; +273 ret.width = this.width; +274 ret.height = this.height; +275 ret.singleWidth = this.singleWidth; +276 ret.singleHeight = this.singleHeight; +277 ret.mapInfo = this.mapInfo; +278 ret.offsetX = this.offsetX; +279 ret.offsetY = this.offsetY; +280 ret.scaleX = this.scaleX; +281 ret.scaleY = this.scaleY; +282 ret.animationsMap= this.animationsMap; +283 ret.parentOffsetX= this.parentOffsetX; +284 ret.parentOffsetY= this.parentOffsetY; 285 -286 return ret; -287 }, -288 /** -289 * Set horizontal displacement to draw image. Positive values means drawing the image more to the -290 * right. -291 * @param x {number} -292 * @return this -293 */ -294 setOffsetX:function (x) { -295 this.offsetX = x; -296 return this; -297 }, -298 /** -299 * Set vertical displacement to draw image. Positive values means drawing the image more to the -300 * bottom. -301 * @param y {number} -302 * @return this -303 */ -304 setOffsetY:function (y) { -305 this.offsetY = y; -306 return this; -307 }, -308 setOffset:function (x, y) { -309 this.offsetX = x; -310 this.offsetY = y; -311 return this; -312 }, -313 /** -314 * Initialize a grid of subimages out of a given image. -315 * @param image {HTMLImageElement|Image} an image object. -316 * @param rows {number} number of rows. -317 * @param columns {number} number of columns -318 * -319 * @return this -320 */ -321 initialize:function (image, rows, columns) { -322 -323 if (!image) { -324 console.log("Null image for SpriteImage."); -325 } -326 -327 if ( isString(image) ) { -328 image= CAAT.currentDirector.getImage(image); -329 } -330 -331 this.parentOffsetX= 0; -332 this.parentOffsetY= 0; -333 -334 this.rows = rows; -335 this.columns = columns; -336 -337 if ( image instanceof CAAT.Foundation.SpriteImage || image instanceof CAAT.SpriteImage ) { -338 this.image = image.image; -339 var sihelper= image.mapInfo[0]; -340 this.width= sihelper.width; -341 this.height= sihelper.height; -342 -343 this.parentOffsetX= sihelper.x; -344 this.parentOffsetY= sihelper.y; -345 -346 this.width= image.mapInfo[0].width; -347 this.height= image.mapInfo[0].height; -348 -349 -350 } else { -351 this.image = image; -352 this.width = image.width; -353 this.height = image.height; -354 this.mapInfo = {}; -355 -356 } -357 -358 this.singleWidth = Math.floor(this.width / columns); -359 this.singleHeight = Math.floor(this.height / rows); -360 -361 var i, sx0, sy0; -362 var helper; -363 -364 if (image.__texturePage) { -365 image.__du = this.singleWidth / image.__texturePage.width; -366 image.__dv = this.singleHeight / image.__texturePage.height; -367 +286 ret.scaleFont= this.scaleFont; +287 +288 return ret; +289 }, +290 /** +291 * Set horizontal displacement to draw image. Positive values means drawing the image more to the +292 * right. +293 * @param x {number} +294 * @return this +295 */ +296 setOffsetX:function (x) { +297 this.offsetX = x; +298 return this; +299 }, +300 /** +301 * Set vertical displacement to draw image. Positive values means drawing the image more to the +302 * bottom. +303 * @param y {number} +304 * @return this +305 */ +306 setOffsetY:function (y) { +307 this.offsetY = y; +308 return this; +309 }, +310 setOffset:function (x, y) { +311 this.offsetX = x; +312 this.offsetY = y; +313 return this; +314 }, +315 /** +316 * Initialize a grid of subimages out of a given image. +317 * @param image {HTMLImageElement|Image} an image object. +318 * @param rows {number} number of rows. +319 * @param columns {number} number of columns +320 * +321 * @return this +322 */ +323 initialize:function (image, rows, columns) { +324 +325 if (!image) { +326 console.log("Null image for SpriteImage."); +327 } +328 +329 if ( isString(image) ) { +330 image= CAAT.currentDirector.getImage(image); +331 } +332 +333 this.parentOffsetX= 0; +334 this.parentOffsetY= 0; +335 +336 this.rows = rows; +337 this.columns = columns; +338 +339 if ( image instanceof CAAT.Foundation.SpriteImage || image instanceof CAAT.SpriteImage ) { +340 this.image = image.image; +341 var sihelper= image.mapInfo[0]; +342 this.width= sihelper.width; +343 this.height= sihelper.height; +344 +345 this.parentOffsetX= sihelper.x; +346 this.parentOffsetY= sihelper.y; +347 +348 this.width= image.mapInfo[0].width; +349 this.height= image.mapInfo[0].height; +350 +351 } else { +352 this.image = image; +353 this.width = image.width; +354 this.height = image.height; +355 this.mapInfo = {}; +356 +357 } +358 +359 this.singleWidth = Math.floor(this.width / columns); +360 this.singleHeight = Math.floor(this.height / rows); +361 +362 var i, sx0, sy0; +363 var helper; +364 +365 if (image.__texturePage) { +366 image.__du = this.singleWidth / image.__texturePage.width; +367 image.__dv = this.singleHeight / image.__texturePage.height; 368 -369 var w = this.singleWidth; -370 var h = this.singleHeight; -371 var mod = this.columns; -372 if (image.inverted) { -373 var t = w; -374 w = h; -375 h = t; -376 mod = this.rows; -377 } -378 -379 var xt = this.image.__tx; -380 var yt = this.image.__ty; -381 -382 var tp = this.image.__texturePage; -383 -384 for (i = 0; i < rows * columns; i++) { -385 +369 +370 var w = this.singleWidth; +371 var h = this.singleHeight; +372 var mod = this.columns; +373 if (image.inverted) { +374 var t = w; +375 w = h; +376 h = t; +377 mod = this.rows; +378 } +379 +380 var xt = this.image.__tx; +381 var yt = this.image.__ty; +382 +383 var tp = this.image.__texturePage; +384 +385 for (i = 0; i < rows * columns; i++) { 386 -387 var c = ((i % mod) >> 0); -388 var r = ((i / mod) >> 0); -389 -390 var u = xt + c * w; // esquina izq x -391 var v = yt + r * h; -392 -393 var u1 = u + w; -394 var v1 = v + h; -395 -396 helper = new CAAT.Foundation.SpriteImageHelper(u, v, (u1 - u), (v1 - v), tp.width, tp.height).setGL( -397 u / tp.width, -398 v / tp.height, -399 u1 / tp.width, -400 v1 / tp.height); -401 -402 this.mapInfo[i] = helper; -403 } -404 -405 } else { -406 for (i = 0; i < rows * columns; i++) { -407 sx0 = ((i % this.columns) | 0) * this.singleWidth + this.parentOffsetX; -408 sy0 = ((i / this.columns) | 0) * this.singleHeight + this.parentOffsetY; -409 -410 helper = new CAAT.Foundation.SpriteImageHelper(sx0, sy0, this.singleWidth, this.singleHeight, image.width, image.height); -411 this.mapInfo[i] = helper; -412 } -413 } -414 -415 return this; -416 }, -417 -418 /** -419 * Must be used to draw actor background and the actor should have setClip(true) so that the image tiles -420 * properly. -421 * @param director -422 * @param time -423 * @param x -424 * @param y -425 */ -426 paintTiled:function (director, time, x, y) { -427 -428 // PENDING: study using a pattern -429 -430 var el = this.mapInfo[this.spriteIndex]; -431 -432 var r = new CAAT.Math.Rectangle(); -433 this.ownerActor.AABB.intersect(director.AABB, r); -434 -435 var w = this.getWidth(); -436 var h = this.getHeight(); -437 var xoff = (this.offsetX - this.ownerActor.x) % w; -438 if (xoff > 0) { -439 xoff = xoff - w; -440 } -441 var yoff = (this.offsetY - this.ownerActor.y) % h; -442 if (yoff > 0) { -443 yoff = yoff - h; -444 } -445 -446 var nw = (((r.width - xoff) / w) >> 0) + 1; -447 var nh = (((r.height - yoff) / h) >> 0) + 1; -448 var i, j; -449 var ctx = director.ctx; -450 -451 for (i = 0; i < nh; i++) { -452 for (j = 0; j < nw; j++) { -453 ctx.drawImage( -454 this.image, -455 el.x, el.y, -456 el.width, el.height, -457 (r.x - this.ownerActor.x + xoff + j * el.width) >> 0, (r.y - this.ownerActor.y + yoff + i * el.height) >> 0, -458 el.width, el.height); -459 } -460 } -461 }, -462 -463 /** -464 * Draws the subimage pointed by imageIndex horizontally inverted. -465 * @param director {CAAT.Foundation.Director} -466 * @param time {number} scene time. -467 * @param x {number} x position in canvas to draw the image. -468 * @param y {number} y position in canvas to draw the image. -469 * -470 * @return this -471 */ -472 paintInvertedH:function (director, time, x, y) { -473 -474 var el = this.mapInfo[this.spriteIndex]; -475 -476 var ctx = director.ctx; -477 ctx.save(); -478 //ctx.translate(((0.5 + x) | 0) + el.width, (0.5 + y) | 0); -479 ctx.translate((x | 0) + el.width, y | 0); -480 ctx.scale(-1, 1); -481 -482 -483 ctx.drawImage( -484 this.image, -485 el.x, el.y, -486 el.width, el.height, -487 this.offsetX >> 0, this.offsetY >> 0, -488 el.width, el.height); -489 -490 ctx.restore(); -491 -492 return this; -493 }, -494 /** -495 * Draws the subimage pointed by imageIndex vertically inverted. -496 * @param director {CAAT.Foundation.Director} -497 * @param time {number} scene time. -498 * @param x {number} x position in canvas to draw the image. -499 * @param y {number} y position in canvas to draw the image. -500 * -501 * @return this -502 */ -503 paintInvertedV:function (director, time, x, y) { +387 +388 var c = ((i % mod) >> 0); +389 var r = ((i / mod) >> 0); +390 +391 var u = xt + c * w; // esquina izq x +392 var v = yt + r * h; +393 +394 var u1 = u + w; +395 var v1 = v + h; +396 +397 helper = new CAAT.Foundation.SpriteImageHelper(u, v, (u1 - u), (v1 - v), tp.width, tp.height).setGL( +398 u / tp.width, +399 v / tp.height, +400 u1 / tp.width, +401 v1 / tp.height); +402 +403 this.mapInfo[i] = helper; +404 } +405 +406 } else { +407 for (i = 0; i < rows * columns; i++) { +408 sx0 = ((i % this.columns) | 0) * this.singleWidth + this.parentOffsetX; +409 sy0 = ((i / this.columns) | 0) * this.singleHeight + this.parentOffsetY; +410 +411 helper = new CAAT.Foundation.SpriteImageHelper(sx0, sy0, this.singleWidth, this.singleHeight, image.width, image.height); +412 this.mapInfo[i] = helper; +413 } +414 } +415 +416 return this; +417 }, +418 +419 /** +420 * Create elements as director.getImage values. +421 * Create as much as elements defined in this sprite image. +422 * The elements will be named prefix+<the map info element name> +423 * @param prefix +424 */ +425 addElementsAsImages : function( prefix ) { +426 for( var i in this.mapInfo ) { +427 var si= new CAAT.Foundation.SpriteImage().initialize( this.image, 1, 1 ); +428 si.addElement(0, this.mapInfo[i]); +429 si.setSpriteIndex(0); +430 CAAT.currentDirector.addImage( prefix+i, si ); +431 } +432 }, +433 +434 copy : function( other ) { +435 this.initialize(other,1,1); +436 this.mapInfo= other.mapInfo; +437 return this; +438 }, +439 +440 /** +441 * Must be used to draw actor background and the actor should have setClip(true) so that the image tiles +442 * properly. +443 * @param director +444 * @param time +445 * @param x +446 * @param y +447 */ +448 paintTiled:function (director, time, x, y) { +449 +450 // PENDING: study using a pattern +451 +452 var el = this.mapInfo[this.spriteIndex]; +453 +454 var r = new CAAT.Math.Rectangle(); +455 this.ownerActor.AABB.intersect(director.AABB, r); +456 +457 var w = this.getWidth(); +458 var h = this.getHeight(); +459 var xoff = (this.offsetX - this.ownerActor.x) % w; +460 if (xoff > 0) { +461 xoff = xoff - w; +462 } +463 var yoff = (this.offsetY - this.ownerActor.y) % h; +464 if (yoff > 0) { +465 yoff = yoff - h; +466 } +467 +468 var nw = (((r.width - xoff) / w) >> 0) + 1; +469 var nh = (((r.height - yoff) / h) >> 0) + 1; +470 var i, j; +471 var ctx = director.ctx; +472 +473 for (i = 0; i < nh; i++) { +474 for (j = 0; j < nw; j++) { +475 ctx.drawImage( +476 this.image, +477 el.x, el.y, +478 el.width, el.height, +479 (r.x - this.ownerActor.x + xoff + j * el.width) >> 0, (r.y - this.ownerActor.y + yoff + i * el.height) >> 0, +480 el.width, el.height); +481 } +482 } +483 }, +484 +485 /** +486 * Draws the subimage pointed by imageIndex horizontally inverted. +487 * @param director {CAAT.Foundation.Director} +488 * @param time {number} scene time. +489 * @param x {number} x position in canvas to draw the image. +490 * @param y {number} y position in canvas to draw the image. +491 * +492 * @return this +493 */ +494 paintInvertedH:function (director, time, x, y) { +495 +496 var el = this.mapInfo[this.spriteIndex]; +497 +498 var ctx = director.ctx; +499 ctx.save(); +500 //ctx.translate(((0.5 + x) | 0) + el.width, (0.5 + y) | 0); +501 ctx.translate((x | 0) + el.width, y | 0); +502 ctx.scale(-1, 1); +503 504 -505 var el = this.mapInfo[this.spriteIndex]; -506 -507 var ctx = director.ctx; -508 ctx.save(); -509 //ctx.translate((x + 0.5) | 0, (0.5 + y + el.height) | 0); -510 ctx.translate(x | 0, (y + el.height) | 0); -511 ctx.scale(1, -1); -512 -513 ctx.drawImage( -514 this.image, -515 el.x, el.y, -516 el.width, el.height, -517 this.offsetX >> 0, this.offsetY >> 0, -518 el.width, el.height); -519 -520 ctx.restore(); -521 -522 return this; -523 }, -524 /** -525 * Draws the subimage pointed by imageIndex both horizontal and vertically inverted. -526 * @param director {CAAT.Foundation.Director} -527 * @param time {number} scene time. -528 * @param x {number} x position in canvas to draw the image. -529 * @param y {number} y position in canvas to draw the image. -530 * -531 * @return this -532 */ -533 paintInvertedHV:function (director, time, x, y) { +505 ctx.drawImage( +506 this.image, +507 el.x, el.y, +508 el.width, el.height, +509 this.offsetX >> 0, this.offsetY >> 0, +510 el.width, el.height); +511 +512 ctx.restore(); +513 +514 return this; +515 }, +516 /** +517 * Draws the subimage pointed by imageIndex vertically inverted. +518 * @param director {CAAT.Foundation.Director} +519 * @param time {number} scene time. +520 * @param x {number} x position in canvas to draw the image. +521 * @param y {number} y position in canvas to draw the image. +522 * +523 * @return this +524 */ +525 paintInvertedV:function (director, time, x, y) { +526 +527 var el = this.mapInfo[this.spriteIndex]; +528 +529 var ctx = director.ctx; +530 ctx.save(); +531 //ctx.translate((x + 0.5) | 0, (0.5 + y + el.height) | 0); +532 ctx.translate(x | 0, (y + el.height) | 0); +533 ctx.scale(1, -1); 534 -535 var el = this.mapInfo[this.spriteIndex]; -536 -537 var ctx = director.ctx; -538 ctx.save(); -539 //ctx.translate((x + 0.5) | 0, (0.5 + y + el.height) | 0); -540 ctx.translate(x | 0, (y + el.height) | 0); -541 ctx.scale(1, -1); -542 ctx.translate(el.width, 0); -543 ctx.scale(-1, 1); -544 -545 ctx.drawImage( -546 this.image, -547 el.x, el.y, -548 el.width, el.height, -549 this.offsetX >> 0, this.offsetY >> 0, -550 el.width, el.height); -551 -552 ctx.restore(); -553 -554 return this; -555 }, -556 /** -557 * Draws the subimage pointed by imageIndex. -558 * @param director {CAAT.Foundation.Director} -559 * @param time {number} scene time. -560 * @param x {number} x position in canvas to draw the image. -561 * @param y {number} y position in canvas to draw the image. -562 * -563 * @return this -564 */ -565 paintN:function (director, time, x, y) { +535 ctx.drawImage( +536 this.image, +537 el.x, el.y, +538 el.width, el.height, +539 this.offsetX >> 0, this.offsetY >> 0, +540 el.width, el.height); +541 +542 ctx.restore(); +543 +544 return this; +545 }, +546 /** +547 * Draws the subimage pointed by imageIndex both horizontal and vertically inverted. +548 * @param director {CAAT.Foundation.Director} +549 * @param time {number} scene time. +550 * @param x {number} x position in canvas to draw the image. +551 * @param y {number} y position in canvas to draw the image. +552 * +553 * @return this +554 */ +555 paintInvertedHV:function (director, time, x, y) { +556 +557 var el = this.mapInfo[this.spriteIndex]; +558 +559 var ctx = director.ctx; +560 ctx.save(); +561 //ctx.translate((x + 0.5) | 0, (0.5 + y + el.height) | 0); +562 ctx.translate(x | 0, (y + el.height) | 0); +563 ctx.scale(1, -1); +564 ctx.translate(el.width, 0); +565 ctx.scale(-1, 1); 566 -567 var el = this.mapInfo[this.spriteIndex]; -568 -569 director.ctx.drawImage( -570 this.image, -571 el.x, el.y, -572 el.width, el.height, -573 (this.offsetX + x) >> 0, (this.offsetY + y) >> 0, -574 el.width, el.height); +567 ctx.drawImage( +568 this.image, +569 el.x, el.y, +570 el.width, el.height, +571 this.offsetX >> 0, this.offsetY >> 0, +572 el.width, el.height); +573 +574 ctx.restore(); 575 576 return this; 577 }, -578 paintAtRect:function (director, time, x, y, w, h) { -579 -580 var el = this.mapInfo[this.spriteIndex]; -581 -582 director.ctx.drawImage( -583 this.image, -584 el.x, el.y, -585 el.width, el.height, -586 (this.offsetX + x) >> 0, (this.offsetY + y) >> 0, -587 w, h); +578 /** +579 * Draws the subimage pointed by imageIndex. +580 * @param director {CAAT.Foundation.Director} +581 * @param time {number} scene time. +582 * @param x {number} x position in canvas to draw the image. +583 * @param y {number} y position in canvas to draw the image. +584 * +585 * @return this +586 */ +587 paintN:function (director, time, x, y) { 588 -589 return this; -590 }, -591 /** -592 * Draws the subimage pointed by imageIndex. -593 * @param director {CAAT.Foundation.Director} -594 * @param time {number} scene time. -595 * @param x {number} x position in canvas to draw the image. -596 * @param y {number} y position in canvas to draw the image. -597 * -598 * @return this -599 */ -600 paintScaledWidth:function (director, time, x, y) { +589 var el = this.mapInfo[this.spriteIndex]; +590 +591 director.ctx.drawImage( +592 this.image, +593 el.x, el.y, +594 el.width, el.height, +595 (this.offsetX + x) >> 0, (this.offsetY + y) >> 0, +596 el.width, el.height); +597 +598 return this; +599 }, +600 paintAtRect:function (director, time, x, y, w, h) { 601 602 var el = this.mapInfo[this.spriteIndex]; 603 @@ -613,487 +613,561 @@ 606 el.x, el.y, 607 el.width, el.height, 608 (this.offsetX + x) >> 0, (this.offsetY + y) >> 0, -609 this.ownerActor.width, el.height); +609 w, h); 610 611 return this; 612 }, -613 paintChunk:function (ctx, dx, dy, x, y, w, h) { -614 ctx.drawImage(this.image, x, y, w, h, dx, dy, w, h); -615 }, -616 paintTile:function (ctx, index, x, y) { -617 var el = this.mapInfo[index]; -618 ctx.drawImage( -619 this.image, -620 el.x, el.y, -621 el.width, el.height, -622 (this.offsetX + x) >> 0, (this.offsetY + y) >> 0, -623 el.width, el.height); -624 -625 return this; -626 }, -627 /** -628 * Draws the subimage pointed by imageIndex scaled to the size of w and h. -629 * @param director {CAAT.Foundation.Director} -630 * @param time {number} scene time. -631 * @param x {number} x position in canvas to draw the image. -632 * @param y {number} y position in canvas to draw the image. -633 * -634 * @return this -635 */ -636 paintScaled:function (director, time, x, y) { -637 -638 var el = this.mapInfo[this.spriteIndex]; -639 -640 director.ctx.drawImage( +613 /** +614 * Draws the subimage pointed by imageIndex. +615 * @param director {CAAT.Foundation.Director} +616 * @param time {number} scene time. +617 * @param x {number} x position in canvas to draw the image. +618 * @param y {number} y position in canvas to draw the image. +619 * +620 * @return this +621 */ +622 paintScaledWidth:function (director, time, x, y) { +623 +624 var el = this.mapInfo[this.spriteIndex]; +625 +626 director.ctx.drawImage( +627 this.image, +628 el.x, el.y, +629 el.width, el.height, +630 (this.offsetX + x) >> 0, (this.offsetY + y) >> 0, +631 this.ownerActor.width, el.height); +632 +633 return this; +634 }, +635 paintChunk:function (ctx, dx, dy, x, y, w, h) { +636 ctx.drawImage(this.image, x, y, w, h, dx, dy, w, h); +637 }, +638 paintTile:function (ctx, index, x, y) { +639 var el = this.mapInfo[index]; +640 ctx.drawImage( 641 this.image, 642 el.x, el.y, 643 el.width, el.height, 644 (this.offsetX + x) >> 0, (this.offsetY + y) >> 0, -645 this.ownerActor.width, this.ownerActor.height); +645 el.width, el.height); 646 647 return this; 648 }, -649 getCurrentSpriteImageCSSPosition:function () { -650 var el = this.mapInfo[this.spriteIndex]; -651 -652 var x = -(el.x + this.parentOffsetX - this.offsetX); -653 var y = -(el.y + this.parentOffsetY - this.offsetY); -654 -655 return '' + x + 'px ' + -656 y + 'px ' + -657 (this.ownerActor.transformation === CAAT.Foundation.SpriteImage.TR_TILE ? 'repeat' : 'no-repeat'); -658 }, -659 /** -660 * Get the number of subimages in this compoundImage -661 * @return {number} -662 */ -663 getNumImages:function () { -664 return this.rows * this.columns; -665 }, -666 -667 setUV:function (uvBuffer, uvIndex) { -668 var im = this.image; -669 -670 if (!im.__texturePage) { -671 return; -672 } +649 /** +650 * Draws the subimage pointed by imageIndex scaled to the size of w and h. +651 * @param director {CAAT.Foundation.Director} +652 * @param time {number} scene time. +653 * @param x {number} x position in canvas to draw the image. +654 * @param y {number} y position in canvas to draw the image. +655 * +656 * @return this +657 */ +658 paintScaled:function (director, time, x, y) { +659 +660 var el = this.mapInfo[this.spriteIndex]; +661 +662 director.ctx.drawImage( +663 this.image, +664 el.x, el.y, +665 el.width, el.height, +666 (this.offsetX + x) >> 0, (this.offsetY + y) >> 0, +667 this.ownerActor.width, this.ownerActor.height); +668 +669 return this; +670 }, +671 getCurrentSpriteImageCSSPosition:function () { +672 var el = this.mapInfo[this.spriteIndex]; 673 -674 var index = uvIndex; -675 var sIndex = this.spriteIndex; -676 var el = this.mapInfo[this.spriteIndex]; -677 -678 var u = el.u; -679 var v = el.v; -680 var u1 = el.u1; -681 var v1 = el.v1; -682 if (this.offsetX || this.offsetY) { -683 var w = this.ownerActor.width; -684 var h = this.ownerActor.height; -685 -686 var tp = im.__texturePage; -687 -688 var _u = -this.offsetX / tp.width; -689 var _v = -this.offsetY / tp.height; -690 var _u1 = (w - this.offsetX) / tp.width; -691 var _v1 = (h - this.offsetY) / tp.height; -692 -693 u = _u + im.__u; -694 v = _v + im.__v; -695 u1 = _u1 + im.__u; -696 v1 = _v1 + im.__v; -697 } -698 -699 if (im.inverted) { -700 uvBuffer[index++] = u1; -701 uvBuffer[index++] = v; -702 -703 uvBuffer[index++] = u1; -704 uvBuffer[index++] = v1; -705 -706 uvBuffer[index++] = u; -707 uvBuffer[index++] = v1; -708 -709 uvBuffer[index++] = u; -710 uvBuffer[index++] = v; -711 } else { -712 uvBuffer[index++] = u; -713 uvBuffer[index++] = v; +674 var x = -(el.x + this.parentOffsetX - this.offsetX); +675 var y = -(el.y + this.parentOffsetY - this.offsetY); +676 +677 return '' + x + 'px ' + +678 y + 'px ' + +679 (this.ownerActor.transformation === CAAT.Foundation.SpriteImage.TR_TILE ? 'repeat' : 'no-repeat'); +680 }, +681 /** +682 * Get the number of subimages in this compoundImage +683 * @return {number} +684 */ +685 getNumImages:function () { +686 return this.rows * this.columns; +687 }, +688 +689 setUV:function (uvBuffer, uvIndex) { +690 var im = this.image; +691 +692 if (!im.__texturePage) { +693 return; +694 } +695 +696 var index = uvIndex; +697 var sIndex = this.spriteIndex; +698 var el = this.mapInfo[this.spriteIndex]; +699 +700 var u = el.u; +701 var v = el.v; +702 var u1 = el.u1; +703 var v1 = el.v1; +704 if (this.offsetX || this.offsetY) { +705 var w = this.ownerActor.width; +706 var h = this.ownerActor.height; +707 +708 var tp = im.__texturePage; +709 +710 var _u = -this.offsetX / tp.width; +711 var _v = -this.offsetY / tp.height; +712 var _u1 = (w - this.offsetX) / tp.width; +713 var _v1 = (h - this.offsetY) / tp.height; 714 -715 uvBuffer[index++] = u1; -716 uvBuffer[index++] = v; -717 -718 uvBuffer[index++] = u1; -719 uvBuffer[index++] = v1; +715 u = _u + im.__u; +716 v = _v + im.__v; +717 u1 = _u1 + im.__u; +718 v1 = _v1 + im.__v; +719 } 720 -721 uvBuffer[index++] = u; -722 uvBuffer[index++] = v1; -723 } -724 }, -725 /** -726 * Set the elapsed time needed to change the image index. -727 * @param fps an integer indicating the time in milliseconds to change. -728 * @return this -729 */ -730 setChangeFPS:function (fps) { -731 this.changeFPS = fps; -732 return this; -733 }, -734 /** -735 * Set the transformation to apply to the Sprite image. -736 * Any value of -737 * <li>TR_NONE -738 * <li>TR_FLIP_HORIZONTAL -739 * <li>TR_FLIP_VERTICAL -740 * <li>TR_FLIP_ALL -741 * -742 * @param transformation an integer indicating one of the previous values. -743 * @return this -744 */ -745 setSpriteTransformation:function (transformation) { -746 this.transformation = transformation; -747 var v = CAAT.Foundation.SpriteImage; -748 switch (transformation) { -749 case v.TR_FLIP_HORIZONTAL: -750 this.paint = this.paintInvertedH; -751 break; -752 case v.TR_FLIP_VERTICAL: -753 this.paint = this.paintInvertedV; -754 break; -755 case v.TR_FLIP_ALL: -756 this.paint = this.paintInvertedHV; -757 break; -758 case v.TR_FIXED_TO_SIZE: -759 this.paint = this.paintScaled; -760 break; -761 case v.TR_FIXED_WIDTH_TO_SIZE: -762 this.paint = this.paintScaledWidth; -763 break; -764 case v.TR_TILE: -765 this.paint = this.paintTiled; -766 break; -767 default: -768 this.paint = this.paintN; -769 } -770 this.ownerActor.invalidate(); -771 return this; -772 }, -773 -774 resetAnimationTime:function () { -775 this.prevAnimationTime = -1; -776 return this; -777 }, -778 -779 /** -780 * Set the sprite animation images index. This method accepts an array of objects which define indexes to -781 * subimages inside this sprite image. -782 * If the SpriteImage is instantiated by calling the method initialize( image, rows, cols ), the value of -783 * aAnimationImageIndex should be an array of numbers, which define the indexes into an array of subimages -784 * with size rows*columns. -785 * If the method InitializeFromMap( image, map ) is called, the value for aAnimationImageIndex is expected -786 * to be an array of strings which are the names of the subobjects contained in the map object. -787 * -788 * @param aAnimationImageIndex an array indicating the Sprite's frames. -789 */ -790 setAnimationImageIndex:function (aAnimationImageIndex) { -791 this.animationImageIndex = aAnimationImageIndex; -792 this.spriteIndex = aAnimationImageIndex[0]; -793 this.prevAnimationTime = -1; -794 -795 return this; -796 }, -797 setSpriteIndex:function (index) { -798 this.spriteIndex = index; -799 return this; -800 }, -801 -802 /** -803 * Draws the sprite image calculated and stored in spriteIndex. -804 * -805 * @param time {number} Scene time when the bounding box is to be drawn. -806 */ -807 setSpriteIndexAtTime:function (time) { -808 -809 if (this.animationImageIndex.length > 1) { -810 if (this.prevAnimationTime === -1) { -811 this.prevAnimationTime = time; -812 -813 //thanks Phloog and ghthor, well spotted. -814 this.spriteIndex = this.animationImageIndex[0]; -815 this.prevIndex= 0; -816 this.ownerActor.invalidate(); -817 } -818 else { -819 var ttime = time; -820 ttime -= this.prevAnimationTime; -821 ttime /= this.changeFPS; -822 ttime %= this.animationImageIndex.length; -823 var idx = Math.floor(ttime); -824 // if ( this.spriteIndex!==idx ) { -825 -826 if ( idx<this.prevIndex ) { // we are getting back in time, or ended playing the animation -827 if ( this.callback ) { -828 this.callback( this, time ); -829 } -830 } -831 -832 this.prevIndex= idx; -833 this.spriteIndex = this.animationImageIndex[idx]; -834 this.ownerActor.invalidate(); -835 // } -836 } -837 } -838 }, -839 -840 getMapInfo:function (index) { -841 return this.mapInfo[ index ]; -842 }, -843 -844 /** -845 * This method takes the output generated from the tool at http://labs.hyperandroid.com/static/texture/spriter.html -846 * and creates a map into that image. -847 * @param image {Image|HTMLImageElement|Canvas} an image -848 * @param map {object} the map into the image to define subimages. -849 */ -850 initializeFromMap:function (image, map) { -851 this.initialize(image, 1, 1); -852 -853 var key; -854 var helper; -855 var count = 0; -856 -857 for (key in map) { -858 var value = map[key]; -859 -860 helper = new CAAT.Foundation.SpriteImageHelper( -861 parseFloat(value.x) + this.parentOffsetX, -862 parseFloat(value.y) + this.parentOffsetY, -863 parseFloat(value.width), -864 parseFloat(value.height), -865 image.width, -866 image.height -867 ); -868 -869 this.mapInfo[key] = helper; -870 -871 // set a default spriteIndex -872 if (!count) { -873 this.setAnimationImageIndex([key]); -874 } -875 -876 count++; -877 } -878 -879 return this; -880 }, -881 -882 /** -883 * Add one element to the spriteImage. -884 * @param key {string|number} index or sprite identifier. -885 * @param value object{ -886 * x: {number}, -887 * y: {number}, -888 * width: {number}, -889 * height: {number}, -890 * xoffset: {number=}, -891 * yoffset: {number=}, -892 * xadvance: {number=} -893 * } -894 * @return {*} -895 */ -896 addElement : function( key, value ) { -897 var helper = new CAAT.Foundation.SpriteImageHelper( -898 parseFloat(value.x) + this.parentOffsetX, -899 parseFloat(value.y) + this.parentOffsetY, -900 parseFloat(value.width), -901 parseFloat(value.height), -902 this.image.width, -903 this.image.height ); -904 -905 helper.xoffset = typeof value.xoffset === 'undefined' ? 0 : parseFloat(value.xoffset); -906 helper.yoffset = typeof value.yoffset === 'undefined' ? 0 : parseFloat(value.yoffset); -907 helper.xadvance = typeof value.xadvance === 'undefined' ? value.width : parseFloat(value.xadvance); -908 -909 this.mapInfo[key] = helper; -910 -911 return this; -912 }, -913 -914 /** -915 * -916 * @param image {Image|HTMLImageElement|Canvas} -917 * @param map object with pairs "<a char>" : { -918 * id : {number}, -919 * height : {number}, -920 * xoffset : {number}, -921 * letter : {string}, -922 * yoffset : {number}, -923 * width : {number}, -924 * xadvance: {number}, -925 * y : {number}, -926 * x : {number} -927 * } -928 */ -929 initializeAsGlyphDesigner:function (image, map) { -930 this.initialize(image, 1, 1); -931 -932 var key; -933 var helper; -934 var count = 0; -935 -936 for (key in map) { -937 var value = map[key]; +721 if (im.inverted) { +722 uvBuffer[index++] = u1; +723 uvBuffer[index++] = v; +724 +725 uvBuffer[index++] = u1; +726 uvBuffer[index++] = v1; +727 +728 uvBuffer[index++] = u; +729 uvBuffer[index++] = v1; +730 +731 uvBuffer[index++] = u; +732 uvBuffer[index++] = v; +733 } else { +734 uvBuffer[index++] = u; +735 uvBuffer[index++] = v; +736 +737 uvBuffer[index++] = u1; +738 uvBuffer[index++] = v; +739 +740 uvBuffer[index++] = u1; +741 uvBuffer[index++] = v1; +742 +743 uvBuffer[index++] = u; +744 uvBuffer[index++] = v1; +745 } +746 }, +747 /** +748 * Set the elapsed time needed to change the image index. +749 * @param fps an integer indicating the time in milliseconds to change. +750 * @return this +751 */ +752 setChangeFPS:function (fps) { +753 this.changeFPS = fps; +754 return this; +755 }, +756 /** +757 * Set the transformation to apply to the Sprite image. +758 * Any value of +759 * <li>TR_NONE +760 * <li>TR_FLIP_HORIZONTAL +761 * <li>TR_FLIP_VERTICAL +762 * <li>TR_FLIP_ALL +763 * +764 * @param transformation an integer indicating one of the previous values. +765 * @return this +766 */ +767 setSpriteTransformation:function (transformation) { +768 this.transformation = transformation; +769 var v = CAAT.Foundation.SpriteImage; +770 switch (transformation) { +771 case v.TR_FLIP_HORIZONTAL: +772 this.paint = this.paintInvertedH; +773 break; +774 case v.TR_FLIP_VERTICAL: +775 this.paint = this.paintInvertedV; +776 break; +777 case v.TR_FLIP_ALL: +778 this.paint = this.paintInvertedHV; +779 break; +780 case v.TR_FIXED_TO_SIZE: +781 this.paint = this.paintScaled; +782 break; +783 case v.TR_FIXED_WIDTH_TO_SIZE: +784 this.paint = this.paintScaledWidth; +785 break; +786 case v.TR_TILE: +787 this.paint = this.paintTiled; +788 break; +789 default: +790 this.paint = this.paintN; +791 } +792 this.ownerActor.invalidate(); +793 return this; +794 }, +795 +796 resetAnimationTime:function () { +797 this.prevAnimationTime = -1; +798 return this; +799 }, +800 +801 /** +802 * Set the sprite animation images index. This method accepts an array of objects which define indexes to +803 * subimages inside this sprite image. +804 * If the SpriteImage is instantiated by calling the method initialize( image, rows, cols ), the value of +805 * aAnimationImageIndex should be an array of numbers, which define the indexes into an array of subimages +806 * with size rows*columns. +807 * If the method InitializeFromMap( image, map ) is called, the value for aAnimationImageIndex is expected +808 * to be an array of strings which are the names of the subobjects contained in the map object. +809 * +810 * @param aAnimationImageIndex an array indicating the Sprite's frames. +811 */ +812 setAnimationImageIndex:function (aAnimationImageIndex) { +813 this.animationImageIndex = aAnimationImageIndex; +814 this.spriteIndex = aAnimationImageIndex[0]; +815 this.prevAnimationTime = -1; +816 +817 return this; +818 }, +819 setSpriteIndex:function (index) { +820 this.spriteIndex = index; +821 return this; +822 }, +823 +824 /** +825 * Draws the sprite image calculated and stored in spriteIndex. +826 * +827 * @param time {number} Scene time when the bounding box is to be drawn. +828 */ +829 setSpriteIndexAtTime:function (time) { +830 +831 if (this.animationImageIndex.length > 1) { +832 if (this.prevAnimationTime === -1) { +833 this.prevAnimationTime = time; +834 +835 //thanks Phloog and ghthor, well spotted. +836 this.spriteIndex = this.animationImageIndex[0]; +837 this.prevIndex= 0; +838 this.ownerActor.invalidate(); +839 } +840 else { +841 var ttime = time; +842 ttime -= this.prevAnimationTime; +843 ttime /= this.changeFPS; +844 ttime %= this.animationImageIndex.length; +845 var idx = Math.floor(ttime); +846 // if ( this.spriteIndex!==idx ) { +847 +848 if ( idx<this.prevIndex ) { // we are getting back in time, or ended playing the animation +849 if ( this.callback ) { +850 this.callback( this, time ); +851 } +852 } +853 +854 this.prevIndex= idx; +855 this.spriteIndex = this.animationImageIndex[idx]; +856 this.ownerActor.invalidate(); +857 // } +858 } +859 } +860 }, +861 +862 getMapInfo:function (index) { +863 return this.mapInfo[ index ]; +864 }, +865 +866 initializeFromGlyphDesigner : function( text ) { +867 for (var i = 0; i < text.length; i++) { +868 if (0 === text[i].indexOf("char ")) { +869 var str = text[i].substring(5); +870 var pairs = str.split(' '); +871 var obj = { +872 x: 0, +873 y: 0, +874 width: 0, +875 height: 0, +876 xadvance: 0, +877 xoffset: 0, +878 yoffset: 0 +879 }; +880 +881 for (var j = 0; j < pairs.length; j++) { +882 var pair = pairs[j]; +883 var pairData = pair.split("="); +884 var key = pairData[0]; +885 var value = pairData[1]; +886 if (value.charAt(0) === '"' && value.charAt(value.length - 1) === '"') { +887 value.substring(1, value.length - 1); +888 } +889 obj[ key ] = value; +890 } +891 +892 this.addElement(String.fromCharCode(obj.id), obj); +893 } +894 } +895 +896 return this; +897 }, +898 +899 /** +900 * This method takes the output generated from the tool at http://labs.hyperandroid.com/static/texture/spriter.html +901 * and creates a map into that image. +902 * @param image {Image|HTMLImageElement|Canvas} an image +903 * @param map {object} the map into the image to define subimages. +904 */ +905 initializeFromMap:function (image, map) { +906 this.initialize(image, 1, 1); +907 +908 var key; +909 var helper; +910 var count = 0; +911 +912 for (key in map) { +913 var value = map[key]; +914 +915 helper = new CAAT.Foundation.SpriteImageHelper( +916 parseFloat(value.x) + this.parentOffsetX, +917 parseFloat(value.y) + this.parentOffsetY, +918 parseFloat(value.width), +919 parseFloat(value.height), +920 image.width, +921 image.height +922 ); +923 +924 this.mapInfo[key] = helper; +925 +926 // set a default spriteIndex +927 if (!count) { +928 this.setAnimationImageIndex([key]); +929 } +930 +931 count++; +932 } +933 +934 return this; +935 }, +936 +937 initializeFromTexturePackerJSON : function( image, obj ) { 938 -939 helper = new CAAT.Foundation.SpriteImageHelper( -940 parseFloat(value.x) + this.parentOffsetX, -941 parseFloat(value.y) + this.parentOffsetX, -942 parseFloat(value.width), -943 parseFloat(value.height), -944 image.width, -945 image.height -946 ); -947 -948 helper.xoffset = typeof value.xoffset === 'undefined' ? 0 : value.xoffset; -949 helper.yoffset = typeof value.yoffset === 'undefined' ? 0 : value.yoffset; -950 helper.xadvance = typeof value.xadvance === 'undefined' ? value.width : value.xadvance; -951 -952 this.mapInfo[key] = helper; -953 -954 // set a default spriteIndex -955 if (!count) { -956 this.setAnimationImageIndex([key]); -957 } -958 -959 count++; -960 } -961 -962 return this; -963 -964 }, -965 -966 -967 initializeAsFontMap:function (image, chars) { -968 this.initialize(image, 1, 1); -969 -970 var helper; -971 var x = 0; -972 -973 for (var i = 0; i < chars.length; i++) { -974 var value = chars[i]; -975 -976 helper = new CAAT.Foundation.SpriteImageHelper( -977 parseFloat(x) + this.parentOffsetX, -978 0 + this.parentOffsetY, -979 parseFloat(value.width), -980 image.height, -981 image.width, -982 image.height -983 ); +939 for( var img in obj.frames ) { +940 var imgData= obj.frames[img]; +941 +942 var si_obj= { +943 x: imgData.frame.x, +944 y: imgData.frame.y, +945 width: imgData.spriteSourceSize.w, +946 height: imgData.spriteSourceSize.h, +947 id: '0' +948 }; +949 +950 var si= new CAAT.Foundation.SpriteImage().initialize( image, 1, 1 ); +951 si.addElement(0,si_obj); +952 CAAT.currentDirector.addImage( img.substring(0,img.indexOf('.')), si ); +953 } +954 }, +955 +956 /** +957 * Add one element to the spriteImage. +958 * @param key {string|number} index or sprite identifier. +959 * @param value object{ +960 * x: {number}, +961 * y: {number}, +962 * width: {number}, +963 * height: {number}, +964 * xoffset: {number=}, +965 * yoffset: {number=}, +966 * xadvance: {number=} +967 * } +968 * @return {*} +969 */ +970 addElement : function( key, value ) { +971 var helper = new CAAT.Foundation.SpriteImageHelper( +972 parseFloat(value.x) + this.parentOffsetX, +973 parseFloat(value.y) + this.parentOffsetY, +974 parseFloat(value.width), +975 parseFloat(value.height), +976 this.image.width, +977 this.image.height ); +978 +979 helper.xoffset = typeof value.xoffset === 'undefined' ? 0 : parseFloat(value.xoffset); +980 helper.yoffset = typeof value.yoffset === 'undefined' ? 0 : parseFloat(value.yoffset); +981 helper.xadvance = typeof value.xadvance === 'undefined' ? value.width : parseFloat(value.xadvance); +982 +983 this.mapInfo[key] = helper; 984 -985 helper.xoffset = 0; -986 helper.yoffset = 0; -987 helper.xadvance = value.width; -988 -989 -990 x += value.width; -991 -992 this.mapInfo[chars[i].c] = helper; -993 -994 // set a default spriteIndex -995 if (!i) { -996 this.setAnimationImageIndex([chars[i].c]); -997 } -998 } -999 -1000 return this; -1001 }, -1002 -1003 /** -1004 * This method creates a font sprite image based on a proportional font -1005 * It assumes the font is evenly spaced in the image -1006 * Example: -1007 * var font = new CAAT.SpriteImage().initializeAsMonoTypeFontMap( -1008 * director.getImage('numbers'), -1009 * "0123456789" -1010 * ); -1011 */ +985 return this; +986 }, +987 +988 /** +989 * +990 * @param image {Image|HTMLImageElement|Canvas} +991 * @param map object with pairs "<a char>" : { +992 * id : {number}, +993 * height : {number}, +994 * xoffset : {number}, +995 * letter : {string}, +996 * yoffset : {number}, +997 * width : {number}, +998 * xadvance: {number}, +999 * y : {number}, +1000 * x : {number} +1001 * } +1002 */ +1003 initializeAsGlyphDesigner:function (image, map) { +1004 this.initialize(image, 1, 1); +1005 +1006 var key; +1007 var helper; +1008 var count = 0; +1009 +1010 for (key in map) { +1011 var value = map[key]; 1012 -1013 initializeAsMonoTypeFontMap:function (image, chars) { -1014 var map = []; -1015 var charArr = chars.split(""); -1016 -1017 var w = image.width / charArr.length >> 0; -1018 -1019 for (var i = 0; i < charArr.length; i++) { -1020 map.push({c:charArr[i], width:w }); -1021 } -1022 -1023 return this.initializeAsFontMap(image, map); -1024 }, +1013 helper = new CAAT.Foundation.SpriteImageHelper( +1014 parseFloat(value.x) + this.parentOffsetX, +1015 parseFloat(value.y) + this.parentOffsetX, +1016 parseFloat(value.width), +1017 parseFloat(value.height), +1018 image.width, +1019 image.height +1020 ); +1021 +1022 helper.xoffset = typeof value.xoffset === 'undefined' ? 0 : value.xoffset; +1023 helper.yoffset = typeof value.yoffset === 'undefined' ? 0 : value.yoffset; +1024 helper.xadvance = typeof value.xadvance === 'undefined' ? value.width : value.xadvance; 1025 -1026 stringWidth:function (str) { -1027 var i, l, w = 0, charInfo; -1028 -1029 for (i = 0, l = str.length; i < l; i++) { -1030 charInfo = this.mapInfo[ str.charAt(i) ]; -1031 if (charInfo) { -1032 w += charInfo.xadvance * this.fontScale; -1033 } +1026 this.mapInfo[key] = helper; +1027 +1028 // set a default spriteIndex +1029 if (!count) { +1030 this.setAnimationImageIndex([key]); +1031 } +1032 +1033 count++; 1034 } 1035 -1036 return w; -1037 }, -1038 -1039 stringHeight:function () { -1040 if (this.fontHeight) { -1041 return this.fontHeight * this.fontScale; -1042 } +1036 return this; +1037 +1038 }, +1039 +1040 +1041 initializeAsFontMap:function (image, chars) { +1042 this.initialize(image, 1, 1); 1043 -1044 var y = 0; -1045 for (var i in this.mapInfo) { -1046 var mi = this.mapInfo[i]; -1047 -1048 var h = mi.height + mi.yoffset; -1049 if (h > y) { -1050 y = h; -1051 } -1052 } -1053 -1054 this.fontHeight = y; -1055 return this.fontHeight * this.fontScale; -1056 }, -1057 -1058 drawText:function (str, ctx, x, y) { -1059 var i, l, charInfo, w; -1060 -1061 for (i = 0; i < str.length; i++) { -1062 charInfo = this.mapInfo[ str.charAt(i) ]; -1063 if (charInfo) { -1064 w = charInfo.width; -1065 if ( w>0 && charInfo.height>0 ) { -1066 ctx.drawImage( -1067 this.image, -1068 charInfo.x, charInfo.y, -1069 w, charInfo.height, -1070 -1071 x + charInfo.xoffset* this.fontScale, y + charInfo.yoffset* this.fontScale, -1072 w* this.fontScale, charInfo.height* this.fontScale); -1073 } -1074 x += charInfo.xadvance* this.fontScale; -1075 } -1076 } -1077 }, -1078 -1079 getFontData : function() { -1080 var as= (this.stringHeight() *.8)>>0; -1081 return { -1082 height : this.stringHeight(), -1083 ascent : as, -1084 descent: this.stringHeight() - as -1085 }; +1044 var helper; +1045 var x = 0; +1046 +1047 for (var i = 0; i < chars.length; i++) { +1048 var value = chars[i]; +1049 +1050 helper = new CAAT.Foundation.SpriteImageHelper( +1051 parseFloat(x) + this.parentOffsetX, +1052 0 + this.parentOffsetY, +1053 parseFloat(value.width), +1054 image.height, +1055 image.width, +1056 image.height +1057 ); +1058 +1059 helper.xoffset = 0; +1060 helper.yoffset = 0; +1061 helper.xadvance = value.width; +1062 +1063 +1064 x += value.width; +1065 +1066 this.mapInfo[chars[i].c] = helper; +1067 +1068 // set a default spriteIndex +1069 if (!i) { +1070 this.setAnimationImageIndex([chars[i].c]); +1071 } +1072 } +1073 +1074 return this; +1075 }, +1076 +1077 /** +1078 * This method creates a font sprite image based on a proportional font +1079 * It assumes the font is evenly spaced in the image +1080 * Example: +1081 * var font = new CAAT.SpriteImage().initializeAsMonoTypeFontMap( +1082 * director.getImage('numbers'), +1083 * "0123456789" +1084 * ); +1085 */ 1086 -1087 } -1088 -1089 } -1090 } -1091 }); -1092 \ No newline at end of file +1087 initializeAsMonoTypeFontMap:function (image, chars) { +1088 var map = []; +1089 var charArr = chars.split(""); +1090 +1091 var w = image.width / charArr.length >> 0; +1092 +1093 for (var i = 0; i < charArr.length; i++) { +1094 map.push({c:charArr[i], width:w }); +1095 } +1096 +1097 return this.initializeAsFontMap(image, map); +1098 }, +1099 +1100 stringWidth:function (str) { +1101 var i, l, w = 0, charInfo; +1102 +1103 for (i = 0, l = str.length; i < l; i++) { +1104 charInfo = this.mapInfo[ str.charAt(i) ]; +1105 if (charInfo) { +1106 w += charInfo.xadvance * this.fontScale; +1107 } +1108 } +1109 +1110 return w; +1111 }, +1112 +1113 stringHeight:function () { +1114 if (this.fontHeight) { +1115 return this.fontHeight * this.fontScale; +1116 } +1117 +1118 var y = 0; +1119 for (var i in this.mapInfo) { +1120 var mi = this.mapInfo[i]; +1121 +1122 var h = mi.height + mi.yoffset; +1123 if (h > y) { +1124 y = h; +1125 } +1126 } +1127 +1128 this.fontHeight = y; +1129 return this.fontHeight * this.fontScale; +1130 }, +1131 +1132 drawText:function (str, ctx, x, y) { +1133 var i, l, charInfo, w; +1134 +1135 for (i = 0; i < str.length; i++) { +1136 charInfo = this.mapInfo[ str.charAt(i) ]; +1137 if (charInfo) { +1138 w = charInfo.width; +1139 if ( w>0 && charInfo.height>0 ) { +1140 ctx.drawImage( +1141 this.image, +1142 charInfo.x, charInfo.y, +1143 w, charInfo.height, +1144 +1145 x + charInfo.xoffset* this.fontScale, y + charInfo.yoffset* this.fontScale, +1146 w* this.fontScale, charInfo.height* this.fontScale); +1147 } +1148 x += charInfo.xadvance* this.fontScale; +1149 } +1150 } +1151 }, +1152 +1153 getFontData : function() { +1154 var as= (this.stringHeight() *.8)>>0; +1155 return { +1156 height : this.stringHeight(), +1157 ascent : as, +1158 descent: this.stringHeight() - as +1159 }; +1160 +1161 } +1162 +1163 } +1164 } +1165 }); +1166 \ No newline at end of file diff --git a/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_Foundation_UI_Label.js.html b/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_Foundation_UI_Label.js.html index 423380cf..3d2e6482 100644 --- a/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_Foundation_UI_Label.js.html +++ b/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_Foundation_UI_Label.js.html @@ -18,1173 +18,1208 @@ 11 depends : [ 12 "CAAT.Foundation.Actor", 13 "CAAT.Foundation.SpriteImage", - 14 "CAAT.Module.Font.Font" - 15 ], - 16 aliases : ["CAAT.UI.Label"], - 17 extendsClass : "CAAT.Foundation.Actor", - 18 extendsWith : function() { - 19 - 20 var DEBUG=0; - 21 var JUSTIFY_RATIO= .6; - 22 - 23 /** - 24 * - 25 * Current applied rendering context information. - 26 */ - 27 var renderContextStyle= function(ctx) { - 28 this.ctx= ctx; - 29 return this; - 30 }; - 31 - 32 renderContextStyle.prototype= { - 33 - 34 ctx : null, - 35 - 36 defaultFS : null, - 37 font : null, - 38 fontSize : null, - 39 fill : null, - 40 stroke : null, - 41 filled : null, - 42 stroked : null, - 43 strokeSize : null, - 44 italic : null, - 45 bold : null, - 46 alignment : null, - 47 tabSize : null, - 48 shadow : null, - 49 shadowBlur : null, - 50 shadowColor : null, - 51 - 52 sfont : null, - 53 - 54 chain : null, - 55 - 56 setDefault : function( defaultStyles ) { - 57 this.defaultFS = 24; - 58 this.font = "Arial"; - 59 this.fontSize = this.defaultFS; - 60 this.fill = '#000'; - 61 this.stroke = '#f00'; - 62 this.filled = true; - 63 this.stroked = false; - 64 this.strokeSize = 1; - 65 this.italic = false; - 66 this.bold = false; - 67 this.alignment = "left"; - 68 this.tabSize = 75; - 69 this.shadow = false; - 70 this.shadowBlur = 0; - 71 this.shadowColor= "#000"; - 72 - 73 for( var style in defaultStyles ) { - 74 if ( defaultStyles.hasOwnProperty(style) ) { - 75 this[style]= defaultStyles[style]; - 76 } - 77 } - 78 - 79 this.__setFont(); - 80 - 81 return this; - 82 }, - 83 - 84 setStyle : function( styles ) { - 85 if ( typeof styles!=="undefined" ) { - 86 for( var style in styles ) { - 87 this[style]= styles[style]; - 88 } - 89 } - 90 return this; - 91 }, - 92 - 93 applyStyle : function() { - 94 this.__setFont(); - 95 - 96 return this; - 97 }, - 98 - 99 clone : function( ) { -100 var c= new renderContextStyle( this.ctx ); -101 var pr; -102 for( pr in this ) { -103 if ( this.hasOwnProperty(pr) ) { -104 c[pr]= this[pr]; -105 } -106 } -107 /* -108 c.defaultFS = this.defaultFS; -109 c.font = this.font; -110 c.fontSize = this.fontSize; -111 c.fill = this.fill; -112 c.stroke = this.stroke; -113 c.filled = this.filled; -114 c.stroked = this.stroked; -115 c.strokeSize = this.strokeSize; -116 c.italic = this.italic; -117 c.bold = this.bold; -118 c.alignment = this.alignment; -119 c.tabSize = this.tabSize; -120 */ -121 -122 var me= this; -123 while( me.chain ) { -124 me= me.chain; -125 for( pr in me ) { -126 if ( c[pr]===null && me.hasOwnProperty(pr) ) { -127 c[pr]= me[pr]; -128 } -129 } -130 } -131 -132 c.__setFont(); -133 -134 return c; -135 }, -136 -137 __getProperty : function( prop ) { -138 var me= this; -139 var res; -140 do { -141 res= me[prop]; -142 if ( res!==null ) { -143 return res; -144 } -145 me= me.chain; -146 } while( me ); -147 -148 return null; -149 }, -150 -151 image : function( ctx ) { -152 this.__setShadow( ctx ); -153 }, -154 -155 text : function( ctx, text, x, y ) { -156 -157 this.__setShadow( ctx ); -158 -159 ctx.font= this.__getProperty("sfont"); -160 -161 if ( this.filled ) { -162 this.__fillText( ctx,text,x,y ); -163 } -164 if ( this.stroked ) { -165 this.__strokeText( ctx,text,x,y ); -166 } -167 }, -168 -169 __setShadow : function( ctx ) { -170 if ( this.__getProperty("shadow" ) ) { -171 ctx.shadowBlur= this.__getProperty("shadowBlur"); -172 ctx.shadowColor= this.__getProperty("shadowColor"); -173 } -174 }, -175 -176 __fillText : function( ctx, text, x, y ) { -177 ctx.fillStyle= this.__getProperty("fill"); -178 ctx.fillText( text, x, y ); -179 }, -180 -181 __strokeText : function( ctx, text, x, y ) { -182 ctx.strokeStyle= this.__getProperty("stroke"); -183 ctx.lineWidth= this.__getProperty("strokeSize"); -184 ctx.beginPath(); -185 ctx.strokeText( text, x, y ); -186 }, -187 -188 __setFont : function() { -189 var italic= this.__getProperty("italic"); -190 var bold= this.__getProperty("bold"); -191 var fontSize= this.__getProperty("fontSize"); -192 var font= this.__getProperty("font"); -193 -194 this.sfont= (italic ? "italic " : "") + -195 (bold ? "bold " : "") + -196 fontSize + "px " + -197 font; -198 -199 this.ctx.font= this.__getProperty("sfont"); -200 }, -201 -202 setBold : function( bool ) { -203 if ( bool!=this.bold ) { -204 this.bold= bool; -205 this.__setFont(); -206 } -207 }, -208 -209 setItalic : function( bool ) { -210 if ( bool!=this.italic ) { -211 this.italic= bool; -212 this.__setFont(); -213 } -214 }, -215 -216 setStroked : function( bool ) { -217 this.stroked= bool; -218 }, -219 -220 setFilled : function( bool ) { -221 this.filled= bool; -222 }, -223 -224 getTabPos : function( x ) { -225 var ts= this.__getProperty("tabSize"); -226 return (((x/ts)>>0)+1)*ts; -227 }, -228 -229 setFillStyle : function( style ) { -230 this.fill= style; -231 }, -232 -233 setStrokeStyle : function( style ) { -234 this.stroke= style; -235 }, -236 -237 setStrokeSize : function( size ) { -238 this.strokeSize= size; -239 }, -240 -241 setAlignment : function( alignment ) { -242 this.alignment= alignment; -243 }, -244 -245 setFontSize : function( size ) { -246 if ( size!==this.fontSize ) { -247 this.fontSize= size; -248 this.__setFont(); -249 } -250 } -251 }; -252 -253 /** -254 * This class keeps track of styles, images, and the current applied style. -255 */ -256 var renderContext= function() { -257 this.text= ""; -258 return this; -259 }; -260 -261 renderContext.prototype= { -262 -263 x : 0, -264 y : 0, -265 width : 0, -266 text : null, -267 -268 crcs : null, // current rendering context style -269 rcs : null, // rendering content styles stack -270 -271 styles : null, -272 images : null, -273 -274 lines : null, -275 -276 documentHeight : 0, -277 -278 anchorStack : null, -279 -280 __nextLine : function() { -281 this.x= 0; -282 this.currentLine= new DocumentLine( -283 CAAT.Module.Font.Font.getFontMetrics( this.crcs.sfont) ); -284 this.lines.push( this.currentLine ); -285 }, -286 -287 /** -288 * -289 * @param image {CAAT.SpriteImage} -290 * @param r {number=} -291 * @param c {number=} -292 * @private -293 */ -294 __image : function( image, r, c ) { -295 + 14 "CAAT.Module.Font.Font", + 15 "CAAT.Foundation.UI.Layout.LayoutManager" + 16 ], + 17 aliases : ["CAAT.UI.Label"], + 18 extendsClass : "CAAT.Foundation.Actor", + 19 extendsWith : function() { + 20 + 21 var DEBUG=0; + 22 var JUSTIFY_RATIO= .6; + 23 + 24 /** + 25 * + 26 * Current applied rendering context information. + 27 */ + 28 var renderContextStyle= function(ctx) { + 29 this.ctx= ctx; + 30 return this; + 31 }; + 32 + 33 renderContextStyle.prototype= { + 34 + 35 ctx : null, + 36 + 37 defaultFS : null, + 38 font : null, + 39 fontSize : null, + 40 fill : null, + 41 stroke : null, + 42 filled : null, + 43 stroked : null, + 44 strokeSize : null, + 45 italic : null, + 46 bold : null, + 47 alignment : null, + 48 tabSize : null, + 49 shadow : null, + 50 shadowBlur : null, + 51 shadowColor : null, + 52 + 53 sfont : null, + 54 + 55 chain : null, + 56 + 57 setDefault : function( defaultStyles ) { + 58 this.defaultFS = 24; + 59 this.font = "Arial"; + 60 this.fontSize = this.defaultFS; + 61 this.fill = '#000'; + 62 this.stroke = '#f00'; + 63 this.filled = true; + 64 this.stroked = false; + 65 this.strokeSize = 1; + 66 this.italic = false; + 67 this.bold = false; + 68 this.alignment = "left"; + 69 this.tabSize = 75; + 70 this.shadow = false; + 71 this.shadowBlur = 0; + 72 this.shadowColor= "#000"; + 73 + 74 for( var style in defaultStyles ) { + 75 if ( defaultStyles.hasOwnProperty(style) ) { + 76 this[style]= defaultStyles[style]; + 77 } + 78 } + 79 + 80 this.__setFont(); + 81 + 82 return this; + 83 }, + 84 + 85 setStyle : function( styles ) { + 86 if ( typeof styles!=="undefined" ) { + 87 for( var style in styles ) { + 88 this[style]= styles[style]; + 89 } + 90 } + 91 return this; + 92 }, + 93 + 94 applyStyle : function() { + 95 this.__setFont(); + 96 + 97 return this; + 98 }, + 99 +100 clone : function( ) { +101 var c= new renderContextStyle( this.ctx ); +102 var pr; +103 for( pr in this ) { +104 if ( this.hasOwnProperty(pr) ) { +105 c[pr]= this[pr]; +106 } +107 } +108 /* +109 c.defaultFS = this.defaultFS; +110 c.font = this.font; +111 c.fontSize = this.fontSize; +112 c.fill = this.fill; +113 c.stroke = this.stroke; +114 c.filled = this.filled; +115 c.stroked = this.stroked; +116 c.strokeSize = this.strokeSize; +117 c.italic = this.italic; +118 c.bold = this.bold; +119 c.alignment = this.alignment; +120 c.tabSize = this.tabSize; +121 */ +122 +123 var me= this; +124 while( me.chain ) { +125 me= me.chain; +126 for( pr in me ) { +127 if ( c[pr]===null && me.hasOwnProperty(pr) ) { +128 c[pr]= me[pr]; +129 } +130 } +131 } +132 +133 c.__setFont(); +134 +135 return c; +136 }, +137 +138 __getProperty : function( prop ) { +139 var me= this; +140 var res; +141 do { +142 res= me[prop]; +143 if ( res!==null ) { +144 return res; +145 } +146 me= me.chain; +147 } while( me ); +148 +149 return null; +150 }, +151 +152 image : function( ctx ) { +153 this.__setShadow( ctx ); +154 }, +155 +156 text : function( ctx, text, x, y ) { +157 +158 this.__setShadow( ctx ); +159 +160 ctx.font= this.__getProperty("sfont"); +161 +162 if ( this.filled ) { +163 this.__fillText( ctx,text,x,y ); +164 } +165 if ( this.stroked ) { +166 this.__strokeText( ctx,text,x,y ); +167 } +168 }, +169 +170 __setShadow : function( ctx ) { +171 if ( this.__getProperty("shadow" ) ) { +172 ctx.shadowBlur= this.__getProperty("shadowBlur"); +173 ctx.shadowColor= this.__getProperty("shadowColor"); +174 } +175 }, +176 +177 __fillText : function( ctx, text, x, y ) { +178 ctx.fillStyle= this.__getProperty("fill"); +179 ctx.fillText( text, x, y ); +180 }, +181 +182 __strokeText : function( ctx, text, x, y ) { +183 ctx.strokeStyle= this.__getProperty("stroke"); +184 ctx.lineWidth= this.__getProperty("strokeSize"); +185 ctx.beginPath(); +186 ctx.strokeText( text, x, y ); +187 }, +188 +189 __setFont : function() { +190 var italic= this.__getProperty("italic"); +191 var bold= this.__getProperty("bold"); +192 var fontSize= this.__getProperty("fontSize"); +193 var font= this.__getProperty("font"); +194 +195 this.sfont= (italic ? "italic " : "") + +196 (bold ? "bold " : "") + +197 fontSize + "px " + +198 font; +199 +200 this.ctx.font= this.__getProperty("sfont"); +201 }, +202 +203 setBold : function( bool ) { +204 if ( bool!=this.bold ) { +205 this.bold= bool; +206 this.__setFont(); +207 } +208 }, +209 +210 setItalic : function( bool ) { +211 if ( bool!=this.italic ) { +212 this.italic= bool; +213 this.__setFont(); +214 } +215 }, +216 +217 setStroked : function( bool ) { +218 this.stroked= bool; +219 }, +220 +221 setFilled : function( bool ) { +222 this.filled= bool; +223 }, +224 +225 getTabPos : function( x ) { +226 var ts= this.__getProperty("tabSize"); +227 return (((x/ts)>>0)+1)*ts; +228 }, +229 +230 setFillStyle : function( style ) { +231 this.fill= style; +232 }, +233 +234 setStrokeStyle : function( style ) { +235 this.stroke= style; +236 }, +237 +238 setStrokeSize : function( size ) { +239 this.strokeSize= size; +240 }, +241 +242 setAlignment : function( alignment ) { +243 this.alignment= alignment; +244 }, +245 +246 setFontSize : function( size ) { +247 if ( size!==this.fontSize ) { +248 this.fontSize= size; +249 this.__setFont(); +250 } +251 } +252 }; +253 +254 /** +255 * This class keeps track of styles, images, and the current applied style. +256 */ +257 var renderContext= function() { +258 this.text= ""; +259 return this; +260 }; +261 +262 renderContext.prototype= { +263 +264 x : 0, +265 y : 0, +266 width : 0, +267 text : null, +268 +269 crcs : null, // current rendering context style +270 rcs : null, // rendering content styles stack +271 +272 styles : null, +273 images : null, +274 +275 lines : null, +276 +277 documentHeight : 0, +278 +279 anchorStack : null, +280 +281 __nextLine : function() { +282 this.x= 0; +283 this.currentLine= new DocumentLine( +284 CAAT.Module.Font.Font.getFontMetrics( this.crcs.sfont) ); +285 this.lines.push( this.currentLine ); +286 }, +287 +288 /** +289 * +290 * @param image {CAAT.SpriteImage} +291 * @param r {number=} +292 * @param c {number=} +293 * @private +294 */ +295 __image : function( image, r, c ) { 296 -297 var image_width; -298 -299 if ( r && c ) { -300 image_width= image.getWidth(); -301 } else { -302 image_width= image.getWrappedImageWidth(); -303 } -304 -305 // la imagen cabe en este sitio. -306 if ( this.width ) { -307 if ( image_width + this.x > this.width && this.x>0 ) { -308 this.__nextLine(); -309 } -310 } -311 -312 this.currentLine.addElementImage( new DocumentElementImage( -313 this.x, -314 image, -315 r, -316 c, -317 this.crcs.clone(), -318 this.__getCurrentAnchor() ) ); -319 -320 this.x+= image_width; -321 }, -322 -323 __text : function() { -324 -325 if ( this.text.length===0 ) { -326 return; -327 } -328 -329 var text_width= this.ctx.measureText(this.text).width; -330 -331 // la palabra cabe en este sitio. -332 if ( this.width ) { -333 if ( text_width + this.x > this.width && this.x>0 ) { -334 this.__nextLine(); -335 } -336 } -337 -338 //this.crcs.text( this.text, this.x, this.y ); -339 this.currentLine.addElement( new DocumentElementText( -340 this.text, -341 this.x, -342 text_width, -343 0, //this.crcs.__getProperty("fontSize"), calculated later -344 this.crcs.clone(), -345 this.__getCurrentAnchor() ) ) ; -346 -347 this.x+= text_width; -348 -349 this.text=""; -350 }, -351 -352 fchar : function( _char ) { -353 -354 if ( _char===' ' ) { -355 -356 this.__text(); -357 -358 this.x+= this.ctx.measureText(_char).width; -359 if ( this.width ) { -360 if ( this.x > this.width ) { -361 this.__nextLine(); -362 } -363 } -364 } else { -365 this.text+= _char; -366 } -367 }, -368 -369 end : function() { -370 if ( this.text.length>0 ) { -371 this.__text(); -372 } -373 -374 var y=0; -375 var lastLineEstimatedDescent= 0; -376 for( var i=0; i<this.lines.length; i++ ) { -377 var inc= this.lines[i].getHeight(); -378 -379 if ( inc===0 ) { -380 // lineas vacias al menos tienen tamaño del estilo por defecto -381 inc= this.styles["default"].fontSize; -382 } -383 y+= inc; -384 -385 /** -386 * add the estimated descent of the last text line to document height's. -387 * the descent is estimated to be a 20% of font's height. -388 */ -389 if ( i===this.lines.length-1 ) { -390 lastLineEstimatedDescent= (inc*.25)>>0; -391 } -392 -393 this.lines[i].setY(y); -394 } -395 -396 this.documentHeight= y + lastLineEstimatedDescent; -397 }, -398 -399 getDocumentHeight : function() { -400 return this.documentHeight; -401 }, -402 -403 __getCurrentAnchor : function() { -404 if ( this.anchorStack.length ) { -405 return this.anchorStack[ this.anchorStack.length-1 ]; -406 } -407 -408 return null; -409 }, -410 -411 __resetAppliedStyles : function() { -412 this.rcs= []; -413 this.__pushDefaultStyles(); -414 }, -415 -416 __pushDefaultStyles : function() { -417 this.crcs= new renderContextStyle(this.ctx).setDefault( this.styles["default"] ); -418 this.rcs.push( this.crcs ); -419 }, -420 -421 __pushStyle : function( style ) { -422 var pcrcs= this.crcs; -423 this.crcs= new renderContextStyle(this.ctx); -424 this.crcs.chain= pcrcs; -425 this.crcs.setStyle( style ); -426 this.crcs.applyStyle( ); -427 -428 this.rcs.push( this.crcs ); -429 }, -430 -431 __popStyle : function() { -432 // make sure you don't remove default style. -433 if ( this.rcs.length>1 ) { -434 this.rcs.pop(); -435 this.crcs= this.rcs[ this.rcs.length-1 ]; -436 this.crcs.applyStyle(); -437 } -438 }, -439 -440 __popAnchor : function() { -441 if ( this.anchorStack.length> 0 ) { -442 this.anchorStack.pop(); -443 } -444 }, -445 -446 __pushAnchor : function( anchor ) { -447 this.anchorStack.push( anchor ); -448 }, -449 -450 start : function( ctx, styles, images, width ) { -451 this.x=0; -452 this.y=0; -453 this.width= typeof width!=="undefined" ? width : 0; -454 this.ctx= ctx; -455 this.lines= []; -456 this.styles= styles; -457 this.images= images; -458 this.anchorStack= []; -459 -460 this.__resetAppliedStyles(); -461 this.__nextLine(); -462 -463 }, -464 -465 setTag : function( tag ) { -466 -467 var pairs, style; -468 -469 this.__text(); -470 -471 tag= tag.toLowerCase(); -472 if ( tag==='b' ) { -473 this.crcs.setBold( true ); -474 } else if ( tag==='/b' ) { -475 this.crcs.setBold( false ); -476 } else if ( tag==='i' ) { -477 this.crcs.setItalic( true ); -478 } else if ( tag==='/i' ) { -479 this.crcs.setItalic( false ); -480 } else if ( tag==='stroked' ) { -481 this.crcs.setStroked( true ); -482 } else if ( tag==='/stroked' ) { -483 this.crcs.setStroked( false ); -484 } else if ( tag==='filled' ) { -485 this.crcs.setFilled( true ); -486 } else if ( tag==='/filled' ) { -487 this.crcs.setFilled( false ); -488 } else if ( tag==='tab' ) { -489 this.x= this.crcs.getTabPos( this.x ); -490 } else if ( tag==='br' ) { -491 this.__nextLine(); -492 } else if ( tag==='/a' ) { -493 this.__popAnchor(); -494 } else if ( tag==='/style' ) { -495 if ( this.rcs.length>1 ) { -496 this.__popStyle(); -497 } else { -498 /** -499 * underflow pop de estilos. eres un cachondo. -500 */ -501 } -502 } else { -503 if ( tag.indexOf("fillcolor")===0 ) { -504 pairs= tag.split("="); -505 this.crcs.setFillStyle( pairs[1] ); -506 } else if ( tag.indexOf("strokecolor")===0 ) { -507 pairs= tag.split("="); -508 this.crcs.setStrokeStyle( pairs[1] ); -509 } else if ( tag.indexOf("strokesize")===0 ) { -510 pairs= tag.split("="); -511 this.crcs.setStrokeSize( pairs[1]|0 ); -512 } else if ( tag.indexOf("fontsize")===0 ) { -513 pairs= tag.split("="); -514 this.crcs.setFontSize( pairs[1]|0 ); -515 } else if ( tag.indexOf("style")===0 ) { -516 pairs= tag.split("="); -517 style= this.styles[ pairs[1] ]; -518 if ( style ) { -519 this.__pushStyle( style ); -520 } -521 } else if ( tag.indexOf("image")===0) { -522 pairs= tag.split("=")[1].split(","); -523 var image= pairs[0]; -524 if ( this.images[image] ) { -525 var r= 0, c=0; -526 if ( pairs.length>=3 ) { -527 r= pairs[1]|0; -528 c= pairs[2]|0; -529 } -530 this.__image( this.images[image], r, c ); -531 } -532 } else if ( tag.indexOf("a=")===0 ) { -533 pairs= tag.split("="); -534 this.__pushAnchor( pairs[1] ); -535 } -536 } -537 } -538 }; -539 -540 /** -541 * Abstract document element. -542 * The document contains a collection of DocumentElementText and DocumentElementImage. -543 * @param anchor -544 * @param style -545 */ -546 var DocumentElement= function( anchor, style ) { -547 this.link= anchor; -548 this.style= style; -549 return this; -550 }; -551 -552 DocumentElement.prototype= { -553 x : null, -554 y : null, -555 width : null, -556 height : null, -557 -558 style : null, -559 -560 link : null, -561 -562 isLink : function() { -563 return this.link; -564 }, -565 -566 setLink : function( link ) { -567 this.link= link; -568 return this; -569 }, -570 -571 getLink : function() { -572 return this.link; -573 }, -574 -575 contains : function(x,y) { -576 return false; -577 } -578 -579 }; -580 -581 /** -582 * This class represents an image in the document. -583 * @param x -584 * @param image -585 * @param r -586 * @param c -587 * @param style -588 * @param anchor -589 */ -590 var DocumentElementImage= function( x, image, r, c, style, anchor ) { -591 -592 DocumentElementImage.superclass.constructor.call(this, anchor, style); -593 -594 this.x= x; -595 this.image= image; -596 this.row= r; -597 this.column= c; -598 this.width= image.getWidth(); -599 this.height= image.getHeight(); -600 -601 if ( this.image instanceof CAAT.SpriteImage || this.image instanceof CAAT.Foundation.SpriteImage ) { -602 this.spriteIndex= r*image.columns+c; -603 this.paint= this.paintSI; -604 } +297 +298 var image_width; +299 +300 if ( typeof r!=="undefined" && typeof c!=="undefined" ) { +301 image_width= image.getWidth(); +302 } else { +303 image_width= ( image instanceof CAAT.Foundation.SpriteImage ) ? image.getWidth() : image.getWrappedImageWidth(); +304 } +305 +306 // la imagen cabe en este sitio. +307 if ( this.width ) { +308 if ( image_width + this.x > this.width && this.x>0 ) { +309 this.__nextLine(); +310 } +311 } +312 +313 this.currentLine.addElementImage( new DocumentElementImage( +314 this.x, +315 image, +316 r, +317 c, +318 this.crcs.clone(), +319 this.__getCurrentAnchor() ) ); +320 +321 this.x+= image_width; +322 }, +323 +324 __text : function() { +325 +326 if ( this.text.length===0 ) { +327 return; +328 } +329 +330 var text_width= this.ctx.measureText(this.text).width; +331 +332 // la palabra cabe en este sitio. +333 if ( this.width ) { +334 if ( text_width + this.x > this.width && this.x>0 ) { +335 this.__nextLine(); +336 } +337 } +338 +339 //this.crcs.text( this.text, this.x, this.y ); +340 this.currentLine.addElement( new DocumentElementText( +341 this.text, +342 this.x, +343 text_width, +344 0, //this.crcs.__getProperty("fontSize"), calculated later +345 this.crcs.clone(), +346 this.__getCurrentAnchor() ) ) ; +347 +348 this.x+= text_width; +349 +350 this.text=""; +351 }, +352 +353 fchar : function( _char ) { +354 +355 if ( _char===' ' ) { +356 +357 this.__text(); +358 +359 this.x+= this.ctx.measureText(_char).width; +360 if ( this.width ) { +361 if ( this.x > this.width ) { +362 this.__nextLine(); +363 } +364 } +365 } else { +366 this.text+= _char; +367 } +368 }, +369 +370 end : function() { +371 if ( this.text.length>0 ) { +372 this.__text(); +373 } +374 +375 var y=0; +376 var lastLineEstimatedDescent= 0; +377 for( var i=0; i<this.lines.length; i++ ) { +378 var inc= this.lines[i].getHeight(); +379 +380 if ( inc===0 ) { +381 // lineas vacias al menos tienen tamaño del estilo por defecto +382 inc= this.styles["default"].fontSize; +383 } +384 y+= inc; +385 +386 /** +387 * add the estimated descent of the last text line to document height's. +388 * the descent is estimated to be a 20% of font's height. +389 */ +390 if ( i===this.lines.length-1 ) { +391 lastLineEstimatedDescent= (inc*.25)>>0; +392 } +393 +394 this.lines[i].setY(y); +395 } +396 +397 this.documentHeight= y + lastLineEstimatedDescent; +398 }, +399 +400 getDocumentHeight : function() { +401 return this.documentHeight; +402 }, +403 +404 __getCurrentAnchor : function() { +405 if ( this.anchorStack.length ) { +406 return this.anchorStack[ this.anchorStack.length-1 ]; +407 } +408 +409 return null; +410 }, +411 +412 __resetAppliedStyles : function() { +413 this.rcs= []; +414 this.__pushDefaultStyles(); +415 }, +416 +417 __pushDefaultStyles : function() { +418 this.crcs= new renderContextStyle(this.ctx).setDefault( this.styles["default"] ); +419 this.rcs.push( this.crcs ); +420 }, +421 +422 __pushStyle : function( style ) { +423 var pcrcs= this.crcs; +424 this.crcs= new renderContextStyle(this.ctx); +425 this.crcs.chain= pcrcs; +426 this.crcs.setStyle( style ); +427 this.crcs.applyStyle( ); +428 +429 this.rcs.push( this.crcs ); +430 }, +431 +432 __popStyle : function() { +433 // make sure you don't remove default style. +434 if ( this.rcs.length>1 ) { +435 this.rcs.pop(); +436 this.crcs= this.rcs[ this.rcs.length-1 ]; +437 this.crcs.applyStyle(); +438 } +439 }, +440 +441 __popAnchor : function() { +442 if ( this.anchorStack.length> 0 ) { +443 this.anchorStack.pop(); +444 } +445 }, +446 +447 __pushAnchor : function( anchor ) { +448 this.anchorStack.push( anchor ); +449 }, +450 +451 start : function( ctx, styles, images, width ) { +452 this.x=0; +453 this.y=0; +454 this.width= typeof width!=="undefined" ? width : 0; +455 this.ctx= ctx; +456 this.lines= []; +457 this.styles= styles; +458 this.images= images; +459 this.anchorStack= []; +460 +461 this.__resetAppliedStyles(); +462 this.__nextLine(); +463 +464 }, +465 +466 setTag : function( tag ) { +467 +468 var pairs, style; +469 +470 this.__text(); +471 +472 tag= tag.toLowerCase(); +473 if ( tag==='b' ) { +474 this.crcs.setBold( true ); +475 } else if ( tag==='/b' ) { +476 this.crcs.setBold( false ); +477 } else if ( tag==='i' ) { +478 this.crcs.setItalic( true ); +479 } else if ( tag==='/i' ) { +480 this.crcs.setItalic( false ); +481 } else if ( tag==='stroked' ) { +482 this.crcs.setStroked( true ); +483 } else if ( tag==='/stroked' ) { +484 this.crcs.setStroked( false ); +485 } else if ( tag==='filled' ) { +486 this.crcs.setFilled( true ); +487 } else if ( tag==='/filled' ) { +488 this.crcs.setFilled( false ); +489 } else if ( tag==='tab' ) { +490 this.x= this.crcs.getTabPos( this.x ); +491 } else if ( tag==='br' ) { +492 this.__nextLine(); +493 } else if ( tag==='/a' ) { +494 this.__popAnchor(); +495 } else if ( tag==='/style' ) { +496 if ( this.rcs.length>1 ) { +497 this.__popStyle(); +498 } else { +499 /** +500 * underflow pop de estilos. eres un cachondo. +501 */ +502 } +503 } else { +504 if ( tag.indexOf("fillcolor")===0 ) { +505 pairs= tag.split("="); +506 this.crcs.setFillStyle( pairs[1] ); +507 } else if ( tag.indexOf("strokecolor")===0 ) { +508 pairs= tag.split("="); +509 this.crcs.setStrokeStyle( pairs[1] ); +510 } else if ( tag.indexOf("strokesize")===0 ) { +511 pairs= tag.split("="); +512 this.crcs.setStrokeSize( pairs[1]|0 ); +513 } else if ( tag.indexOf("fontsize")===0 ) { +514 pairs= tag.split("="); +515 this.crcs.setFontSize( pairs[1]|0 ); +516 } else if ( tag.indexOf("style")===0 ) { +517 pairs= tag.split("="); +518 style= this.styles[ pairs[1] ]; +519 if ( style ) { +520 this.__pushStyle( style ); +521 } +522 } else if ( tag.indexOf("image")===0) { +523 pairs= tag.split("=")[1].split(","); +524 var image= pairs[0]; +525 if ( this.images[image] ) { +526 var r= 0, c=0; +527 if ( pairs.length>=3 ) { +528 r= pairs[1]|0; +529 c= pairs[2]|0; +530 } +531 this.__image( this.images[image], r, c ); +532 } else if (CAAT.currentDirector.getImage(image) ) { +533 this.__image( CAAT.currentDirector.getImage(image) ); +534 } +535 } else if ( tag.indexOf("a=")===0 ) { +536 pairs= tag.split("="); +537 this.__pushAnchor( pairs[1] ); +538 } +539 } +540 } +541 }; +542 +543 /** +544 * Abstract document element. +545 * The document contains a collection of DocumentElementText and DocumentElementImage. +546 * @param anchor +547 * @param style +548 */ +549 var DocumentElement= function( anchor, style ) { +550 this.link= anchor; +551 this.style= style; +552 return this; +553 }; +554 +555 DocumentElement.prototype= { +556 x : null, +557 y : null, +558 width : null, +559 height : null, +560 +561 style : null, +562 +563 link : null, +564 +565 isLink : function() { +566 return this.link; +567 }, +568 +569 setLink : function( link ) { +570 this.link= link; +571 return this; +572 }, +573 +574 getLink : function() { +575 return this.link; +576 }, +577 +578 contains : function(x,y) { +579 return false; +580 } +581 +582 }; +583 +584 /** +585 * This class represents an image in the document. +586 * @param x +587 * @param image +588 * @param r +589 * @param c +590 * @param style +591 * @param anchor +592 */ +593 var DocumentElementImage= function( x, image, r, c, style, anchor ) { +594 +595 DocumentElementImage.superclass.constructor.call(this, anchor, style); +596 +597 this.x= x; +598 this.image= image; +599 this.row= r; +600 this.column= c; +601 this.width= image.getWidth(); +602 this.height= image.getHeight(); +603 +604 if ( this.image instanceof CAAT.SpriteImage || this.image instanceof CAAT.Foundation.SpriteImage ) { 605 -606 return this; -607 }; -608 -609 DocumentElementImage.prototype= { -610 image : null, -611 row : null, -612 column : null, -613 spriteIndex : null, -614 -615 paint : function( ctx ) { -616 this.style.image( ctx ); -617 ctx.drawImage( this.image, this.x, -this.height+1); -618 if ( DEBUG ) { -619 ctx.strokeRect( this.x, -this.height+1, this.width, this.height ); -620 } -621 }, +606 if ( typeof r==="undefined" || typeof c==="undefined" ) { +607 this.spriteIndex= 0; +608 } else { +609 this.spriteIndex= r*image.columns+c; +610 } +611 this.paint= this.paintSI; +612 } +613 +614 return this; +615 }; +616 +617 DocumentElementImage.prototype= { +618 image : null, +619 row : null, +620 column : null, +621 spriteIndex : null, 622 -623 paintSI : function( ctx ) { +623 paint : function( ctx ) { 624 this.style.image( ctx ); -625 this.image.setSpriteIndex( this.spriteIndex ); -626 this.image.paint( { ctx: ctx }, 0, this.x, -this.height+1 ); -627 if ( DEBUG ) { -628 ctx.strokeRect( this.x, -this.height+1, this.width, this.height ); -629 } -630 }, -631 -632 getHeight : function() { -633 return this.image instanceof CAAT.Foundation.SpriteImage ? this.image.singleHeight : this.image.height; -634 }, -635 -636 getFontMetrics : function() { -637 return null; +625 ctx.drawImage( this.image, this.x, -this.height+1); +626 if ( DEBUG ) { +627 ctx.strokeRect( this.x, -this.height+1, this.width, this.height ); +628 } +629 }, +630 +631 paintSI : function( ctx ) { +632 this.style.image( ctx ); +633 this.image.setSpriteIndex( this.spriteIndex ); +634 this.image.paint( { ctx: ctx }, 0, this.x, -this.height+1 ); +635 if ( DEBUG ) { +636 ctx.strokeRect( this.x, -this.height+1, this.width, this.height ); +637 } 638 }, 639 -640 contains : function(x,y) { -641 return x>=this.x && x<=this.x+this.width && y>=this.y && y<this.y + this.height; +640 getHeight : function() { +641 return this.image instanceof CAAT.Foundation.SpriteImage ? this.image.getHeight() : this.image.height; 642 }, 643 -644 setYPosition : function( baseline ) { -645 this.y= baseline - this.height + 1; -646 } +644 getFontMetrics : function() { +645 return null; +646 }, 647 -648 }; -649 -650 /** -651 * This class represents a text in the document. The text will have applied the styles selected -652 * when it was defined. -653 * @param text -654 * @param x -655 * @param width -656 * @param height -657 * @param style -658 * @param anchor -659 */ -660 var DocumentElementText= function( text,x,width,height,style, anchor) { -661 -662 DocumentElementText.superclass.constructor.call(this, anchor, style); -663 -664 this.x= x; -665 this.y= 0; -666 this.width= width; -667 this.text= text; -668 this.style= style; -669 this.fm= CAAT.Module.Font.Font.getFontMetrics( style.sfont ); -670 this.height= this.fm.height; +648 contains : function(x,y) { +649 return x>=this.x && x<=this.x+this.width && y>=this.y && y<this.y + this.height; +650 }, +651 +652 setYPosition : function( baseline ) { +653 this.y= baseline - this.height + 1; +654 } +655 +656 }; +657 +658 /** +659 * This class represents a text in the document. The text will have applied the styles selected +660 * when it was defined. +661 * @param text +662 * @param x +663 * @param width +664 * @param height +665 * @param style +666 * @param anchor +667 */ +668 var DocumentElementText= function( text,x,width,height,style, anchor) { +669 +670 DocumentElementText.superclass.constructor.call(this, anchor, style); 671 -672 return this; -673 }; -674 -675 DocumentElementText.prototype= { -676 -677 text : null, -678 style : null, -679 fm : null, -680 -681 bl : null, // where baseline was set. current 0 in ctx. +672 this.x= x; +673 this.y= 0; +674 this.width= width; +675 this.text= text; +676 this.style= style; +677 this.fm= CAAT.Module.Font.Font.getFontMetrics( style.sfont ); +678 this.height= this.fm.height; +679 +680 return this; +681 }; 682 -683 paint : function( ctx ) { -684 this.style.text( ctx, this.text, this.x, 0 ); -685 if ( DEBUG ) { -686 ctx.strokeRect( this.x, -this.fm.ascent, this.width, this.height); -687 } -688 }, -689 -690 getHeight : function() { -691 return this.fm.height; -692 }, -693 -694 getFontMetrics : function() { -695 return this.fm; //CAAT.Font.getFontMetrics( this.style.sfont); +683 DocumentElementText.prototype= { +684 +685 text : null, +686 style : null, +687 fm : null, +688 +689 bl : null, // where baseline was set. current 0 in ctx. +690 +691 paint : function( ctx ) { +692 this.style.text( ctx, this.text, this.x, 0 ); +693 if ( DEBUG ) { +694 ctx.strokeRect( this.x, -this.fm.ascent, this.width, this.height); +695 } 696 }, 697 -698 contains : function( x, y ) { -699 return x>= this.x && x<=this.x+this.width && -700 y>= this.y && y<= this.y+this.height; -701 }, -702 -703 setYPosition : function( baseline ) { -704 this.bl= baseline; -705 this.y= baseline - this.fm.ascent; -706 } -707 }; -708 -709 extend( DocumentElementImage, DocumentElement ); -710 extend( DocumentElementText, DocumentElement ); -711 -712 /** -713 * This class represents a document line. -714 * It contains a collection of DocumentElement objects. -715 */ -716 var DocumentLine= function( defaultFontMetrics ) { -717 this.elements= []; -718 this.defaultFontMetrics= defaultFontMetrics; -719 return this; -720 }; -721 -722 DocumentLine.prototype= { -723 elements : null, -724 width : 0, -725 height : 0, -726 defaultHeight : 0, // default line height in case it is empty. -727 y : 0, -728 x : 0, -729 alignment : null, -730 -731 baselinePos : 0, -732 -733 addElement : function( element ) { -734 this.width= Math.max( this.width, element.x + element.width ); -735 this.height= Math.max( this.height, element.height ); -736 this.elements.push( element ); -737 this.alignment= element.style.__getProperty("alignment"); -738 }, -739 -740 addElementImage : function( element ) { -741 this.width= Math.max( this.width, element.x + element.width ); -742 this.height= Math.max( this.height, element.height ); -743 this.elements.push( element ); -744 }, -745 -746 getHeight : function() { -747 return this.height; -748 }, -749 -750 setY : function( y ) { -751 this.y= y; +698 getHeight : function() { +699 return this.fm.height; +700 }, +701 +702 getFontMetrics : function() { +703 return this.fm; //CAAT.Font.getFontMetrics( this.style.sfont); +704 }, +705 +706 contains : function( x, y ) { +707 return x>= this.x && x<=this.x+this.width && +708 y>= this.y && y<= this.y+this.height; +709 }, +710 +711 setYPosition : function( baseline ) { +712 this.bl= baseline; +713 this.y= baseline - this.fm.ascent; +714 } +715 }; +716 +717 extend( DocumentElementImage, DocumentElement ); +718 extend( DocumentElementText, DocumentElement ); +719 +720 /** +721 * This class represents a document line. +722 * It contains a collection of DocumentElement objects. +723 */ +724 var DocumentLine= function( defaultFontMetrics ) { +725 this.elements= []; +726 this.defaultFontMetrics= defaultFontMetrics; +727 return this; +728 }; +729 +730 DocumentLine.prototype= { +731 elements : null, +732 width : 0, +733 height : 0, +734 defaultHeight : 0, // default line height in case it is empty. +735 y : 0, +736 x : 0, +737 alignment : null, +738 +739 baselinePos : 0, +740 +741 addElement : function( element ) { +742 this.width= Math.max( this.width, element.x + element.width ); +743 this.height= Math.max( this.height, element.height ); +744 this.elements.push( element ); +745 this.alignment= element.style.__getProperty("alignment"); +746 }, +747 +748 addElementImage : function( element ) { +749 this.width= Math.max( this.width, element.x + element.width ); +750 this.height= Math.max( this.height, element.height ); +751 this.elements.push( element ); 752 }, 753 -754 getY : function() { -755 return this.y; +754 getHeight : function() { +755 return this.height; 756 }, 757 -758 paint : function( ctx ) { -759 ctx.save(); -760 ctx.translate(this.x,this.y + this.baselinePos ); +758 setY : function( y ) { +759 this.y= y; +760 }, 761 -762 for( var i=0; i<this.elements.length; i++ ) { -763 this.elements[i].paint(ctx); -764 } +762 getY : function() { +763 return this.y; +764 }, 765 -766 ctx.restore(); -767 -768 }, +766 paint : function( ctx ) { +767 ctx.save(); +768 ctx.translate(this.x,this.y + this.baselinePos ); 769 -770 setAlignment : function( width ) { -771 var j; -772 -773 if ( this.alignment==="center" ) { -774 this.x= (width - this.width)/2; -775 } else if ( this.alignment==="right" ) { -776 this.x= width - this.width; -777 } else if ( this.alignment==="justify" ) { -778 -779 // justify: only when text overflows further than document's 80% width -780 if ( this.width / width >= JUSTIFY_RATIO && this.elements.length>1 ) { -781 var remaining= width - this.width; -782 -783 var forEachElement= (remaining/(this.elements.length-1))|0; -784 for( j=1; j<this.elements.length ; j++ ) { -785 this.elements[j].x+= j*forEachElement; -786 } -787 -788 remaining= width - this.width - forEachElement*(this.elements.length-1); -789 for( j=0; j<remaining; j++ ) { -790 this.elements[this.elements.length-1-j].x+= remaining-j; -791 } -792 } -793 } -794 }, +770 for( var i=0; i<this.elements.length; i++ ) { +771 this.elements[i].paint(ctx); +772 } +773 +774 ctx.restore(); +775 +776 }, +777 +778 setAlignment : function( width ) { +779 var j; +780 +781 if ( this.alignment==="center" ) { +782 this.x= (width - this.width)/2; +783 } else if ( this.alignment==="right" ) { +784 this.x= width - this.width; +785 } else if ( this.alignment==="justify" ) { +786 +787 // justify: only when text overflows further than document's 80% width +788 if ( this.width / width >= JUSTIFY_RATIO && this.elements.length>1 ) { +789 var remaining= width - this.width; +790 +791 var forEachElement= (remaining/(this.elements.length-1))|0; +792 for( j=1; j<this.elements.length ; j++ ) { +793 this.elements[j].x+= j*forEachElement; +794 } 795 -796 adjustHeight : function() { -797 var biggestFont=null; -798 var biggestImage=null; -799 var i; -800 -801 for( i=0; i<this.elements.length; i+=1 ) { -802 var elem= this.elements[i]; +796 remaining= width - this.width - forEachElement*(this.elements.length-1); +797 for( j=0; j<remaining; j++ ) { +798 this.elements[this.elements.length-1-j].x+= remaining-j; +799 } +800 } +801 } +802 }, 803 -804 var fm= elem.getFontMetrics(); -805 if ( null!=fm ) { // gest a fontMetrics, is a DocumentElementText (text) -806 if ( !biggestFont ) { -807 biggestFont= fm; -808 } else { -809 if ( fm.ascent > biggestFont.ascent ) { -810 biggestFont= fm; -811 } -812 } -813 } else { // no FontMetrics, it is an image. -814 if (!biggestImage) { -815 biggestImage= elem; +804 adjustHeight : function() { +805 var biggestFont=null; +806 var biggestImage=null; +807 var i; +808 +809 for( i=0; i<this.elements.length; i+=1 ) { +810 var elem= this.elements[i]; +811 +812 var fm= elem.getFontMetrics(); +813 if ( null!=fm ) { // gest a fontMetrics, is a DocumentElementText (text) +814 if ( !biggestFont ) { +815 biggestFont= fm; 816 } else { -817 if ( elem.getHeight() > elem.getHeight() ) { -818 biggestImage= elem; +817 if ( fm.ascent > biggestFont.ascent ) { +818 biggestFont= fm; 819 } 820 } -821 } -822 } -823 -824 this.baselinePos= Math.max( -825 biggestFont ? biggestFont.ascent : this.defaultFontMetrics.ascent, -826 biggestImage ? biggestImage.getHeight() : this.defaultFontMetrics.ascent ); -827 this.height= this.baselinePos + (biggestFont!=null ? biggestFont.descent : this.defaultFontMetrics.descent ); -828 -829 for( i=0; i<this.elements.length; i++ ) { -830 this.elements[i].setYPosition( this.baselinePos ); -831 } -832 -833 return this.height; -834 }, -835 -836 /** -837 * Every element is positioned at line's baseline. -838 * @param x -839 * @param y -840 * @private -841 */ -842 __getElementAt : function( x, y ) { -843 for( var i=0; i<this.elements.length; i++ ) { -844 var elem= this.elements[i]; -845 if ( elem.contains(x,y) ) { -846 return elem; -847 } -848 } -849 -850 return null; -851 } -852 }; -853 -854 return { -855 -856 /** -857 * @lends CAAT.Foundation.UI.Label.prototype -858 */ -859 -860 -861 __init : function() { -862 this.__super(); +821 } else { // no FontMetrics, it is an image. +822 if (!biggestImage) { +823 biggestImage= elem; +824 } else { +825 if ( elem.getHeight() > elem.getHeight() ) { +826 biggestImage= elem; +827 } +828 } +829 } +830 } +831 +832 this.baselinePos= Math.max( +833 biggestFont ? biggestFont.ascent : this.defaultFontMetrics.ascent, +834 biggestImage ? biggestImage.getHeight() : this.defaultFontMetrics.ascent ); +835 this.height= this.baselinePos + (biggestFont!=null ? biggestFont.descent : this.defaultFontMetrics.descent ); +836 +837 for( i=0; i<this.elements.length; i++ ) { +838 this.elements[i].setYPosition( this.baselinePos ); +839 } +840 +841 return this.height; +842 }, +843 +844 /** +845 * Every element is positioned at line's baseline. +846 * @param x +847 * @param y +848 * @private +849 */ +850 __getElementAt : function( x, y ) { +851 for( var i=0; i<this.elements.length; i++ ) { +852 var elem= this.elements[i]; +853 if ( elem.contains(x,y) ) { +854 return elem; +855 } +856 } +857 +858 return null; +859 } +860 }; +861 +862 return { 863 -864 this.rc= new renderContext(); -865 this.lines= []; -866 this.styles= {}; -867 this.images= {}; +864 /** +865 * @lends CAAT.Foundation.UI.Label.prototype +866 */ +867 868 -869 return this; -870 }, +869 __init : function() { +870 this.__super(); 871 -872 /** -873 * This Label document´s horizontal alignment. -874 * @type {CAAT.Foundation.UI.Layout.LayoutManager} -875 * @private -876 */ -877 halignment : CAAT.Foundation.UI.Layout.LayoutManager.ALIGNMENT.LEFT, -878 -879 /** -880 * This Label document´s vertical alignment. -881 * @type {CAAT.Foundation.UI.Layout.LayoutManager} -882 * @private -883 */ -884 valignment : CAAT.Foundation.UI.Layout.LayoutManager.ALIGNMENT.TOP, -885 -886 /** -887 * This label text. -888 * @type {string} -889 * @private -890 */ -891 text : null, -892 -893 /** -894 * This label document´s render context -895 * @type {RenderContext} -896 * @private -897 */ -898 rc : null, -899 -900 /** -901 * Styles object. -902 * @private -903 */ -904 styles : null, -905 -906 /** -907 * Calculated document width. -908 * @private -909 */ -910 documentWidth : 0, -911 -912 /** -913 * Calculated document Height. -914 * @private -915 */ -916 documentHeight : 0, -917 -918 /** -919 * Document x position. -920 * @private -921 */ -922 documentX : 0, -923 -924 /** -925 * Document y position. -926 * @private -927 */ -928 documentY : 0, -929 -930 /** -931 * Does this label document flow ? -932 * @private -933 */ -934 reflow : true, -935 -936 /** -937 * Collection of text lines calculated for the label. -938 * @private -939 */ -940 lines : null, // calculated elements lines... -941 -942 /** -943 * Collection of image objects in this label´s document. -944 * @private -945 */ -946 images : null, -947 -948 /** -949 * Registered callback to notify on anchor click event. -950 * @private -951 */ -952 clickCallback : null, -953 -954 setStyle : function( name, styleData ) { -955 this.styles[ name ]= styleData; -956 return this; -957 }, -958 -959 addImage : function( name, spriteImage ) { -960 this.images[ name ]= spriteImage; -961 return this; -962 }, +872 this.rc= new renderContext(); +873 this.lines= []; +874 this.styles= {}; +875 this.images= {}; +876 +877 return this; +878 }, +879 +880 /** +881 * This Label document´s horizontal alignment. +882 * @type {CAAT.Foundation.UI.Layout.LayoutManager} +883 * @private +884 */ +885 halignment : CAAT.Foundation.UI.Layout.LayoutManager.ALIGNMENT.LEFT, +886 +887 /** +888 * This Label document´s vertical alignment. +889 * @type {CAAT.Foundation.UI.Layout.LayoutManager} +890 * @private +891 */ +892 valignment : CAAT.Foundation.UI.Layout.LayoutManager.ALIGNMENT.TOP, +893 +894 /** +895 * This label text. +896 * @type {string} +897 * @private +898 */ +899 text : null, +900 +901 /** +902 * This label document´s render context +903 * @type {RenderContext} +904 * @private +905 */ +906 rc : null, +907 +908 /** +909 * Styles object. +910 * @private +911 */ +912 styles : null, +913 +914 /** +915 * Calculated document width. +916 * @private +917 */ +918 documentWidth : 0, +919 +920 /** +921 * Calculated document Height. +922 * @private +923 */ +924 documentHeight : 0, +925 +926 /** +927 * Document x position. +928 * @private +929 */ +930 documentX : 0, +931 +932 /** +933 * Document y position. +934 * @private +935 */ +936 documentY : 0, +937 +938 /** +939 * Does this label document flow ? +940 * @private +941 */ +942 reflow : true, +943 +944 /** +945 * Collection of text lines calculated for the label. +946 * @private +947 */ +948 lines : null, // calculated elements lines... +949 +950 /** +951 * Collection of image objects in this label´s document. +952 * @private +953 */ +954 images : null, +955 +956 /** +957 * Registered callback to notify on anchor click event. +958 * @private +959 */ +960 clickCallback : null, +961 +962 matchTextSize : true, 963 -964 setSize : function(w,h) { -965 CAAT.Foundation.UI.Label.superclass.setSize.call( this, w, h ); -966 this.setText( this.text, this.width ); -967 return this; -968 }, -969 -970 setBounds : function( x,y,w,h ) { -971 CAAT.Foundation.UI.Label.superclass.setBounds.call( this,x,y,w,h ); -972 this.setText( this.text, this.width ); -973 return this; +964 /** +965 * Make the label actor the size the label document has been calculated for. +966 * @param match {boolean} +967 */ +968 setMatchTextSize : function( match ) { +969 this.matchTextSize= match; +970 if ( match ) { +971 this.width= this.preferredSize.width; +972 this.height= this.preferredSize.height; +973 } 974 }, 975 -976 setText : function( _text, width ) { -977 -978 if ( null===_text ) { -979 return; -980 } -981 -982 var cached= this.cached; -983 if ( cached ) { -984 this.stopCacheAsBitmap(); -985 } -986 -987 this.documentWidth= 0; -988 this.documentHeight= 0; -989 -990 this.text= _text; +976 setStyle : function( name, styleData ) { +977 this.styles[ name ]= styleData; +978 return this; +979 }, +980 +981 addImage : function( name, spriteImage ) { +982 this.images[ name ]= spriteImage; +983 return this; +984 }, +985 +986 setSize : function(w,h) { +987 CAAT.Foundation.UI.Label.superclass.setSize.call( this, w, h ); +988 this.setText( this.text, this.width ); +989 return this; +990 }, 991 -992 var i, l, text; -993 var tag_closes_at_pos, tag; -994 var _char; -995 var ctx= CAAT.currentDirector.ctx; -996 ctx.save(); +992 setBounds : function( x,y,w,h ) { +993 CAAT.Foundation.UI.Label.superclass.setBounds.call( this,x,y,w,h ); +994 this.setText( this.text, this.width ); +995 return this; +996 }, 997 -998 text= this.text; +998 setText : function( _text, width ) { 999 -1000 i=0; -1001 l=text.length; -1002 -1003 this.rc.start( ctx, this.styles, this.images, width ); -1004 -1005 while( i<l ) { -1006 _char= text.charAt(i); -1007 -1008 if ( _char==='\\' ) { -1009 i+=1; -1010 this.rc.fchar( text.charAt(i) ); -1011 i+=1; -1012 -1013 } else if ( _char==='<' ) { // try an enhancement. -1014 -1015 // try finding another '>' and see whether it matches a tag -1016 tag_closes_at_pos= text.indexOf('>', i+1); -1017 if ( -1!==tag_closes_at_pos ) { -1018 tag= text.substr( i+1, tag_closes_at_pos-i-1 ); -1019 if ( tag.indexOf("<")!==-1 ) { -1020 this.rc.fchar( _char ); -1021 i+=1; -1022 } else { -1023 this.rc.setTag( tag ); -1024 i= tag_closes_at_pos+1; -1025 } -1026 } -1027 } else { -1028 this.rc.fchar( _char ); -1029 i+= 1; -1030 } -1031 } -1032 -1033 this.rc.end(); -1034 this.lines= this.rc.lines; -1035 -1036 this.__calculateDocumentDimension( typeof width==="undefined" ? 0 : width ); -1037 this.setLinesAlignment(); -1038 -1039 ctx.restore(); -1040 -1041 this.setPreferredSize( this.documentWidth, this.documentHeight ); -1042 this.invalidateLayout(); -1043 -1044 this.setDocumentPosition(); -1045 -1046 if ( cached ) { -1047 this.cacheAsBitmap(0,cached); -1048 } -1049 -1050 return this; -1051 }, -1052 -1053 setVerticalAlignment : function( align ) { -1054 this.valignment= align; -1055 this.setDocumentPosition(); -1056 return this; -1057 }, -1058 -1059 setHorizontalAlignment : function( align ) { -1060 this.halignment= align; -1061 this.setDocumentPosition(); -1062 return this; -1063 }, -1064 -1065 setDocumentPosition : function() { -1066 var xo=0, yo=0; +1000 if ( null===_text ) { +1001 return; +1002 } +1003 +1004 var cached= this.cached; +1005 if ( cached ) { +1006 this.stopCacheAsBitmap(); +1007 } +1008 +1009 this.documentWidth= 0; +1010 this.documentHeight= 0; +1011 +1012 this.text= _text; +1013 +1014 var i, l, text; +1015 var tag_closes_at_pos, tag; +1016 var _char; +1017 var ctx= CAAT.currentDirector.ctx; +1018 ctx.save(); +1019 +1020 text= this.text; +1021 +1022 i=0; +1023 l=text.length; +1024 +1025 this.rc.start( ctx, this.styles, this.images, width ); +1026 +1027 while( i<l ) { +1028 _char= text.charAt(i); +1029 +1030 if ( _char==='\\' ) { +1031 i+=1; +1032 this.rc.fchar( text.charAt(i) ); +1033 i+=1; +1034 +1035 } else if ( _char==='<' ) { // try an enhancement. +1036 +1037 // try finding another '>' and see whether it matches a tag +1038 tag_closes_at_pos= text.indexOf('>', i+1); +1039 if ( -1!==tag_closes_at_pos ) { +1040 tag= text.substr( i+1, tag_closes_at_pos-i-1 ); +1041 if ( tag.indexOf("<")!==-1 ) { +1042 this.rc.fchar( _char ); +1043 i+=1; +1044 } else { +1045 this.rc.setTag( tag ); +1046 i= tag_closes_at_pos+1; +1047 } +1048 } +1049 } else { +1050 this.rc.fchar( _char ); +1051 i+= 1; +1052 } +1053 } +1054 +1055 this.rc.end(); +1056 this.lines= this.rc.lines; +1057 +1058 this.__calculateDocumentDimension( typeof width==="undefined" ? 0 : width ); +1059 this.setLinesAlignment(); +1060 +1061 ctx.restore(); +1062 +1063 this.setPreferredSize( this.documentWidth, this.documentHeight ); +1064 this.invalidateLayout(); +1065 +1066 this.setDocumentPosition(); 1067 -1068 if ( this.valignment===CAAT.Foundation.UI.Layout.LayoutManager.ALIGNMENT.CENTER ) { -1069 yo= (this.height - this.documentHeight )/2; -1070 } else if ( this.valignment===CAAT.Foundation.UI.Layout.LayoutManager.ALIGNMENT.BOTTOM ) { -1071 yo= this.height - this.documentHeight; -1072 } -1073 -1074 if ( this.halignment===CAAT.Foundation.UI.Layout.LayoutManager.ALIGNMENT.CENTER ) { -1075 xo= (this.width - this.documentWidth )/2; -1076 } else if ( this.halignment===CAAT.Foundation.UI.Layout.LayoutManager.ALIGNMENT.RIGHT ) { -1077 xo= this.width - this.documentWidth; -1078 } +1068 if ( cached ) { +1069 this.cacheAsBitmap(0,cached); +1070 } +1071 +1072 if ( this.matchTextSize ) { +1073 this.width= this.preferredSize.width; +1074 this.height= this.preferredSize.height; +1075 } +1076 +1077 return this; +1078 }, 1079 -1080 this.documentX= xo; -1081 this.documentY= yo; -1082 }, -1083 -1084 __calculateDocumentDimension : function( suggestedWidth ) { -1085 var i; -1086 var y= 0; -1087 -1088 this.documentWidth= 0; -1089 this.documentHeight= 0; -1090 for( i=0; i<this.lines.length; i++ ) { -1091 this.lines[i].y =y; -1092 this.documentWidth= Math.max( this.documentWidth, this.lines[i].width ); -1093 this.documentHeight+= this.lines[i].adjustHeight(); -1094 y+= this.lines[i].getHeight(); -1095 } -1096 -1097 this.documentWidth= Math.max( this.documentWidth, suggestedWidth ); -1098 -1099 return this; -1100 }, -1101 -1102 setLinesAlignment : function() { -1103 -1104 for( var i=0; i<this.lines.length; i++ ) { -1105 this.lines[i].setAlignment( this.documentWidth ) -1106 } -1107 }, +1080 setVerticalAlignment : function( align ) { +1081 this.valignment= align; +1082 this.setDocumentPosition(); +1083 return this; +1084 }, +1085 +1086 setHorizontalAlignment : function( align ) { +1087 this.halignment= align; +1088 this.setDocumentPosition(); +1089 return this; +1090 }, +1091 +1092 setDocumentPosition : function( halign, valign ) { +1093 +1094 if ( typeof halign!=="undefined" ) { +1095 this.setHorizontalAlignment(halign); +1096 } +1097 if ( typeof valign!=="undefined" ) { +1098 this.setVerticalAlignment(valign); +1099 } +1100 +1101 var xo=0, yo=0; +1102 +1103 if ( this.valignment===CAAT.Foundation.UI.Layout.LayoutManager.ALIGNMENT.CENTER ) { +1104 yo= (this.height - this.documentHeight )/2; +1105 } else if ( this.valignment===CAAT.Foundation.UI.Layout.LayoutManager.ALIGNMENT.BOTTOM ) { +1106 yo= this.height - this.documentHeight; +1107 } 1108 -1109 paint : function( director, time ) { -1110 -1111 if ( this.cached===CAAT.Foundation.Actor.CACHE_NONE ) { -1112 var ctx= director.ctx; -1113 -1114 ctx.save(); -1115 -1116 ctx.textBaseline="alphabetic"; -1117 ctx.translate( this.documentX, this.documentY ); +1109 if ( this.halignment===CAAT.Foundation.UI.Layout.LayoutManager.ALIGNMENT.CENTER ) { +1110 xo= (this.width - this.documentWidth )/2; +1111 } else if ( this.halignment===CAAT.Foundation.UI.Layout.LayoutManager.ALIGNMENT.RIGHT ) { +1112 xo= this.width - this.documentWidth; +1113 } +1114 +1115 this.documentX= xo; +1116 this.documentY= yo; +1117 }, 1118 -1119 for( var i=0; i<this.lines.length; i++ ) { -1120 var line= this.lines[i]; -1121 line.paint( director.ctx ); +1119 __calculateDocumentDimension : function( suggestedWidth ) { +1120 var i; +1121 var y= 0; 1122 -1123 if ( DEBUG ) { -1124 ctx.strokeRect( line.x, line.y, line.width, line.height ); -1125 } -1126 } -1127 -1128 ctx.restore(); -1129 } else { -1130 if ( this.backgroundImage ) { -1131 this.backgroundImage.paint(director,time,0,0); -1132 } -1133 } -1134 }, -1135 -1136 __getDocumentElementAt : function( x, y ) { -1137 -1138 x-= this.documentX; -1139 y-= this.documentY; -1140 -1141 for( var i=0; i<this.lines.length; i++ ) { -1142 var line= this.lines[i]; +1123 this.documentWidth= 0; +1124 this.documentHeight= 0; +1125 for( i=0; i<this.lines.length; i++ ) { +1126 this.lines[i].y =y; +1127 this.documentWidth= Math.max( this.documentWidth, this.lines[i].width ); +1128 this.documentHeight+= this.lines[i].adjustHeight(); +1129 y+= this.lines[i].getHeight(); +1130 } +1131 +1132 this.documentWidth= Math.max( this.documentWidth, suggestedWidth ); +1133 +1134 return this; +1135 }, +1136 +1137 setLinesAlignment : function() { +1138 +1139 for( var i=0; i<this.lines.length; i++ ) { +1140 this.lines[i].setAlignment( this.documentWidth ) +1141 } +1142 }, 1143 -1144 if ( line.x<=x && line.y<=y && line.x+line.width>=x && line.y+line.height>=y ) { -1145 return line.__getElementAt( x - line.x, y - line.y ); -1146 } -1147 } +1144 paint : function( director, time ) { +1145 +1146 if ( this.cached===CAAT.Foundation.Actor.CACHE_NONE ) { +1147 var ctx= director.ctx; 1148 -1149 return null; -1150 }, -1151 -1152 mouseExit : function(e) { -1153 CAAT.setCursor( "default"); -1154 }, -1155 -1156 mouseMove : function(e) { -1157 var elem= this.__getDocumentElementAt(e.x, e.y); -1158 if ( elem && elem.getLink() ) { -1159 CAAT.setCursor( "pointer"); -1160 } else { -1161 CAAT.setCursor( "default"); -1162 } -1163 }, -1164 -1165 mouseClick : function(e) { -1166 if ( this.clickCallback ) { -1167 var elem= this.__getDocumentElementAt(e.x, e.y); -1168 if ( elem.getLink() ) { -1169 this.clickCallback( elem.getLink() ); -1170 } -1171 } -1172 }, -1173 -1174 setClickCallback : function( callback ) { -1175 this.clickCallback= callback; -1176 return this; -1177 } -1178 } -1179 -1180 } -1181 -1182 }); -1183 \ No newline at end of file +1149 ctx.save(); +1150 +1151 ctx.textBaseline="alphabetic"; +1152 ctx.translate( this.documentX, this.documentY ); +1153 +1154 for( var i=0; i<this.lines.length; i++ ) { +1155 var line= this.lines[i]; +1156 line.paint( director.ctx ); +1157 +1158 if ( DEBUG ) { +1159 ctx.strokeRect( line.x, line.y, line.width, line.height ); +1160 } +1161 } +1162 +1163 ctx.restore(); +1164 } else { +1165 if ( this.backgroundImage ) { +1166 this.backgroundImage.paint(director,time,0,0); +1167 } +1168 } +1169 }, +1170 +1171 __getDocumentElementAt : function( x, y ) { +1172 +1173 x-= this.documentX; +1174 y-= this.documentY; +1175 +1176 for( var i=0; i<this.lines.length; i++ ) { +1177 var line= this.lines[i]; +1178 +1179 if ( line.x<=x && line.y<=y && line.x+line.width>=x && line.y+line.height>=y ) { +1180 return line.__getElementAt( x - line.x, y - line.y ); +1181 } +1182 } +1183 +1184 return null; +1185 }, +1186 +1187 mouseExit : function(e) { +1188 CAAT.setCursor( "default"); +1189 }, +1190 +1191 mouseMove : function(e) { +1192 var elem= this.__getDocumentElementAt(e.x, e.y); +1193 if ( elem && elem.getLink() ) { +1194 CAAT.setCursor( "pointer"); +1195 } else { +1196 CAAT.setCursor( "default"); +1197 } +1198 }, +1199 +1200 mouseClick : function(e) { +1201 if ( this.clickCallback ) { +1202 var elem= this.__getDocumentElementAt(e.x, e.y); +1203 if ( elem.getLink() ) { +1204 this.clickCallback( elem.getLink() ); +1205 } +1206 } +1207 }, +1208 +1209 setClickCallback : function( callback ) { +1210 this.clickCallback= callback; +1211 return this; +1212 } +1213 } +1214 +1215 } +1216 +1217 }); +1218 \ No newline at end of file diff --git a/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_math_bezier.js.html b/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_Math_Bezier.js.html similarity index 100% rename from documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_math_bezier.js.html rename to documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_Math_Bezier.js.html diff --git a/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_math_dimension.js.html b/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_Math_Dimension.js.html similarity index 100% rename from documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_math_dimension.js.html rename to documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_Math_Dimension.js.html diff --git a/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_Math_Matrix.js.html b/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_Math_Matrix.js.html index 53f7dd96..d49e821d 100644 --- a/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_Math_Matrix.js.html +++ b/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_Math_Matrix.js.html @@ -45,384 +45,387 @@ 38 CAAT.Math.Matrix.prototype.transformRenderingContext= CAAT.Matrix.prototype.transformRenderingContext_NoClamp; 39 CAAT.Math.Matrix.prototype.transformRenderingContextSet= CAAT.Matrix.prototype.transformRenderingContextSet_NoClamp; 40 } - 41 } - 42 }, - 43 extendsWith:function () { - 44 return { - 45 - 46 /** - 47 * @lends CAAT.Math.Matrix.prototype - 48 */ - 49 - 50 /** - 51 * An array of 9 numbers. - 52 */ - 53 matrix:null, - 54 - 55 __init:function () { - 56 this.matrix = [ - 57 1.0, 0.0, 0.0, - 58 0.0, 1.0, 0.0, 0.0, 0.0, 1.0 ]; - 59 - 60 if (typeof Float32Array !== "undefined") { - 61 this.matrix = new Float32Array(this.matrix); - 62 } - 63 - 64 return this; - 65 }, - 66 - 67 /** - 68 * Transform a point by this matrix. The parameter point will be modified with the transformation values. - 69 * @param point {CAAT.Point}. - 70 * @return {CAAT.Point} the parameter point. - 71 */ - 72 transformCoord:function (point) { - 73 var x = point.x; - 74 var y = point.y; - 75 - 76 var tm = this.matrix; - 77 - 78 point.x = x * tm[0] + y * tm[1] + tm[2]; - 79 point.y = x * tm[3] + y * tm[4] + tm[5]; - 80 - 81 return point; - 82 }, - 83 /** - 84 * Create a new rotation matrix and set it up for the specified angle in radians. - 85 * @param angle {number} - 86 * @return {CAAT.Matrix} a matrix object. - 87 * - 88 * @static - 89 */ - 90 rotate:function (angle) { - 91 var m = new CAAT.Math.Matrix(); - 92 m.setRotation(angle); - 93 return m; - 94 }, - 95 setRotation:function (angle) { - 96 - 97 this.identity(); - 98 - 99 var tm = this.matrix; -100 var c = Math.cos(angle); -101 var s = Math.sin(angle); -102 tm[0] = c; -103 tm[1] = -s; -104 tm[3] = s; -105 tm[4] = c; -106 -107 return this; -108 }, -109 /** -110 * Create a scale matrix. -111 * @param scalex {number} x scale magnitude. -112 * @param scaley {number} y scale magnitude. -113 * -114 * @return {CAAT.Matrix} a matrix object. -115 * -116 * @static + 41 }, + 42 /** + 43 * Create a scale matrix. + 44 * @param scalex {number} x scale magnitude. + 45 * @param scaley {number} y scale magnitude. + 46 * + 47 * @return {CAAT.Matrix} a matrix object. + 48 * + 49 * @static + 50 */ + 51 scale:function (scalex, scaley) { + 52 var m = new CAAT.Math.Matrix(); + 53 + 54 m.matrix[0] = scalex; + 55 m.matrix[4] = scaley; + 56 + 57 return m; + 58 }, + 59 /** + 60 * Create a new rotation matrix and set it up for the specified angle in radians. + 61 * @param angle {number} + 62 * @return {CAAT.Matrix} a matrix object. + 63 * + 64 * @static + 65 */ + 66 rotate:function (angle) { + 67 var m = new CAAT.Math.Matrix(); + 68 m.setRotation(angle); + 69 return m; + 70 }, + 71 /** + 72 * Create a translation matrix. + 73 * @param x {number} x translation magnitude. + 74 * @param y {number} y translation magnitude. + 75 * + 76 * @return {CAAT.Matrix} a matrix object. + 77 * @static + 78 * + 79 */ + 80 translate:function (x, y) { + 81 var m = new CAAT.Math.Matrix(); + 82 + 83 m.matrix[2] = x; + 84 m.matrix[5] = y; + 85 + 86 return m; + 87 } + 88 }, + 89 extendsWith:function () { + 90 return { + 91 + 92 /** + 93 * @lends CAAT.Math.Matrix.prototype + 94 */ + 95 + 96 /** + 97 * An array of 9 numbers. + 98 */ + 99 matrix:null, +100 +101 __init:function () { +102 this.matrix = [ +103 1.0, 0.0, 0.0, +104 0.0, 1.0, 0.0, 0.0, 0.0, 1.0 ]; +105 +106 if (typeof Float32Array !== "undefined") { +107 this.matrix = new Float32Array(this.matrix); +108 } +109 +110 return this; +111 }, +112 +113 /** +114 * Transform a point by this matrix. The parameter point will be modified with the transformation values. +115 * @param point {CAAT.Point}. +116 * @return {CAAT.Point} the parameter point. 117 */ -118 scale:function (scalex, scaley) { -119 var m = new CAAT.Math.Matrix(); -120 -121 m.matrix[0] = scalex; -122 m.matrix[4] = scaley; +118 transformCoord:function (point) { +119 var x = point.x; +120 var y = point.y; +121 +122 var tm = this.matrix; 123 -124 return m; -125 }, -126 setScale:function (scalex, scaley) { -127 this.identity(); -128 -129 this.matrix[0] = scalex; -130 this.matrix[4] = scaley; +124 point.x = x * tm[0] + y * tm[1] + tm[2]; +125 point.y = x * tm[3] + y * tm[4] + tm[5]; +126 +127 return point; +128 }, +129 +130 setRotation:function (angle) { 131 -132 return this; -133 }, -134 /** -135 * Create a translation matrix. -136 * @param x {number} x translation magnitude. -137 * @param y {number} y translation magnitude. -138 * -139 * @return {CAAT.Matrix} a matrix object. -140 * @static -141 * -142 */ -143 translate:function (x, y) { -144 var m = new CAAT.Math.Matrix(); -145 -146 m.matrix[2] = x; -147 m.matrix[5] = y; -148 -149 return m; -150 }, -151 /** -152 * Sets this matrix as a translation matrix. -153 * @param x -154 * @param y -155 */ -156 setTranslate:function (x, y) { -157 this.identity(); -158 -159 this.matrix[2] = x; -160 this.matrix[5] = y; +132 this.identity(); +133 +134 var tm = this.matrix; +135 var c = Math.cos(angle); +136 var s = Math.sin(angle); +137 tm[0] = c; +138 tm[1] = -s; +139 tm[3] = s; +140 tm[4] = c; +141 +142 return this; +143 }, +144 +145 setScale:function (scalex, scaley) { +146 this.identity(); +147 +148 this.matrix[0] = scalex; +149 this.matrix[4] = scaley; +150 +151 return this; +152 }, +153 +154 /** +155 * Sets this matrix as a translation matrix. +156 * @param x +157 * @param y +158 */ +159 setTranslate:function (x, y) { +160 this.identity(); 161 -162 return this; -163 }, -164 /** -165 * Copy into this matrix the given matrix values. -166 * @param matrix {CAAT.Matrix} -167 * @return this -168 */ -169 copy:function (matrix) { -170 matrix = matrix.matrix; -171 -172 var tmatrix = this.matrix; -173 tmatrix[0] = matrix[0]; -174 tmatrix[1] = matrix[1]; -175 tmatrix[2] = matrix[2]; -176 tmatrix[3] = matrix[3]; -177 tmatrix[4] = matrix[4]; -178 tmatrix[5] = matrix[5]; -179 tmatrix[6] = matrix[6]; -180 tmatrix[7] = matrix[7]; -181 tmatrix[8] = matrix[8]; -182 -183 return this; -184 }, -185 /** -186 * Set this matrix to the identity matrix. -187 * @return this -188 */ -189 identity:function () { -190 -191 var m = this.matrix; -192 m[0] = 1.0; -193 m[1] = 0.0; -194 m[2] = 0.0; -195 -196 m[3] = 0.0; -197 m[4] = 1.0; -198 m[5] = 0.0; -199 -200 m[6] = 0.0; -201 m[7] = 0.0; -202 m[8] = 1.0; -203 -204 return this; -205 }, -206 /** -207 * Multiply this matrix by a given matrix. -208 * @param m {CAAT.Matrix} -209 * @return this -210 */ -211 multiply:function (m) { -212 -213 var tm = this.matrix; -214 var mm = m.matrix; +162 this.matrix[2] = x; +163 this.matrix[5] = y; +164 +165 return this; +166 }, +167 /** +168 * Copy into this matrix the given matrix values. +169 * @param matrix {CAAT.Matrix} +170 * @return this +171 */ +172 copy:function (matrix) { +173 matrix = matrix.matrix; +174 +175 var tmatrix = this.matrix; +176 tmatrix[0] = matrix[0]; +177 tmatrix[1] = matrix[1]; +178 tmatrix[2] = matrix[2]; +179 tmatrix[3] = matrix[3]; +180 tmatrix[4] = matrix[4]; +181 tmatrix[5] = matrix[5]; +182 tmatrix[6] = matrix[6]; +183 tmatrix[7] = matrix[7]; +184 tmatrix[8] = matrix[8]; +185 +186 return this; +187 }, +188 /** +189 * Set this matrix to the identity matrix. +190 * @return this +191 */ +192 identity:function () { +193 +194 var m = this.matrix; +195 m[0] = 1.0; +196 m[1] = 0.0; +197 m[2] = 0.0; +198 +199 m[3] = 0.0; +200 m[4] = 1.0; +201 m[5] = 0.0; +202 +203 m[6] = 0.0; +204 m[7] = 0.0; +205 m[8] = 1.0; +206 +207 return this; +208 }, +209 /** +210 * Multiply this matrix by a given matrix. +211 * @param m {CAAT.Matrix} +212 * @return this +213 */ +214 multiply:function (m) { 215 -216 var tm0 = tm[0]; -217 var tm1 = tm[1]; -218 var tm2 = tm[2]; -219 var tm3 = tm[3]; -220 var tm4 = tm[4]; -221 var tm5 = tm[5]; -222 var tm6 = tm[6]; -223 var tm7 = tm[7]; -224 var tm8 = tm[8]; -225 -226 var mm0 = mm[0]; -227 var mm1 = mm[1]; -228 var mm2 = mm[2]; -229 var mm3 = mm[3]; -230 var mm4 = mm[4]; -231 var mm5 = mm[5]; -232 var mm6 = mm[6]; -233 var mm7 = mm[7]; -234 var mm8 = mm[8]; -235 -236 tm[0] = tm0 * mm0 + tm1 * mm3 + tm2 * mm6; -237 tm[1] = tm0 * mm1 + tm1 * mm4 + tm2 * mm7; -238 tm[2] = tm0 * mm2 + tm1 * mm5 + tm2 * mm8; -239 tm[3] = tm3 * mm0 + tm4 * mm3 + tm5 * mm6; -240 tm[4] = tm3 * mm1 + tm4 * mm4 + tm5 * mm7; -241 tm[5] = tm3 * mm2 + tm4 * mm5 + tm5 * mm8; -242 tm[6] = tm6 * mm0 + tm7 * mm3 + tm8 * mm6; -243 tm[7] = tm6 * mm1 + tm7 * mm4 + tm8 * mm7; -244 tm[8] = tm6 * mm2 + tm7 * mm5 + tm8 * mm8; -245 -246 return this; -247 }, -248 /** -249 * Premultiply this matrix by a given matrix. -250 * @param m {CAAT.Matrix} -251 * @return this -252 */ -253 premultiply:function (m) { -254 -255 var m00 = m.matrix[0] * this.matrix[0] + m.matrix[1] * this.matrix[3] + m.matrix[2] * this.matrix[6]; -256 var m01 = m.matrix[0] * this.matrix[1] + m.matrix[1] * this.matrix[4] + m.matrix[2] * this.matrix[7]; -257 var m02 = m.matrix[0] * this.matrix[2] + m.matrix[1] * this.matrix[5] + m.matrix[2] * this.matrix[8]; -258 -259 var m10 = m.matrix[3] * this.matrix[0] + m.matrix[4] * this.matrix[3] + m.matrix[5] * this.matrix[6]; -260 var m11 = m.matrix[3] * this.matrix[1] + m.matrix[4] * this.matrix[4] + m.matrix[5] * this.matrix[7]; -261 var m12 = m.matrix[3] * this.matrix[2] + m.matrix[4] * this.matrix[5] + m.matrix[5] * this.matrix[8]; -262 -263 var m20 = m.matrix[6] * this.matrix[0] + m.matrix[7] * this.matrix[3] + m.matrix[8] * this.matrix[6]; -264 var m21 = m.matrix[6] * this.matrix[1] + m.matrix[7] * this.matrix[4] + m.matrix[8] * this.matrix[7]; -265 var m22 = m.matrix[6] * this.matrix[2] + m.matrix[7] * this.matrix[5] + m.matrix[8] * this.matrix[8]; -266 -267 this.matrix[0] = m00; -268 this.matrix[1] = m01; -269 this.matrix[2] = m02; -270 -271 this.matrix[3] = m10; -272 this.matrix[4] = m11; -273 this.matrix[5] = m12; -274 -275 this.matrix[6] = m20; -276 this.matrix[7] = m21; -277 this.matrix[8] = m22; -278 -279 -280 return this; -281 }, -282 /** -283 * Creates a new inverse matrix from this matrix. -284 * @return {CAAT.Matrix} an inverse matrix. -285 */ -286 getInverse:function () { -287 var tm = this.matrix; -288 -289 var m00 = tm[0]; -290 var m01 = tm[1]; -291 var m02 = tm[2]; -292 var m10 = tm[3]; -293 var m11 = tm[4]; -294 var m12 = tm[5]; -295 var m20 = tm[6]; -296 var m21 = tm[7]; -297 var m22 = tm[8]; -298 -299 var newMatrix = new CAAT.Math.Matrix(); -300 -301 var determinant = m00 * (m11 * m22 - m21 * m12) - m10 * (m01 * m22 - m21 * m02) + m20 * (m01 * m12 - m11 * m02); -302 if (determinant === 0) { -303 return null; -304 } -305 -306 var m = newMatrix.matrix; -307 -308 m[0] = m11 * m22 - m12 * m21; -309 m[1] = m02 * m21 - m01 * m22; -310 m[2] = m01 * m12 - m02 * m11; -311 -312 m[3] = m12 * m20 - m10 * m22; -313 m[4] = m00 * m22 - m02 * m20; -314 m[5] = m02 * m10 - m00 * m12; -315 -316 m[6] = m10 * m21 - m11 * m20; -317 m[7] = m01 * m20 - m00 * m21; -318 m[8] = m00 * m11 - m01 * m10; -319 -320 newMatrix.multiplyScalar(1 / determinant); -321 -322 return newMatrix; -323 }, -324 /** -325 * Multiply this matrix by a scalar. -326 * @param scalar {number} scalar value -327 * -328 * @return this -329 */ -330 multiplyScalar:function (scalar) { -331 var i; -332 -333 for (i = 0; i < 9; i++) { -334 this.matrix[i] *= scalar; -335 } -336 -337 return this; -338 }, +216 var tm = this.matrix; +217 var mm = m.matrix; +218 +219 var tm0 = tm[0]; +220 var tm1 = tm[1]; +221 var tm2 = tm[2]; +222 var tm3 = tm[3]; +223 var tm4 = tm[4]; +224 var tm5 = tm[5]; +225 var tm6 = tm[6]; +226 var tm7 = tm[7]; +227 var tm8 = tm[8]; +228 +229 var mm0 = mm[0]; +230 var mm1 = mm[1]; +231 var mm2 = mm[2]; +232 var mm3 = mm[3]; +233 var mm4 = mm[4]; +234 var mm5 = mm[5]; +235 var mm6 = mm[6]; +236 var mm7 = mm[7]; +237 var mm8 = mm[8]; +238 +239 tm[0] = tm0 * mm0 + tm1 * mm3 + tm2 * mm6; +240 tm[1] = tm0 * mm1 + tm1 * mm4 + tm2 * mm7; +241 tm[2] = tm0 * mm2 + tm1 * mm5 + tm2 * mm8; +242 tm[3] = tm3 * mm0 + tm4 * mm3 + tm5 * mm6; +243 tm[4] = tm3 * mm1 + tm4 * mm4 + tm5 * mm7; +244 tm[5] = tm3 * mm2 + tm4 * mm5 + tm5 * mm8; +245 tm[6] = tm6 * mm0 + tm7 * mm3 + tm8 * mm6; +246 tm[7] = tm6 * mm1 + tm7 * mm4 + tm8 * mm7; +247 tm[8] = tm6 * mm2 + tm7 * mm5 + tm8 * mm8; +248 +249 return this; +250 }, +251 /** +252 * Premultiply this matrix by a given matrix. +253 * @param m {CAAT.Matrix} +254 * @return this +255 */ +256 premultiply:function (m) { +257 +258 var m00 = m.matrix[0] * this.matrix[0] + m.matrix[1] * this.matrix[3] + m.matrix[2] * this.matrix[6]; +259 var m01 = m.matrix[0] * this.matrix[1] + m.matrix[1] * this.matrix[4] + m.matrix[2] * this.matrix[7]; +260 var m02 = m.matrix[0] * this.matrix[2] + m.matrix[1] * this.matrix[5] + m.matrix[2] * this.matrix[8]; +261 +262 var m10 = m.matrix[3] * this.matrix[0] + m.matrix[4] * this.matrix[3] + m.matrix[5] * this.matrix[6]; +263 var m11 = m.matrix[3] * this.matrix[1] + m.matrix[4] * this.matrix[4] + m.matrix[5] * this.matrix[7]; +264 var m12 = m.matrix[3] * this.matrix[2] + m.matrix[4] * this.matrix[5] + m.matrix[5] * this.matrix[8]; +265 +266 var m20 = m.matrix[6] * this.matrix[0] + m.matrix[7] * this.matrix[3] + m.matrix[8] * this.matrix[6]; +267 var m21 = m.matrix[6] * this.matrix[1] + m.matrix[7] * this.matrix[4] + m.matrix[8] * this.matrix[7]; +268 var m22 = m.matrix[6] * this.matrix[2] + m.matrix[7] * this.matrix[5] + m.matrix[8] * this.matrix[8]; +269 +270 this.matrix[0] = m00; +271 this.matrix[1] = m01; +272 this.matrix[2] = m02; +273 +274 this.matrix[3] = m10; +275 this.matrix[4] = m11; +276 this.matrix[5] = m12; +277 +278 this.matrix[6] = m20; +279 this.matrix[7] = m21; +280 this.matrix[8] = m22; +281 +282 +283 return this; +284 }, +285 /** +286 * Creates a new inverse matrix from this matrix. +287 * @return {CAAT.Matrix} an inverse matrix. +288 */ +289 getInverse:function () { +290 var tm = this.matrix; +291 +292 var m00 = tm[0]; +293 var m01 = tm[1]; +294 var m02 = tm[2]; +295 var m10 = tm[3]; +296 var m11 = tm[4]; +297 var m12 = tm[5]; +298 var m20 = tm[6]; +299 var m21 = tm[7]; +300 var m22 = tm[8]; +301 +302 var newMatrix = new CAAT.Math.Matrix(); +303 +304 var determinant = m00 * (m11 * m22 - m21 * m12) - m10 * (m01 * m22 - m21 * m02) + m20 * (m01 * m12 - m11 * m02); +305 if (determinant === 0) { +306 return null; +307 } +308 +309 var m = newMatrix.matrix; +310 +311 m[0] = m11 * m22 - m12 * m21; +312 m[1] = m02 * m21 - m01 * m22; +313 m[2] = m01 * m12 - m02 * m11; +314 +315 m[3] = m12 * m20 - m10 * m22; +316 m[4] = m00 * m22 - m02 * m20; +317 m[5] = m02 * m10 - m00 * m12; +318 +319 m[6] = m10 * m21 - m11 * m20; +320 m[7] = m01 * m20 - m00 * m21; +321 m[8] = m00 * m11 - m01 * m10; +322 +323 newMatrix.multiplyScalar(1 / determinant); +324 +325 return newMatrix; +326 }, +327 /** +328 * Multiply this matrix by a scalar. +329 * @param scalar {number} scalar value +330 * +331 * @return this +332 */ +333 multiplyScalar:function (scalar) { +334 var i; +335 +336 for (i = 0; i < 9; i++) { +337 this.matrix[i] *= scalar; +338 } 339 -340 /** -341 * -342 * @param ctx -343 */ -344 transformRenderingContextSet_NoClamp:function (ctx) { -345 var m = this.matrix; -346 ctx.setTransform(m[0], m[3], m[1], m[4], m[2], m[5]); -347 return this; -348 }, -349 -350 /** -351 * -352 * @param ctx -353 */ -354 transformRenderingContext_NoClamp:function (ctx) { -355 var m = this.matrix; -356 ctx.transform(m[0], m[3], m[1], m[4], m[2], m[5]); -357 return this; -358 }, -359 -360 /** -361 * -362 * @param ctx -363 */ -364 transformRenderingContextSet_Clamp:function (ctx) { -365 var m = this.matrix; -366 ctx.setTransform(m[0], m[3], m[1], m[4], m[2] >> 0, m[5] >> 0); -367 return this; -368 }, -369 -370 /** -371 * -372 * @param ctx -373 */ -374 transformRenderingContext_Clamp:function (ctx) { -375 var m = this.matrix; -376 ctx.transform(m[0], m[3], m[1], m[4], m[2] >> 0, m[5] >> 0); -377 return this; -378 }, -379 -380 setModelViewMatrix:function ( x, y, sx, sy, r ) { -381 var c, s, _m00, _m01, _m10, _m11; -382 var mm0, mm1, mm2, mm3, mm4, mm5; -383 var mm; -384 -385 mm = this.matrix; -386 -387 mm0 = 1; -388 mm1 = 0; -389 mm3 = 0; -390 mm4 = 1; -391 -392 mm2 = x; -393 mm5 = y; +340 return this; +341 }, +342 +343 /** +344 * +345 * @param ctx +346 */ +347 transformRenderingContextSet_NoClamp:function (ctx) { +348 var m = this.matrix; +349 ctx.setTransform(m[0], m[3], m[1], m[4], m[2], m[5]); +350 return this; +351 }, +352 +353 /** +354 * +355 * @param ctx +356 */ +357 transformRenderingContext_NoClamp:function (ctx) { +358 var m = this.matrix; +359 ctx.transform(m[0], m[3], m[1], m[4], m[2], m[5]); +360 return this; +361 }, +362 +363 /** +364 * +365 * @param ctx +366 */ +367 transformRenderingContextSet_Clamp:function (ctx) { +368 var m = this.matrix; +369 ctx.setTransform(m[0], m[3], m[1], m[4], m[2] >> 0, m[5] >> 0); +370 return this; +371 }, +372 +373 /** +374 * +375 * @param ctx +376 */ +377 transformRenderingContext_Clamp:function (ctx) { +378 var m = this.matrix; +379 ctx.transform(m[0], m[3], m[1], m[4], m[2] >> 0, m[5] >> 0); +380 return this; +381 }, +382 +383 setModelViewMatrix:function ( x, y, sx, sy, r ) { +384 var c, s, _m00, _m01, _m10, _m11; +385 var mm0, mm1, mm2, mm3, mm4, mm5; +386 var mm; +387 +388 mm = this.matrix; +389 +390 mm0 = 1; +391 mm1 = 0; +392 mm3 = 0; +393 mm4 = 1; 394 -395 c = Math.cos(r); -396 s = Math.sin(r); -397 _m00 = mm0; -398 _m01 = mm1; -399 _m10 = mm3; -400 _m11 = mm4; -401 mm0 = _m00 * c + _m01 * s; -402 mm1 = -_m00 * s + _m01 * c; -403 mm3 = _m10 * c + _m11 * s; -404 mm4 = -_m10 * s + _m11 * c; -405 -406 mm0 = mm0 * this.scaleX; -407 mm1 = mm1 * this.scaleY; -408 mm3 = mm3 * this.scaleX; -409 mm4 = mm4 * this.scaleY; -410 -411 mm[0] = mm0; -412 mm[1] = mm1; -413 mm[2] = mm2; -414 mm[3] = mm3; -415 mm[4] = mm4; -416 mm[5] = mm5; -417 } -418 } -419 } -420 }); -421 \ No newline at end of file +395 mm2 = x; +396 mm5 = y; +397 +398 c = Math.cos(r); +399 s = Math.sin(r); +400 _m00 = mm0; +401 _m01 = mm1; +402 _m10 = mm3; +403 _m11 = mm4; +404 mm0 = _m00 * c + _m01 * s; +405 mm1 = -_m00 * s + _m01 * c; +406 mm3 = _m10 * c + _m11 * s; +407 mm4 = -_m10 * s + _m11 * c; +408 +409 mm0 = mm0 * this.scaleX; +410 mm1 = mm1 * this.scaleY; +411 mm3 = mm3 * this.scaleX; +412 mm4 = mm4 * this.scaleY; +413 +414 mm[0] = mm0; +415 mm[1] = mm1; +416 mm[2] = mm2; +417 mm[3] = mm3; +418 mm[4] = mm4; +419 mm[5] = mm5; +420 } +421 } +422 } +423 }); +424 \ No newline at end of file diff --git a/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_math_point.js.html b/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_Math_Point.js.html similarity index 100% rename from documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_math_point.js.html rename to documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_Math_Point.js.html diff --git a/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_math_rectangle.js.html b/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_Math_Rectangle.js.html similarity index 83% rename from documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_math_rectangle.js.html rename to documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_Math_Rectangle.js.html index eda9bff9..5056c20a 100644 --- a/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_math_rectangle.js.html +++ b/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_Math_Rectangle.js.html @@ -30,193 +30,197 @@ 23 */ 24 25 __init : function( x,y,w,h ) { - 26 this.setLocation(x,y); - 27 this.setDimension(w,h); - 28 }, - 29 - 30 /** - 31 * Rectangle x position. - 32 */ - 33 x: 0, - 34 - 35 /** - 36 * Rectangle y position. - 37 */ - 38 y: 0, - 39 - 40 /** - 41 * Rectangle x1 position. - 42 */ - 43 x1: 0, - 44 - 45 /** - 46 * Rectangle y1 position. - 47 */ - 48 y1: 0, - 49 - 50 /** - 51 * Rectangle width. - 52 */ - 53 width: -1, - 54 - 55 /** - 56 * Rectangle height. - 57 */ - 58 height: -1, - 59 - 60 setEmpty : function() { - 61 this.width= -1; - 62 this.height= -1; - 63 this.x= 0; - 64 this.y= 0; - 65 this.x1= 0; - 66 this.y1= 0; - 67 return this; - 68 }, - 69 /** - 70 * Set this rectangle's location. - 71 * @param x {number} - 72 * @param y {number} - 73 */ - 74 setLocation: function( x,y ) { - 75 this.x= x; - 76 this.y= y; - 77 this.x1= this.x+this.width; - 78 this.y1= this.y+this.height; - 79 return this; - 80 }, - 81 /** - 82 * Set this rectangle's dimension. - 83 * @param w {number} - 84 * @param h {number} - 85 */ - 86 setDimension : function( w,h ) { - 87 this.width= w; - 88 this.height= h; - 89 this.x1= this.x+this.width; - 90 this.y1= this.y+this.height; - 91 return this; - 92 }, - 93 setBounds : function( x,y,w,h ) { - 94 this.setLocation( x, y ); - 95 this.setDimension( w, h ); - 96 return this; - 97 }, - 98 /** - 99 * Return whether the coordinate is inside this rectangle. -100 * @param px {number} -101 * @param py {number} -102 * -103 * @return {boolean} -104 */ -105 contains : function(px,py) { -106 //return px>=0 && px<this.width && py>=0 && py<this.height; -107 return px>=this.x && px<this.x1 && py>=this.y && py<this.y1; -108 }, -109 /** -110 * Return whether this rectangle is empty, that is, has zero dimension. -111 * @return {boolean} -112 */ -113 isEmpty : function() { -114 return this.width===-1 && this.height===-1; -115 }, -116 /** -117 * Set this rectangle as the union of this rectangle and the given point. -118 * @param px {number} -119 * @param py {number} -120 */ -121 union : function(px,py) { -122 -123 if ( this.isEmpty() ) { -124 this.x= px; -125 this.x1= px; -126 this.y= py; -127 this.y1= py; -128 this.width=0; -129 this.height=0; -130 return; -131 } -132 -133 this.x1= this.x+this.width; -134 this.y1= this.y+this.height; -135 -136 if ( py<this.y ) { -137 this.y= py; -138 } -139 if ( px<this.x ) { -140 this.x= px; -141 } -142 if ( py>this.y1 ) { -143 this.y1= py; -144 } -145 if ( px>this.x1 ){ -146 this.x1= px; -147 } -148 -149 this.width= this.x1-this.x; -150 this.height= this.y1-this.y; -151 }, -152 unionRectangle : function( rectangle ) { -153 this.union( rectangle.x , rectangle.y ); -154 this.union( rectangle.x1, rectangle.y ); -155 this.union( rectangle.x, rectangle.y1 ); -156 this.union( rectangle.x1, rectangle.y1 ); -157 return this; -158 }, -159 intersects : function( r ) { -160 if ( r.isEmpty() || this.isEmpty() ) { -161 return false; -162 } -163 -164 if ( r.x1<= this.x ) { + 26 if ( arguments.length!==4 ) { + 27 this.setEmpty(); + 28 } else { + 29 this.setLocation(x,y); + 30 this.setDimension(w,h); + 31 } + 32 }, + 33 + 34 /** + 35 * Rectangle x position. + 36 */ + 37 x: 0, + 38 + 39 /** + 40 * Rectangle y position. + 41 */ + 42 y: 0, + 43 + 44 /** + 45 * Rectangle x1 position. + 46 */ + 47 x1: 0, + 48 + 49 /** + 50 * Rectangle y1 position. + 51 */ + 52 y1: 0, + 53 + 54 /** + 55 * Rectangle width. + 56 */ + 57 width: -1, + 58 + 59 /** + 60 * Rectangle height. + 61 */ + 62 height: -1, + 63 + 64 setEmpty : function() { + 65 this.width= -1; + 66 this.height= -1; + 67 this.x= 0; + 68 this.y= 0; + 69 this.x1= 0; + 70 this.y1= 0; + 71 return this; + 72 }, + 73 /** + 74 * Set this rectangle's location. + 75 * @param x {number} + 76 * @param y {number} + 77 */ + 78 setLocation: function( x,y ) { + 79 this.x= x; + 80 this.y= y; + 81 this.x1= this.x+this.width; + 82 this.y1= this.y+this.height; + 83 return this; + 84 }, + 85 /** + 86 * Set this rectangle's dimension. + 87 * @param w {number} + 88 * @param h {number} + 89 */ + 90 setDimension : function( w,h ) { + 91 this.width= w; + 92 this.height= h; + 93 this.x1= this.x+this.width; + 94 this.y1= this.y+this.height; + 95 return this; + 96 }, + 97 setBounds : function( x,y,w,h ) { + 98 this.setLocation( x, y ); + 99 this.setDimension( w, h ); +100 return this; +101 }, +102 /** +103 * Return whether the coordinate is inside this rectangle. +104 * @param px {number} +105 * @param py {number} +106 * +107 * @return {boolean} +108 */ +109 contains : function(px,py) { +110 //return px>=0 && px<this.width && py>=0 && py<this.height; +111 return px>=this.x && px<this.x1 && py>=this.y && py<this.y1; +112 }, +113 /** +114 * Return whether this rectangle is empty, that is, has zero dimension. +115 * @return {boolean} +116 */ +117 isEmpty : function() { +118 return this.width===-1 && this.height===-1; +119 }, +120 /** +121 * Set this rectangle as the union of this rectangle and the given point. +122 * @param px {number} +123 * @param py {number} +124 */ +125 union : function(px,py) { +126 +127 if ( this.isEmpty() ) { +128 this.x= px; +129 this.x1= px; +130 this.y= py; +131 this.y1= py; +132 this.width=0; +133 this.height=0; +134 return; +135 } +136 +137 this.x1= this.x+this.width; +138 this.y1= this.y+this.height; +139 +140 if ( py<this.y ) { +141 this.y= py; +142 } +143 if ( px<this.x ) { +144 this.x= px; +145 } +146 if ( py>this.y1 ) { +147 this.y1= py; +148 } +149 if ( px>this.x1 ){ +150 this.x1= px; +151 } +152 +153 this.width= this.x1-this.x; +154 this.height= this.y1-this.y; +155 }, +156 unionRectangle : function( rectangle ) { +157 this.union( rectangle.x , rectangle.y ); +158 this.union( rectangle.x1, rectangle.y ); +159 this.union( rectangle.x, rectangle.y1 ); +160 this.union( rectangle.x1, rectangle.y1 ); +161 return this; +162 }, +163 intersects : function( r ) { +164 if ( r.isEmpty() || this.isEmpty() ) { 165 return false; 166 } -167 if ( r.x >= this.x1 ) { -168 return false; -169 } -170 if ( r.y1<= this.y ) { -171 return false; -172 } -173 -174 return r.y < this.y1; -175 }, -176 -177 intersectsRect : function( x,y,w,h ) { -178 if ( -1===w || -1===h ) { -179 return false; -180 } -181 -182 var x1= x+w-1; -183 var y1= y+h-1; -184 -185 if ( x1< this.x ) { -186 return false; -187 } -188 if ( x > this.x1 ) { -189 return false; -190 } -191 if ( y1< this.y ) { -192 return false; -193 } -194 return y <= this.y1; -195 -196 }, -197 -198 intersect : function( i, r ) { -199 if ( typeof r==='undefined' ) { -200 r= new CAAT.Math.Rectangle(); -201 } -202 -203 r.x= Math.max( this.x, i.x ); -204 r.y= Math.max( this.y, i.y ); -205 r.x1=Math.min( this.x1, i.x1 ); -206 r.y1=Math.min( this.y1, i.y1 ); -207 r.width= r.x1-r.x; -208 r.height=r.y1-r.y; -209 -210 return r; -211 } -212 } -213 } -214 }); -215 \ No newline at end of file +167 +168 if ( r.x1<= this.x ) { +169 return false; +170 } +171 if ( r.x >= this.x1 ) { +172 return false; +173 } +174 if ( r.y1<= this.y ) { +175 return false; +176 } +177 +178 return r.y < this.y1; +179 }, +180 +181 intersectsRect : function( x,y,w,h ) { +182 if ( -1===w || -1===h ) { +183 return false; +184 } +185 +186 var x1= x+w-1; +187 var y1= y+h-1; +188 +189 if ( x1< this.x ) { +190 return false; +191 } +192 if ( x > this.x1 ) { +193 return false; +194 } +195 if ( y1< this.y ) { +196 return false; +197 } +198 return y <= this.y1; +199 +200 }, +201 +202 intersect : function( i, r ) { +203 if ( typeof r==='undefined' ) { +204 r= new CAAT.Math.Rectangle(); +205 } +206 +207 r.x= Math.max( this.x, i.x ); +208 r.y= Math.max( this.y, i.y ); +209 r.x1=Math.min( this.x1, i.x1 ); +210 r.y1=Math.min( this.y1, i.y1 ); +211 r.width= r.x1-r.x; +212 r.height=r.y1-r.y; +213 +214 return r; +215 } +216 } +217 } +218 }); +219 \ No newline at end of file diff --git a/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_Modules_Audio_AudioManager.js.html b/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_Modules_Audio_AudioManager.js.html index b6d6a774..706bd098 100644 --- a/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_Modules_Audio_AudioManager.js.html +++ b/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_Modules_Audio_AudioManager.js.html @@ -32,497 +32,539 @@ 25 */ 26 27 defines:"CAAT.Module.Audio.AudioManager", - 28 depends:[ - 29 "CAAT.Module.Runtime.BrowserInfo" - 30 ], - 31 extendsWith:function () { - 32 return { - 33 - 34 /** - 35 * @lends CAAT.Module.Audio.AudioManager.prototype - 36 */ - 37 - 38 __init:function () { - 39 this.browserInfo = CAAT.Module.Runtime.BrowserInfo; - 40 return this; - 41 }, - 42 - 43 /** - 44 * The only background music audio channel. - 45 */ - 46 musicChannel: null, - 47 - 48 /** - 49 * Some browser info needed to know whether we´re in FF so we can fix the loop bug. - 50 */ - 51 browserInfo:null, - 52 - 53 /** - 54 * Is music enabled ? - 55 */ - 56 musicEnabled:true, - 57 - 58 /** - 59 * Are FX sounds enabled ? - 60 */ - 61 fxEnabled:true, - 62 - 63 /** - 64 * A collection of Audio objects. - 65 */ - 66 audioCache:null, - 67 - 68 /** - 69 * A cache of empty Audio objects. - 70 */ - 71 channels:null, - 72 - 73 /** - 74 * Currently used Audio objects. - 75 */ - 76 workingChannels:null, - 77 - 78 /** - 79 * Currently looping Audio objects. + 28 extendsWith:function () { + 29 return { + 30 + 31 /** + 32 * @lends CAAT.Module.Audio.AudioManager.prototype + 33 */ + 34 + 35 __init:function () { + 36 this.isFirefox= navigator.userAgent.match(/Firefox/g)!==null; + 37 return this; + 38 }, + 39 + 40 isFirefox : false, + 41 + 42 /** + 43 * The only background music audio channel. + 44 */ + 45 musicChannel: null, + 46 + 47 /** + 48 * Is music enabled ? + 49 */ + 50 musicEnabled:true, + 51 + 52 /** + 53 * Are FX sounds enabled ? + 54 */ + 55 fxEnabled:true, + 56 + 57 /** + 58 * A collection of Audio objects. + 59 */ + 60 audioCache:null, + 61 + 62 /** + 63 * A cache of empty Audio objects. + 64 */ + 65 channels:null, + 66 + 67 /** + 68 * Currently used Audio objects. + 69 */ + 70 workingChannels:null, + 71 + 72 /** + 73 * Currently looping Audio objects. + 74 */ + 75 loopingChannels:[], + 76 + 77 /** + 78 * available formats for audio elements. + 79 * the system will load audio files with the extensions in this preferred order. 80 */ - 81 loopingChannels:[], - 82 - 83 /** - 84 * Audio formats. - 85 * @dict - 86 */ - 87 audioTypes:{ // supported audio formats. Don't remember where i took them from :S - 88 'mp3':'audio/mpeg;', - 89 'ogg':'audio/ogg; codecs="vorbis"', - 90 'wav':'audio/wav; codecs="1"', - 91 'mp4':'audio/mp4; codecs="mp4a.40.2"' - 92 }, - 93 - 94 /** - 95 * Initializes the sound subsystem by creating a fixed number of Audio channels. - 96 * Every channel registers a handler for sound playing finalization. If a callback is set, the - 97 * callback function will be called with the associated sound id in the cache. - 98 * - 99 * @param numChannels {number} number of channels to pre-create. 8 by default. -100 * -101 * @return this. -102 */ -103 initialize:function (numChannels) { -104 -105 this.audioCache = []; -106 this.channels = []; -107 this.workingChannels = []; -108 -109 for (var i = 0; i <= numChannels; i++) { -110 var channel = document.createElement('audio'); -111 -112 if (null !== channel) { -113 channel.finished = -1; -114 this.channels.push(channel); -115 var me = this; -116 channel.addEventListener( -117 'ended', -118 // on sound end, set channel to available channels list. -119 function (audioEvent) { -120 var target = audioEvent.target; -121 var i; -122 -123 // remove from workingChannels -124 for (i = 0; i < me.workingChannels.length; i++) { -125 if (me.workingChannels[i] === target) { -126 me.workingChannels.splice(i, 1); -127 break; -128 } -129 } -130 -131 if (target.caat_callback) { -132 target.caat_callback(target.caat_id); -133 } -134 -135 // set back to channels. -136 me.channels.push(target); -137 }, -138 false -139 ); -140 } -141 } -142 -143 this.musicChannel= this.channels.pop(); + 81 audioFormatExtensions : [ + 82 'ogg', + 83 'wav', + 84 'x-wav', + 85 'mp3' + 86 ], + 87 + 88 currentAudioFormatExtension : 'ogg', + 89 + 90 /** + 91 * Audio formats. + 92 * @dict + 93 */ + 94 audioTypes:{ // supported audio formats. Don't remember where i took them from :S + 95 'ogg': 'audio/ogg', + 96 'mp3': 'audio/mpeg;', + 97 'wav': 'audio/wav', + 98 'x-wav':'audio/x-wav', + 99 'mp4': 'audio/mp4"' +100 }, +101 +102 /** +103 * Initializes the sound subsystem by creating a fixed number of Audio channels. +104 * Every channel registers a handler for sound playing finalization. If a callback is set, the +105 * callback function will be called with the associated sound id in the cache. +106 * +107 * @param numChannels {number} number of channels to pre-create. 8 by default. +108 * +109 * @return this. +110 */ +111 initialize:function (numChannels ) { +112 +113 this.setAudioFormatExtensions( this.audioFormatExtensions ); +114 +115 this.audioCache = []; +116 this.channels = []; +117 this.workingChannels = []; +118 +119 for (var i = 0; i <= numChannels; i++) { +120 var channel = document.createElement('audio'); +121 +122 if (null !== channel) { +123 channel.finished = -1; +124 this.channels.push(channel); +125 var me = this; +126 channel.addEventListener( +127 'ended', +128 // on sound end, set channel to available channels list. +129 function (audioEvent) { +130 var target = audioEvent.target; +131 var i; +132 +133 // remove from workingChannels +134 for (i = 0; i < me.workingChannels.length; i++) { +135 if (me.workingChannels[i] === target) { +136 me.workingChannels.splice(i, 1); +137 break; +138 } +139 } +140 +141 if (target.caat_callback) { +142 target.caat_callback(target.caat_id); +143 } 144 -145 return this; -146 }, -147 /** -148 * Tries to add an audio tag to the available list of valid audios. The audio is described by a url. -149 * @param id {object} an object to associate the audio element (if suitable to be played). -150 * @param url {string} a string describing an url. -151 * @param endplaying_callback {function} callback to be called upon sound end. -152 * -153 * @return {boolean} a boolean indicating whether the browser can play this resource. -154 * -155 * @private -156 */ -157 addAudioFromURL:function (id, url, endplaying_callback) { -158 var extension = null; -159 var audio = document.createElement('audio'); -160 -161 if (null !== audio) { -162 -163 if (!audio.canPlayType) { -164 return false; -165 } -166 -167 extension = url.substr(url.lastIndexOf('.') + 1); -168 var canplay = audio.canPlayType(this.audioTypes[extension]); -169 -170 if (canplay !== "" && canplay !== "no") { -171 audio.src = url; -172 audio.preload = "auto"; -173 audio.load(); -174 if (endplaying_callback) { -175 audio.caat_callback = endplaying_callback; -176 audio.caat_id = id; -177 } -178 this.audioCache.push({ id:id, audio:audio }); +145 // set back to channels. +146 me.channels.push(target); +147 }, +148 false +149 ); +150 } +151 } +152 +153 this.musicChannel= this.channels.pop(); +154 +155 return this; +156 }, +157 +158 setAudioFormatExtensions : function( formats ) { +159 this.audioFormatExtensions= formats; +160 this.__setCurrentAudioFormatExtension(); +161 return this; +162 }, +163 +164 __setCurrentAudioFormatExtension : function( ) { +165 +166 var audio= new Audio(); +167 +168 for( var i= 0, l=this.audioFormatExtensions.length; i<l; i+=1 ) { +169 var res= audio.canPlayType( this.audioTypes[this.audioFormatExtensions[i]]).toLowerCase(); +170 if ( res!=="no" && res!=="" ) { +171 this.currentAudioFormatExtension= this.audioFormatExtensions[i]; +172 console.log("Audio type set to: "+this.currentAudioFormatExtension); +173 return; +174 } +175 } +176 +177 this.currentAudioFormatExtension= null; +178 }, 179 -180 return true; -181 } -182 } -183 -184 return false; -185 }, -186 /** -187 * Tries to add an audio tag to the available list of valid audios. The audio element comes from -188 * an HTMLAudioElement. -189 * @param id {object} an object to associate the audio element (if suitable to be played). -190 * @param audio {HTMLAudioElement} a DOM audio node. -191 * @param endplaying_callback {function} callback to be called upon sound end. -192 * -193 * @return {boolean} a boolean indicating whether the browser can play this resource. -194 * -195 * @private -196 */ -197 addAudioFromDomNode:function (id, audio, endplaying_callback) { -198 -199 var extension = audio.src.substr(audio.src.lastIndexOf('.') + 1); -200 if (audio.canPlayType(this.audioTypes[extension])) { -201 if (endplaying_callback) { -202 audio.caat_callback = endplaying_callback; -203 audio.caat_id = id; -204 } -205 this.audioCache.push({ id:id, audio:audio }); -206 -207 return true; -208 } -209 -210 return false; -211 }, -212 /** -213 * Adds an elements to the audio cache. -214 * @param id {object} an object to associate the audio element (if suitable to be played). -215 * @param element {URL|HTMLElement} an url or html audio tag. -216 * @param endplaying_callback {function} callback to be called upon sound end. -217 * -218 * @return {boolean} a boolean indicating whether the browser can play this resource. -219 * -220 * @private -221 */ -222 addAudioElement:function (id, element, endplaying_callback) { -223 if (typeof element === "string") { -224 return this.addAudioFromURL(id, element, endplaying_callback); -225 } else { -226 try { -227 if (element instanceof HTMLAudioElement) { -228 return this.addAudioFromDomNode(id, element, endplaying_callback); -229 } -230 } -231 catch (e) { -232 } -233 } -234 -235 return false; -236 }, -237 /** -238 * creates an Audio object and adds it to the audio cache. -239 * This function expects audio data described by two elements, an id and an object which will -240 * describe an audio element to be associated with the id. The object will be of the form -241 * array, dom node or a url string. -242 * -243 * <p> -244 * The audio element can be one of the two forms: -245 * -246 * <ol> -247 * <li>Either an HTMLAudioElement/Audio object or a string url. -248 * <li>An array of elements of the previous form. -249 * </ol> -250 * -251 * <p> -252 * When the audio attribute is an array, this function will iterate throught the array elements -253 * until a suitable audio element to be played is found. When this is the case, the other array -254 * elements won't be taken into account. The valid form of using this addAudio method will be: -255 * -256 * <p> -257 * 1.<br> -258 * addAudio( id, url } ). In this case, if the resource pointed by url is -259 * not suitable to be played (i.e. a call to the Audio element's canPlayType method return 'no') -260 * no resource will be added under such id, so no sound will be played when invoking the play(id) -261 * method. -262 * <p> -263 * 2.<br> -264 * addAudio( id, dom_audio_tag ). In this case, the same logic than previous case is applied, but -265 * this time, the parameter url is expected to be an audio tag present in the html file. -266 * <p> -267 * 3.<br> -268 * addAudio( id, [array_of_url_or_domaudiotag] ). In this case, the function tries to locate a valid -269 * resource to be played in any of the elements contained in the array. The array element's can -270 * be any type of case 1 and 2. As soon as a valid resource is found, it will be associated to the -271 * id in the valid audio resources to be played list. -272 * -273 * @return this -274 */ -275 addAudio:function (id, array_of_url_or_domnodes, endplaying_callback) { -276 -277 if (array_of_url_or_domnodes instanceof Array) { -278 /* -279 iterate throught array elements until we can safely add an audio element. -280 */ -281 for (var i = 0; i < array_of_url_or_domnodes.length; i++) { -282 if (this.addAudioElement(id, array_of_url_or_domnodes[i], endplaying_callback)) { -283 break; -284 } -285 } -286 } else { -287 this.addAudioElement(id, array_of_url_or_domnodes, endplaying_callback); -288 } -289 -290 return this; -291 }, -292 /** -293 * Returns an audio object. -294 * @param aId {object} the id associated to the target Audio object. -295 * @return {object} the HTMLAudioElement addociated to the given id. -296 */ -297 getAudio:function (aId) { -298 for (var i = 0; i < this.audioCache.length; i++) { -299 if (this.audioCache[i].id === aId) { -300 return this.audioCache[i].audio; -301 } -302 } -303 -304 return null; -305 }, -306 -307 stopMusic : function() { -308 this.musicChannel.pause(); -309 }, -310 -311 playMusic : function(id) { -312 if (!this.musicEnabled) { -313 return null; -314 } -315 -316 var audio_in_cache = this.getAudio(id); -317 // existe el audio, y ademas hay un canal de audio disponible. -318 if (null !== audio_in_cache) { -319 var audio =this.musicChannel; -320 if (null !== audio) { -321 audio.src = audio_in_cache.src; -322 audio.preload = "auto"; -323 -324 if (this.browserInfo.browser === 'Firefox') { -325 audio.addEventListener( -326 'ended', -327 // on sound end, restart music. -328 function (audioEvent) { -329 var target = audioEvent.target; -330 target.currentTime = 0; -331 }, -332 false -333 ); -334 } else { -335 audio.loop = true; -336 } -337 audio.load(); -338 audio.play(); -339 return audio; -340 } -341 } -342 -343 return null; -344 }, -345 -346 /** -347 * Set an audio object volume. -348 * @param id {object} an audio Id -349 * @param volume {number} volume to set. The volume value is not checked. -350 * -351 * @return this -352 */ -353 setVolume:function (id, volume) { -354 var audio = this.getAudio(id); -355 if (null != audio) { -356 audio.volume = volume; -357 } -358 -359 return this; -360 }, -361 -362 /** -363 * Plays an audio file from the cache if any sound channel is available. -364 * The playing sound will occupy a sound channel and when ends playing will leave -365 * the channel free for any other sound to be played in. -366 * @param id {object} an object identifying a sound in the sound cache. -367 * @return { id: {Object}, audio: {(Audio|HTMLAudioElement)} } -368 */ -369 play:function (id) { -370 if (!this.fxEnabled) { -371 return null; -372 } -373 -374 var audio = this.getAudio(id); -375 // existe el audio, y ademas hay un canal de audio disponible. -376 if (null !== audio && this.channels.length > 0) { -377 var channel = this.channels.shift(); -378 channel.src = audio.src; -379 // channel.load(); -380 channel.volume = audio.volume; -381 channel.play(); -382 this.workingChannels.push(channel); -383 } -384 -385 return audio; -386 }, -387 -388 /** -389 * cancel all instances of a sound identified by id. This id is the value set -390 * to identify a sound. -391 * @param id -392 * @return {*} -393 */ -394 cancelPlay : function(id) { -395 -396 for( var i=0 ; this.workingChannels.length; i++ ) { -397 var audio= this.workingChannels[i]; -398 if ( audio.caat_id===id ) { -399 audio.pause(); -400 this.channels.push(audio); -401 this.workingChannels.splice(i,1); -402 } -403 } -404 -405 return this; -406 }, -407 -408 /** -409 * cancel a channel sound -410 * @param audioObject -411 * @return {*} -412 */ -413 cancelPlayByChannel : function(audioObject) { -414 -415 for( var i=0 ; this.workingChannels.length; i++ ) { -416 if ( this.workingChannels[i]===audioObject ) { -417 this.channels.push(audioObject); -418 this.workingChannels.splice(i,1); -419 return this; -420 } -421 } -422 -423 return this; -424 }, -425 -426 /** -427 * This method creates a new AudioChannel to loop the sound with. -428 * It returns an Audio object so that the developer can cancel the sound loop at will. -429 * The user must call <code>pause()</code> method to stop playing a loop. -430 * <p> -431 * Firefox does not honor the loop property, so looping is performed by attending end playing -432 * event on audio elements. -433 * -434 * @return {HTMLElement} an Audio instance if a valid sound id is supplied. Null otherwise +180 __getAudioUrl : function( url ) { +181 +182 if ( this.currentAudioFormatExtension===null ) { +183 return url; +184 } +185 +186 var lio= url.lastIndexOf( "." ); +187 if ( lio<0 ) { +188 console.log("Audio w/o extension: "+url); +189 lio= url.length()-1; +190 } +191 +192 var uri= url.substring( 0, lio+1 ) + this.currentAudioFormatExtension; +193 return uri; +194 }, +195 +196 /** +197 * Tries to add an audio tag to the available list of valid audios. The audio is described by a url. +198 * @param id {object} an object to associate the audio element (if suitable to be played). +199 * @param url {string} a string describing an url. +200 * @param endplaying_callback {function} callback to be called upon sound end. +201 * +202 * @return {boolean} a boolean indicating whether the browser can play this resource. +203 * +204 * @private +205 */ +206 addAudioFromURL:function (id, url, endplaying_callback) { +207 var audio = document.createElement('audio'); +208 +209 if (null !== audio) { +210 +211 audio.src = this.__getAudioUrl(url); +212 console.log("Loading audio: "+audio.src); +213 audio.preload = "auto"; +214 audio.load(); +215 if (endplaying_callback) { +216 audio.caat_callback = endplaying_callback; +217 audio.caat_id = id; +218 } +219 this.audioCache.push({ id:id, audio:audio }); +220 +221 return true; +222 } +223 +224 return false; +225 }, +226 /** +227 * Tries to add an audio tag to the available list of valid audios. The audio element comes from +228 * an HTMLAudioElement. +229 * @param id {object} an object to associate the audio element (if suitable to be played). +230 * @param audio {HTMLAudioElement} a DOM audio node. +231 * @param endplaying_callback {function} callback to be called upon sound end. +232 * +233 * @return {boolean} a boolean indicating whether the browser can play this resource. +234 * +235 * @private +236 */ +237 addAudioFromDomNode:function (id, audio, endplaying_callback) { +238 +239 var extension = audio.src.substr(audio.src.lastIndexOf('.') + 1); +240 if (audio.canPlayType(this.audioTypes[extension])) { +241 if (endplaying_callback) { +242 audio.caat_callback = endplaying_callback; +243 audio.caat_id = id; +244 } +245 this.audioCache.push({ id:id, audio:audio }); +246 +247 return true; +248 } +249 +250 return false; +251 }, +252 /** +253 * Adds an elements to the audio cache. +254 * @param id {object} an object to associate the audio element (if suitable to be played). +255 * @param element {URL|HTMLElement} an url or html audio tag. +256 * @param endplaying_callback {function} callback to be called upon sound end. +257 * +258 * @return {boolean} a boolean indicating whether the browser can play this resource. +259 * +260 * @private +261 */ +262 addAudioElement:function (id, element, endplaying_callback) { +263 if (typeof element === "string") { +264 return this.addAudioFromURL(id, element, endplaying_callback); +265 } else { +266 try { +267 if (element instanceof HTMLAudioElement) { +268 return this.addAudioFromDomNode(id, element, endplaying_callback); +269 } +270 } +271 catch (e) { +272 } +273 } +274 +275 return false; +276 }, +277 /** +278 * creates an Audio object and adds it to the audio cache. +279 * This function expects audio data described by two elements, an id and an object which will +280 * describe an audio element to be associated with the id. The object will be of the form +281 * array, dom node or a url string. +282 * +283 * <p> +284 * The audio element can be one of the two forms: +285 * +286 * <ol> +287 * <li>Either an HTMLAudioElement/Audio object or a string url. +288 * <li>An array of elements of the previous form. +289 * </ol> +290 * +291 * <p> +292 * When the audio attribute is an array, this function will iterate throught the array elements +293 * until a suitable audio element to be played is found. When this is the case, the other array +294 * elements won't be taken into account. The valid form of using this addAudio method will be: +295 * +296 * <p> +297 * 1.<br> +298 * addAudio( id, url } ). In this case, if the resource pointed by url is +299 * not suitable to be played (i.e. a call to the Audio element's canPlayType method return 'no') +300 * no resource will be added under such id, so no sound will be played when invoking the play(id) +301 * method. +302 * <p> +303 * 2.<br> +304 * addAudio( id, dom_audio_tag ). In this case, the same logic than previous case is applied, but +305 * this time, the parameter url is expected to be an audio tag present in the html file. +306 * <p> +307 * 3.<br> +308 * addAudio( id, [array_of_url_or_domaudiotag] ). In this case, the function tries to locate a valid +309 * resource to be played in any of the elements contained in the array. The array element's can +310 * be any type of case 1 and 2. As soon as a valid resource is found, it will be associated to the +311 * id in the valid audio resources to be played list. +312 * +313 * @return this +314 */ +315 addAudio:function (id, array_of_url_or_domnodes, endplaying_callback) { +316 +317 if (array_of_url_or_domnodes instanceof Array) { +318 /* +319 iterate throught array elements until we can safely add an audio element. +320 */ +321 for (var i = 0; i < array_of_url_or_domnodes.length; i++) { +322 if (this.addAudioElement(id, array_of_url_or_domnodes[i], endplaying_callback)) { +323 break; +324 } +325 } +326 } else { +327 this.addAudioElement(id, array_of_url_or_domnodes, endplaying_callback); +328 } +329 +330 return this; +331 }, +332 /** +333 * Returns an audio object. +334 * @param aId {object} the id associated to the target Audio object. +335 * @return {object} the HTMLAudioElement addociated to the given id. +336 */ +337 getAudio:function (aId) { +338 for (var i = 0; i < this.audioCache.length; i++) { +339 if (this.audioCache[i].id === aId) { +340 return this.audioCache[i].audio; +341 } +342 } +343 +344 return null; +345 }, +346 +347 stopMusic : function() { +348 this.musicChannel.pause(); +349 }, +350 +351 playMusic : function(id) { +352 if (!this.musicEnabled) { +353 return null; +354 } +355 +356 var audio_in_cache = this.getAudio(id); +357 // existe el audio, y ademas hay un canal de audio disponible. +358 if (null !== audio_in_cache) { +359 var audio =this.musicChannel; +360 if (null !== audio) { +361 audio.src = audio_in_cache.src; +362 audio.preload = "auto"; +363 +364 if (this.isFirefox) { +365 audio.addEventListener( +366 'ended', +367 // on sound end, restart music. +368 function (audioEvent) { +369 var target = audioEvent.target; +370 target.currentTime = 0; +371 }, +372 false +373 ); +374 } else { +375 audio.loop = true; +376 } +377 audio.load(); +378 audio.play(); +379 return audio; +380 } +381 } +382 +383 return null; +384 }, +385 +386 /** +387 * Set an audio object volume. +388 * @param id {object} an audio Id +389 * @param volume {number} volume to set. The volume value is not checked. +390 * +391 * @return this +392 */ +393 setVolume:function (id, volume) { +394 var audio = this.getAudio(id); +395 if (null != audio) { +396 audio.volume = volume; +397 } +398 +399 return this; +400 }, +401 +402 /** +403 * Plays an audio file from the cache if any sound channel is available. +404 * The playing sound will occupy a sound channel and when ends playing will leave +405 * the channel free for any other sound to be played in. +406 * @param id {object} an object identifying a sound in the sound cache. +407 * @return { id: {Object}, audio: {(Audio|HTMLAudioElement)} } +408 */ +409 play:function (id) { +410 if (!this.fxEnabled) { +411 return null; +412 } +413 +414 var audio = this.getAudio(id); +415 // existe el audio, y ademas hay un canal de audio disponible. +416 if (null !== audio && this.channels.length > 0) { +417 var channel = this.channels.shift(); +418 channel.src = audio.src; +419 // channel.load(); +420 channel.volume = audio.volume; +421 channel.play(); +422 this.workingChannels.push(channel); +423 } else { +424 console.log("Can't play audio: "+id); +425 } +426 +427 return audio; +428 }, +429 +430 /** +431 * cancel all instances of a sound identified by id. This id is the value set +432 * to identify a sound. +433 * @param id +434 * @return {*} 435 */ -436 loop:function (id) { +436 cancelPlay : function(id) { 437 -438 if (!this.musicEnabled) { -439 return null; -440 } -441 -442 var audio_in_cache = this.getAudio(id); -443 // existe el audio, y ademas hay un canal de audio disponible. -444 if (null !== audio_in_cache) { -445 var audio = document.createElement('audio'); -446 if (null !== audio) { -447 audio.src = audio_in_cache.src; -448 audio.preload = "auto"; +438 for( var i=0 ; this.workingChannels.length; i++ ) { +439 var audio= this.workingChannels[i]; +440 if ( audio.caat_id===id ) { +441 audio.pause(); +442 this.channels.push(audio); +443 this.workingChannels.splice(i,1); +444 } +445 } +446 +447 return this; +448 }, 449 -450 if (this.browserInfo.browser === 'Firefox') { -451 audio.addEventListener( -452 'ended', -453 // on sound end, set channel to available channels list. -454 function (audioEvent) { -455 var target = audioEvent.target; -456 target.currentTime = 0; -457 }, -458 false -459 ); -460 } else { -461 audio.loop = true; -462 } -463 audio.load(); -464 audio.play(); -465 this.loopingChannels.push(audio); -466 return audio; -467 } -468 } -469 -470 return null; -471 }, -472 /** -473 * Cancel all playing audio channels -474 * Get back the playing channels to available channel list. +450 /** +451 * cancel a channel sound +452 * @param audioObject +453 * @return {*} +454 */ +455 cancelPlayByChannel : function(audioObject) { +456 +457 for( var i=0 ; this.workingChannels.length; i++ ) { +458 if ( this.workingChannels[i]===audioObject ) { +459 this.channels.push(audioObject); +460 this.workingChannels.splice(i,1); +461 return this; +462 } +463 } +464 +465 return this; +466 }, +467 +468 /** +469 * This method creates a new AudioChannel to loop the sound with. +470 * It returns an Audio object so that the developer can cancel the sound loop at will. +471 * The user must call <code>pause()</code> method to stop playing a loop. +472 * <p> +473 * Firefox does not honor the loop property, so looping is performed by attending end playing +474 * event on audio elements. 475 * -476 * @return this +476 * @return {HTMLElement} an Audio instance if a valid sound id is supplied. Null otherwise 477 */ -478 endSound:function () { -479 var i; -480 for (i = 0; i < this.workingChannels.length; i++) { -481 this.workingChannels[i].pause(); -482 this.channels.push(this.workingChannels[i]); -483 } -484 -485 for (i = 0; i < this.loopingChannels.length; i++) { -486 this.loopingChannels[i].pause(); -487 } -488 -489 this.workingChannels= []; -490 this.loopingChannels= []; +478 loop:function (id) { +479 +480 if (!this.musicEnabled) { +481 return null; +482 } +483 +484 var audio_in_cache = this.getAudio(id); +485 // existe el audio, y ademas hay un canal de audio disponible. +486 if (null !== audio_in_cache) { +487 var audio = document.createElement('audio'); +488 if (null !== audio) { +489 audio.src = audio_in_cache.src; +490 audio.preload = "auto"; 491 -492 this.stopMusic(); -493 -494 return this; -495 }, -496 setSoundEffectsEnabled:function (enable) { -497 this.fxEnabled = enable; -498 for (var i = 0; i < this.loopingChannels.length; i++) { -499 if (enable) { -500 this.loopingChannels[i].play(); -501 } else { -502 this.loopingChannels[i].pause(); -503 } -504 } -505 return this; -506 }, -507 isSoundEffectsEnabled:function () { -508 return this.fxEnabled; -509 }, -510 setMusicEnabled:function (enable) { -511 this.musicEnabled = enable; -512 this.stopMusic(); -513 return this; -514 }, -515 isMusicEnabled:function () { -516 return this.musicEnabled; -517 } -518 } -519 } -520 }); -521 \ No newline at end of file +492 if (this.isFirefox) { +493 audio.addEventListener( +494 'ended', +495 // on sound end, set channel to available channels list. +496 function (audioEvent) { +497 var target = audioEvent.target; +498 target.currentTime = 0; +499 }, +500 false +501 ); +502 } else { +503 audio.loop = true; +504 } +505 audio.load(); +506 audio.play(); +507 this.loopingChannels.push(audio); +508 return audio; +509 } +510 } +511 +512 return null; +513 }, +514 /** +515 * Cancel all playing audio channels +516 * Get back the playing channels to available channel list. +517 * +518 * @return this +519 */ +520 endSound:function () { +521 var i; +522 for (i = 0; i < this.workingChannels.length; i++) { +523 this.workingChannels[i].pause(); +524 this.channels.push(this.workingChannels[i]); +525 } +526 +527 for (i = 0; i < this.loopingChannels.length; i++) { +528 this.loopingChannels[i].pause(); +529 } +530 +531 this.workingChannels= []; +532 this.loopingChannels= []; +533 +534 this.stopMusic(); +535 +536 return this; +537 }, +538 setSoundEffectsEnabled:function (enable) { +539 this.fxEnabled = enable; +540 for (var i = 0; i < this.loopingChannels.length; i++) { +541 if (enable) { +542 this.loopingChannels[i].play(); +543 } else { +544 this.loopingChannels[i].pause(); +545 } +546 } +547 return this; +548 }, +549 isSoundEffectsEnabled:function () { +550 return this.fxEnabled; +551 }, +552 setMusicEnabled:function (enable) { +553 this.musicEnabled = enable; +554 this.stopMusic(); +555 return this; +556 }, +557 isMusicEnabled:function () { +558 return this.musicEnabled; +559 } +560 } +561 } +562 }); +563 \ No newline at end of file diff --git a/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_modules_CircleManager_PackedCircle.js.html b/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_Modules_CircleManager_PackedCircle.js.html similarity index 100% rename from documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_modules_CircleManager_PackedCircle.js.html rename to documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_Modules_CircleManager_PackedCircle.js.html diff --git a/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_modules_CircleManager_PackedCircleManager.js.html b/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_Modules_CircleManager_PackedCircleManager.js.html similarity index 100% rename from documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_modules_CircleManager_PackedCircleManager.js.html rename to documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_Modules_CircleManager_PackedCircleManager.js.html diff --git a/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_modules_Font_font.js.html b/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_Modules_Font_Font.js.html similarity index 97% rename from documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_modules_Font_font.js.html rename to documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_Modules_Font_Font.js.html index 85753834..6cda3778 100644 --- a/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_modules_Font_font.js.html +++ b/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_Modules_Font_Font.js.html @@ -51,7 +51,7 @@ 44 45 getFontMetricsNoCSS:function (font) { 46 - 47 var re = /(\d+)p[x|t]/i; + 47 var re = /(\d+)p[x|t]\s*/i; 48 var res = re.exec(font); 49 50 var height; @@ -274,113 +274,114 @@ 267 } 268 this.charMap[cchar] = { 269 x:x + padding, -270 width:charWidth[i] - 2 * padding -271 }; -272 x += charWidth[i]; -273 } -274 -275 this.image = canvas; -276 -277 return this; -278 }, -279 -280 setAsSpriteImage:function () { -281 var cm = []; -282 var _index = 0; -283 for (var i in this.charMap) { -284 var _char = i; -285 var charData = this.charMap[i]; -286 -287 cm[i] = { -288 id:_index++, -289 height:this.height, -290 xoffset:0, -291 letter:_char, -292 yoffset:0, -293 width:charData.width, -294 xadvance:charData.width, -295 x:charData.x, -296 y:0 -297 }; -298 } -299 -300 this.spriteImage = new CAAT.Foundation.SpriteImage().initializeAsGlyphDesigner(this.image, cm); -301 return this; -302 }, -303 -304 getAscent:function () { -305 return this.ascent; -306 }, -307 -308 getDescent:function () { -309 return this.descent; -310 }, -311 -312 stringHeight:function () { -313 return this.height; -314 }, -315 -316 getFontData:function () { -317 return { -318 height:this.height, -319 ascent:this.ascent, -320 descent:this.descent -321 }; -322 }, -323 -324 stringWidth:function (str) { -325 var i, l, w = 0, c; -326 -327 for (i = 0, l = str.length; i < l; i++) { -328 c = this.charMap[ str.charAt(i) ]; -329 if (c) { -330 w += c.width; -331 } else { -332 w += UNKNOWN_CHAR_WIDTH; -333 } -334 } -335 -336 return w; -337 }, -338 -339 drawText:function (str, ctx, x, y) { -340 var i, l, charInfo, w; -341 var height = this.image.height; -342 -343 for (i = 0, l = str.length; i < l; i++) { -344 charInfo = this.charMap[ str.charAt(i) ]; -345 if (charInfo) { -346 w = charInfo.width; -347 if ( w>0 && charInfo.height>0 ) { -348 ctx.drawImage( -349 this.image, -350 charInfo.x, 0, -351 w, height, -352 x, y, -353 w, height); -354 } -355 x += w; -356 } else { -357 ctx.strokeStyle = '#f00'; -358 ctx.strokeRect(x, y, UNKNOWN_CHAR_WIDTH, height); -359 x += UNKNOWN_CHAR_WIDTH; -360 } -361 } -362 }, -363 -364 save:function () { -365 var str = "image/png"; -366 var strData = this.image.toDataURL(str); -367 document.location.href = strData.replace(str, "image/octet-stream"); -368 }, -369 -370 drawSpriteText:function (director, time) { -371 this.spriteImage.drawSpriteText(director, time); -372 } -373 -374 } -375 } -376 -377 }); -378 -379 \ No newline at end of file +270 width:charWidth[i] - 2 * padding, +271 height: this.height +272 }; +273 x += charWidth[i]; +274 } +275 +276 this.image = canvas; +277 +278 return this; +279 }, +280 +281 setAsSpriteImage:function () { +282 var cm = []; +283 var _index = 0; +284 for (var i in this.charMap) { +285 var _char = i; +286 var charData = this.charMap[i]; +287 +288 cm[i] = { +289 id:_index++, +290 height:this.height, +291 xoffset:0, +292 letter:_char, +293 yoffset:0, +294 width:charData.width, +295 xadvance:charData.width, +296 x:charData.x, +297 y:0 +298 }; +299 } +300 +301 this.spriteImage = new CAAT.Foundation.SpriteImage().initializeAsGlyphDesigner(this.image, cm); +302 return this; +303 }, +304 +305 getAscent:function () { +306 return this.ascent; +307 }, +308 +309 getDescent:function () { +310 return this.descent; +311 }, +312 +313 stringHeight:function () { +314 return this.height; +315 }, +316 +317 getFontData:function () { +318 return { +319 height:this.height, +320 ascent:this.ascent, +321 descent:this.descent +322 }; +323 }, +324 +325 stringWidth:function (str) { +326 var i, l, w = 0, c; +327 +328 for (i = 0, l = str.length; i < l; i++) { +329 c = this.charMap[ str.charAt(i) ]; +330 if (c) { +331 w += c.width; +332 } else { +333 w += UNKNOWN_CHAR_WIDTH; +334 } +335 } +336 +337 return w; +338 }, +339 +340 drawText:function (str, ctx, x, y) { +341 var i, l, charInfo, w; +342 var height = this.image.height; +343 +344 for (i = 0, l = str.length; i < l; i++) { +345 charInfo = this.charMap[ str.charAt(i) ]; +346 if (charInfo) { +347 w = charInfo.width; +348 if ( w>0 && charInfo.height>0 ) { +349 ctx.drawImage( +350 this.image, +351 charInfo.x, 0, +352 w, height, +353 x, y, +354 w, height); +355 } +356 x += w; +357 } else { +358 ctx.strokeStyle = '#f00'; +359 ctx.strokeRect(x, y, UNKNOWN_CHAR_WIDTH, height); +360 x += UNKNOWN_CHAR_WIDTH; +361 } +362 } +363 }, +364 +365 save:function () { +366 var str = "image/png"; +367 var strData = this.image.toDataURL(str); +368 document.location.href = strData.replace(str, "image/octet-stream"); +369 }, +370 +371 drawSpriteText:function (director, time) { +372 this.spriteImage.drawSpriteText(director, time); +373 } +374 +375 } +376 } +377 +378 }); +379 +380 \ No newline at end of file diff --git a/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_Modules_Image_Preloader_Preloader.js.html b/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_Modules_Image_Preloader_Preloader.js.html index 2822787e..38cbfb88 100644 --- a/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_Modules_Image_Preloader_Preloader.js.html +++ b/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_Modules_Image_Preloader_Preloader.js.html @@ -74,86 +74,96 @@ 67 68 __init : function() { 69 this.elements= []; - 70 return this; - 71 }, - 72 - 73 /** - 74 * a list of elements to load. - 75 * @type {Array.<{ id, image }>} - 76 */ - 77 elements: null, - 78 - 79 /** - 80 * elements counter. - 81 */ - 82 imageCounter: 0, - 83 - 84 /** - 85 * Callback finished loading. - 86 */ - 87 cfinished: null, - 88 - 89 /** - 90 * Callback element loaded. - 91 */ - 92 cloaded: null, - 93 - 94 /** - 95 * Callback error loading. - 96 */ - 97 cerrored: null, - 98 - 99 /** -100 * loaded elements count. -101 */ -102 loadedCount: 0, -103 -104 addElement : function( id, path ) { -105 this.elements.push( new descriptor(id,path,this) ); -106 return this; -107 }, + 70 this.baseURL= ""; + 71 return this; + 72 }, + 73 + 74 currentGroup : null, + 75 + 76 /** + 77 * a list of elements to load. + 78 * @type {Array.<{ id, image }>} + 79 */ + 80 elements: null, + 81 + 82 /** + 83 * elements counter. + 84 */ + 85 imageCounter: 0, + 86 + 87 /** + 88 * Callback finished loading. + 89 */ + 90 cfinished: null, + 91 + 92 /** + 93 * Callback element loaded. + 94 */ + 95 cloaded: null, + 96 + 97 /** + 98 * Callback error loading. + 99 */ +100 cerrored: null, +101 +102 /** +103 * loaded elements count. +104 */ +105 loadedCount: 0, +106 +107 baseURL : null, 108 -109 clear : function() { -110 for( var i=0; i<this.elements.length; i++ ) { -111 this.elements[i].clear(); -112 } -113 this.elements= null; -114 }, -115 -116 __onload : function( d ) { -117 if ( this.cloaded ) { -118 this.cloaded(d.id); -119 } +109 addElement : function( id, path ) { +110 this.elements.push( new descriptor(id,this.baseURL+path,this) ); +111 return this; +112 }, +113 +114 clear : function() { +115 for( var i=0; i<this.elements.length; i++ ) { +116 this.elements[i].clear(); +117 } +118 this.elements= null; +119 }, 120 -121 this.loadedCount++; -122 if ( this.loadedCount===this.elements.length ) { -123 if ( this.cfinished ) { -124 this.cfinished( this.elements ); -125 } -126 } -127 }, -128 -129 __onerror : function( d ) { -130 if ( this.cerrored ) { -131 this.cerrored(d.id); -132 } -133 }, -134 -135 load: function( onfinished, onload_one, onerror ) { -136 -137 this.cfinished= onfinished; -138 this.cloaded= onload_one; -139 this.cerroed= onerror; -140 -141 var i; -142 -143 for( i=0; i<this.elements.length; i++ ) { -144 this.elements[i].load(); -145 } +121 __onload : function( d ) { +122 if ( this.cloaded ) { +123 this.cloaded(d.id); +124 } +125 +126 this.loadedCount++; +127 if ( this.loadedCount===this.elements.length ) { +128 if ( this.cfinished ) { +129 this.cfinished( this.elements ); +130 } +131 } +132 }, +133 +134 __onerror : function( d ) { +135 if ( this.cerrored ) { +136 this.cerrored(d.id); +137 } +138 }, +139 +140 setBaseURL : function( base ) { +141 this.baseURL= base; +142 return this; +143 }, +144 +145 load: function( onfinished, onload_one, onerror ) { 146 -147 return this; -148 } -149 } -150 } -151 }); -152 \ No newline at end of file +147 this.cfinished= onfinished; +148 this.cloaded= onload_one; +149 this.cerroed= onerror; +150 +151 var i; +152 +153 for( i=0; i<this.elements.length; i++ ) { +154 this.elements[i].load(); +155 } +156 +157 return this; +158 } +159 } +160 } +161 }); +162 \ No newline at end of file diff --git a/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_Modules_Skeleton_Bone.js.html b/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_Modules_Skeleton_Bone.js.html new file mode 100644 index 00000000..6894ed9e --- /dev/null +++ b/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_Modules_Skeleton_Bone.js.html @@ -0,0 +1,514 @@ +
      1 /**
    +  2  * Created with JetBrains WebStorm.
    +  3  * User: ibon
    +  4  * Date: 3/21/13
    +  5  * Time: 7:51 PM
    +  6  * To change this template use File | Settings | File Templates.
    +  7  */
    +  8 CAAT.Module({
    +  9 
    + 10     /**
    + 11      * @name Skeleton
    + 12      * @memberof CAAT.Module
    + 13      * @namespace
    + 14      */
    + 15 
    + 16     /**
    + 17      * @name Bone
    + 18      * @memberof CAAT.Module.Skeleton
    + 19      * @constructor
    + 20      */
    + 21 
    + 22     defines : "CAAT.Module.Skeleton.Bone",
    + 23     depends : [
    + 24         "CAAT.Behavior.Interpolator",
    + 25         "CAAT.Behavior.RotateBehavior",
    + 26         "CAAT.Behavior.PathBehavior",
    + 27         "CAAT.Behavior.ScaleBehavior",
    + 28         "CAAT.Behavior.ContainerBehavior"
    + 29     ],
    + 30     extendsWith : function() {
    + 31 
    + 32 
    + 33         /**
    + 34          * @lends CAAT.Module.Skeleton.Bone.prototype
    + 35          */
    + 36 
    + 37         var defPoint = { x: 0, y: 0 };
    + 38         var defScale = { scaleX: 1, scaleY: 1 };
    + 39         var defAngle = 0;
    + 40 
    + 41         var cangle;
    + 42         var cscale;
    + 43         var cpoint;
    + 44 
    + 45         function fntr(behavior, orgtime, time, actor, value) {
    + 46             cpoint= value;
    + 47         }
    + 48 
    + 49         function fnsc(behavior, orgtime, time, actor, value) {
    + 50             cscale= value;
    + 51         }
    + 52 
    + 53         function fnrt(behavior, orgtime, time, actor, value) {
    + 54             cangle= value;
    + 55         }
    + 56 
    + 57         return {
    + 58             id : null,
    + 59 
    + 60             wx : 0,
    + 61             wy : 0,
    + 62             wrotationAngle : 0,
    + 63             wscaleX : 0,
    + 64             wscaleY : 0,
    + 65 
    + 66             /**
    + 67              * Bone x position relative parent
    + 68              * @type number
    + 69              */
    + 70             x : 0,
    + 71 
    + 72             /**
    + 73              * Bone y position relative parent
    + 74              * @type {number}
    + 75              */
    + 76             y : 0,
    + 77 
    + 78             positionAnchorX : 0,
    + 79             positionAnchorY : 0,
    + 80 
    + 81             /**
    + 82              * Bone rotation angle
    + 83              * @type {number}
    + 84              */
    + 85             rotationAngle : 0,
    + 86             rotationAnchorX : 0,
    + 87             rotationAnchorY : 0.5,
    + 88 
    + 89             scaleX : 1,
    + 90             scaleY : 1,
    + 91             scaleAnchorX : .5,
    + 92             scaleAnchorY : .5,
    + 93 
    + 94             /**
    + 95              * Bone size.
    + 96              * @type number
    + 97              */
    + 98             size : 0,
    + 99 
    +100             /**
    +101              * @type CAAT.Math.Matrix
    +102              */
    +103             matrix : null,
    +104 
    +105             /**
    +106              * @type CAAT.Math.Matrix
    +107              */
    +108             wmatrix : null,
    +109 
    +110             /**
    +111              * @type CAAT.Skeleton.Bone
    +112              */
    +113             parent : null,
    +114 
    +115             /**
    +116              * @type CAAT.Behavior.ContainerBehavior
    +117              */
    +118             keyframesTranslate : null,
    +119 
    +120             /**
    +121              * @type CAAT.PathUtil.Path
    +122              */
    +123             keyframesTranslatePath : null,
    +124 
    +125             /**
    +126              * @type CAAT.Behavior.ContainerBehavior
    +127              */
    +128             keyframesScale : null,
    +129 
    +130             /**
    +131              * @type CAAT.Behavior.ContainerBehavior
    +132              */
    +133             keyframesRotate : null,
    +134 
    +135             /**
    +136              * @type object
    +137              */
    +138             keyframesByAnimation : null,
    +139 
    +140             currentAnimation : null,
    +141 
    +142             /**
    +143              * @type Array.<CAAT.Skeleton.Bone>
    +144              */
    +145             children : null,
    +146 
    +147             behaviorApplicationTime : -1,
    +148 
    +149             __init : function(id) {
    +150                 this.id= id;
    +151                 this.matrix= new CAAT.Math.Matrix();
    +152                 this.wmatrix= new CAAT.Math.Matrix();
    +153                 this.parent= null;
    +154                 this.children= [];
    +155 
    +156                 this.keyframesByAnimation = {};
    +157 
    +158                 return this;
    +159             },
    +160 
    +161             setBehaviorApplicationTime : function(t) {
    +162                 this.behaviorApplicationTime= t;
    +163                 return this;
    +164             },
    +165 
    +166             __createAnimation : function(name) {
    +167 
    +168                 var keyframesTranslate= new CAAT.Behavior.ContainerBehavior(true).setCycle(true, true).setId("keyframes_tr");
    +169                 var keyframesScale= new CAAT.Behavior.ContainerBehavior(true).setCycle(true, true).setId("keyframes_sc");
    +170                 var keyframesRotate= new CAAT.Behavior.ContainerBehavior(true).setCycle(true, true).setId("keyframes_rt");
    +171 
    +172                 keyframesTranslate.addListener( { behaviorApplied : fntr });
    +173                 keyframesScale.addListener( { behaviorApplied : fnsc });
    +174                 keyframesRotate.addListener( { behaviorApplied : fnrt });
    +175 
    +176                 var animData= {
    +177                     keyframesTranslate  : keyframesTranslate,
    +178                     keyframesScale      : keyframesScale,
    +179                     keyframesRotate     : keyframesRotate
    +180                 };
    +181 
    +182                 this.keyframesByAnimation[name]= animData;
    +183 
    +184                 return animData;
    +185             },
    +186 
    +187             __getAnimation : function(name) {
    +188                 var animation= this.keyframesByAnimation[ name ];
    +189                 if (!animation) {
    +190                     animation= this.__createAnimation(name);
    +191                 }
    +192 
    +193                 return animation;
    +194             },
    +195 
    +196             /**
    +197              *
    +198              * @param parent {CAAT.Skeleton.Bone}
    +199              * @returns {*}
    +200              */
    +201             __setParent : function( parent ) {
    +202                 this.parent= parent;
    +203                 return this;
    +204             },
    +205 
    +206             addBone : function( bone ) {
    +207                 this.children.push(bone);
    +208                 bone.__setParent(this);
    +209                 return this;
    +210             },
    +211 
    +212             __noValue : function( keyframes ) {
    +213                 keyframes.doValueApplication= false;
    +214                 if ( keyframes instanceof CAAT.Behavior.ContainerBehavior ) {
    +215                     this.__noValue( keyframes );
    +216                 }
    +217             },
    +218 
    +219             __setInterpolator : function(behavior, curve) {
    +220                 if (curve && curve!=="stepped") {
    +221                     behavior.setInterpolator(
    +222                             new CAAT.Behavior.Interpolator().createQuadricBezierInterpolator(
    +223                                     new CAAT.Math.Point(0,0),
    +224                                     new CAAT.Math.Point(curve[0], curve[1]),
    +225                                     new CAAT.Math.Point(curve[2], curve[3])
    +226                             )
    +227                     );
    +228                 }
    +229             },
    +230 
    +231             /**
    +232              *
    +233              * @param name {string} keyframe animation name
    +234              * @param angleStart {number} rotation start angle
    +235              * @param angleEnd {number} rotation end angle
    +236              * @param timeStart {number} keyframe start time
    +237              * @param timeEnd {number} keyframe end time
    +238              * @param curve {Array.<number>=} 4 numbers definint a quadric bezier info. two first points
    +239              *  assumed to be 0,0.
    +240              */
    +241             addRotationKeyframe : function( name, angleStart, angleEnd, timeStart, timeEnd, curve ) {
    +242 
    +243                 var as= 2*Math.PI*angleStart/360;
    +244                 var ae= 2*Math.PI*angleEnd/360;
    +245 
    +246                 // minimum distant between two angles.
    +247 
    +248                 if ( as<-Math.PI ) {
    +249                     if (Math.abs(as+this.rotationAngle)>2*Math.PI) {
    +250                         as= -(as+Math.PI);
    +251                     } else {
    +252                         as= (as+Math.PI);
    +253                     }
    +254                 } else if (as > Math.PI) {
    +255                     as -= 2 * Math.PI;
    +256                 }
    +257 
    +258                 if ( ae<-Math.PI ) {
    +259 
    +260                     if (Math.abs(ae+this.rotationAngle)>2*Math.PI) {
    +261                         ae= -(ae+Math.PI);
    +262                     } else {
    +263                         ae= (ae+Math.PI);
    +264                     }
    +265                 } else if ( ae>Math.PI ) {
    +266                     ae-=2*Math.PI;
    +267                 }
    +268 
    +269                 angleStart= -as;
    +270                 angleEnd= -ae;
    +271 
    +272                 var behavior= new CAAT.Behavior.RotateBehavior().
    +273                         setFrameTime( timeStart, timeEnd-timeStart+1).
    +274                         setValues( angleStart, angleEnd, 0, .5).
    +275                         setValueApplication(false);
    +276 
    +277                 this.__setInterpolator( behavior, curve );
    +278 
    +279                 var animation= this.__getAnimation(name);
    +280                 animation.keyframesRotate.addBehavior(behavior);
    +281             },
    +282 
    +283             endRotationKeyframes : function(name) {
    +284 
    +285             },
    +286 
    +287             addTranslationKeyframe : function( name, startX, startY, endX, endY, timeStart, timeEnd, curve ) {
    +288                 var behavior= new CAAT.Behavior.PathBehavior().
    +289                     setFrameTime( timeStart, timeEnd-timeStart+1).
    +290                     setValues( new CAAT.PathUtil.Path().
    +291                         setLinear( startX, startY, endX, endY )
    +292                     ).
    +293                     setValueApplication(false);
    +294 
    +295                 this.__setInterpolator( behavior, curve );
    +296 
    +297                 var animation= this.__getAnimation(name);
    +298                 animation.keyframesTranslate.addBehavior( behavior );
    +299             },
    +300 
    +301             addScaleKeyframe : function( name, scaleX, endScaleX, scaleY, endScaleY, timeStart, timeEnd, curve ) {
    +302                 var behavior= new CAAT.Behavior.ScaleBehavior().
    +303                     setFrameTime( timeStart, timeEnd-timeStart+1).
    +304                     setValues( scaleX, endScaleX, scaleY, endScaleY ).
    +305                     setValueApplication(false);
    +306 
    +307                 this.__setInterpolator( behavior, curve );
    +308 
    +309                 var animation= this.__getAnimation(name);
    +310                 animation.keyframesScale.addBehavior( behavior );
    +311             },
    +312 
    +313             endTranslationKeyframes : function(name) {
    +314 
    +315             },
    +316 
    +317             setSize : function(s) {
    +318                 this.width= s;
    +319                 this.height= 0;
    +320             },
    +321 
    +322             endScaleKeyframes : function(name) {
    +323 
    +324             },
    +325 
    +326             setPosition : function( x, y ) {
    +327                 this.x= x;
    +328                 this.y= -y;
    +329                 return this;
    +330             } ,
    +331 
    +332             /**
    +333              * default anchor values are for spine tool.
    +334              * @param angle {number}
    +335              * @param anchorX {number=}
    +336              * @param anchorY {number=}
    +337              * @returns {*}
    +338              */
    +339             setRotateTransform : function( angle, anchorX, anchorY ) {
    +340                 this.rotationAngle= -angle*2*Math.PI/360;
    +341                 this.rotationAnchorX= typeof anchorX!=="undefined" ? anchorX : 0;
    +342                 this.rotationAnchorY= typeof anchorY!=="undefined" ? anchorY : .5;
    +343                 return this;
    +344             },
    +345 
    +346             /**
    +347              *
    +348              * @param sx {number}
    +349              * @param sy {number}
    +350              * @param anchorX {number=} anchorX: .5 by default
    +351              * @param anchorY {number=} anchorY. .5 by default
    +352              * @returns {*}
    +353              */
    +354             setScaleTransform : function( sx, sy, anchorX, anchorY ) {
    +355                 this.scaleX= sx;
    +356                 this.scaleY= sy;
    +357                 this.scaleAnchorX= typeof anchorX!=="undefined" ? anchorX : .5;
    +358                 this.scaleAnchorY= typeof anchorY!=="undefined" ? anchorY : .5;
    +359                 return this;
    +360             },
    +361 
    +362 
    +363             __setModelViewMatrix : function() {
    +364                 var c, s, _m00, _m01, _m10, _m11;
    +365                 var mm0, mm1, mm2, mm3, mm4, mm5;
    +366                 var mm;
    +367 
    +368                 var mm = this.matrix.matrix;
    +369 
    +370                 mm0 = 1;
    +371                 mm1 = 0;
    +372                 mm3 = 0;
    +373                 mm4 = 1;
    +374 
    +375                 mm2 = this.wx - this.positionAnchorX * this.width;
    +376                 mm5 = this.wy - this.positionAnchorY * this.height;
    +377 
    +378                 if (this.wrotationAngle) {
    +379 
    +380                     var rx = this.rotationAnchorX * this.width;
    +381                     var ry = this.rotationAnchorY * this.height;
    +382 
    +383                     mm2 += mm0 * rx + mm1 * ry;
    +384                     mm5 += mm3 * rx + mm4 * ry;
    +385 
    +386                     c = Math.cos(this.wrotationAngle);
    +387                     s = Math.sin(this.wrotationAngle);
    +388                     _m00 = mm0;
    +389                     _m01 = mm1;
    +390                     _m10 = mm3;
    +391                     _m11 = mm4;
    +392                     mm0 = _m00 * c + _m01 * s;
    +393                     mm1 = -_m00 * s + _m01 * c;
    +394                     mm3 = _m10 * c + _m11 * s;
    +395                     mm4 = -_m10 * s + _m11 * c;
    +396 
    +397                     mm2 += -mm0 * rx - mm1 * ry;
    +398                     mm5 += -mm3 * rx - mm4 * ry;
    +399                 }
    +400                 if (this.wscaleX != 1 || this.wscaleY != 1) {
    +401 
    +402                     var sx = this.scaleAnchorX * this.width;
    +403                     var sy = this.scaleAnchorY * this.height;
    +404 
    +405                     mm2 += mm0 * sx + mm1 * sy;
    +406                     mm5 += mm3 * sx + mm4 * sy;
    +407 
    +408                     mm0 = mm0 * this.wscaleX;
    +409                     mm1 = mm1 * this.wscaleY;
    +410                     mm3 = mm3 * this.wscaleX;
    +411                     mm4 = mm4 * this.wscaleY;
    +412 
    +413                     mm2 += -mm0 * sx - mm1 * sy;
    +414                     mm5 += -mm3 * sx - mm4 * sy;
    +415                 }
    +416 
    +417                 mm[0] = mm0;
    +418                 mm[1] = mm1;
    +419                 mm[2] = mm2;
    +420                 mm[3] = mm3;
    +421                 mm[4] = mm4;
    +422                 mm[5] = mm5;
    +423 
    +424                 if (this.parent) {
    +425                     this.wmatrix.copy(this.parent.wmatrix);
    +426                     this.wmatrix.multiply(this.matrix);
    +427                 } else {
    +428                     this.wmatrix.identity();
    +429                 }
    +430             },
    +431 
    +432             setAnimation : function(name) {
    +433                 var animation= this.keyframesByAnimation[name];
    +434                 if (animation) {
    +435                     this.keyframesRotate= animation.keyframesRotate;
    +436                     this.keyframesScale= animation.keyframesScale;
    +437                     this.keyframesTranslate= animation.keyframesTranslate;
    +438                 }
    +439 
    +440                 for( var i= 0, l=this.children.length; i<l; i+=1 ) {
    +441                     this.children[i].setAnimation(name);
    +442                 }
    +443             },
    +444 
    +445             /**
    +446              * @param time {number}
    +447              */
    +448             apply : function( time, animationTime ) {
    +449 
    +450                 cpoint= defPoint;
    +451                 cangle= defAngle;
    +452                 cscale= defScale;
    +453 
    +454                 if (this.keyframesTranslate) {
    +455                     this.keyframesTranslate.apply(time);
    +456                 }
    +457 
    +458                 if ( this.keyframesRotate ) {
    +459                     this.keyframesRotate.apply(time);
    +460                 }
    +461 
    +462                 if ( this.keyframesScale ) {
    +463                     this.keyframesScale.apply(time);
    +464                 }
    +465 
    +466                 this.wx= cpoint.x + this.x;
    +467                 this.wy= cpoint.y + this.y;
    +468 
    +469                 this.wrotationAngle = cangle + this.rotationAngle;
    +470 
    +471                 this.wscaleX= cscale.scaleX * this.scaleX;
    +472                 this.wscaleY= cscale.scaleY * this.scaleY;
    +473 
    +474                 this.__setModelViewMatrix();
    +475 
    +476                 for( var i=0; i<this.children.length; i++ ) {
    +477                     this.children[i].apply(time);
    +478                 }
    +479             },
    +480 
    +481             transformContext : function(ctx) {
    +482                 var m= this.wmatrix.matrix;
    +483                 ctx.transform( m[0], m[3], m[1], m[4], m[2], m[5] );
    +484             },
    +485 
    +486             paint : function( actorMatrix, ctx ) {
    +487                 ctx.save();
    +488                     this.transformContext(ctx);
    +489 
    +490                     ctx.strokeStyle= 'blue';
    +491                     ctx.beginPath();
    +492                     ctx.moveTo(0,-2);
    +493                     ctx.lineTo(this.width,this.height);
    +494                     ctx.lineTo(0,2);
    +495                     ctx.lineTo(0,-2);
    +496                     ctx.stroke();
    +497                 ctx.restore();
    +498 
    +499                 for( var i=0; i<this.children.length; i++ ) {
    +500                     this.children[i].paint(actorMatrix, ctx);
    +501                 }
    +502 
    +503 
    +504             }
    +505         }
    +506     }
    +507 });
    \ No newline at end of file diff --git a/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_Modules_Skeleton_BoneActor.js.html b/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_Modules_Skeleton_BoneActor.js.html new file mode 100644 index 00000000..c67f389d --- /dev/null +++ b/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_Modules_Skeleton_BoneActor.js.html @@ -0,0 +1,265 @@ +
      1 CAAT.Module({
    +  2 
    +  3 
    +  4     /**
    +  5      * @name BoneActor
    +  6      * @memberof CAAT.Module.Skeleton
    +  7      * @constructor
    +  8      */
    +  9 
    + 10     defines : "CAAT.Module.Skeleton.BoneActor",
    + 11     depends : [
    + 12         "CAAT.Module.Skeleton.BoneActorAttachment"
    + 13     ],
    + 14     extendsWith : function() {
    + 15 
    + 16         return {
    + 17 
    + 18             /**
    + 19              * @lends CAAT.Module.Skeleton.BoneActor.prototype
    + 20              */
    + 21 
    + 22             bone    : null,
    + 23             skinInfo : null,
    + 24             skinInfoByName : null,
    + 25             currentSkinInfo : null,
    + 26             skinDataKeyframes : null,
    + 27             parent : null,
    + 28             worldModelViewMatrix : null,
    + 29             skinMatrix : null,  // compositon of bone + skin info
    + 30             AABB : null,
    + 31 
    + 32             /**
    + 33              * @type {object}
    + 34              * @map {string}, { x:{number}, y: {number} }
    + 35              */
    + 36             attachments : null,
    + 37 
    + 38             __init : function() {
    + 39                 this.skinInfo= [];
    + 40                 this.worldModelViewMatrix= new CAAT.Math.Matrix();
    + 41                 this.skinMatrix= new CAAT.Math.Matrix();
    + 42                 this.skinInfoByName= {};
    + 43                 this.skinDataKeyframes= [];
    + 44                 this.attachments= [];
    + 45                 this.AABB= new CAAT.Math.Rectangle();
    + 46             },
    + 47 
    + 48             addAttachment : function( id, normalized_x, normalized_y, callback ) {
    + 49 
    + 50                 this.attachments.push( new CAAT.Module.Skeleton.BoneActorAttachment(id, normalized_x, normalized_y, callback) );
    + 51             },
    + 52 
    + 53             addAttachmentListener : function( al ) {
    + 54 
    + 55             },
    + 56 
    + 57             setBone : function(bone) {
    + 58                 this.bone= bone;
    + 59                 return this;
    + 60             },
    + 61 
    + 62             addSkinInfo : function( si ) {
    + 63                 if (null===this.currentSkinInfo) {
    + 64                     this.currentSkinInfo= si;
    + 65                 }
    + 66                 this.skinInfo.push( si );
    + 67                 this.skinInfoByName[ si.name ]= si;
    + 68                 return this;
    + 69             },
    + 70 
    + 71             setDefaultSkinInfoByName : function( name ) {
    + 72                 var v= this.skinInfoByName[name];
    + 73                 if (v) {
    + 74                     this.currentSkinInfo= v;
    + 75                 }
    + 76 
    + 77                 return this;
    + 78             },
    + 79 
    + 80             emptySkinDataKeyframe : function() {
    + 81                 this.skinDataKeyframes= [];
    + 82             },
    + 83 
    + 84             addSkinDataKeyframe : function( name, start, duration ) {
    + 85                 this.skinDataKeyframes.push( {
    + 86                     name : name,
    + 87                     start : start,
    + 88                     duration : duration
    + 89                 });
    + 90             },
    + 91 
    + 92             __getCurrentSkinInfo : function(time) {
    + 93                 if ( this.skinDataKeyframes.length ) {
    + 94                     time=(time%1000)/1000;
    + 95 
    + 96                     for( var i=0, l=this.skinDataKeyframes.length; i<l; i+=1 ) {
    + 97                         var sdkf= this.skinDataKeyframes[i];
    + 98                         if ( time>=sdkf.start && time<=sdkf.start+sdkf.duration ) {
    + 99                             return this.currentSkinInfo= this.skinInfoByName[ sdkf.name ];
    +100                         }
    +101                     }
    +102 
    +103                     return null;
    +104                 }
    +105 
    +106                 return this.currentSkinInfo;
    +107             },
    +108 
    +109             paint : function( ctx, time ) {
    +110 
    +111                 var skinInfo= this.__getCurrentSkinInfo(time);
    +112 
    +113                 if (!skinInfo || !skinInfo.image) {
    +114                     return;
    +115                 }
    +116 
    +117                 /*
    +118                     var w= skinInfo.width*.5;
    +119                     var h= skinInfo.height*.5;
    +120 
    +121                     ctx.translate(skinInfo.x, skinInfo.y );
    +122                     ctx.rotate(skinInfo.angle);
    +123                     ctx.scale(skinInfo.scaleX, skinInfo.scaleY);
    +124                     ctx.translate( -w, -h);
    +125                 */
    +126 
    +127                 this.worldModelViewMatrix.transformRenderingContextSet(ctx);
    +128                 skinInfo.matrix.transformRenderingContext( ctx );
    +129                 ctx.drawImage( skinInfo.image, 0, 0, skinInfo.image.width, skinInfo.image.height );
    +130 
    +131             },
    +132 
    +133             setupAnimation : function(time) {
    +134                 this.setModelViewMatrix();
    +135                 this.prepareAABB(time);
    +136                 this.__setupAttachments();
    +137             },
    +138 
    +139             prepareAABB : function(time) {
    +140                 var skinInfo= this.__getCurrentSkinInfo(time);
    +141                 var x=0, y=0, w, h;
    +142 
    +143                 if ( skinInfo ) {
    +144                     w= skinInfo.width;
    +145                     h= skinInfo.height;
    +146                 } else {
    +147                     w= h= 1;
    +148                 }
    +149 
    +150                 var vv= [
    +151                     new CAAT.Math.Point(x,y),
    +152                     new CAAT.Math.Point(x+w,0),
    +153                     new CAAT.Math.Point(x+w, y+h),
    +154                     new CAAT.Math.Point(x, y + h)
    +155                 ];
    +156 
    +157                 var AABB= this.AABB;
    +158                 var vvv;
    +159 
    +160                 /**
    +161                  * cache the bone+skin matrix for later usage in attachment calculations.
    +162                  */
    +163                 var amatrix= this.skinMatrix;
    +164                 amatrix.copy( this.worldModelViewMatrix );
    +165                 amatrix.multiply( this.currentSkinInfo.matrix );
    +166 
    +167                 for( var i=0; i<vv.length; i++ ) {
    +168                     vv[i]= amatrix.transformCoord(vv[i]);
    +169                 }
    +170 
    +171                 var xmin = Number.MAX_VALUE, xmax = -Number.MAX_VALUE;
    +172                 var ymin = Number.MAX_VALUE, ymax = -Number.MAX_VALUE;
    +173 
    +174                 vvv = vv[0];
    +175                 if (vvv.x < xmin) {
    +176                     xmin = vvv.x;
    +177                 }
    +178                 if (vvv.x > xmax) {
    +179                     xmax = vvv.x;
    +180                 }
    +181                 if (vvv.y < ymin) {
    +182                     ymin = vvv.y;
    +183                 }
    +184                 if (vvv.y > ymax) {
    +185                     ymax = vvv.y;
    +186                 }
    +187                 vvv = vv[1];
    +188                 if (vvv.x < xmin) {
    +189                     xmin = vvv.x;
    +190                 }
    +191                 if (vvv.x > xmax) {
    +192                     xmax = vvv.x;
    +193                 }
    +194                 if (vvv.y < ymin) {
    +195                     ymin = vvv.y;
    +196                 }
    +197                 if (vvv.y > ymax) {
    +198                     ymax = vvv.y;
    +199                 }
    +200                 vvv = vv[2];
    +201                 if (vvv.x < xmin) {
    +202                     xmin = vvv.x;
    +203                 }
    +204                 if (vvv.x > xmax) {
    +205                     xmax = vvv.x;
    +206                 }
    +207                 if (vvv.y < ymin) {
    +208                     ymin = vvv.y;
    +209                 }
    +210                 if (vvv.y > ymax) {
    +211                     ymax = vvv.y;
    +212                 }
    +213                 vvv = vv[3];
    +214                 if (vvv.x < xmin) {
    +215                     xmin = vvv.x;
    +216                 }
    +217                 if (vvv.x > xmax) {
    +218                     xmax = vvv.x;
    +219                 }
    +220                 if (vvv.y < ymin) {
    +221                     ymin = vvv.y;
    +222                 }
    +223                 if (vvv.y > ymax) {
    +224                     ymax = vvv.y;
    +225                 }
    +226 
    +227                 AABB.x = xmin;
    +228                 AABB.y = ymin;
    +229                 AABB.x1 = xmax;
    +230                 AABB.y1 = ymax;
    +231                 AABB.width = (xmax - xmin);
    +232                 AABB.height = (ymax - ymin);
    +233             },
    +234 
    +235             setModelViewMatrix : function() {
    +236 
    +237                 if (this.parent) {
    +238                     this.worldModelViewMatrix.copy(this.parent.worldModelViewMatrix);
    +239                     this.worldModelViewMatrix.multiply(this.bone.wmatrix);
    +240 
    +241                 } else {
    +242                     this.worldModelViewMatrix.identity();
    +243                 }
    +244             },
    +245 
    +246             __setupAttachments : function( ) {
    +247                 for( var i= 0, l=this.attachments.length; i<l; i+=1 ) {
    +248                     var attachment= this.attachments[ i ];
    +249                     attachment.transform( this.skinMatrix, this.currentSkinInfo.width, this.currentSkinInfo.height );
    +250                 }
    +251             },
    +252 
    +253             getAttachment : function( id ) {
    +254                 return this.attachments[id];
    +255             }
    +256         }
    +257     }
    +258 });
    \ No newline at end of file diff --git a/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_Modules_Skeleton_Skeleton.js.html b/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_Modules_Skeleton_Skeleton.js.html new file mode 100644 index 00000000..099388a2 --- /dev/null +++ b/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_Modules_Skeleton_Skeleton.js.html @@ -0,0 +1,290 @@ +
      1 CAAT.Module( {
    +  2 
    +  3     /**
    +  4      * @name Skeleton
    +  5      * @memberof CAAT.Module.Skeleton
    +  6      * @constructor
    +  7      */
    +  8 
    +  9     defines : "CAAT.Module.Skeleton.Skeleton",
    + 10     depends : [
    + 11         "CAAT.Module.Skeleton.Bone"
    + 12     ],
    + 13     extendsWith : {
    + 14 
    + 15         /**
    + 16          * @lends CAAT.Module.Skeleton.Skeleton.prototype
    + 17          */
    + 18 
    + 19         bones : null,
    + 20         bonesArray : null,
    + 21         animation : null,
    + 22         root  : null,
    + 23         currentAnimationName : null,
    + 24         skeletonDataFromFile : null,
    + 25 
    + 26         __init : function(skeletonDataFromFile) {
    + 27             this.bones= {};
    + 28             this.bonesArray= [];
    + 29             this.animations= {};
    + 30 
    + 31             // bones
    + 32             if (skeletonDataFromFile) {
    + 33                 this.__setSkeleton( skeletonDataFromFile );
    + 34             }
    + 35         },
    + 36 
    + 37         getSkeletonDataFromFile : function() {
    + 38             return this.skeletonDataFromFile;
    + 39         },
    + 40 
    + 41         __setSkeleton : function( skeletonDataFromFile ) {
    + 42             this.skeletonDataFromFile= skeletonDataFromFile;
    + 43             for ( var i=0; i<skeletonDataFromFile.bones.length; i++ ) {
    + 44                 var boneInfo= skeletonDataFromFile.bones[i];
    + 45                 this.addBone(boneInfo);
    + 46             }
    + 47         },
    + 48 
    + 49         setSkeletonFromFile : function(url) {
    + 50             var me= this;
    + 51             new CAAT.Module.Preloader.XHR().load(
    + 52                     function( result, content ) {
    + 53                         if (result==="ok" ) {
    + 54                             me.__setSkeleton( JSON.parse(content) );
    + 55                         }
    + 56                     },
    + 57                     url,
    + 58                     false,
    + 59                     "GET"
    + 60             );
    + 61 
    + 62             return this;
    + 63         },
    + 64 
    + 65         addAnimationFromFile : function(name, url) {
    + 66             var me= this;
    + 67             new CAAT.Module.Preloader.XHR().load(
    + 68                     function( result, content ) {
    + 69                         if (result==="ok" ) {
    + 70                             me.addAnimation( name, JSON.parse(content) );
    + 71                         }
    + 72                     },
    + 73                     url,
    + 74                     false,
    + 75                     "GET"
    + 76             );
    + 77 
    + 78             return this;
    + 79         },
    + 80 
    + 81         addAnimation : function(name, animation) {
    + 82 
    + 83             // bones animation
    + 84             for( var bonename in animation.bones ) {
    + 85 
    + 86                 var boneanimation= animation.bones[bonename];
    + 87 
    + 88                 if ( boneanimation.rotate ) {
    + 89 
    + 90                     for( var i=0; i<boneanimation.rotate.length-1; i++ ) {
    + 91                         this.addRotationKeyframe(
    + 92                             name,
    + 93                             {
    + 94                                 boneId : bonename,
    + 95                                 angleStart : boneanimation.rotate[i].angle,
    + 96                                 angleEnd : boneanimation.rotate[i+1].angle,
    + 97                                 timeStart : boneanimation.rotate[i].time*1000,
    + 98                                 timeEnd : boneanimation.rotate[i+1].time*1000,
    + 99                                 curve : boneanimation.rotate[i].curve
    +100                             } );
    +101                     }
    +102                 }
    +103 
    +104                 if (boneanimation.translate) {
    +105 
    +106                     for( var i=0; i<boneanimation.translate.length-1; i++ ) {
    +107 
    +108                         this.addTranslationKeyframe(
    +109                             name,
    +110                             {
    +111                                 boneId      : bonename,
    +112                                 startX      : boneanimation.translate[i].x,
    +113                                 startY      : -boneanimation.translate[i].y,
    +114                                 endX        : boneanimation.translate[i+1].x,
    +115                                 endY        : -boneanimation.translate[i+1].y,
    +116                                 timeStart   : boneanimation.translate[i].time * 1000,
    +117                                 timeEnd     : boneanimation.translate[i+1].time * 1000,
    +118                                 curve       : "stepped" //boneanimation.translate[i].curve
    +119 
    +120                             });
    +121                     }
    +122                 }
    +123 
    +124                 if ( boneanimation.scale ) {
    +125                     for( var i=0; i<boneanimation.scale.length-1; i++ ) {
    +126                         this.addScaleKeyframe(
    +127                             name,
    +128                             {
    +129                                 boneId : bonename,
    +130                                 startScaleX : boneanimation.rotate[i].x,
    +131                                 endScaleX : boneanimation.rotate[i+1].x,
    +132                                 startScaleY : boneanimation.rotate[i].y,
    +133                                 endScaleY : boneanimation.rotate[i+1].y,
    +134                                 timeStart : boneanimation.rotate[i].time*1000,
    +135                                 timeEnd : boneanimation.rotate[i+1].time*1000,
    +136                                 curve : boneanimation.rotate[i].curve
    +137                             } );
    +138                     }
    +139                 }
    +140 
    +141                 this.endKeyframes( name, bonename );
    +142 
    +143             }
    +144 
    +145             if ( null===this.currentAnimationName ) {
    +146                 this.animations[name]= animation;
    +147                 this.setAnimation(name);
    +148             }
    +149 
    +150             return this;
    +151         },
    +152 
    +153         setAnimation : function(name) {
    +154             this.root.setAnimation( name );
    +155             this.currentAnimationName= name;
    +156         },
    +157 
    +158         getCurrentAnimationData : function() {
    +159             return this.animations[ this.currentAnimationName ];
    +160         },
    +161 
    +162         getAnimationDataByName : function(name) {
    +163             return this.animations[name];
    +164         },
    +165 
    +166         getNumBones : function() {
    +167             return this.bonesArray.length;
    +168         },
    +169 
    +170         getRoot : function() {
    +171             return this.root;
    +172         },
    +173 
    +174         calculate : function(time, animationTime) {
    +175             this.root.apply(time, animationTime);
    +176         },
    +177 
    +178         getBoneById : function(id) {
    +179             return this.bones[id];
    +180         },
    +181 
    +182         getBoneByIndex : function(index) {
    +183             return this.bonesArray[ index ];
    +184         },
    +185 
    +186         addBone : function( boneInfo ) {
    +187             var bone= new CAAT.Module.Skeleton.Bone(boneInfo.name);
    +188 
    +189             bone.setPosition(
    +190                 typeof boneInfo.x!=="undefined" ? boneInfo.x : 0,
    +191                 typeof boneInfo.y!=="undefined" ? boneInfo.y : 0 );
    +192             bone.setRotateTransform( boneInfo.rotation ? boneInfo.rotation : 0 );
    +193             bone.setSize( boneInfo.length ? boneInfo.length : 0, 0 );
    +194 
    +195             this.bones[boneInfo.name]= bone;
    +196 
    +197             if (boneInfo.parent) {
    +198 
    +199                 var parent= this.bones[boneInfo.parent];
    +200                 if ( parent ) {
    +201                     parent.addBone(bone);
    +202                 } else {
    +203                     console.log("Referenced parent Bone '"+boneInfo.parent+"' which does not exist");
    +204                 }
    +205             }
    +206 
    +207             this.bonesArray.push(bone);
    +208 
    +209             // BUGBUG should be an explicit root bone identification.
    +210             if (!this.root) {
    +211                 this.root= bone;
    +212             }
    +213         },
    +214 
    +215         addRotationKeyframe : function( name, keyframeInfo ) {
    +216             var bone= this.bones[ keyframeInfo.boneId ];
    +217             if ( bone ) {
    +218                 bone.addRotationKeyframe(
    +219                     name,
    +220                     keyframeInfo.angleStart,
    +221                     keyframeInfo.angleEnd,
    +222                     keyframeInfo.timeStart,
    +223                     keyframeInfo.timeEnd,
    +224                     keyframeInfo.curve
    +225                 )
    +226             } else {
    +227                 console.log("Rotation Keyframe for non-existant bone: '"+keyframeInfo.boneId+"'" );
    +228             }
    +229         },
    +230 
    +231         addScaleKeyframe : function( name, keyframeInfo ) {
    +232             var bone= this.bones[ keyframeInfo.boneId ];
    +233             if ( bone ) {
    +234                 bone.addRotationKeyframe(
    +235                     name,
    +236                     keyframeInfo.startScaleX,
    +237                     keyframeInfo.endScaleX,
    +238                     keyframeInfo.startScaleY,
    +239                     keyframeInfo.endScaleY,
    +240                     keyframeInfo.timeStart,
    +241                     keyframeInfo.timeEnd,
    +242                     keyframeInfo.curve
    +243                 )
    +244             } else {
    +245                 console.log("Scale Keyframe for non-existant bone: '"+keyframeInfo.boneId+"'" );
    +246             }
    +247         },
    +248 
    +249         addTranslationKeyframe : function( name, keyframeInfo ) {
    +250 
    +251             var bone= this.bones[ keyframeInfo.boneId ];
    +252             if ( bone ) {
    +253 
    +254                 bone.addTranslationKeyframe(
    +255                     name,
    +256                     keyframeInfo.startX,
    +257                     keyframeInfo.startY,
    +258                     keyframeInfo.endX,
    +259                     keyframeInfo.endY,
    +260                     keyframeInfo.timeStart,
    +261                     keyframeInfo.timeEnd,
    +262                     keyframeInfo.curve
    +263                 )
    +264             } else {
    +265                 console.log("Translation Keyframe for non-existant bone: '"+keyframeInfo.boneId+"'" );
    +266             }
    +267         },
    +268 
    +269         endKeyframes : function( name, boneId ) {
    +270             var bone= this.bones[boneId];
    +271             if (bone) {
    +272                 bone.endTranslationKeyframes(name);
    +273                 bone.endRotationKeyframes(name);
    +274                 bone.endScaleKeyframes(name);
    +275             }
    +276         },
    +277 
    +278         paint : function( actorMatrix, ctx ) {
    +279             this.root.paint(actorMatrix,ctx);
    +280         }
    +281 
    +282     }
    +283 });
    \ No newline at end of file diff --git a/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_Modules_Skeleton_SkeletonActor.js.html b/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_Modules_Skeleton_SkeletonActor.js.html new file mode 100644 index 00000000..947f7677 --- /dev/null +++ b/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_Modules_Skeleton_SkeletonActor.js.html @@ -0,0 +1,389 @@ +
      1 CAAT.Module({
    +  2 
    +  3     /**
    +  4      * @name SkeletonActor
    +  5      * @memberof CAAT.Module.Skeleton.prototype
    +  6      * @constructor
    +  7      */
    +  8 
    +  9     defines: "CAAT.Module.Skeleton.SkeletonActor",
    + 10     extendsClass: "CAAT.Foundation.Actor",
    + 11     depends: [
    + 12         "CAAT.Module.Skeleton.Skeleton",
    + 13         "CAAT.Module.Skeleton.BoneActor",
    + 14         "CAAT.Foundation.Actor"
    + 15     ],
    + 16     extendsWith: function () {
    + 17 
    + 18 
    + 19 
    + 20         /**
    + 21          * Holder to keep animation slots information.
    + 22          */
    + 23         function SlotInfoData( sortId, attachment, name, bone ) {
    + 24 
    + 25             this.sortId= sortId;
    + 26             this.attachment= attachment;
    + 27             this.name= name;
    + 28             this.bone= bone;
    + 29 
    + 30             return this;
    + 31         }
    + 32 
    + 33         return {
    + 34 
    + 35             /**
    + 36              * @lends CAAT.Module.Skeleton.SkeletonActor
    + 37              */
    + 38 
    + 39             skeleton: null,
    + 40 
    + 41             /**
    + 42              * @type object
    + 43              * @map < boneId{string}, SlotInfoData >
    + 44              */
    + 45             slotInfo: null,
    + 46 
    + 47             /**
    + 48              * @type Array.<SlotInfoData>
    + 49              */
    + 50             slotInfoArray: null,
    + 51 
    + 52             /**
    + 53              * @type object
    + 54              * @map
    + 55              */
    + 56             skinByName: null,
    + 57 
    + 58             /**
    + 59              * @type CAAT.Foundation.Director
    + 60              */
    + 61             director: null,
    + 62 
    + 63             /**
    + 64              * @type boolean
    + 65              */
    + 66             _showBones: false,
    + 67 
    + 68             /**
    + 69              * Currently selected animation play time.
    + 70              * Zero to make it last for its default value.
    + 71              * @type number
    + 72              */
    + 73             animationDuration : 0,
    + 74 
    + 75             showAABB : false,
    + 76             bonesActor : null,
    + 77 
    + 78             __init: function (director, skeleton) {
    + 79                 this.__super();
    + 80 
    + 81                 this.director = director;
    + 82                 this.skeleton = skeleton;
    + 83                 this.slotInfo = {};
    + 84                 this.slotInfoArray = [];
    + 85                 this.bonesActor= [];
    + 86                 this.skinByName = {};
    + 87 
    + 88                 this.setSkin();
    + 89                 this.setAnimation("default");
    + 90 
    + 91                 return this;
    + 92             },
    + 93 
    + 94             showBones: function (show) {
    + 95                 this._showBones = show;
    + 96                 return this;
    + 97             },
    + 98 
    + 99             /**
    +100              * build an sprite-sheet composed of numSprites elements and organized in rows x columns
    +101              * @param numSprites {number}
    +102              * @param rows {number=}
    +103              * @param columns {number=}
    +104              */
    +105             buildSheet : function( numSprites, rows, columns ) {
    +106 
    +107                 var i, j,l;
    +108                 var AABBs= [];
    +109                 var maxTime= 1000;  // BUGBUG search for animation time.
    +110                 var ssItemWidth, ssItemHeight;  // sprite sheet item width and height
    +111                 var ssItemMinX= Number.MAX_VALUE, ssItemMinY= Number.MAX_VALUE;
    +112                 var ssItemMaxOffsetY, ssItemMaxOffsetX;
    +113 
    +114                 // prepare this actor's world model view matrix, but with no position.
    +115                 var px= this.x;
    +116                 var py= this.y;
    +117                 this.x= this.y= 0;
    +118                 this.setModelViewMatrix();
    +119 
    +120 
    +121                 rows= rows || 1;
    +122                 columns= columns || 1;
    +123 
    +124                 // calculate all sprite sheet frames aabb.
    +125                 for( j=0; j<numSprites; j++ ) {
    +126                     var aabb= new CAAT.Math.Rectangle();
    +127                     var time= maxTime/numSprites*j;
    +128                     AABBs.push( aabb );
    +129                     this.skeleton.calculate( time, this.animationDuration );
    +130 
    +131                     for( i= 0, l= this.bonesActor.length; i<l; i+=1 ) {
    +132                         var bone= this.bonesActor[i];
    +133                         var boneAABB;
    +134                         bone.setupAnimation(time);
    +135                         boneAABB= bone.AABB;
    +136                         aabb.unionRectangle(boneAABB);
    +137                         if ( boneAABB.x < ssItemMinX ) {
    +138                             ssItemMinX= boneAABB.x;
    +139                         }
    +140                     }
    +141                 }
    +142 
    +143                 // calculate offsets for each aabb and sprite-sheet element size.
    +144                 ssItemWidth= 0;
    +145                 ssItemHeight= 0;
    +146                 ssItemMinX= Number.MAX_VALUE;
    +147                 ssItemMinY= Number.MAX_VALUE;
    +148                 for( i=0; i<AABBs.length; i++ ) {
    +149                     if ( AABBs[i].x < ssItemMinX ) {
    +150                         ssItemMinX= AABBs[i].x;
    +151                     }
    +152                     if ( AABBs[i].y < ssItemMinY ) {
    +153                         ssItemMinY= AABBs[i].y;
    +154                     }
    +155                     if ( AABBs[i].width>ssItemWidth ) {
    +156                         ssItemWidth= AABBs[i].width;
    +157                     }
    +158                     if ( AABBs[i].height>ssItemHeight ) {
    +159                         ssItemHeight= AABBs[i].height;
    +160                     }
    +161                 }
    +162                 ssItemWidth= (ssItemWidth|0)+1;
    +163                 ssItemHeight= (ssItemHeight|0)+1;
    +164 
    +165                 // calculate every animation offset against biggest animation size.
    +166                 ssItemMaxOffsetY= -Number.MAX_VALUE;
    +167                 ssItemMaxOffsetX= -Number.MAX_VALUE;
    +168                 var offsetMinX=Number.MAX_VALUE, offsetMaxX=-Number.MAX_VALUE;
    +169                 for( i=0; i<AABBs.length; i++ ) {
    +170                     var offsetX= (ssItemWidth - AABBs[i].width)/2;
    +171                     var offsetY= (ssItemHeight - AABBs[i].height)/2;
    +172 
    +173                     if ( offsetY>ssItemMaxOffsetY ) {
    +174                         ssItemMaxOffsetY= offsetY;
    +175                     }
    +176 
    +177                     if ( offsetX>ssItemMaxOffsetX ) {
    +178                         ssItemMaxOffsetX= offsetX;
    +179                     }
    +180                 }
    +181 
    +182 
    +183                 // create a canvas of the neccessary size
    +184                 var canvas= document.createElement("canvas");
    +185                 canvas.width= ssItemWidth * numSprites;
    +186                 canvas.height= ssItemHeight;
    +187                 var ctx= canvas.getContext("2d");
    +188 
    +189                 // draw animation into canvas.
    +190                 for( j=0; j<numSprites; j++ ) {
    +191 
    +192                     //this.x= j*ssItemWidth + offsetMaxX - ssItemMaxOffsetX ;
    +193                     this.x= j*ssItemWidth - ssItemMinX;
    +194                     this.y= ssItemHeight - ssItemMaxOffsetY/2 - 1;
    +195 
    +196                     this.setModelViewMatrix();
    +197 
    +198                     var time= maxTime/numSprites*j;
    +199                     this.skeleton.calculate( time, this.animationDuration );
    +200 
    +201                     // prepare bones
    +202                     for( i= 0, l= this.bonesActor.length; i<l; i+=1 ) {
    +203                         this.bonesActor[i].setupAnimation(time);
    +204                         this.bonesActor[i].paint( ctx, time );
    +205                     }
    +206 
    +207                     ctx.restore();
    +208                 }
    +209 
    +210                 this.x= px;
    +211                 this.y= py;
    +212 
    +213                 return canvas;
    +214             },
    +215 
    +216             animate: function (director, time) {
    +217                 var i,l;
    +218 
    +219                 var ret= CAAT.Module.Skeleton.SkeletonActor.superclass.animate.call( this, director, time );
    +220 
    +221                 this.skeleton.calculate( time, this.animationDuration );
    +222 
    +223                 for( i= 0, l= this.bonesActor.length; i<l; i+=1 ) {
    +224                     this.bonesActor[i].setupAnimation(time);
    +225                 }
    +226 
    +227                 this.AABB.setEmpty();
    +228                 for( i= 0, l= this.bonesActor.length; i<l; i+=1 ) {
    +229                     this.AABB.unionRectangle(this.bonesActor[i].AABB);
    +230                 }
    +231 
    +232                 return ret;
    +233             },
    +234 
    +235             paint : function( director, time ) {
    +236                 CAAT.Module.Skeleton.SkeletonActor.superclass.paint.call(this,director,time);
    +237                 for( var i= 0, l=this.bonesActor.length; i<l; i+=1 ) {
    +238                     this.bonesActor[i].paint( director.ctx, time );
    +239                 }
    +240 
    +241 
    +242                 if (this._showBones && this.skeleton) {
    +243                     this.worldModelViewMatrix.transformRenderingContextSet(director.ctx);
    +244                     this.skeleton.paint(this.worldModelViewMatrix, director.ctx);
    +245                 }
    +246             },
    +247 
    +248             __addBoneActor : function( boneActor ) {
    +249                 this.bonesActor.push( boneActor );
    +250                 boneActor.parent= this;
    +251                 return this;
    +252             },
    +253 
    +254             setSkin: function (skin) {
    +255 
    +256                 this.bonesActor= [];
    +257                 this.slotInfoArray = [];
    +258                 this.slotInfo = {};
    +259 
    +260                 var skeletonData = this.skeleton.getSkeletonDataFromFile();
    +261 
    +262                 // slots info
    +263                 for (var slot = 0; slot < skeletonData.slots.length; slot++) {
    +264                     var slotInfo = skeletonData.slots[slot];
    +265                     var bone = this.skeleton.getBoneById(slotInfo.bone);
    +266                     if (bone) {
    +267                         var slotInfoData = new SlotInfoData(
    +268                                 slot,
    +269                                 slotInfo.attachment,
    +270                                 slotInfo.name,
    +271                                 slotInfo.bone );
    +272 
    +273                         this.slotInfo[ bone.id ] = slotInfoData;
    +274                         this.slotInfoArray.push(slotInfoData);
    +275 
    +276 
    +277                         var skinData = null;
    +278                         if (skin) {
    +279                             skinData = skeletonData.skins[skin][slotInfo.name];
    +280                         }
    +281                         if (!skinData) {
    +282                             skinData = skeletonData.skins["default"][slotInfo.name];
    +283                         }
    +284                         if (skinData) {
    +285 
    +286                             //create an actor for each slot data found.
    +287                             var boneActorSkin = new CAAT.Module.Skeleton.BoneActor();
    +288                             boneActorSkin.id = slotInfo.name;
    +289                             boneActorSkin.setBone(bone);
    +290 
    +291                             this.__addBoneActor(boneActorSkin);
    +292                             this.skinByName[slotInfo.name] = boneActorSkin;
    +293 
    +294                             // add skining info for each slot data.
    +295                             for (var skinDef in skinData) {
    +296                                 var skinInfo = skinData[skinDef];
    +297                                 var angle= -(skinInfo.rotation || 0) * 2 * Math.PI / 360;
    +298                                 var x= skinInfo.x|0;
    +299                                 var y= -skinInfo.y|0;
    +300                                 var w= skinInfo.width|0;
    +301                                 var h= skinInfo.height|0;
    +302                                 var scaleX= skinInfo.scaleX|1;
    +303                                 var scaleY= skinInfo.scaleY|1;
    +304 
    +305                                 var matrix= CAAT.Math.Matrix.translate( -skinInfo.width/2, -skinInfo.height/2 );
    +306                                 matrix.premultiply( CAAT.Math.Matrix.rotate( angle ) );
    +307                                 matrix.premultiply( CAAT.Math.Matrix.scale( scaleX, scaleY ) );
    +308                                 matrix.premultiply( CAAT.Math.Matrix.translate( x, y ) );
    +309 
    +310                                 /*
    +311                                 only needed values are:
    +312                                   + image
    +313                                   + matrix
    +314                                   + name
    +315 
    +316                                   all the rest are just to keep original values.
    +317                                  */
    +318                                 boneActorSkin.addSkinInfo({
    +319                                     angle: angle,
    +320                                     x: x,
    +321                                     y: y,
    +322                                     width: w,
    +323                                     height: h,
    +324                                     image: this.director.getImage(skinData[skinDef].name ? skinData[skinDef].name : skinDef),
    +325                                     matrix : matrix,
    +326                                     scaleX : scaleX,
    +327                                     scaleY : scaleY,
    +328                                     name: skinDef
    +329                                 });
    +330                             }
    +331 
    +332                             boneActorSkin.setDefaultSkinInfoByName(slotInfo.attachment);
    +333                         }
    +334                     } else {
    +335                         console.log("Unknown bone to apply skin: " + slotInfo.bone);
    +336                     }
    +337                 }
    +338 
    +339                 return this;
    +340             },
    +341 
    +342             setAnimation: function (name, animationDuration ) {
    +343 
    +344                 this.animationDuration= animationDuration||0;
    +345 
    +346                 var animationInfo = this.skeleton.getAnimationDataByName(name);
    +347                 if (!animationInfo) {
    +348                     return;
    +349                 }
    +350 
    +351                 var animationSlots = animationInfo.slots;
    +352                 for (var animationSlot in animationSlots) {
    +353                     var attachments = animationSlots[animationSlot].attachment;
    +354                     var boneActor = this.skinByName[ animationSlot ];
    +355                     if (boneActor) {
    +356                         boneActor.emptySkinDataKeyframe();
    +357                         for (var i = 0, l = attachments.length - 1; i < l; i += 1) {
    +358                             var start = attachments[i].time;
    +359                             var len = attachments[i + 1].time - attachments[i].time;
    +360                             boneActor.addSkinDataKeyframe(attachments[i].name, start, len);
    +361                         }
    +362                     } else {
    +363                         console.log("Adding skinDataKeyframe to unkown boneActor: " + animationSlot);
    +364                     }
    +365                 }
    +366 
    +367                 return this;
    +368             },
    +369 
    +370             getBoneActorById : function( id ) {
    +371                 return this.skinByName[id];
    +372             },
    +373 
    +374             addAttachment : function( slotId, normalized_x, normalized_y, callback ) {
    +375                 var slotBoneActor= this.getBoneActorById(slotId);
    +376                 if ( slotBoneActor ) {
    +377                     slotBoneActor.addAttachment(slotId,normalized_x,normalized_y,callback);
    +378                 }
    +379             }
    +380         }
    +381     }
    +382 });
    \ No newline at end of file diff --git a/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_PathUtil_Path.js.html b/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_PathUtil_Path.js.html index 760cb809..6c7cb2ed 100644 --- a/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_PathUtil_Path.js.html +++ b/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_PathUtil_Path.js.html @@ -597,8 +597,8 @@ 590 * @param time {number} a value between 0 and 1 both inclusive. 0 will return path's starting coordinate. 591 * 1 will return path's end coordinate. 592 * @param open_contour {boolean=} treat this path as an open contour. It is intended for -593 * open paths, and interpolators which give values above 1. see @link -594 * @param tangent_threshold {number=} +593 * open paths, and interpolators which give values above 1. see tutorial 7.1. +594 * @link{../../documentation/tutorials/t7-1.html} 595 * 596 * @return {CAAT.Foundation.Point} 597 */ diff --git a/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_webgl_glu.js.html b/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_WebGL_GLU.js.html similarity index 100% rename from documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_webgl_glu.js.html rename to documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_WebGL_GLU.js.html diff --git a/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_core_class.js.html b/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_core_class.js.html deleted file mode 100644 index 8fe09670..00000000 --- a/documentation/jsdoc/symbols/src/_Users_ibon_js_CAAT_src_core_class.js.html +++ /dev/null @@ -1,474 +0,0 @@ -
      1 
    -  2 extend = function (subc, superc) {
    -  3     var subcp = subc.prototype;
    -  4 
    -  5     // Class pattern.
    -  6     var CAATObject = function () {
    -  7     };
    -  8     CAATObject.prototype = superc.prototype;
    -  9 
    - 10     subc.prototype = new CAATObject();       // chain prototypes.
    - 11     subc.superclass = superc.prototype;
    - 12     subc.prototype.constructor = subc;
    - 13 
    - 14     // Reset constructor. See Object Oriented Javascript for an in-depth explanation of this.
    - 15     if (superc.prototype.constructor === Object.prototype.constructor) {
    - 16         superc.prototype.constructor = superc;
    - 17     }
    - 18 
    - 19     // los metodos de superc, que no esten en esta clase, crear un metodo que
    - 20     // llama al metodo de superc.
    - 21     for (var method in subcp) {
    - 22         if (subcp.hasOwnProperty(method)) {
    - 23             subc.prototype[method] = subcp[method];
    - 24 
    - 25             /**
    - 26              * Sintactic sugar to add a __super attribute on every overriden method.
    - 27              * Despite comvenient, it slows things down by 5fps.
    - 28              *
    - 29              * Uncomment at your own risk.
    - 30              *
    - 31              // tenemos en super un metodo con igual nombre.
    - 32              if ( superc.prototype[method]) {
    - 33             subc.prototype[method]= (function(fn, fnsuper) {
    - 34                 return function() {
    - 35                     var prevMethod= this.__super;
    - 36 
    - 37                     this.__super= fnsuper;
    - 38 
    - 39                     var retValue= fn.apply(
    - 40                             this,
    - 41                             Array.prototype.slice.call(arguments) );
    - 42 
    - 43                     this.__super= prevMethod;
    - 44 
    - 45                     return retValue;
    - 46                 };
    - 47             })(subc.prototype[method], superc.prototype[method]);
    - 48         }
    - 49              */
    - 50 
    - 51         }
    - 52     }
    - 53 };
    - 54 
    - 55 
    - 56 extendWith = function (base, subclass, with_object) {
    - 57     var CAATObject = function () {
    - 58     };
    - 59 
    - 60     CAATObject.prototype = base.prototype;
    - 61 
    - 62     subclass.prototype = new CAATObject();
    - 63     subclass.superclass = base.prototype;
    - 64     subclass.prototype.constructor = subclass;
    - 65 
    - 66     if (base.prototype.constructor === Object.prototype.constructor) {
    - 67         base.prototype.constructor = base;
    - 68     }
    - 69 
    - 70     if (with_object) {
    - 71         for (var method in with_object) {
    - 72             if (with_object.hasOwnProperty(method)) {
    - 73                 subclass.prototype[ method ] = with_object[method];
    - 74                 /*
    - 75                  if ( base.prototype[method]) {
    - 76                  subclass.prototype[method]= (function(fn, fnsuper) {
    - 77                  return function() {
    - 78                  var prevMethod= this.__super;
    - 79                  this.__super= fnsuper;
    - 80                  var retValue= fn.apply(this, arguments );
    - 81                  this.__super= prevMethod;
    - 82 
    - 83                  return retValue;
    - 84                  };
    - 85                  })(subclass.prototype[method], base.prototype[method]);
    - 86                  }
    - 87                  /**/
    - 88             }
    - 89         }
    - 90     }
    - 91 };
    - 92 
    - 93 /**
    - 94  * Dynamic Proxy for an object or wrap/decorate a function.
    - 95  *
    - 96  * @param object
    - 97  * @param preMethod
    - 98  * @param postMethod
    - 99  * @param errorMethod
    -100  */
    -101 proxy = function (object, preMethod, postMethod, errorMethod) {
    -102 
    -103     // proxy a function
    -104     if (typeof object === 'function') {
    -105 
    -106         if (object.__isProxy) {
    -107             return object;
    -108         }
    -109 
    -110         return (function (fn) {
    -111 
    -112             var proxyfn = function () {
    -113                 if (preMethod) {
    -114                     preMethod({
    -115                         fn:fn,
    -116                         arguments:Array.prototype.slice.call(arguments)});
    -117                 }
    -118                 var retValue = null;
    -119                 try {
    -120                     // apply original function call with itself as context
    -121                     retValue = fn.apply(fn, Array.prototype.slice.call(arguments));
    -122                     // everything went right on function call, then call
    -123                     // post-method hook if present
    -124                     if (postMethod) {
    -125                         retValue = postMethod({
    -126                             fn:fn,
    -127                             arguments:Array.prototype.slice.call(arguments)});
    -128                     }
    -129                 } catch (e) {
    -130                     // an exeception was thrown, call exception-method hook if
    -131                     // present and return its result as execution result.
    -132                     if (errorMethod) {
    -133                         retValue = errorMethod({
    -134                             fn:fn,
    -135                             arguments:Array.prototype.slice.call(arguments),
    -136                             exception:e});
    -137                     } else {
    -138                         // since there's no error hook, just throw the exception
    -139                         throw e;
    -140                     }
    -141                 }
    -142 
    -143                 // return original returned value to the caller.
    -144                 return retValue;
    -145             };
    -146             proxyfn.__isProxy = true;
    -147 
    -148             for (var method in fn) {
    -149                 if (fn.hasOwnProperty(method) && typeof fn[method] !== "function") {
    -150                     if (method !== "__object" && method !== "__isProxy") {
    -151                         (function (proxyfn, fn, method) {
    -152                             proxyfn.__defineGetter__(method, function () {
    -153                                 return fn[method];
    -154                             });
    -155                             proxyfn.__defineSetter__(method, function (vale) {
    -156                                 fn[method] = vale;
    -157                             });
    -158                         })(proxyfn, fn, method);
    -159                     }
    -160                 }
    -161             }
    -162 
    -163 
    -164             return proxyfn;
    -165 
    -166         })(object);
    -167     }
    -168 
    -169     /**
    -170      * If not a function then only non privitive objects can be proxied.
    -171      * If it is a previously created proxy, return the proxy itself.
    -172      */
    -173     if (typeof object !== 'object' ||
    -174         isArray(object) ||
    -175         isString(object) ||
    -176         object.__isProxy) {
    -177 
    -178         return object;
    -179     }
    -180 
    -181     // Our proxy object class.
    -182     var cproxy = function () {
    -183     };
    -184     // A new proxy instance.
    -185     var proxy = new cproxy();
    -186     // hold the proxied object as member. Needed to assign proper
    -187     // context on proxy method call.
    -188     proxy.__object = object;
    -189     proxy.__isProxy = true;
    -190 
    -191     // For every element in the object to be proxied
    -192     for (var method in object) {
    -193 
    -194         // only function members
    -195         if (object.hasOwnProperty(method) && typeof object[method] === 'function') {
    -196             // add to the proxy object a method of equal signature to the
    -197             // method present at the object to be proxied.
    -198             // cache references of object, function and function name.
    -199             proxy[method] = (function (proxy, fn, method) {
    -200                 return function () {
    -201                     // call pre-method hook if present.
    -202                     if (preMethod) {
    -203                         preMethod({
    -204                             object:proxy.__object,
    -205                             method:method,
    -206                             arguments:Array.prototype.slice.call(arguments)});
    -207                     }
    -208                     var retValue = null;
    -209                     try {
    -210                         // apply original object call with proxied object as
    -211                         // function context.
    -212                         retValue = fn.apply(proxy.__object, arguments);
    -213                         // everything went right on function call, the call
    -214                         // post-method hook if present
    -215                         if (postMethod) {
    -216                             postMethod({
    -217                                 object:proxy.__object,
    -218                                 method:method,
    -219                                 arguments:Array.prototype.slice.call(arguments)});
    -220                         }
    -221                     } catch (e) {
    -222                         // an exeception was thrown, call exception-method hook if
    -223                         // present and return its result as execution result.
    -224                         if (errorMethod) {
    -225                             retValue = errorMethod({
    -226                                 object:proxy.__object,
    -227                                 method:method,
    -228                                 arguments:Array.prototype.slice.call(arguments),
    -229                                 exception:e});
    -230                         } else {
    -231                             // since there's no error hook, just throw the exception
    -232                             throw e;
    -233                         }
    -234                     }
    -235 
    -236                     // return original returned value to the caller.
    -237                     return retValue;
    -238                 };
    -239             })(proxy, object[method], method);
    -240         } else {
    -241             if (method !== "__object" && method !== "__isProxy") {
    -242                 (function (proxy, method) {
    -243                     proxy.__defineGetter__(method, function () {
    -244                         return proxy.__object[method];
    -245                     });
    -246                     proxy.__defineSetter__(method, function (vale) {
    -247                         proxy.__object[method] = vale;
    -248                     });
    -249                 })(proxy, method);
    -250             }
    -251         }
    -252     }
    -253 
    -254     // return our newly created and populated of functions proxy object.
    -255     return proxy;
    -256 };
    -257 
    -258 /** proxy sample usage
    -259 
    -260  var c0= new Meetup.C1(5);
    -261 
    -262  var cp1= proxy(
    -263  c1,
    -264  function() {
    -265         console.log('pre method on object: ',
    -266                 arguments[0].object.toString(),
    -267                 arguments[0].method,
    -268                 arguments[0].arguments );
    -269     },
    -270  function() {
    -271         console.log('post method on object: ',
    -272                 arguments[0].object.toString(),
    -273                 arguments[0].method,
    -274                 arguments[0].arguments );
    -275 
    -276     },
    -277  function() {
    -278         console.log('exception on object: ',
    -279                 arguments[0].object.toString(),
    -280                 arguments[0].method,
    -281                 arguments[0].arguments,
    -282                 arguments[0].exception);
    -283 
    -284         return -1;
    -285     });
    -286  **/
    -287 
    -288 proxify = function (ns, preMethod, postMethod, errorMethod, getter, setter) {
    -289 
    -290     var nns = "__" + ns + "__";
    -291 
    -292     var obj = window;
    -293     var path = ns.split(".");
    -294     while (path.length > 1) {
    -295         obj = obj[ path.shift() ];
    -296     }
    -297 
    -298     window[nns] = obj[path];
    -299 
    -300     (function (root, obj, path, nns, ns) {
    -301         var newC = function () {
    -302             console.log("Creating object of type proxy[" + ns + "]");
    -303             var obj = new root[nns](Array.prototype.slice.call(arguments));
    -304 
    -305             obj.____name = ns;
    -306             return proxyObject(obj, preMethod, postMethod, errorMethod, getter, setter);
    -307 
    -308         };
    -309 
    -310         // set new constructor function prototype as previous one.
    -311         newC.prototype = root[nns].prototype;
    -312 
    -313         for (var method in obj[path]) {
    -314             if (obj[path].hasOwnProperty(method) && typeof obj[path][method] !== "function") {
    -315                 if (method !== "__object" && method !== "__isProxy") {
    -316                     (function (prevConstructor, method, newC) {
    -317                         newC.__defineGetter__(method, function () {
    -318                             return prevConstructor[method];
    -319                         });
    -320                         newC.__defineSetter__(method, function (vale) {
    -321                             prevConstructor[method] = vale;
    -322                         });
    -323                     })(obj[path], method, newC);
    -324                 }
    -325             }
    -326         }
    -327 
    -328         obj[path] = newC;
    -329 
    -330     })(window, obj, path, nns, ns);
    -331 
    -332 };
    -333 
    -334 proxyObject = function (object, preMethod, postMethod, errorMethod, getter, setter) {
    -335 
    -336     /**
    -337      * If not a function then only non privitive objects can be proxied.
    -338      * If it is a previously created proxy, return the proxy itself.
    -339      */
    -340     if (typeof object !== 'object' ||
    -341         isArray(object) ||
    -342         isString(object) ||
    -343         object.__isProxy) {
    -344 
    -345         return object;
    -346     }
    -347 
    -348     // hold the proxied object as member. Needed to assign proper
    -349     // context on proxy method call.
    -350     object.$proxy__isProxy = true;
    -351 
    -352     // For every element in the object to be proxied
    -353     for (var method in object) {
    -354 
    -355         if (!object.hasOwnProperty(method)) {
    -356             continue;
    -357         }
    -358 
    -359         if (method === "constructor") {
    -360             continue;
    -361         }
    -362 
    -363         // only function members
    -364         if (typeof object[method] === 'function') {
    -365 
    -366             var fn = object[method];
    -367             object["$proxy__" + method] = fn;
    -368 
    -369             object[method] = (function (object, fn, fnname) {
    -370                 return function () {
    -371 
    -372                     var args = Array.prototype.slice.call(arguments);
    -373 
    -374                     // call pre-method hook if present.
    -375                     if (preMethod) {
    -376                         preMethod({
    -377                             object:object,
    -378                             objectName:object.____name,
    -379                             method:fnname,
    -380                             arguments:args });
    -381                     }
    -382                     var retValue = null;
    -383                     try {
    -384                         // apply original object call with proxied object as
    -385                         // function context.
    -386                         retValue = fn.apply(object, args);
    -387                         // everything went right on function call, the call
    -388                         // post-method hook if present
    -389                         if (postMethod) {
    -390                             /*var rr= */
    -391                             postMethod({
    -392                                 object:object,
    -393                                 objectName:object.____name,
    -394                                 method:fnname,
    -395                                 arguments:args });
    -396                             /*
    -397                              if ( typeof rr!=="undefined" ) {
    -398                              //retValue= rr;
    -399                              }
    -400                              */
    -401                         }
    -402                     } catch (e) {
    -403                         // an exeception was thrown, call exception-method hook if
    -404                         // present and return its result as execution result.
    -405                         if (errorMethod) {
    -406                             retValue = errorMethod({
    -407                                 object:object,
    -408                                 objectName:object.____name,
    -409                                 method:fnname,
    -410                                 arguments:args,
    -411                                 exception:e});
    -412                         } else {
    -413                             // since there's no error hook, just throw the exception
    -414                             throw e;
    -415                         }
    -416                     }
    -417 
    -418                     // return original returned value to the caller.
    -419                     return retValue;
    -420                 };
    -421             })(object, fn, method);
    -422         } else {
    -423             if (method !== "____name") {
    -424                 (function (object, attribute, getter, setter) {
    -425 
    -426                     object["$proxy__" + attribute] = object[attribute];
    -427 
    -428                     object.__defineGetter__(attribute, function () {
    -429                         if (getter) {
    -430                             getter(object.____name, attribute);
    -431                         }
    -432                         return object["$proxy__" + attribute];
    -433                     });
    -434                     object.__defineSetter__(attribute, function (value) {
    -435                         object["$proxy__" + attribute] = value;
    -436                         if (setter) {
    -437                             setter(object.____name, attribute, value);
    -438                         }
    -439                     });
    -440                 })(object, method, getter, setter);
    -441             }
    -442         }
    -443     }
    -444 
    -445     // return our newly created and populated with functions proxied object.
    -446     return object;
    -447 }
    -448 
    -449 CAAT.Module({
    -450     defines : "CAAT.Core.Class",
    -451     extendsWith : function() {
    -452 
    -453         /**
    -454          * See LICENSE file.
    -455          *
    -456          * Extend a prototype with another to form a classical OOP inheritance procedure.
    -457          *
    -458          * @param subc {object} Prototype to define the base class
    -459          * @param superc {object} Prototype to be extended (derived class).
    -460          */
    -461 
    -462 
    -463         return {
    -464 
    -465         };
    -466     }
    -467 });
    \ No newline at end of file diff --git a/documentation/tutorials/02_CAAT_Foundation_Actor_Events.html b/documentation/tutorials/02_CAAT_Foundation_Actor_Events.html index c5f175b7..7fbfe448 100644 --- a/documentation/tutorials/02_CAAT_Foundation_Actor_Events.html +++ b/documentation/tutorials/02_CAAT_Foundation_Actor_Events.html @@ -115,7 +115,7 @@

    Actor Input Events

    the following information:

    • screenPoint
      The 2D point of the screen coordinate that originated the mouse event.
    • -
    • x,y the same as screenPoint but w/o being wrapped in an object.
    • +
    • x,y the same as point but w/o being wrapped in an object.
    • point
      The 2D point of local Actor coordinates. Remember that local coordinates are from (0,0) to actor's (width,height). These 2D point is derived from the screenPoint. @@ -413,4 +413,4 @@

      Example

    - \ No newline at end of file + diff --git a/documentation/tutorials/index.html b/documentation/tutorials/index.html index e75bf6e7..e806d4c3 100644 --- a/documentation/tutorials/index.html +++ b/documentation/tutorials/index.html @@ -99,6 +99,10 @@

    What is CAAT ?

  • CAAT.Interpolator. Control behavior application.
  • Example +
  • Skeletal animation.
  • +
  • Spine format TBD + +
  • CAAT.Path. Complex paths to enrich your developments.
  • Linear Path
  • Curve Path @@ -107,6 +111,8 @@

    What is CAAT ?

  • Catmull-Rom
  • Traverse a Path
  • Path as Interpolator +
  • SVG import TBD +
  • Other CAAT Actors. Some helper actors.
  • ShapeActor diff --git a/readme.md b/readme.md index a246972a..9d220fe6 100644 --- a/readme.md +++ b/readme.md @@ -11,14 +11,18 @@ Follow the official twitter account CAAT's github pages, including: * Demos -* Tutorials +* Tutorials * API ## HOW TO ## -Tutorials can be found here. +Tutorials can be found here. ## Examples and sample code ## +Skeletal animation +Sprite Animations +Multiline text +Bitmap Atlas Path management Procedural fishpond Sprites traversing a random path @@ -49,7 +53,6 @@ Visit CAAT's github pages, inc Minimal Paint Auto Layout Fonts -Sprite Animations SVG Path CSS3 Keyframes diff --git a/src/Behavior/BaseBehavior.js b/src/Behavior/BaseBehavior.js index a2a6261a..527afeda 100644 --- a/src/Behavior/BaseBehavior.js +++ b/src/Behavior/BaseBehavior.js @@ -440,6 +440,10 @@ CAAT.Module({ return this; }, + isCycle : function() { + return this.cycleBehavior; + }, + /** * Adds an observer to this behavior. * @param behaviorListener an observer instance. diff --git a/src/Behavior/ContainerBehavior.js b/src/Behavior/ContainerBehavior.js index 1c94a734..fb2730cd 100644 --- a/src/Behavior/ContainerBehavior.js +++ b/src/Behavior/ContainerBehavior.js @@ -36,7 +36,7 @@ CAAT.Module({ * @type {Array.} */ behaviors:null, // contained behaviors array - + recursiveCycleBehavior : false, conforming : false, /** @@ -85,6 +85,20 @@ CAAT.Module({ return null; }, + setCycle : function( cycle, recurse ) { + CAAT.Behavior.ContainerBehavior.superclass.setCycle.call(this,cycle); + + if ( recurse ) { + for( var i=0; i=}, // dependencies class names - * extendsClass{string}, // class to extend from - * extensdWith{object}, // actual prototype to extend - * aliases{Array}, // other class names - * onCreation{function=} // optional callback to call after class creation. - * onPreCreation{function=} // optional callback to call after namespace class creation. + * extendsClass{string}, // class to extend from + * extensdWith{object}, // actual prototype to extend + * aliases{Array} // other class names * } * + * @name Module + * @memberof CAAT + * @static + * * @param obj {object} - * @private */ - CAAT.Module= function loadModule(obj) { + NS.Module= function loadModule(obj) { if (!obj.defines) { console.error("Bad module definition: "+obj); @@ -727,17 +740,17 @@ * @memberOf CAAT * @namespace */ - CAAT.ModuleManager= {}; + NS.ModuleManager= {}; /** * Define global base position for modules structure. * @param baseURL {string} * @return {*} */ - CAAT.ModuleManager.baseURL= function(baseURL) { + NS.ModuleManager.baseURL= function(baseURL) { if ( !baseURL ) { - return CAAT.Module; + return NS.Module; } if (!baseURL.endsWith("/") ) { @@ -745,7 +758,7 @@ } ModuleManager.baseURL= baseURL; - return CAAT.ModuleManager; + return NS.ModuleManager; }; /** @@ -753,7 +766,7 @@ * @param module {string} * @param path {string} */ - CAAT.ModuleManager.setModulePath= function( module, path ) { + NS.ModuleManager.setModulePath= function( module, path ) { if ( !path.endsWith("/") ) { path= path + "/"; @@ -774,7 +787,7 @@ return a= 0; pos--) { + this.removeBehaviour(bl[pos]); + } + // console.log(this.behaviorList); + return this; + }, /** * Remove a Behavior with id param as behavior identifier from this actor. * This function will remove ALL behavior instances with the given id. @@ -1512,12 +1540,19 @@ CAAT.Module({ this.parent.removeChild(this); } + this.fireEvent('destroyed', time); + if ( !this.isCachedActor ) { + this.clean(); + } + + }, + + clean : function() { this.backgroundImage= null; this.emptyBehaviorList(); - this.fireEvent('destroyed', time); this.lifecycleListenerList= []; - }, + /** * Transform a point or array of points in model space to view space. * @@ -1586,7 +1621,7 @@ CAAT.Module({ if (this.dirty) { this.setModelViewMatrix(); } - this.worldModelViewMatrixI = this.worldModelViewMatrix.getInverse(); + this.worldModelViewMatrix.getInverse(this.worldModelViewMatrixI); this.worldModelViewMatrixI.transformCoord(point); return point; }, @@ -1606,7 +1641,7 @@ CAAT.Module({ return null; } - this.modelViewMatrixI = this.modelViewMatrix.getInverse(); + this.modelViewMatrix.getInverse(this.modelViewMatrixI); this.modelViewMatrixI.transformCoord(point); return this.contains(point.x, point.y) ? this : null; }, @@ -1671,6 +1706,8 @@ CAAT.Module({ * @ignore */ this.mouseUp = function (mouseEvent) { + this.emit('mouseUp', mouseEvent); // TODO: make preventable, if 1 listener returns false, cancel the mouseDrag + this.__d_ax = -1; this.__d_ay = -1; }; @@ -1683,6 +1720,8 @@ CAAT.Module({ */ this.mouseDrag = function (mouseEvent) { + this.emit('mouseDrag', mouseEvent); // TODO: make preventable, if 1 listener returns false, cancel the mouseDrag + var pt; pt = this.modelToView(new CAAT.Math.Point(mouseEvent.x, mouseEvent.y)); @@ -1781,6 +1820,7 @@ CAAT.Module({ * @param mouseEvent {CAAT.Event.MouseEvent} */ mouseDown:function (mouseEvent) { + this.emit('mouseDown', mouseEvent); // TODO: make preventable, if 1 listener returns false, cancel the mouseDrag }, /** * default mouse release in Actor handler. @@ -2564,6 +2604,84 @@ CAAT.Module({ findActorById : function(id) { return this.id===id ? this : null; + }, + + + /** + * Add multiple event listeners to this Actor + * + * @param event listeners in the form { 'eventname': callbackFunction, 'othereventName': otherCallback } + */ + + addEventListeners: function(object) { + var event; + + for (event in object) { + if (!this.eventListeners[event]) { + this.eventListeners[event] = []; + } + this.eventListeners[event].push(object[event]); + } + return this; + }, + + /** + * Remove a single event listener from this Actor + * + * @param event name + * @param specified callback to be removed, a single event name can have multiple callbacks + */ + removeEventListener: function(event, callback) { + for (var i=0;i< this.eventListeners[event].length;i++) { + if(this.eventListeners[event][i] == callback) { + this.eventListeners[event].splice(i, 1); + return this; + } + } + return this; + }, + + /** + * Remove all event listeners from this Actor + * Can either remove all listeners on a single event name, or everything + * + * @param event name, if not specified, will remove every single event listener + */ + removeAllEventListeners: function(event) { + if (event) { + if (this.eventListeners[event]) { + this.eventListeners[event] = []; + } + } else { + this.eventListeners = {}; // remove everything + } + }, + + /** + * Shorthand method for adding a single event listener + * + * @param event name + * @param callback function + */ + on: function(event, callback, options) { // TODO: allow single: true in options to remove after first fire + var args = {}; + args[event] = callback; + return this.addEventListeners(args); + }, + + /** + * Fire an event on this object, calling all registered event listeners in turn + * + * @param event name + * @param callback functions will be called with this object as a single argument + */ + emit: function(event, params) { + if (!this.eventListeners || !this.eventListeners[event]) return this; + + for (var i=0;i< this.eventListeners[event].length;i++) { + this.eventListeners[event][i].call(null, params); + } + return this; } } } diff --git a/src/Foundation/ActorCSS.js b/src/Foundation/ActorCSS.js index 97429931..4ac0cb88 100644 --- a/src/Foundation/ActorCSS.js +++ b/src/Foundation/ActorCSS.js @@ -61,8 +61,10 @@ CAAT.Module({ this.setScale(1, 1); this.setRotation(0); - this.modelViewMatrix = new CAAT.Matrix(); - this.worldModelViewMatrix = new CAAT.Matrix(); + this.modelViewMatrix = new CAAT.Math.Matrix(); + this.modelViewMatrixI = new CAAT.Math.Matrix(); + this.worldModelViewMatrix = new CAAT.Math.Matrix(); + this.worldModelViewMatrixI = new CAAT.Math.Matrix(); return this; }, @@ -1436,7 +1438,7 @@ CAAT.Module({ * */ viewToModel:function (point) { - this.worldModelViewMatrixI = this.worldModelViewMatrix.getInverse(); + this.worldModelViewMatrix.getInverse(this.worldModelViewMatrixI); this.worldModelViewMatrixI.transformCoord(point); return point; }, @@ -1468,7 +1470,7 @@ CAAT.Module({ } this.setModelViewMatrix(); - this.modelViewMatrixI = this.modelViewMatrix.getInverse(); + this.modelViewMatrix.getInverse(this.modelViewMatrixI); this.modelViewMatrixI.transformCoord(point); return this.contains(point.x, point.y) ? this : null; }, diff --git a/src/Foundation/ActorContainer.js b/src/Foundation/ActorContainer.js index 4f717ce5..40fc64b1 100644 --- a/src/Foundation/ActorContainer.js +++ b/src/Foundation/ActorContainer.js @@ -263,6 +263,10 @@ CAAT.Module({ } } + if (this.postPaint) { + this.postPaint( director, time ); + } + ctx.restore(); return true; @@ -404,6 +408,15 @@ CAAT.Module({ addChildImmediately:function (child, constraint) { return this.addChild(child, constraint); }, + + addActorImmediately: function(child,constraint) { + return this.addChildImmediately(child,constraint); + }, + + addActor : function( child, constraint ) { + return this.addChild(child,constraint); + }, + /** * Adds an Actor to this ActorContainer. * The Actor will be added to the container AFTER frame animation, and not on method call time. @@ -544,6 +557,18 @@ CAAT.Module({ } return -1; }, + /** + * Removed all Actors from this ActorContainer. + * + * @return array of former children + */ + removeAllChildren: function() { + var cl = this.childrenList.slice(); // Make a shalow copy + for (var pos = cl.length-1;pos>=0;pos--) { + this.removeChildAt(pos); + } + return cl; + }, removeChildAt:function (pos) { var cl = this.childrenList; var rm; @@ -561,7 +586,7 @@ CAAT.Module({ return null; }, /** - * Removed an Actor form this ActorContainer. + * Removed an Actor from this ActorContainer. * If the Actor is not contained into this Container, nothing happends. * * @param child a CAAT.Foundation.Actor object instance. diff --git a/src/Foundation/ActorContainerCSS.js b/src/Foundation/ActorContainerCSS.js index c228e059..48fb1d9b 100644 --- a/src/Foundation/ActorContainerCSS.js +++ b/src/Foundation/ActorContainerCSS.js @@ -192,6 +192,15 @@ CAAT.Module({ */ endAnimate:function (director, time) { }, + + addActorImmediately: function(child,constraint) { + return this.addChildImmediately(child,constraint); + }, + + addActor : function( child, constraint ) { + return this.addChild(child,constraint); + }, + /** * Adds an Actor to this Container. * The Actor will be added ON METHOD CALL, despite the rendering pipeline stage being executed at diff --git a/src/Foundation/Director.js b/src/Foundation/Director.js index b16268a3..f98a2074 100644 --- a/src/Foundation/Director.js +++ b/src/Foundation/Director.js @@ -449,6 +449,11 @@ CAAT.Module({ return this.audioManager.cancelPlayByChannel(audioObject); }, + setAudioFormatExtensions : function( extensions ) { + this.audioManager.setAudioFormatExtensions(extensions); + return this; + }, + setValueForKey : function( key, value ) { this.__map[key]= value; return this; @@ -456,7 +461,6 @@ CAAT.Module({ getValueForKey : function( key ) { return this.__map[key]; - return this; }, createTimer:function (startTime, duration, callback_timeout, callback_tick, callback_cancel) { @@ -1137,7 +1141,7 @@ CAAT.Module({ this.timerManager.checkTimers(time); this.setModelViewMatrix(this); - this.modelViewMatrixI = this.modelViewMatrix.getInverse(); + this.modelViewMatrix.getInverse(this.modelViewMatrixI); this.setScreenBounds(); this.dirty = false; @@ -1340,6 +1344,46 @@ CAAT.Module({ this.setScene(0); } }, + + /** + * Private + * Gets a contained Scene index on this Director. + * + * @param scene a CAAT.Foundation.Scene object instance. + * + * @return {number} + */ + findScene:function (scene) { + var sl = this.scenes; + var i; + var len = sl.length; + + for (i = 0; i < len; i++) { + if (sl[i] === scene) { + return i; + } + } + return -1; + }, + + /** + * Private + * Removes a scene from this director. + * + * @param scene a CAAT.Foundation.Scene object instance or scene index. + * + * @return {number} + */ + removeScene: function(scene) { + if (typeof scene == 'number') { + this.scenes.splice(scene, 1); + } else { + var idx = this.findScene(scene); + if (idx > 0) { + this.scenes.splice(idx, 1); + } + } + }, /** * Get the number of scenes contained in the Director. * @return {number} the number of scenes contained in the Director. @@ -1558,10 +1602,11 @@ CAAT.Module({ /** * Changes (or sets) the current Director scene to the index * parameter. There will be no transition on scene change. - * @param sceneIndex {number} an integer indicating the index of the target Scene + * @param scene {number or scene object} an integer indicating the index of the target Scene or the target Scene itself * to be shown. */ - setScene:function (sceneIndex) { + setScene:function (scene) { + var sceneIndex = (typeof scene == 'number') ? scene : this.findScene(scene); var sin = this.scenes[ sceneIndex ]; this.childrenList = []; this.addChild(sin); @@ -1939,10 +1984,11 @@ CAAT.Module({ style = style ? style.getPropertyValue('position') : null; } -// if (!/^(relative|absolute|fixed)$/.test(style)) { + // Accumulate offsets... + x += node[left]; + y += node[top]; + if (!/^(fixed)$/.test(style)) { - x += node[left]; - y += node[top]; node = node[parent]; } else { break; @@ -2005,7 +2051,7 @@ CAAT.Module({ pt.x = posx; pt.y = posy; if (!this.modelViewMatrixI) { - this.modelViewMatrixI = this.modelViewMatrix.getInverse(); + this.modelViewMatrix.getInverse(this.modelViewMatrixI); } this.modelViewMatrixI.transformCoord(pt); posx = pt.x; @@ -2111,7 +2157,7 @@ CAAT.Module({ // check for mouse move threshold. if (!this.dragging) { - if (Math.abs(this.prevMousePoint.x - pos.x) < CAAT.DRAG_THRESHOLD_X || + if (Math.abs(this.prevMousePoint.x - pos.x) < CAAT.DRAG_THRESHOLD_X && Math.abs(this.prevMousePoint.y - pos.y) < CAAT.DRAG_THRESHOLD_Y) { return; } diff --git a/src/Foundation/SpriteImage.js b/src/Foundation/SpriteImage.js index 97ab7055..fd405eab 100644 --- a/src/Foundation/SpriteImage.js +++ b/src/Foundation/SpriteImage.js @@ -48,7 +48,9 @@ CAAT.Module({ this.mapInfo = {}; this.animationsMap= {}; - if ( arguments.length===3 ) { + if ( arguments.length===1 ) { + this.initialize.call(this, arguments[0], 1, 1); + } else if ( arguments.length===3 ) { this.initialize.apply(this, arguments); } return this; @@ -414,6 +416,21 @@ CAAT.Module({ return this; }, + /** + * Create elements as director.getImage values. + * Create as much as elements defined in this sprite image. + * The elements will be named prefix+ + * @param prefix + */ + addElementsAsImages : function( prefix ) { + for( var i in this.mapInfo ) { + var si= new CAAT.Foundation.SpriteImage().initialize( this.image, 1, 1 ); + si.addElement(0, this.mapInfo[i]); + si.setSpriteIndex(0); + CAAT.currentDirector.addImage( prefix+i, si ); + } + }, + copy : function( other ) { this.initialize(other,1,1); this.mapInfo= other.mapInfo; @@ -448,8 +465,8 @@ CAAT.Module({ yoff = yoff - h; } - var nw = (((r.width - xoff) / w) >> 0) + 1; - var nh = (((r.height - yoff) / h) >> 0) + 1; + var nw = (((r.width - xoff) / w)) + 1; + var nh = (((r.height - yoff) / h)) + 1; var i, j; var ctx = director.ctx; @@ -459,7 +476,7 @@ CAAT.Module({ this.image, el.x, el.y, el.width, el.height, - (r.x - this.ownerActor.x + xoff + j * el.width) >> 0, (r.y - this.ownerActor.y + yoff + i * el.height) >> 0, + (r.x - this.ownerActor.x + xoff + j * el.width), (r.y - this.ownerActor.y + yoff + i * el.height), el.width, el.height); } } @@ -489,7 +506,7 @@ CAAT.Module({ this.image, el.x, el.y, el.width, el.height, - this.offsetX >> 0, this.offsetY >> 0, + this.offsetX, this.offsetY, el.width, el.height); ctx.restore(); @@ -519,7 +536,7 @@ CAAT.Module({ this.image, el.x, el.y, el.width, el.height, - this.offsetX >> 0, this.offsetY >> 0, + this.offsetX, this.offsetY, el.width, el.height); ctx.restore(); @@ -551,7 +568,7 @@ CAAT.Module({ this.image, el.x, el.y, el.width, el.height, - this.offsetX >> 0, this.offsetY >> 0, + this.offsetX, this.offsetY, el.width, el.height); ctx.restore(); @@ -575,7 +592,7 @@ CAAT.Module({ this.image, el.x, el.y, el.width, el.height, - (this.offsetX + x) >> 0, (this.offsetY + y) >> 0, + (this.offsetX + x), (this.offsetY + y), el.width, el.height); return this; @@ -588,7 +605,7 @@ CAAT.Module({ this.image, el.x, el.y, el.width, el.height, - (this.offsetX + x) >> 0, (this.offsetY + y) >> 0, + (this.offsetX + x), (this.offsetY + y), w, h); return this; @@ -610,7 +627,7 @@ CAAT.Module({ this.image, el.x, el.y, el.width, el.height, - (this.offsetX + x) >> 0, (this.offsetY + y) >> 0, + (this.offsetX + x), (this.offsetY + y), this.ownerActor.width, el.height); return this; @@ -624,7 +641,7 @@ CAAT.Module({ this.image, el.x, el.y, el.width, el.height, - (this.offsetX + x) >> 0, (this.offsetY + y) >> 0, + (this.offsetX + x), (this.offsetY + y), el.width, el.height); return this; @@ -646,7 +663,7 @@ CAAT.Module({ this.image, el.x, el.y, el.width, el.height, - (this.offsetX + x) >> 0, (this.offsetY + y) >> 0, + (this.offsetX + x), (this.offsetY + y), this.ownerActor.width, this.ownerActor.height); return this; @@ -846,6 +863,39 @@ CAAT.Module({ return this.mapInfo[ index ]; }, + initializeFromGlyphDesigner : function( text ) { + for (var i = 0; i < text.length; i++) { + if (0 === text[i].indexOf("char ")) { + var str = text[i].substring(5); + var pairs = str.split(' '); + var obj = { + x: 0, + y: 0, + width: 0, + height: 0, + xadvance: 0, + xoffset: 0, + yoffset: 0 + }; + + for (var j = 0; j < pairs.length; j++) { + var pair = pairs[j]; + var pairData = pair.split("="); + var key = pairData[0]; + var value = pairData[1]; + if (value.charAt(0) === '"' && value.charAt(value.length - 1) === '"') { + value.substring(1, value.length - 1); + } + obj[ key ] = value; + } + + this.addElement(String.fromCharCode(obj.id), obj); + } + } + + return this; + }, + /** * This method takes the output generated from the tool at http://labs.hyperandroid.com/static/texture/spriter.html * and creates a map into that image. @@ -884,6 +934,25 @@ CAAT.Module({ return this; }, + initializeFromTexturePackerJSON : function( image, obj ) { + + for( var img in obj.frames ) { + var imgData= obj.frames[img]; + + var si_obj= { + x: imgData.frame.x, + y: imgData.frame.y, + width: imgData.spriteSourceSize.w, + height: imgData.spriteSourceSize.h, + id: '0' + }; + + var si= new CAAT.Foundation.SpriteImage().initialize( image, 1, 1 ); + si.addElement(0,si_obj); + CAAT.currentDirector.addImage( img.substring(0,img.indexOf('.')), si ); + } + }, + /** * Add one element to the spriteImage. * @param key {string|number} index or sprite identifier. diff --git a/src/Foundation/Timer/TimerManager.js b/src/Foundation/Timer/TimerManager.js index 5aa46101..9c953765 100644 --- a/src/Foundation/Timer/TimerManager.js +++ b/src/Foundation/Timer/TimerManager.js @@ -128,6 +128,16 @@ CAAT.Module({ tl.splice(i, 1); } } + }, + /** + * Removes all timers. + */ + removeAllTimers:function () { + var i; + var tl = this.timerList; + for (i = tl.length-1; i >= 0; i--) { + tl.splice(i, 1); + } } } }); diff --git a/src/Foundation/UI/Label.js b/src/Foundation/UI/Label.js index ef19715e..884f7d66 100644 --- a/src/Foundation/UI/Label.js +++ b/src/Foundation/UI/Label.js @@ -11,7 +11,8 @@ CAAT.Module( { depends : [ "CAAT.Foundation.Actor", "CAAT.Foundation.SpriteImage", - "CAAT.Module.Font.Font" + "CAAT.Module.Font.Font", + "CAAT.Foundation.UI.Layout.LayoutManager" ], aliases : ["CAAT.UI.Label"], extendsClass : "CAAT.Foundation.Actor", @@ -31,44 +32,50 @@ CAAT.Module( { renderContextStyle.prototype= { - ctx : null, - - defaultFS : null, - font : null, - fontSize : null, - fill : null, - stroke : null, - filled : null, - stroked : null, - strokeSize : null, - italic : null, - bold : null, - alignment : null, - tabSize : null, - shadow : null, - shadowBlur : null, - shadowColor : null, + ctx : null, + + defaultFS : null, + font : null, + fontSize : null, + fill : null, + stroke : null, + filled : null, + stroked : null, + strokeSize : null, + italic : null, + bold : null, + alignment : null, + tabSize : null, + shadow : null, + shadowBlur : null, + shadowColor : null, + shadowOffsetX: null, + shadowOffsetY: null, + - sfont : null, + sfont : null, - chain : null, + chain : null, setDefault : function( defaultStyles ) { - this.defaultFS = 24; - this.font = "Arial"; - this.fontSize = this.defaultFS; - this.fill = '#000'; - this.stroke = '#f00'; - this.filled = true; - this.stroked = false; - this.strokeSize = 1; - this.italic = false; - this.bold = false; - this.alignment = "left"; - this.tabSize = 75; - this.shadow = false; - this.shadowBlur = 0; - this.shadowColor= "#000"; + this.defaultFS = 24; + this.font = "Arial"; + this.fontSize = this.defaultFS; + this.fill = '#000'; + this.stroke = '#f00'; + this.filled = true; + this.stroked = false; + this.strokeSize = 1; + this.italic = false; + this.bold = false; + this.alignment = "left"; + this.tabSize = 75; + this.shadow = false; + this.shadowBlur = 0; + this.shadowColor = "#000"; + this.shadowOffsetX= 0; + this.shadowOffsetY= 0; + for( var style in defaultStyles ) { if ( defaultStyles.hasOwnProperty(style) ) { @@ -168,8 +175,10 @@ CAAT.Module( { __setShadow : function( ctx ) { if ( this.__getProperty("shadow" ) ) { - ctx.shadowBlur= this.__getProperty("shadowBlur"); - ctx.shadowColor= this.__getProperty("shadowColor"); + ctx.shadowBlur = this.__getProperty("shadowBlur"); + ctx.shadowColor = this.__getProperty("shadowColor"); + ctx.shadowOffsetX= this.__getProperty("shadowOffsetX"); + ctx.shadowOffsetY= this.__getProperty("shadowOffsetY"); } }, @@ -296,10 +305,10 @@ CAAT.Module( { var image_width; - if ( r && c ) { + if ( typeof r!=="undefined" && typeof c!=="undefined" ) { image_width= image.getWidth(); } else { - image_width= image.getWrappedImageWidth(); + image_width= ( image instanceof CAAT.Foundation.SpriteImage ) ? image.getWidth() : image.getWrappedImageWidth(); } // la imagen cabe en este sitio. @@ -528,6 +537,8 @@ CAAT.Module( { c= pairs[2]|0; } this.__image( this.images[image], r, c ); + } else if (CAAT.currentDirector.getImage(image) ) { + this.__image( CAAT.currentDirector.getImage(image) ); } } else if ( tag.indexOf("a=")===0 ) { pairs= tag.split("="); @@ -599,7 +610,12 @@ CAAT.Module( { this.height= image.getHeight(); if ( this.image instanceof CAAT.SpriteImage || this.image instanceof CAAT.Foundation.SpriteImage ) { - this.spriteIndex= r*image.columns+c; + + if ( typeof r==="undefined" || typeof c==="undefined" ) { + this.spriteIndex= 0; + } else { + this.spriteIndex= r*image.columns+c; + } this.paint= this.paintSI; } @@ -630,7 +646,7 @@ CAAT.Module( { }, getHeight : function() { - return this.image instanceof CAAT.Foundation.SpriteImage ? this.image.singleHeight : this.image.height; + return this.image instanceof CAAT.Foundation.SpriteImage ? this.image.getHeight() : this.image.height; }, getFontMetrics : function() { @@ -951,6 +967,20 @@ CAAT.Module( { */ clickCallback : null, + matchTextSize : true, + + /** + * Make the label actor the size the label document has been calculated for. + * @param match {boolean} + */ + setMatchTextSize : function( match ) { + this.matchTextSize= match; + if ( match ) { + this.width= this.preferredSize.width; + this.height= this.preferredSize.height; + } + }, + setStyle : function( name, styleData ) { this.styles[ name ]= styleData; return this; @@ -978,6 +1008,7 @@ CAAT.Module( { if ( null===_text ) { return; } + width = width || this.width; var cached= this.cached; if ( cached ) { @@ -1047,6 +1078,11 @@ CAAT.Module( { this.cacheAsBitmap(0,cached); } + if ( this.matchTextSize ) { + this.width= this.preferredSize.width; + this.height= this.preferredSize.height; + } + return this; }, @@ -1062,7 +1098,15 @@ CAAT.Module( { return this; }, - setDocumentPosition : function() { + setDocumentPosition : function( halign, valign ) { + + if ( typeof halign!=="undefined" ) { + this.setHorizontalAlignment(halign); + } + if ( typeof valign!=="undefined" ) { + this.setVerticalAlignment(valign); + } + var xo=0, yo=0; if ( this.valignment===CAAT.Foundation.UI.Layout.LayoutManager.ALIGNMENT.CENTER ) { diff --git a/src/Math/Matrix.js b/src/Math/Matrix.js index c7397bda..51cfcad9 100644 --- a/src/Math/Matrix.js +++ b/src/Math/Matrix.js @@ -38,6 +38,52 @@ CAAT.Module({ CAAT.Math.Matrix.prototype.transformRenderingContext= CAAT.Matrix.prototype.transformRenderingContext_NoClamp; CAAT.Math.Matrix.prototype.transformRenderingContextSet= CAAT.Matrix.prototype.transformRenderingContextSet_NoClamp; } + }, + /** + * Create a scale matrix. + * @param scalex {number} x scale magnitude. + * @param scaley {number} y scale magnitude. + * + * @return {CAAT.Matrix} a matrix object. + * + * @static + */ + scale:function (scalex, scaley) { + var m = new CAAT.Math.Matrix(); + + m.matrix[0] = scalex; + m.matrix[4] = scaley; + + return m; + }, + /** + * Create a new rotation matrix and set it up for the specified angle in radians. + * @param angle {number} + * @return {CAAT.Matrix} a matrix object. + * + * @static + */ + rotate:function (angle) { + var m = new CAAT.Math.Matrix(); + m.setRotation(angle); + return m; + }, + /** + * Create a translation matrix. + * @param x {number} x translation magnitude. + * @param y {number} y translation magnitude. + * + * @return {CAAT.Matrix} a matrix object. + * @static + * + */ + translate:function (x, y) { + var m = new CAAT.Math.Matrix(); + + m.matrix[2] = x; + m.matrix[5] = y; + + return m; } }, extendsWith:function () { @@ -55,7 +101,8 @@ CAAT.Module({ __init:function () { this.matrix = [ 1.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, 0.0, 1.0 ]; + 0.0, 1.0, 0.0, + 0.0, 0.0, 1.0 ]; if (typeof Float32Array !== "undefined") { this.matrix = new Float32Array(this.matrix); @@ -80,18 +127,7 @@ CAAT.Module({ return point; }, - /** - * Create a new rotation matrix and set it up for the specified angle in radians. - * @param angle {number} - * @return {CAAT.Matrix} a matrix object. - * - * @static - */ - rotate:function (angle) { - var m = new CAAT.Math.Matrix(); - m.setRotation(angle); - return m; - }, + setRotation:function (angle) { this.identity(); @@ -106,23 +142,7 @@ CAAT.Module({ return this; }, - /** - * Create a scale matrix. - * @param scalex {number} x scale magnitude. - * @param scaley {number} y scale magnitude. - * - * @return {CAAT.Matrix} a matrix object. - * - * @static - */ - scale:function (scalex, scaley) { - var m = new CAAT.Math.Matrix(); - - m.matrix[0] = scalex; - m.matrix[4] = scaley; - return m; - }, setScale:function (scalex, scaley) { this.identity(); @@ -131,23 +151,7 @@ CAAT.Module({ return this; }, - /** - * Create a translation matrix. - * @param x {number} x translation magnitude. - * @param y {number} y translation magnitude. - * - * @return {CAAT.Matrix} a matrix object. - * @static - * - */ - translate:function (x, y) { - var m = new CAAT.Math.Matrix(); - - m.matrix[2] = x; - m.matrix[5] = y; - return m; - }, /** * Sets this matrix as a translation matrix. * @param x @@ -283,7 +287,7 @@ CAAT.Module({ * Creates a new inverse matrix from this matrix. * @return {CAAT.Matrix} an inverse matrix. */ - getInverse:function () { + getInverse:function (out) { var tm = this.matrix; var m00 = tm[0]; @@ -296,7 +300,7 @@ CAAT.Module({ var m21 = tm[7]; var m22 = tm[8]; - var newMatrix = new CAAT.Math.Matrix(); + var newMatrix = out || new CAAT.Math.Matrix(); var determinant = m00 * (m11 * m22 - m21 * m12) - m10 * (m01 * m22 - m21 * m02) + m20 * (m01 * m12 - m11 * m02); if (determinant === 0) { diff --git a/src/Math/Rectangle.js b/src/Math/Rectangle.js index 0879ac45..e0f19787 100644 --- a/src/Math/Rectangle.js +++ b/src/Math/Rectangle.js @@ -23,8 +23,12 @@ CAAT.Module( { */ __init : function( x,y,w,h ) { - this.setLocation(x,y); - this.setDimension(w,h); + if ( arguments.length!==4 ) { + this.setEmpty(); + } else { + this.setLocation(x,y); + this.setDimension(w,h); + } }, /** diff --git a/src/Modules/Audio/AudioManager.js b/src/Modules/Audio/AudioManager.js index 3a8b0864..e85978af 100644 --- a/src/Modules/Audio/AudioManager.js +++ b/src/Modules/Audio/AudioManager.js @@ -25,9 +25,6 @@ CAAT.Module({ */ defines:"CAAT.Module.Audio.AudioManager", - depends:[ - "CAAT.Module.Runtime.BrowserInfo" - ], extendsWith:function () { return { @@ -36,20 +33,17 @@ CAAT.Module({ */ __init:function () { - this.browserInfo = CAAT.Module.Runtime.BrowserInfo; + this.isFirefox= navigator.userAgent.match(/Firefox/g)!==null; return this; }, + isFirefox : false, + /** * The only background music audio channel. */ musicChannel: null, - /** - * Some browser info needed to know whether we´re in FF so we can fix the loop bug. - */ - browserInfo:null, - /** * Is music enabled ? */ @@ -80,15 +74,29 @@ CAAT.Module({ */ loopingChannels:[], + /** + * available formats for audio elements. + * the system will load audio files with the extensions in this preferred order. + */ + audioFormatExtensions : [ + 'ogg', + 'wav', + 'x-wav', + 'mp3' + ], + + currentAudioFormatExtension : 'ogg', + /** * Audio formats. * @dict */ audioTypes:{ // supported audio formats. Don't remember where i took them from :S - 'mp3':'audio/mpeg;', - 'ogg':'audio/ogg; codecs="vorbis"', - 'wav':'audio/wav; codecs="1"', - 'mp4':'audio/mp4; codecs="mp4a.40.2"' + 'ogg': 'audio/ogg', + 'mp3': 'audio/mpeg;', + 'wav': 'audio/wav', + 'x-wav':'audio/x-wav', + 'mp4': 'audio/mp4"' }, /** @@ -100,7 +108,9 @@ CAAT.Module({ * * @return this. */ - initialize:function (numChannels) { + initialize:function (numChannels ) { + + this.setAudioFormatExtensions( this.audioFormatExtensions ); this.audioCache = []; this.channels = []; @@ -144,6 +154,45 @@ CAAT.Module({ return this; }, + + setAudioFormatExtensions : function( formats ) { + this.audioFormatExtensions= formats; + this.__setCurrentAudioFormatExtension(); + return this; + }, + + __setCurrentAudioFormatExtension : function( ) { + + var audio= new Audio(); + + for( var i= 0, l=this.audioFormatExtensions.length; i} @@ -144,7 +146,7 @@ CAAT.Module( { this.cfinished= onfinished; this.cloaded= onload_one; - this.cerroed= onerror; + this.cerrored= onerror; var i; diff --git a/src/Modules/Particle/Emitter.js b/src/Modules/Particle/Emitter.js new file mode 100644 index 00000000..8e2e960a --- /dev/null +++ b/src/Modules/Particle/Emitter.js @@ -0,0 +1,581 @@ +CAAT.Module({ + + /** + * + * CAAT.Module.Particle.Emitter is a particle emitter for CAAT. + * Because of the amount of particles that possibly need to be emitted, + * the Emitter is responsible for calculating the positions of particles + * and painting them on the canvas. Delegating that to the particle objects + * is too expensive. + * + * The Emitter is a port from https://github.com/city41/particle.js + * The port has been altered to make it more performant, allow it to be integrated + * into a CAAT based application, and allow it to emit particles along a custom CAAT.Path + * emitter Path. + * + * The Emitter is configured with a system config object (see configure method) + * + * @name Emitter + * @memberof CAAT.Module.Particle + * @constructor + * @author Rob Boerman + * + */ + + // TODO: add start/stop/events + // TODO: add particle rotation + + defines: "CAAT.Module.Particle.Emitter", + extendsClass: "CAAT.Foundation.Actor", + depends: [ + "CAAT.Foundation.Actor" + // "CAAT.Module.Particle.Particle" + ], + extendsWith: function () { + + /* internal utility functions */ + function isNumber(i) { + return typeof i === 'number'; + } + + function isInteger(num) { + return num === (num | 0); + } + + function random(minOrMax, maxOrUndefined, dontFloor) { + dontFloor = dontFloor || false; + + var min = isNumber(maxOrUndefined) ? minOrMax: 0; + var max = isNumber(maxOrUndefined) ? maxOrUndefined: minOrMax; + + var range = max - min; + + var result = Math.random() * range + min; + + if (isInteger(min) && isInteger(max) && ! dontFloor) { + return Math.floor(result); + } else { + return result; + } + } + + function random11() { + return random(-1, 1, true); + } + + + function normalize(vector) { + var length = Math.sqrt(vector.x * vector.x + vector.y * vector.y); + + vector.x /= length; + vector.y /= length; + } + + function merge(obj, config) { + for (var prop in config) { + if (config.hasOwnProperty(prop)) { + obj[prop] = config[prop]; + } + } + } + + function colorArrayToString(array, overrideAlpha) { + var r = array[0] | 0; + var g = array[1] | 0; + var b = array[2] | 0; + var a = overrideAlpha || array[3]; + + return 'rgba(' + r + ', ' + g + ', ' + b + ', ' + a + ')'; + } + + // Lookup variables for particle arrays + var PARTICLE_VARS = 0; + var PARTICLE_POS_X = PARTICLE_VARS++, + PARTICLE_POS_Y = PARTICLE_VARS++, + PARTICLE_STARTPOS_X = PARTICLE_VARS++, + PARTICLE_STARTPOS_Y = PARTICLE_VARS++, + PARTICLE_TANGENTIAL_X = PARTICLE_VARS++, + PARTICLE_TANGENTIAL_Y = PARTICLE_VARS++, + PARTICLE_FORCES_X = PARTICLE_VARS++, + PARTICLE_FORCES_Y = PARTICLE_VARS++, + PARTICLE_RADIAL_X = PARTICLE_VARS++, + PARTICLE_RADIAL_Y = PARTICLE_VARS++, + PARTICLE_VELOCITY_X = PARTICLE_VARS++, + PARTICLE_VELOCITY_Y = PARTICLE_VARS++, + PARTICLE_STARTANGLE = PARTICLE_VARS++, + PARTICLE_ROTATION = PARTICLE_VARS++, + PARTICLE_ROTATION_SPEED = PARTICLE_VARS++, + PARTICLE_RADIAL_ACCEL = PARTICLE_VARS++, + PARTICLE_TANGENTIAL_ACCEL = PARTICLE_VARS++, + PARTICLE_SCALE = PARTICLE_VARS++, + PARTICLE_DELTASCALE = PARTICLE_VARS++, + PARTICLE_RADIUS = PARTICLE_VARS++, + PARTICLE_COLOR = PARTICLE_VARS++, + PARTICLE_LIFE = PARTICLE_VARS++, + PARTICLE_DELTALIFE = PARTICLE_VARS++; + PARTICLE_SPAWNCOUNT = PARTICLE_VARS++; + + + return { + deltaColor: null, // rgba change per piece of a second delta + colors: null, // reusable array of intermediate colors + particleWidth: 0, + particleHeight: 0, + active: false, + started: false, + canvas: null, // Possible to specify a render canvas, otherwise it will take the director canvas + ctx: null, // specific render canvas 2d context + + __init: function (director) { + this.__super(); + + this.director = director; + this._particlePool = []; + + return this; + }, + + configure: function(system) { + this.system = system || {}; + + var texture = this.texture || null, + emitterPath = this.emitterPath || null; + + // Setup defaults + merge(this, { + totalParticles: 10, // Total particles in life + emissionRate: 10/2, // Amount of particles to emit per second + gravity: { // Gravity force in x and y direction + x: 0, + y: 0 + }, + posVar: { // Variance in emit point position, whether on path or single point + x: 0, + y: 0 + }, + angle: 0.5*Math.PI, // angle at which an emitted particle is fired + angleVar: 0, // variance in radians at which a particle is emitted + emitterPath: this.emitterPath || null, // it's possible to use a path along which a particle is randomly emitted. + angleFromPath: false, // if true, calculate the emit angle from the path, 0 rad = direction of path + speed: 25, // initial speed of emitted particle + speedVar: 0, // variance in speed of emitted particles + rotationSpeed: 0, // initial rotation speed in radians per second + rotationSpeedVar: 0, // variance in rotation speed + life: 2, // total life time per particle in seconds + lives: Infinity, // amount of respawns a particle gets + lifeVar: 0.1, // variance of life per particle in seconds + radialAccel: 0, // accelleration in direction of movement of particle in pixels per second^2 + radialAccelVar: 0, // variance in radial acceleration per particle in pixels per second^2 + tangentialAccel: 0, // accelleration perpendicular to movement of particle in pixels per second^2 + tangentialAccelVar: 0, // variance in tangential acceleration per particle in pixels per second^2 + texture: this.texture || null, // sprite image for particles, all coordinates are centered on the particle + radius: 5, // if texture is not available, a round particle with radial gradient will be created + textureAdditive: false, // true to set blending mode to 'lighter', adding colors written at same location + startScale: 1, // initial scale of emitted particle + endScale: 1, // final scale of particle at end of life + startColor: [255, 208, 0, 1], // [R,B,G,A] array of initial color of emitted particle + endColor: [255, 0, 0, 0], // [R,B,G,A] array of final color of emitted particle at end of life + colorSteps: 20, // the sprite image is tinted from the startcolor to end color in colorSteps steps + totalDuration: Infinity // total duration of particle emitter, emission needs to be restarted after + }); + + // Now merge the entered configuration on top of the defaults + merge(this, this.system); + + // Particle size defaults + this.particleWidth = 2* this.radius; + this.particleHeight = 2* this.radius; + this.started = false; + + return this; + }, + + setTexture: function(texture) { + if (texture) { + this.texture = texture; + this.particleWidth = texture.width; + this.particleHeight = texture.height; + return this; + } + + // By default create a white dot with tranparent edges if a texture has not been provided + this.texture = document.createElement('canvas'); + this.particleWidth = 2*this.radius; + this.particleHeight = 2*this.radius; + this.texture.width = this.particleWidth; + this.texture.height = this.particleHeight; + var ctx = this.texture.getContext('2d'); + var grd; + + // CocoonJS createRadialGradient does not work correct + if (navigator.isCocoonJS) { + grd = ctx.createRadialGradient(this.radius, this.radius, 0.8*this.radius, this.radius, this.radius, this.radius); + grd.addColorStop(0, 'rgba(255, 255, 255, 1)'); + grd.addColorStop(1, 'rgba(255, 255, 255, 0.5)'); + } else { + grd = ctx.createRadialGradient(this.radius, this.radius, 0.1*this.radius, this.radius, this.radius, this.radius); + grd.addColorStop(0, 'rgba(255, 255, 255, 1)'); + grd.addColorStop(1, 'rgba(255, 255, 255, 0)'); + } + + ctx.fillStyle = grd; + ctx.beginPath(); + ctx.arc( + this.radius, + this.radius, + this.radius, + 0, + 2 * Math.PI, + false + ); + + ctx.fill(); + + return this; + }, + + buildColors: function() { + this.colors = []; + + this.setTexture(this.texture); + + var startColor = this.startColor; + + // if there is no endColor, then the particle will end up staying at startColor the whole time + var endColor = startColor; + if (this.endColor) { + endColor = this.endColor; + } + + this.deltaColor = [(endColor[0] - startColor[0]) / this.life, (endColor[1] - startColor[1]) / this.life, (endColor[2] - startColor[2]) / this.life, (endColor[3] - startColor[3]) / this.life]; + + for (var i=0;i<=this.colorSteps;i++) { + var color = startColor.slice(); + var alpha = startColor[3]; + var scale = this.startScale + (i/this.colorSteps)*(this.endScale - this.startScale); + color[0] += this.deltaColor[0] * (i/this.colorSteps) * this.life; + color[1] += this.deltaColor[1] * (i/this.colorSteps) * this.life; + color[2] += this.deltaColor[2] * (i/this.colorSteps) * this.life; + alpha += this.deltaColor[3] * (i/this.colorSteps) * this.life; // Use the color alpha as global alpha for the sprite image + + var colorCanvas = document.createElement('canvas'); + colorCanvas.width = this.particleWidth; + colorCanvas.height = this.particleHeight; + var ctx = colorCanvas.getContext('2d'); + ctx.globalAlpha = alpha; + var centerX = (1-scale)*0.5*this.particleWidth; + var centerY = (1-scale)*0.5*this.particleHeight; + ctx.translate(1-scale,scale); + ctx.scale(scale,scale); + + ctx.drawImage(this.texture, 0, 0); + + // now use source-atop to "tint" the texture + ctx.globalCompositeOperation = "source-atop"; + ctx.fillStyle = colorArrayToString(color); + ctx.fillRect(0, 0, colorCanvas.width, colorCanvas.height); + + this.colors.push(colorCanvas); + } + }, + + setCanvas: function(canvas) { + this.canvas = canvas; + this.ctx = canvas.getContext('2d'); + return this; + }, + + // sets a path along which particles are emitted + setPath: function(path) { + this.emitterPath = path; + this.emitPoints = []; + var emitPoint; + + if (path) { + path.updatePath(); + var length = path.getLength(); + for (var i=0;i 0) ? life : 0; + + particle[PARTICLE_SCALE] = this.startScale || 1; + particle[PARTICLE_DELTASCALE] = typeof this.endScale != 'undefined' ? (this.endScale - this.startScale) : 0; + particle[PARTICLE_DELTASCALE] /= particle[PARTICLE_LIFE]; + + particle[PARTICLE_RADIUS] = typeof this.radius != 'undefined' ? this.radius + (this.radiusVar || 0) * random11() : 0; + + particle[PARTICLE_COLOR] = 0; + }, + + /* + * Updates a particle based on how much time has passed in delta + * Moves the particle using its velocity and all forces acting on it (gravity, + * radial and tangential acceleration), and updates all the properties of the + * particle like its size, color, etc + */ + _updateParticle: function(p, delta, i) { + if (p[PARTICLE_LIFE] > 0) { + + // these vectors are stored on the particle so we can reuse them, avoids + // generating lots of unnecessary objects each frame + + p[PARTICLE_FORCES_X] = 0; + p[PARTICLE_FORCES_Y] = 0; + + p[PARTICLE_RADIAL_X] = 0; + p[PARTICLE_RADIAL_Y] = 0; + + // dont apply radial forces until moved away from the emitter + if ((p[PARTICLE_POS_X] !== p[PARTICLE_STARTPOS_X] || p[PARTICLE_POS_Y] !== p[PARTICLE_STARTPOS_Y]) && (p[PARTICLE_RADIAL_ACCEL] || p[PARTICLE_TANGENTIAL_ACCEL])) { + p[PARTICLE_RADIAL_X] = p[PARTICLE_POS_X] - p[PARTICLE_STARTPOS_X]; + p[PARTICLE_RADIAL_Y] = p[PARTICLE_POS_Y] - p[PARTICLE_STARTPOS_Y]; + + // normalize + var length = Math.sqrt(p[PARTICLE_RADIAL_X] * p[PARTICLE_RADIAL_X] + p[PARTICLE_RADIAL_Y] * p[PARTICLE_RADIAL_Y]); + p[PARTICLE_RADIAL_X] /= length; + p[PARTICLE_RADIAL_Y] /= length; + } + + p[PARTICLE_TANGENTIAL_X] = p[PARTICLE_RADIAL_X]; + p[PARTICLE_TANGENTIAL_Y] = p[PARTICLE_RADIAL_Y]; + + p[PARTICLE_RADIAL_X] *= p[PARTICLE_RADIAL_ACCEL]; + p[PARTICLE_RADIAL_Y] *= p[PARTICLE_RADIAL_ACCEL]; + + var newy = p[PARTICLE_TANGENTIAL_X]; + p[PARTICLE_TANGENTIAL_X] = - p[PARTICLE_TANGENTIAL_Y]; + p[PARTICLE_TANGENTIAL_Y] = newy; + + p[PARTICLE_TANGENTIAL_X] *= p[PARTICLE_TANGENTIAL_ACCEL]; + p[PARTICLE_TANGENTIAL_Y] *= p[PARTICLE_TANGENTIAL_ACCEL]; + + p[PARTICLE_FORCES_X] = p[PARTICLE_RADIAL_X] + p[PARTICLE_TANGENTIAL_X] + this.gravity.x; + p[PARTICLE_FORCES_Y] = p[PARTICLE_RADIAL_Y] + p[PARTICLE_TANGENTIAL_Y] + this.gravity.y; + + p[PARTICLE_FORCES_X] *= delta; + p[PARTICLE_FORCES_Y] *= delta; + + p[PARTICLE_VELOCITY_X] += p[PARTICLE_FORCES_X]; + p[PARTICLE_VELOCITY_Y] += p[PARTICLE_FORCES_Y]; + + p[PARTICLE_POS_X] += p[PARTICLE_VELOCITY_X] * delta; + p[PARTICLE_POS_Y] += p[PARTICLE_VELOCITY_Y] * delta; + + p[PARTICLE_ROTATION] += p[PARTICLE_ROTATION_SPEED] * delta; + + p[PARTICLE_LIFE] -= delta; + p[PARTICLE_DELTALIFE] = 1 - (p[PARTICLE_LIFE]/this.life); + + if (p[PARTICLE_DELTALIFE] < 0) {p[PARTICLE_DELTALIFE] = 0;} // Math.max is EXPENSIVE + p[PARTICLE_COLOR] = (p[PARTICLE_DELTALIFE] * this.colors.length) | 0; + + ++this._particleIndex; + } else { + // the particle has died, time to return it to the particle pool + // take the particle at the current index + var temp = this._particlePool[i]; + + // and move it to the end of the active particles, keeping all alive particles pushed + // up to the front of the pool + this._particlePool[i] = this._particlePool[this._particleCount - 1]; + + if (temp[PARTICLE_SPAWNCOUNT] >= this.lives) { + this._particlePool.splice(this.__particleCount-1,1); + this.totalParticles--; + } else { + this._particlePool[this._particleCount - 1] = temp; + } + + // decrease the count to indicate that one less particle in the pool is active. + --this._particleCount; + } + }, + + animate: function (director, time) { + var i,l; + + if (!this.started) { + return this; + } + + if (!this.startTime) { + // Do nothing in the first frame, only set the start time + this.startTime = this.lastTime = time; + return this; + } + + this._elapsed = time - this.startTime; + var delta = (time - this.lastTime) / 1000; // in seconds, used fo emission rate per second + this.lastTime = time; + this.active = this._elapsed < this.totalDuration; + + if (!this.active) { + return this; + } + + CAAT.Module.Particle.Emitter.superclass.animate.call( this, director, time ); + + if (this.emissionRate) { + // emit new particles based on how much time has passed and the emission rate + var rate = 1.0 / this.emissionRate; + this._emitCounter += delta; + + while (!this._isFull() && this._emitCounter > rate) { + this._addParticle(); + this._emitCounter -= rate; + } + } + + this._particleIndex = 0; + + while (this._particleIndex < this._particleCount) { + var p = this._particlePool[this._particleIndex]; + this._updateParticle(p, delta, this._particleIndex); + } + + return this; + }, + + paint : function( director, time ) { + if (!this.active) { + return this; + } + + CAAT.Module.Particle.Emitter.superclass.paint.call(this,director,time); + + var ctx = this.ctx || director.ctx; + + if(this.textureAdditive) { + ctx.globalCompositeOperation = 'lighter'; + } else { + ctx.globalCompositeOperation = 'source-over'; + } + + var w, h; + for(var i = 0; i < this._particlePool.length; ++i) { + var p = this._particlePool[i]; + if (p[PARTICLE_LIFE] > 0) { + ctx.save(); + w = this.particleWidth*p[PARTICLE_SCALE]; + h = this.particleHeight*p[PARTICLE_SCALE]; + + // figure out the x and y locations to render at, to center the texture in the buffer + var x = p[PARTICLE_POS_X] - w / 2; + var y = p[PARTICLE_POS_Y] - h / 2; + ctx.translate(x, y); + ctx.rotate(p[PARTICLE_ROTATION]); + ctx.drawImage(this.colors[p[PARTICLE_COLOR]], 0, 0); + ctx.restore(); + } + } + } + }; + } +}); \ No newline at end of file diff --git a/src/Modules/Particle/Particle.js b/src/Modules/Particle/Particle.js new file mode 100644 index 00000000..67e7480b --- /dev/null +++ b/src/Modules/Particle/Particle.js @@ -0,0 +1,62 @@ +CAAT.Module({ + /** + * @name Particle + * @memberof CAAT.Module.Particle + * @constructor + */ + + defines : "CAAT.Module.Particle.Particle", + extendsWith : function() { + + function toRad(deg) { + return Math.PI * deg / 180; + } + + return { + __init : function() { + this.pos = { + x: 0, + y: 0 + }; + + this.startPos = { + x: 0, + y: 0 + }; + + this.tangential = { + x: 0, + y: 0 + }; + + this.forces = { + x: 0, + y: 0 + }; + + this.radial = { + x: 0, + y: 0 + }; + + this.setVelocity(0, 0); + this.life = 0; + + return this; + }, + + setVelocity: function(angle, speed) { + this.vel = { + x: Math.cos(angle) * speed, + y: -Math.sin(angle) * speed + }; + }, + + paint : function( ctx, time ) { + console.log('particle paint'); + + } + + }; + } +}); \ No newline at end of file diff --git a/src/Modules/Skeleton/Bone.js b/src/Modules/Skeleton/Bone.js old mode 100644 new mode 100755 index 7e11fc97..98179af7 --- a/src/Modules/Skeleton/Bone.js +++ b/src/Modules/Skeleton/Bone.js @@ -6,6 +6,19 @@ * To change this template use File | Settings | File Templates. */ CAAT.Module({ + + /** + * @name Skeleton + * @memberof CAAT.Module + * @namespace + */ + + /** + * @name Bone + * @memberof CAAT.Module.Skeleton + * @constructor + */ + defines : "CAAT.Module.Skeleton.Bone", depends : [ "CAAT.Behavior.Interpolator", @@ -16,6 +29,11 @@ CAAT.Module({ ], extendsWith : function() { + + /** + * @lends CAAT.Module.Skeleton.Bone.prototype + */ + var defPoint = { x: 0, y: 0 }; var defScale = { scaleX: 1, scaleY: 1 }; var defAngle = 0; @@ -24,6 +42,18 @@ CAAT.Module({ var cscale; var cpoint; + function fntr(behavior, orgtime, time, actor, value) { + cpoint= value; + } + + function fnsc(behavior, orgtime, time, actor, value) { + cscale= value; + } + + function fnrt(behavior, orgtime, time, actor, value) { + cangle= value; + } + return { id : null, @@ -102,38 +132,65 @@ CAAT.Module({ */ keyframesRotate : null, + /** + * @type object + */ + keyframesByAnimation : null, + + currentAnimation : null, + /** * @type Array. */ children : null, + behaviorApplicationTime : -1, + __init : function(id) { this.id= id; this.matrix= new CAAT.Math.Matrix(); this.wmatrix= new CAAT.Math.Matrix(); this.parent= null; this.children= []; - this.keyframesTranslate= new CAAT.Behavior.ContainerBehavior(true).setCycle(true).setId("keyframes_tr"); - this.keyframesScale= new CAAT.Behavior.ContainerBehavior(true).setCycle(true).setId("keyframes_sc"); - this.keyframesRotate= new CAAT.Behavior.ContainerBehavior(true).setCycle(true).setId("keyframes_rt"); - function fntr(behavior, orgtime, time, actor, value) { - cpoint= value; - } + this.keyframesByAnimation = {}; - function fnsc(behavior, orgtime, time, actor, value) { - cscale= value; - } + return this; + }, - function fnrt(behavior, orgtime, time, actor, value) { - cangle= value; - } + setBehaviorApplicationTime : function(t) { + this.behaviorApplicationTime= t; + return this; + }, - this.keyframesTranslate.addListener( { behaviorApplied : fntr }); - this.keyframesScale.addListener( { behaviorApplied : fnsc }); - this.keyframesRotate.addListener( { behaviorApplied : fnrt }); + __createAnimation : function(name) { - return this; + var keyframesTranslate= new CAAT.Behavior.ContainerBehavior(true).setCycle(true, true).setId("keyframes_tr"); + var keyframesScale= new CAAT.Behavior.ContainerBehavior(true).setCycle(true, true).setId("keyframes_sc"); + var keyframesRotate= new CAAT.Behavior.ContainerBehavior(true).setCycle(true, true).setId("keyframes_rt"); + + keyframesTranslate.addListener( { behaviorApplied : fntr }); + keyframesScale.addListener( { behaviorApplied : fnsc }); + keyframesRotate.addListener( { behaviorApplied : fnrt }); + + var animData= { + keyframesTranslate : keyframesTranslate, + keyframesScale : keyframesScale, + keyframesRotate : keyframesRotate + }; + + this.keyframesByAnimation[name]= animData; + + return animData; + }, + + __getAnimation : function(name) { + var animation= this.keyframesByAnimation[ name ]; + if (!animation) { + animation= this.__createAnimation(name); + } + + return animation; }, /** @@ -159,17 +216,6 @@ CAAT.Module({ } }, - /** - * - * @param keyframes {CAAT.Behavior.ContainerBehavior} - * @returns {*} - */ - setTranslationKeyframes : function( keyframes ) { - this.keyframesTranslate= keyframes; - this.__noValue( keyframes ); - return this; - }, - __setInterpolator : function(behavior, curve) { if (curve && curve!=="stepped") { behavior.setInterpolator( @@ -184,6 +230,7 @@ CAAT.Module({ /** * + * @param name {string} keyframe animation name * @param angleStart {number} rotation start angle * @param angleEnd {number} rotation end angle * @param timeStart {number} keyframe start time @@ -191,17 +238,21 @@ CAAT.Module({ * @param curve {Array.=} 4 numbers definint a quadric bezier info. two first points * assumed to be 0,0. */ - addRotationKeyframe : function( angleStart, angleEnd, timeStart, timeEnd, curve ) { + addRotationKeyframe : function( name, angleStart, angleEnd, timeStart, timeEnd, curve ) { var as= 2*Math.PI*angleStart/360; var ae= 2*Math.PI*angleEnd/360; + // minimum distant between two angles. + if ( as<-Math.PI ) { if (Math.abs(as+this.rotationAngle)>2*Math.PI) { as= -(as+Math.PI); } else { as= (as+Math.PI); } + } else if (as > Math.PI) { + as -= 2 * Math.PI; } if ( ae<-Math.PI ) { @@ -211,12 +262,13 @@ CAAT.Module({ } else { ae= (ae+Math.PI); } + } else if ( ae>Math.PI ) { + ae-=2*Math.PI; } angleStart= -as; angleEnd= -ae; - var behavior= new CAAT.Behavior.RotateBehavior(). setFrameTime( timeStart, timeEnd-timeStart+1). setValues( angleStart, angleEnd, 0, .5). @@ -224,14 +276,15 @@ CAAT.Module({ this.__setInterpolator( behavior, curve ); - this.keyframesRotate.addBehavior(behavior); + var animation= this.__getAnimation(name); + animation.keyframesRotate.addBehavior(behavior); }, - endRotationKeyframes : function() { + endRotationKeyframes : function(name) { }, - addTranslationKeyframe : function( startX, startY, endX, endY, timeStart, timeEnd, curve ) { + addTranslationKeyframe : function( name, startX, startY, endX, endY, timeStart, timeEnd, curve ) { var behavior= new CAAT.Behavior.PathBehavior(). setFrameTime( timeStart, timeEnd-timeStart+1). setValues( new CAAT.PathUtil.Path(). @@ -241,42 +294,33 @@ CAAT.Module({ this.__setInterpolator( behavior, curve ); - this.keyframesTranslate.addBehavior( behavior ); + var animation= this.__getAnimation(name); + animation.keyframesTranslate.addBehavior( behavior ); }, - endTranslationKeyframes : function() { + addScaleKeyframe : function( name, scaleX, endScaleX, scaleY, endScaleY, timeStart, timeEnd, curve ) { + var behavior= new CAAT.Behavior.ScaleBehavior(). + setFrameTime( timeStart, timeEnd-timeStart+1). + setValues( scaleX, endScaleX, scaleY, endScaleY ). + setValueApplication(false); - }, + this.__setInterpolator( behavior, curve ); - setSize : function(s) { - this.width= s; - this.height= 0; + var animation= this.__getAnimation(name); + animation.keyframesScale.addBehavior( behavior ); }, - endScaleKeyframes : function() { + endTranslationKeyframes : function(name) { }, - /** - * - * @param keyframes {CAAT.Behavior.ContainerBehavior} - * @returns {*} - */ - setRotationKeyframes : function( keyframes ) { - this.keyframesRotate= keyframes; - this.__noValue( keyframes ); - return this; + setSize : function(s) { + this.width= s; + this.height= 0; }, - /** - * - * @param keyframes {CAAT.Behavior.ContainerBehavior} - * @returns {*} - */ - setScaleKeyframes : function( keyframes ) { - this.keyframesScale= keyframes; - this.__noValue( keyframes ); - return this; + endScaleKeyframes : function(name) { + }, setPosition : function( x, y ) { @@ -331,7 +375,7 @@ CAAT.Module({ mm2 = this.wx - this.positionAnchorX * this.width; mm5 = this.wy - this.positionAnchorY * this.height; - if (this.rotationAngle) { + if (this.wrotationAngle) { var rx = this.rotationAnchorX * this.width; var ry = this.rotationAnchorY * this.height; @@ -385,18 +429,39 @@ CAAT.Module({ } }, + setAnimation : function(name) { + var animation= this.keyframesByAnimation[name]; + if (animation) { + this.keyframesRotate= animation.keyframesRotate; + this.keyframesScale= animation.keyframesScale; + this.keyframesTranslate= animation.keyframesTranslate; + } + + for( var i= 0, l=this.children.length; i=sdkf.start && time<=sdkf.start+sdkf.duration ) { + return this.currentSkinInfo= this.skinInfoByName[ sdkf.name ]; + } } + return null; + } + + return this.currentSkinInfo; + }, + + paint : function( ctx, time ) { + + var skinInfo= this.__getCurrentSkinInfo(time); + + if (!skinInfo || !skinInfo.image) { + return; + } + + /* var w= skinInfo.width*.5; var h= skinInfo.height*.5; - ctx.save(); - ctx.translate(-w+skinInfo.x, -h+skinInfo.y ); + ctx.translate(skinInfo.x, skinInfo.y ); + ctx.rotate(skinInfo.angle); + ctx.scale(skinInfo.scaleX, skinInfo.scaleY); + ctx.translate( -w, -h); + */ + + this.worldModelViewMatrix.transformRenderingContextSet(ctx); + skinInfo.matrix.transformRenderingContext( ctx ); + ctx.drawImage( skinInfo.image, 0, 0, skinInfo.image.width, skinInfo.image.height ); + + }, + + setupAnimation : function(time) { + this.setModelViewMatrix(); + this.prepareAABB(time); + this.__setupAttachments(); + }, - ctx.translate(w, h); - ctx.rotate(skinInfo.angle); - ctx.translate( -w, -h); + prepareAABB : function(time) { + var skinInfo= this.__getCurrentSkinInfo(time); + var x=0, y=0, w, h; - ctx.drawImage( skinInfo.image, 0, 0, skinInfo.image.width, skinInfo.image.height ); - ctx.restore(); + if ( skinInfo ) { + w= skinInfo.width; + h= skinInfo.height; + } else { + w= h= 1; } + var vv= [ + new CAAT.Math.Point(x,y), + new CAAT.Math.Point(x+w,0), + new CAAT.Math.Point(x+w, y+h), + new CAAT.Math.Point(x, y + h) + ]; + + var AABB= this.AABB; + var vvv; + + /** + * cache the bone+skin matrix for later usage in attachment calculations. + */ + var amatrix= this.skinMatrix; + amatrix.copy( this.worldModelViewMatrix ); + amatrix.multiply( this.currentSkinInfo.matrix ); + + for( var i=0; i xmax) { + xmax = vvv.x; + } + if (vvv.y < ymin) { + ymin = vvv.y; + } + if (vvv.y > ymax) { + ymax = vvv.y; + } + vvv = vv[1]; + if (vvv.x < xmin) { + xmin = vvv.x; + } + if (vvv.x > xmax) { + xmax = vvv.x; + } + if (vvv.y < ymin) { + ymin = vvv.y; + } + if (vvv.y > ymax) { + ymax = vvv.y; + } + vvv = vv[2]; + if (vvv.x < xmin) { + xmin = vvv.x; + } + if (vvv.x > xmax) { + xmax = vvv.x; + } + if (vvv.y < ymin) { + ymin = vvv.y; + } + if (vvv.y > ymax) { + ymax = vvv.y; + } + vvv = vv[3]; + if (vvv.x < xmin) { + xmin = vvv.x; + } + if (vvv.x > xmax) { + xmax = vvv.x; + } + if (vvv.y < ymin) { + ymin = vvv.y; + } + if (vvv.y > ymax) { + ymax = vvv.y; + } + + AABB.x = xmin; + AABB.y = ymin; + AABB.x1 = xmax; + AABB.y1 = ymax; + AABB.width = (xmax - xmin); + AABB.height = (ymax - ymin); }, setModelViewMatrix : function() { - this.modelViewMatrix.copy( this.bone.wmatrix ); if (this.parent) { - - this.isAA = false; this.worldModelViewMatrix.copy(this.parent.worldModelViewMatrix); - this.worldModelViewMatrix.multiply(this.modelViewMatrix); - this.wdirty = true; + this.worldModelViewMatrix.multiply(this.bone.wmatrix); } else { - if (this.dirty) { - this.wdirty = true; - } - this.worldModelViewMatrix.identity(); - this.isAA = this.rotationAngle === 0 && this.scaleX === 1 && this.scaleY === 1; } + }, + + __setupAttachments : function( ) { + for( var i= 0, l=this.attachments.length; i + */ + slotInfo: null, - animate : function( director, time ) { - this.skeleton.calculate(time); - return CAAT.Module.Skeleton.SkeletonActor.superclass.animate.call(this, director, time); - }, + /** + * @type Array. + */ + slotInfoArray: null, - paint : function( director, time ) { - if (!this.skeleton) { - return; - } + /** + * @type object + * @map + */ + skinByName: null, + + /** + * @type CAAT.Foundation.Director + */ + director: null, + + /** + * @type boolean + */ + _showBones: false, + + /** + * Currently selected animation play time. + * Zero to make it last for its default value. + * @type number + */ + animationDuration : 0, + + showAABB : false, + bonesActor : null, + + __init: function (director, skeleton) { + this.__super(); + + this.director = director; + this.skeleton = skeleton; + this.slotInfo = {}; + this.slotInfoArray = []; + this.bonesActor= []; + this.skinByName = {}; - this.skeleton.paint(this.worldModelViewMatrix, director.ctx); - -// CAAT.Foundation.ActorContainer.superclass.paint.call( this, director, time ); - }, - - setSkinInfo : function( skeleton, director ) { - - // slots info - for( var slot=0; slotssItemWidth ) { + ssItemWidth= AABBs[i].width; + } + if ( AABBs[i].height>ssItemHeight ) { + ssItemHeight= AABBs[i].height; + } + } + ssItemWidth= (ssItemWidth|0)+1; + ssItemHeight= (ssItemHeight|0)+1; - // set actors order. - for( var i=0; issItemMaxOffsetY ) { + ssItemMaxOffsetY= offsetY; + } + + if ( offsetX>ssItemMaxOffsetX ) { + ssItemMaxOffsetX= offsetX; + } + } + + + // create a canvas of the neccessary size + var canvas= document.createElement("canvas"); + canvas.width= ssItemWidth * numSprites; + canvas.height= ssItemHeight; + var ctx= canvas.getContext("2d"); + + // draw animation into canvas. + for( j=0; j "${FILE_CAAT}" +echo "/*" > "${FILE_CAAT}" cat LICENSE >> "${FILE_CAAT}" -echo -e "\nVersion: ${VERSION}\n" >> "${FILE_CAAT}" -echo -e "Created on:" >> "${FILE_CAAT}" +echo "\nVersion: ${VERSION}\n" >> "${FILE_CAAT}" +echo "Created on:" >> "${FILE_CAAT}" date "+DATE: %Y-%m-%d%nTIME: %H:%M:%S" >> "${FILE_CAAT}" -echo -e "*/\n\n" >> "${FILE_CAAT}" +echo "*/\n\n" >> "${FILE_CAAT}" more ./src/Core/ModuleManager.js >> "${FILE_CAAT}" more ./src/Core/Constants.js >> "${FILE_CAAT}" @@ -56,6 +58,7 @@ more ./src/Modules/CircleManager/PackedCircle.js >> "${FILE_CAAT}" more ./src/Modules/CircleManager/PackedCircleManager.js >> "${FILE_CAAT}" more ./src/Modules/Image/Preloader/Preloader.js >> "${FILE_CAAT}" more ./src/Modules/Image/Preloader/ImagePreloader.js >> "${FILE_CAAT}" +more ./src/Modules/Image/Preloader/XHR.js >> "${FILE_CAAT}" more ./src/Modules/Image/Util/ImageUtil.js >> "${FILE_CAAT}" more ./src/Modules/Collision/Quadtree.js >> "${FILE_CAAT}" more ./src/Modules/Collision/SpatialHash.js >> "${FILE_CAAT}" @@ -69,6 +72,9 @@ more ./src/Modules/Initialization/Template.js >> "${FILE_CAAT}" more ./src/Modules/Initialization/TemplateWithSplash.js >> "${FILE_CAAT}" more ./src/Modules/CSS/csskeyframehelper.js >> "${FILE_CAAT}" +# more ./src/Modules/Particle/Particle.js >> "${FILE_CAAT}" +more ./src/Modules/Particle/Emitter.js >> "${FILE_CAAT}" + more ./src/PathUtil/PathSegment.js >> "${FILE_CAAT}" more ./src/PathUtil/ArcPath.js >> "${FILE_CAAT}" @@ -118,15 +124,13 @@ more ./src/Foundation/UI/ShapeActor.js >> "${FILE_CAAT}" more ./src/Foundation/UI/StarActor.js >> "${FILE_CAAT}" more ./src/Foundation/UI/TextActor.js >> "${FILE_CAAT}" -echo -e "CAAT.ModuleManager.solveAll();" >> "${FILE_CAAT}" +echo "CAAT.ModuleManager.solveAll();" >> "${FILE_CAAT}" # Distribute resulting compiled files # -echo -e "\nCopying:" -while read LINE; do - echo -e "\tCopying results to ${LINE}" - cp ${FILE_CAAT} ${LINE} -done < version.distribution +echo "\nCopying:" +echo "\tCopying results to ${CAAT_BUILD_DIR}" +cp ${FILE_CAAT} ${CAAT_BUILD_DIR} @@ -134,16 +138,16 @@ done < version.distribution # CSS # echo "Packing ${FILE_CAAT_CSS}" -echo -e "/*" > "${FILE_CAAT_CSS}" +echo "/*" > "${FILE_CAAT_CSS}" cat LICENSE >> "${FILE_CAAT_CSS}" -echo -e "\nVersion: ${VERSION}\n" >> "${FILE_CAAT_CSS}" -echo -e "Created on:" >> "${FILE_CAAT_CSS}" +echo "\nVersion: ${VERSION}\n" >> "${FILE_CAAT_CSS}" +echo "Created on:" >> "${FILE_CAAT_CSS}" date "+DATE: %Y-%m-%d%nTIME: %H:%M:%S" >> "${FILE_CAAT_CSS}" -echo -e "*/\n\n" >> "${FILE_CAAT_CSS}" +echo "*/\n\n" >> "${FILE_CAAT_CSS}" more ./src/Core/ModuleManager.js >> "${FILE_CAAT_CSS}" -echo -e "CAAT.__CSS__=1;" >> "${FILE_CAAT_CSS}" +echo "CAAT.__CSS__=1;" >> "${FILE_CAAT_CSS}" more ./src/Core/Constants.js >> "${FILE_CAAT_CSS}" more ./src/Core/Class.js >> "${FILE_CAAT_CSS}" @@ -176,6 +180,7 @@ more ./src/Modules/CircleManager/PackedCircle.js >> "${FILE_CAAT_CSS}" more ./src/Modules/CircleManager/PackedCircleManager.js >> "${FILE_CAAT_CSS}" more ./src/Modules/Image/Preloader/Preloader.js >> "${FILE_CAAT_CSS}" more ./src/Modules/Image/Preloader/ImagePreloader.js >> "${FILE_CAAT_CSS}" +more ./src/Modules/Image/Preloader/XHR.js >> "${FILE_CAAT_CSS}" more ./src/Modules/Image/Util/ImageUtil.js >> "${FILE_CAAT_CSS}" more ./src/Modules/Collision/Quadtree.js >> "${FILE_CAAT_CSS}" more ./src/Modules/Collision/SpatialHash.js >> "${FILE_CAAT_CSS}" @@ -189,6 +194,9 @@ more ./src/Modules/Initialization/Template.js >> "${FILE_CAAT_CSS}" more ./src/Modules/Initialization/TemplateWithSplash.js >> "${FILE_CAAT_CSS}" more ./src/Modules/CSS/csskeyframehelper.js >> "${FILE_CAAT}" +# more ./src/Modules/Particle/Particle.js >> "${FILE_CAAT_CSS}" +# more ./src/Modules/Particle/Emitter.js >> "${FILE_CAAT_CSS}" + more ./src/PathUtil/PathSegment.js >> "${FILE_CAAT_CSS}" more ./src/PathUtil/ArcPath.js >> "${FILE_CAAT_CSS}" @@ -234,38 +242,34 @@ more ./src/Foundation/UI/ShapeActor.js >> "${FILE_CAAT_CSS}" more ./src/Foundation/UI/StarActor.js >> "${FILE_CAAT_CSS}" more ./src/Foundation/UI/TextActor.js >> "${FILE_CAAT_CSS}" -echo -e "CAAT.ModuleManager.solveAll();" >> "${FILE_CAAT_CSS}" +echo "CAAT.ModuleManager.solveAll();" >> "${FILE_CAAT_CSS}" # Distribute resulting compiled files # -echo -e "\nCopying:" -while read LINE; do - echo -e "\tCopying results to ${LINE}" - cp ${FILE_CAAT_CSS} ${LINE} -done < version.distribution +echo "\nCopying:" +echo "\tCopying results to ${CAAT_BUILD_DIR}" +cp ${FILE_CAAT_CSS} ${CAAT_BUILD_DIR} # box2d echo "Packing ${FILE_CAAT_BOX2D}" -echo -e "/*" > "${FILE_CAAT_BOX2D}" +echo "/*" > "${FILE_CAAT_BOX2D}" cat LICENSE >> "${FILE_CAAT_BOX2D}" -echo -e "\nVersion: ${VERSION}\n" >> "${FILE_CAAT_BOX2D}" -echo -e "Created on:" >> "${FILE_CAAT_BOX2D}" +echo "\nVersion: ${VERSION}\n" >> "${FILE_CAAT_BOX2D}" +echo "Created on:" >> "${FILE_CAAT_BOX2D}" date "+DATE: %Y-%m-%d%nTIME: %H:%M:%S" >> "${FILE_CAAT_BOX2D}" -echo -e "*/\n\n" >> "${FILE_CAAT_BOX2D}" +echo "*/\n\n" >> "${FILE_CAAT_BOX2D}" more ./src/Foundation/Box2D/B2DBodyActor.js >> "${FILE_CAAT_BOX2D}" more ./src/Foundation/Box2D/B2DCircularBody.js >> "${FILE_CAAT_BOX2D}" more ./src/Foundation/Box2D/B2DPolygonBody.js >> "${FILE_CAAT_BOX2D}" -echo -e "CAAT.ModuleManager.solveAll();" >> "${FILE_CAAT_BOX2D}" +echo "CAAT.ModuleManager.solveAll();" >> "${FILE_CAAT_BOX2D}" # Distribute resulting compiled files # -echo -e "\nCopying:" -while read LINE; do - echo -e "\tCopying results to ${LINE}" - cp ${FILE_CAAT_BOX2D} ${LINE} -done < version.distribution +echo "\nCopying:" +echo "\tCopying results to ${CAAT_BUILD_DIR}" +cp ${FILE_CAAT_BOX2D} ${CAAT_BUILD_DIR} diff --git a/version.compile.sh b/version.compile.sh index c890bc05..ea66242f 100755 --- a/version.compile.sh +++ b/version.compile.sh @@ -1,9 +1,9 @@ -if [ "${CAAT_DST}" == "" ]; then - echo CAAT_DST is not defined. - exit -1; -fi +source ./version.compile.variables.sh +./version.compile.pack.sh -echo -e "\n\nCompilation process\n\n" +CAAT_DST="/tmp/caat" + +echo "\n\nCompilation process\n\n" # # define CAAT products files. @@ -25,7 +25,7 @@ echo "" > "${FILE_CAAT}" echo "" > "${FILE_CAAT_CSS}" echo "" > "${FILE_CAAT_BOX2D}" -SOURCE_DIR=/Users/ibon/js/CAAT/src +SOURCE_DIR=${CAAT_SOURCE_DIR} # # set compilation level @@ -63,65 +63,62 @@ echo "From files at: ${SOURCE_DIR}" # # create stub files for all CAAT products. # -echo -e "/*" >> "${FILE_CAAT}" +echo "/*" >> "${FILE_CAAT}" cat LICENSE >> "${FILE_CAAT}" -echo -e "\nVersion: ${VERSION}\n" >> "${FILE_CAAT}" -echo -e "Created on:" >> "${FILE_CAAT}" +echo "\nVersion: ${VERSION}\n" >> "${FILE_CAAT}" +echo "Created on:" >> "${FILE_CAAT}" date "+DATE: %Y-%m-%d%nTIME: %H:%M:%S" >> "${FILE_CAAT}" -echo -e "*/\n\n" >> "${FILE_CAAT}" +echo "*/\n\n" >> "${FILE_CAAT}" -echo -e "/*" >> "${FILE_CAAT_CSS}" +echo "/*" >> "${FILE_CAAT_CSS}" cat LICENSE >> "${FILE_CAAT_CSS}" -echo -e "\nVersion: ${VERSION}\n" >> "${FILE_CAAT_CSS}" -echo -e "Created on:" >> "${FILE_CAAT_CSS}" +echo "\nVersion: ${VERSION}\n" >> "${FILE_CAAT_CSS}" +echo "Created on:" >> "${FILE_CAAT_CSS}" date "+DATE: %Y-%m-%d%nTIME: %H:%M:%S" >> "${FILE_CAAT_CSS}" -echo -e "*/\n\n" >> "${FILE_CAAT_CSS}" +echo "*/\n\n" >> "${FILE_CAAT_CSS}" -echo -e "/*" >> "${FILE_CAAT_BOX2D}" +echo "/*" >> "${FILE_CAAT_BOX2D}" cat LICENSE >> "${FILE_CAAT_BOX2D}" -echo -e "\nVersion: ${VERSION}\n" >> "${FILE_CAAT_BOX2D}" -echo -e "Created on:" >> "${FILE_CAAT_BOX2D}" +echo "\nVersion: ${VERSION}\n" >> "${FILE_CAAT_BOX2D}" +echo "Created on:" >> "${FILE_CAAT_BOX2D}" date "+DATE: %Y-%m-%d%nTIME: %H:%M:%S" >> "${FILE_CAAT_BOX2D}" -echo -e "*/\n\n" >> "${FILE_CAAT_BOX2D}" +echo "*/\n\n" >> "${FILE_CAAT_BOX2D}" # # Compile canvas/GL # -echo -e "\nCreating CAAT canvas/webGL" -/usr/bin/java -jar /Users/ibon/applications/closure/compiler.jar --compilation_level "${COMPILATION_LEVEL}" \ ---js build/caat.js \ +echo "\nCreating CAAT canvas/webGL" +/usr/bin/java -jar ${CAAT_CLOSURE_PATH}/compiler.jar --compilation_level "${COMPILATION_LEVEL}" \ +--js ${CAAT_BUILD_DIR}/caat.js \ >> "${FILE_CAAT}" # # Compile box2d # echo "Creating CAAT Box2d" - /usr/bin/java -jar /Users/ibon/applications/closure/compiler.jar --compilation_level "${COMPILATION_LEVEL}" --js build/caat-box2d.js >> "${FILE_CAAT_BOX2D}" + /usr/bin/java -jar ${CAAT_CLOSURE_PATH}/compiler.jar --compilation_level "${COMPILATION_LEVEL}" --js ${CAAT_BUILD_DIR}/caat-box2d.js >> "${FILE_CAAT_BOX2D}" # # Compile css # echo "Creating CAAT CSS" -echo -e "CAAT.__CSS__=1;" >> /tmp/__css.js -java -jar /Users/ibon/applications/closure/compiler.jar --compilation_level "${COMPILATION_LEVEL}" \ - --js build/caat-css.js >> "${FILE_CAAT_CSS}" +echo "CAAT.__CSS__=1;" >> /tmp/__css.js +java -jar ${CAAT_CLOSURE_PATH}/compiler.jar --compilation_level "${COMPILATION_LEVEL}" \ + --js ${CAAT_BUILD_DIR}/caat-css.js >> "${FILE_CAAT_CSS}" # # Distribute resulting compiled files # -echo -e "\nCopying:" -while read LINE; do - echo -e "\tCopying results to ${LINE}" - cp ${FILE_CAAT} ${LINE} - cp ${FILE_CAAT_CSS} ${LINE} - cp ${FILE_CAAT_BOX2D} ${LINE} -done < version.distribution +echo "\nCopying:" +echo "\tCopying results to ${CAAT_BUILD_DIR}" +cp ${FILE_CAAT} ${CAAT_BUILD_DIR} +cp ${FILE_CAAT_CSS} ${CAAT_BUILD_DIR} +cp ${FILE_CAAT_BOX2D} ${CAAT_BUILD_DIR} -./version.compile.pack.sh # # Generating JSDoc. # -echo -e "\nGenerating JSDoc" +echo "\nGenerating JSDoc" ./version.compile.doc.sh diff --git a/version.compile.variables.sh b/version.compile.variables.sh new file mode 100755 index 00000000..ecc681d6 --- /dev/null +++ b/version.compile.variables.sh @@ -0,0 +1,7 @@ +CAAT_SOURCE_DIR=${CAAT_SOURCE_DIR:-./src} +CAAT_BUILD_DIR=${CAAT_BUILD_DIR:-/Users/rob/projects/caat_build/build} +CAAT_JSDOC_OUTPUT=${CAAT_JSDOC_OUTPUT:-/Users/rob/projects/caat_build/documentation/jsdoc} + +CAAT_DST=${CAAT_DST:-/tmp/caat} +CAAT_CLOSURE_PATH=${CAAT_CLOSURE_PATH:-/Users/rob/utils/closure} +CAAT_JSDOC_TOOLKIT_PATH=${CAAT_JSDOC_TOOLKIT_PATH:-/Users/rob/utils/jsdoc-toolkit} diff --git a/version.incremental b/version.incremental index 64bb6b74..1e8b3149 100644 --- a/version.incremental +++ b/version.incremental @@ -1 +1 @@ -30 +6 diff --git a/version.nfo b/version.nfo index 103222a4..9e2ed689 100644 --- a/version.nfo +++ b/version.nfo @@ -1 +1 @@ -0.6 build: 30 +0.6 build: 6