var cc=cc||{};cc._tmp=cc._tmp||{};cc._LogInfos={};_p=window;_p=Object.prototype;delete window._p;cc.newElement=function(a){return document.createElement(a)};cc._addEventListener=function(a,b,c,d){a.addEventListener(b,c,d)};cc._isNodeJs="undefined"!==typeof require&&require("fs");cc.each=function(a,b,c){if(a)if(a instanceof Array)for(var d=0,e=a.length;d=
a._limit)){var b=a._pool.shift(),c=b.value,d=b.index;a._workingSize++;a._iterator.call(a._iteratorTarget,c,d,function(b){a.finishedSize++;a._workingSize--;var c=Array.prototype.slice.call(arguments,1);a._results[this.index]=c[0];a.finishedSize===a.size?a._onEnd&&a._onEnd.call(a._onEndTarget,null,a._results):a._handleItem()}.bind(b),a)}};f.flow=function(){if(0===this._pool.length)this._onEnd&&this._onEnd.call(this._onEndTarget,null,[]);else for(var a=0;ac?a+b+d:a.substring(0,c)+b+d},changeBasename:function(a,b,c){if(0===b.indexOf("."))return this.changeExtname(a,b);var d=a.indexOf("?"),e="";c=c?this.extname(a):"";0=d?0:d+1)+b+c+e},_normalize:function(a){var b=a=String(a);do b=a,a=a.replace(this.normalizeRE,"");while(b.length!==a.length);return a}};
cc.loader={_jsCache:{},_register:{},_langPathCache:{},_aliases:{},resPath:"",audioPath:"",cache:{},getXMLHttpRequest:function(){return window.XMLHttpRequest?new window.XMLHttpRequest:new ActiveXObject("MSXML2.XMLHTTP")},_getArgs4Js:function(a){var b=a[0],c=a[1],d=a[2],e=["",null,null];if(1===a.length)e[1]=b instanceof Array?b:[b];else if(2===a.length)"function"===typeof c?(e[1]=b instanceof Array?b:[b],e[2]=c):(e[0]=b||"",e[1]=c instanceof Array?c:[c]);else if(3===a.length)e[0]=b||"",e[1]=c instanceof
Array?c:[c],e[2]=d;else throw Error("arguments error to load js!");return e},loadJs:function(a,b,c){var d=this,e=d._jsCache,f=d._getArgs4Js(arguments),g=f[0],h=f[1],f=f[2];-1=b.length)d&&d();else{var e=this;e._createScript(cc.path.join(a,b[c]),!1,function(f){if(f)return d(f);e._loadJs4Dependency(a,b,c+1,d)})}},_loadJsImg:function(){var a=document,b=a.getElementById("cocos2d_loadJsImg");if(!b){b=cc.newElement("img");cc._loadingImage&&(b.src=cc._loadingImage);a=a.getElementById(cc.game.config.id);a.style.backgroundColor="transparent";a.parentNode.appendChild(b);var c=getComputedStyle?getComputedStyle(a):a.currentStyle;c||(c={width:a.width,
height:a.height});b.style.left=a.offsetLeft+(parseFloat(c.width)-b.width)/2+"px";b.style.top=a.offsetTop+(parseFloat(c.height)-b.height)/2+"px";b.style.position="absolute"}return b},loadTxt:function(a,b){if(cc._isNodeJs)require("fs").readFile(a,function(a,c){a?b(a):b(null,c.toString())});else{var c=this.getXMLHttpRequest(),d="load "+a+" failed!";c.open("GET",a,!0);/msie/i.test(navigator.userAgent)&&!/opera/i.test(navigator.userAgent)?(c.setRequestHeader("Accept-Charset","utf-8"),c.onreadystatechange=
function(){4===c.readyState&&(200===c.status?b(null,c.responseText):b({status:c.status,errorMessage:d},null))}):(c.overrideMimeType&&c.overrideMimeType("text/plain; charset\x3dutf-8"),c.onload=function(){4===c.readyState&&(200===c.status?b(null,c.responseText):b({status:c.status,errorMessage:d},null))},c.onerror=function(){b({status:c.status,errorMessage:d},null)});c.send(null)}},_loadTxtSync:function(a){if(cc._isNodeJs)return require("fs").readFileSync(a).toString();var b=this.getXMLHttpRequest();
b.open("GET",a,!1);/msie/i.test(navigator.userAgent)&&!/opera/i.test(navigator.userAgent)?b.setRequestHeader("Accept-Charset","utf-8"):b.overrideMimeType&&b.overrideMimeType("text/plain; charset\x3dutf-8");b.send(null);return 4===!b.readyState||200!==b.status?null:b.responseText},loadCsb:function(a,b){var c=new XMLHttpRequest,d="load "+a+" failed!";c.open("GET",a,!0);c.responseType="arraybuffer";c.onload=function(){var a=c.response;a&&(window.msg=a);4===c.readyState&&(200===c.status?b(null,c.response):
b({status:c.status,errorMessage:d},null))};c.onerror=function(){b({status:c.status,errorMessage:d},null)};c.send(null)},loadJson:function(a,b){this.loadTxt(a,function(c,d){if(c)b(c);else{try{var e=JSON.parse(d)}catch(f){throw Error("parse json ["+a+"] failed : "+f);}b(null,e)}})},_checkIsImageURL:function(a){return null!=/(\.png)|(\.jpg)|(\.bmp)|(\.jpeg)|(\.gif)/.exec(a)},loadImg:function(a,b,c){var d={isCrossOrigin:!0};void 0!==c?d.isCrossOrigin=null===b.isCrossOrigin?d.isCrossOrigin:b.isCrossOrigin:
void 0!==b&&(c=b);var e=this.getRes(a);if(e)return c&&c(null,e),e;e=new Image;d.isCrossOrigin&&"file://"!==location.origin&&(e.crossOrigin="Anonymous");var f=function(){this.removeEventListener("load",f,!1);this.removeEventListener("error",h,!1);c&&c(null,e)},g=this,h=function(){this.removeEventListener("error",h,!1);e.crossOrigin&&"anonymous"===e.crossOrigin.toLowerCase()?(d.isCrossOrigin=!1,g.release(a),cc.loader.loadImg(a,d,c)):"function"===typeof c&&c("load image failed")};cc._addEventListener(e,
"load",f);cc._addEventListener(e,"error",h);e.src=a;return e},_loadResIterator:function(a,b,c){var d=this,e=null,f=a.type;f?(f="."+f.toLowerCase(),e=a.src?a.src:a.name+f):(e=a,f=cc.path.extname(e));if(b=d.getRes(e))return c(null,b);b=null;f&&(b=d._register[f.toLowerCase()]);if(!b)return cc.error("loader for ["+f+"] not exists!"),c();f=e;cc._urlRegExp.test(e)||(f=b.getBasePath?b.getBasePath():d.resPath,f=d.getUrl(f,e));cc.game.config.noCache&&"string"===typeof f&&(f=d._noCacheRex.test(f)?f+("\x26_t\x3d"+
(new Date-0)):f+("?_t\x3d"+(new Date-0)));b.load(f,e,a,function(a,b){a?(cc.log(a),d.cache[e]=null,delete d.cache[e],c({status:520,errorMessage:a},null)):(d.cache[e]=b,c(null,b))})},_noCacheRex:/\?/,getUrl:function(a,b){var c=this._langPathCache,d=cc.path;if(void 0!==a&&void 0===b){b=a;var e=d.extname(b),e=e?e.toLowerCase():"";a=(e=this._register[e])?e.getBasePath?e.getBasePath():this.resPath:this.resPath}b=cc.path.join(a||"",b);if(b.match(/[\/(\\\\)]lang[\/(\\\\)]/i)){if(c[b])return c[b];d=d.extname(b)||
"";b=c[b]=b.substring(0,b.length-d.length)+"_"+cc.sys.language+d}return b},load:function(a,b,c){var d=this,e=arguments.length;if(0===e)throw Error("arguments error!");3===e?"function"===typeof b&&(b="function"===typeof c?{trigger:b,cb:c}:{cb:b,cbTarget:c}):2===e?"function"===typeof b&&(b={cb:b}):1===e&&(b={});a instanceof Array||(a=[a]);e=new cc.AsyncPool(a,0,function(a,c,e,k){d._loadResIterator(a,c,function(a){var c=Array.prototype.slice.call(arguments,1);b.trigger&&b.trigger.call(b.triggerTarget,
c[0],k.size,k.finishedSize);e(a,c[0])})},b.cb,b.cbTarget);e.flow();return e},_handleAliases:function(a,b){var c=this._aliases,d=[],e;for(e in a){var f=a[e];c[e]=f;d.push(f)}this.load(d,b)},loadAliases:function(a,b){var c=this,d=c.getRes(a);d?c._handleAliases(d.filenames,b):c.load(a,function(a,d){c._handleAliases(d[0].filenames,b)})},register:function(a,b){if(a&&b){if("string"===typeof a)return this._register[a.trim().toLowerCase()]=b;for(var c=0,d=a.length;cb)return"";var c=a[0],d=!0;"object"===typeof c&&(d=!1);for(var e=1;ee)e=0;var f=[a.OS_ANDROID],g=[],h=cc.newElement("canvas");cc._renderType=cc._RENDER_TYPE_CANVAS;cc._supportRender=!1;var k=d.WebGLRenderingContext;if(2===e||0===e&&k&&-1===f.indexOf(a.os)&&-1===g.indexOf(a.browserType))try{cc.create3DContext(h,{stencil:!0,preserveDrawingBuffer:!0})&&(cc._renderType=cc._RENDER_TYPE_WEBGL,cc._supportRender=!0)}catch(m){}if(1===e||0===e&&!1===cc._supportRender)try{h.getContext("2d"),cc._renderType=cc._RENDER_TYPE_CANVAS,
cc._supportRender=!0}catch(n){}})(c,a);c._canUseCanvasNewBlendModes=function(){var a=document.createElement("canvas");a.width=1;a.height=1;a=a.getContext("2d");a.fillStyle="#000";a.fillRect(0,0,1,1);a.globalCompositeOperation="multiply";var b=document.createElement("canvas");b.width=1;b.height=1;var c=b.getContext("2d");c.fillStyle="#fff";c.fillRect(0,0,1,1);a.drawImage(b,0,0,1,1);return 0===a.getImageData(0,0,1,1).data[0]};c._supportCanvasNewBlendModes=c._canUseCanvasNewBlendModes();try{var p=c.localStorage=
d.localStorage;p.setItem("storage","");p.removeItem("storage");p=null}catch(t){p=function(){cc.warn("Warning: localStorage isn't enabled. Please confirm browser cookie or privacy option")},c.localStorage={getItem:p,setItem:p,removeItem:p,clear:p}}p=c.capabilities={canvas:!0};cc._renderType===cc._RENDER_TYPE_WEBGL&&(p.opengl=!0);if(void 0!==g.ontouchstart||void 0!==f.ontouchstart||e.msPointerEnabled)p.touches=!0;void 0!==g.onmouseup&&(p.mouse=!0);void 0!==g.onkeyup&&(p.keyboard=!0);if(d.DeviceMotionEvent||
d.DeviceOrientationEvent)p.accelerometer=!0;c.garbageCollect=function(){};c.dumpRoot=function(){};c.restartVM=function(){};c.cleanScript=function(a){};c.isObjectValid=function(a){return a?!0:!1};c.dump=function(){var a;a=""+("isMobile : "+this.isMobile+"\r\n");a+="language : "+this.language+"\r\n";a+="browserType : "+this.browserType+"\r\n";a+="capabilities : "+JSON.stringify(this.capabilities)+"\r\n";a+="os : "+this.os+"\r\n";a+="platform : "+this.platform+"\r\n";cc.log(a)};c.openURL=function(a){window.open(a)}};
cc.ORIENTATION_PORTRAIT=0;cc.ORIENTATION_PORTRAIT_UPSIDE_DOWN=1;cc.ORIENTATION_LANDSCAPE_LEFT=2;cc.ORIENTATION_LANDSCAPE_RIGHT=3;cc._drawingUtil=null;cc._renderContext=null;cc._canvas=null;cc._gameDiv=null;cc._rendererInitialized=!1;cc._setupCalled=!1;
cc._setup=function(a,b,c){if(!cc._setupCalled){cc._setupCalled=!0;var d=window,e=cc.$(a)||cc.$("#"+a),f;cc.game._setAnimFrame();"CANVAS"===e.tagName?(b=b||e.width,c=c||e.height,f=cc.container=cc.newElement("DIV"),a=cc._canvas=e,a.parentNode.insertBefore(f,a),a.appendTo(f),f.setAttribute("id","Cocos2dGameContainer")):("DIV"!==e.tagName&&cc.log("Warning: target element is not a DIV or CANVAS"),b=b||e.clientWidth,c=c||e.clientHeight,f=cc.container=e,a=cc._canvas=cc.$(cc.newElement("CANVAS")),e.appendChild(a));
a.addClass("gameCanvas");a.setAttribute("width",b||480);a.setAttribute("height",c||320);a.setAttribute("tabindex",99);a.style.outline="none";e=f.style;e.width=(b||480)+"px";e.height=(c||320)+"px";e.margin="0 auto";e.position="relative";e.overflow="hidden";f.top="100%";cc._renderType===cc._RENDER_TYPE_WEBGL&&(cc._renderContext=cc.webglContext=cc.create3DContext(a,{stencil:!0,preserveDrawingBuffer:!0,antialias:!cc.sys.isMobile,alpha:!0}));cc._renderContext?(d.gl=cc._renderContext,cc._drawingUtil=new cc.DrawingPrimitiveWebGL(cc._renderContext),
cc._rendererInitialized=!0,cc.textureCache._initializingRenderer(),cc.shaderCache._init()):(cc._renderContext=new cc.CanvasContextWrapper(a.getContext("2d")),cc._drawingUtil=cc.DrawingPrimitiveCanvas?new cc.DrawingPrimitiveCanvas(cc._renderContext):null);cc._gameDiv=f;cc.log(cc.ENGINE_VERSION);cc._setContextMenuEnable(!1);cc.sys.isMobile&&(b=cc.newElement("style"),b.type="text/css",document.body.appendChild(b),b.textContent="body,canvas,div{ -moz-user-select: none;-webkit-user-select: none;-ms-user-select: none;-khtml-user-select: none;-webkit-tap-highlight-color:rgba(0,0,0,0);}");
cc.view=cc.EGLView._getInstance();cc.inputManager.registerSystemEvent(cc._canvas);cc.director=cc.Director._getInstance();cc.director.setOpenGLView&&cc.director.setOpenGLView(cc.view);cc.winSize=cc.director.getWinSize();cc.saxParser=new cc.SAXParser;cc.plistParser=new cc.PlistParser}};cc._checkWebGLRenderMode=function(){if(cc._renderType!==cc._RENDER_TYPE_WEBGL)throw Error("This feature supports WebGL render mode only.");};cc._isContextMenuEnable=!1;
cc._setContextMenuEnable=function(a){cc._isContextMenuEnable=a;cc._canvas.oncontextmenu=function(){if(!cc._isContextMenuEnable)return!1}};
cc.game={DEBUG_MODE_NONE:0,DEBUG_MODE_INFO:1,DEBUG_MODE_WARN:2,DEBUG_MODE_ERROR:3,DEBUG_MODE_INFO_FOR_WEB_PAGE:4,DEBUG_MODE_WARN_FOR_WEB_PAGE:5,DEBUG_MODE_ERROR_FOR_WEB_PAGE:6,EVENT_HIDE:"game_on_hide",EVENT_SHOW:"game_on_show",EVENT_RESIZE:"game_on_resize",_eventHide:null,_eventShow:null,_onBeforeStartArr:[],CONFIG_KEY:{engineDir:"engineDir",dependencies:"dependencies",debugMode:"debugMode",showFPS:"showFPS",frameRate:"frameRate",id:"id",renderMode:"renderMode",jsList:"jsList",classReleaseMode:"classReleaseMode"},
_prepareCalled:!1,_prepared:!1,_paused:!0,_intervalId:null,_lastTime:null,_frameTime:null,config:null,onStart:null,onStop:null,setFrameRate:function(a){this.config[this.CONFIG_KEY.frameRate]=a;this._intervalId&&window.cancelAnimationFrame(this._intervalId);this._paused=!0;this._setAnimFrame();this._runMainLoop()},_setAnimFrame:function(){this._lastTime=new Date;this._frameTime=1E3/cc.game.config[cc.game.CONFIG_KEY.frameRate];cc.sys.os===cc.sys.OS_IOS&&cc.sys.browserType===cc.sys.BROWSER_TYPE_WECHAT||
60!==cc.game.config[cc.game.CONFIG_KEY.frameRate]?(window.requestAnimFrame=this._stTime,window.cancelAnimationFrame=this._ctTime):(window.requestAnimFrame=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||this._stTime,window.cancelAnimationFrame=window.cancelAnimationFrame||window.cancelRequestAnimationFrame||window.msCancelRequestAnimationFrame||window.mozCancelRequestAnimationFrame||window.oCancelRequestAnimationFrame||
window.webkitCancelRequestAnimationFrame||window.msCancelAnimationFrame||window.mozCancelAnimationFrame||window.webkitCancelAnimationFrame||window.oCancelAnimationFrame||this._ctTime)},_stTime:function(a){var b=(new Date).getTime(),c=Math.max(0,cc.game._frameTime-(b-cc.game._lastTime)),d=window.setTimeout(function(){a()},c);cc.game._lastTime=b+c;return d},_ctTime:function(a){window.clearTimeout(a)},_runMainLoop:function(){var a=this,b,c=cc.director;c.setDisplayStats(a.config[a.CONFIG_KEY.showFPS]);
b=function(){a._paused||(c.mainLoop(),a._intervalId&&window.cancelAnimationFrame(a._intervalId),a._intervalId=window.requestAnimFrame(b))};window.requestAnimFrame(b);a._paused=!1},restart:function(){cc.director.popToSceneStackLevel(0);cc.audioEngine&&cc.audioEngine.end();cc.game.onStart()},run:function(a){var b=this,c=function(){a&&(b.config[b.CONFIG_KEY.id]=a);b._prepareCalled||b.prepare(function(){b._prepared=!0});cc._supportRender&&(b._checkPrepare=setInterval(function(){b._prepared&&(cc._setup(b.config[b.CONFIG_KEY.id]),
b._runMainLoop(),b._eventHide=b._eventHide||new cc.EventCustom(b.EVENT_HIDE),b._eventHide.setUserData(b),b._eventShow=b._eventShow||new cc.EventCustom(b.EVENT_SHOW),b._eventShow.setUserData(b),b.onStart(),clearInterval(b._checkPrepare))},10))};document.body?c():cc._addEventListener(window,"load",function(){this.removeEventListener("load",arguments.callee,!1);c()},!1)},_initConfig:function(){var a=this.CONFIG_KEY,b=function(b){b[a.engineDir]=b[a.engineDir]||"frameworks/cocos2d-html5";null==b[a.debugMode]&&
(b[a.debugMode]=0);b[a.frameRate]=b[a.frameRate]||60;null==b[a.renderMode]&&(b[a.renderMode]=1);return b};if(document.ccConfig)this.config=b(document.ccConfig);else try{for(var c=document.getElementsByTagName("script"),d=0;dh.indexOf("core")&&h.splice(0,0,"core");for(var v=0,s=h.length;vb.DEBUG_MODE_ERROR?(c=cc._logToWebPage.bind(cc),cc.error=function(){c("ERROR : "+cc.formatStr.apply(cc,arguments))},cc.assert=function(a,b){if(!a&&b){for(var f=2;fc;c++)for(var d=0;256>d;d++)b[String.fromCharCode(c+256*d)]=String.fromCharCode(c)+String.fromCharCode(d);c=IEBinaryToArray_ByteStr(a);a=IEBinaryToArray_ByteStr_Last(a);return c.replace(/[\s\S]/g,function(a){return b[a]})+a}};cc=cc||{};cc._loadingImage="data:image/gif;base64,R0lGODlhEAAQALMNAD8/P7+/vyoqKlVVVX9/fxUVFUBAQGBgYMDAwC8vL5CQkP///wAAAP///wAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQFAAANACwAAAAAEAAQAAAEO5DJSau9OOvNex0IMnDIsiCkiW6g6BmKYlBFkhSUEgQKlQCARG6nEBwOgl+QApMdCIRD7YZ5RjlGpCUCACH5BAUAAA0ALAAAAgAOAA4AAAQ6kLGB0JA4M7QW0hrngRllkYyhKAYqKUGguAws0ypLS8JxCLQDgXAIDg+FRKIA6v0SAECCBpXSkstMBAAh+QQFAAANACwAAAAACgAQAAAEOJDJORAac6K1kDSKYmydpASBUl0mqmRfaGTCcQgwcxDEke+9XO2WkxQSiUIuAQAkls0n7JgsWq8RACH5BAUAAA0ALAAAAAAOAA4AAAQ6kMlplDIzTxWC0oxwHALnDQgySAdBHNWFLAvCukc215JIZihVIZEogDIJACBxnCSXTcmwGK1ar1hrBAAh+QQFAAANACwAAAAAEAAKAAAEN5DJKc4RM+tDyNFTkSQF5xmKYmQJACTVpQSBwrpJNteZSGYoFWjIGCAQA2IGsVgglBOmEyoxIiMAIfkEBQAADQAsAgAAAA4ADgAABDmQSVZSKjPPBEDSGucJxyGA1XUQxAFma/tOpDlnhqIYN6MEAUXvF+zldrMBAjHoIRYLhBMqvSmZkggAIfkEBQAADQAsBgAAAAoAEAAABDeQyUmrnSWlYhMASfeFVbZdjHAcgnUQxOHCcqWylKEohqUEAYVkgEAMfkEJYrFA6HhKJsJCNFoiACH5BAUAAA0ALAIAAgAOAA4AAAQ3kMlJq704611SKloCAEk4lln3DQgyUMJxCBKyLAh1EMRR3wiDQmHY9SQslyIQUMRmlmVTIyRaIgA7";
cc._fpsImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAAgCAYAAAD9qabkAAAKQ2lDQ1BJQ0MgcHJvZmlsZQAAeNqdU3dYk/cWPt/3ZQ9WQtjwsZdsgQAiI6wIyBBZohCSAGGEEBJAxYWIClYUFRGcSFXEgtUKSJ2I4qAouGdBiohai1VcOO4f3Ke1fXrv7e371/u855zn/M55zw+AERImkeaiagA5UoU8Otgfj09IxMm9gAIVSOAEIBDmy8JnBcUAAPADeXh+dLA//AGvbwACAHDVLiQSx+H/g7pQJlcAIJEA4CIS5wsBkFIAyC5UyBQAyBgAsFOzZAoAlAAAbHl8QiIAqg0A7PRJPgUA2KmT3BcA2KIcqQgAjQEAmShHJAJAuwBgVYFSLALAwgCgrEAiLgTArgGAWbYyRwKAvQUAdo5YkA9AYACAmUIszAAgOAIAQx4TzQMgTAOgMNK/4KlfcIW4SAEAwMuVzZdL0jMUuJXQGnfy8ODiIeLCbLFCYRcpEGYJ5CKcl5sjE0jnA0zODAAAGvnRwf44P5Dn5uTh5mbnbO/0xaL+a/BvIj4h8d/+vIwCBAAQTs/v2l/l5dYDcMcBsHW/a6lbANpWAGjf+V0z2wmgWgrQevmLeTj8QB6eoVDIPB0cCgsL7SViob0w44s+/zPhb+CLfvb8QB7+23rwAHGaQJmtwKOD/XFhbnauUo7nywRCMW735yP+x4V//Y4p0eI0sVwsFYrxWIm4UCJNx3m5UpFEIcmV4hLpfzLxH5b9CZN3DQCshk/ATrYHtctswH7uAQKLDljSdgBAfvMtjBoLkQAQZzQyefcAAJO/+Y9AKwEAzZek4wAAvOgYXKiUF0zGCAAARKCBKrBBBwzBFKzADpzBHbzAFwJhBkRADCTAPBBCBuSAHAqhGJZBGVTAOtgEtbADGqARmuEQtMExOA3n4BJcgetwFwZgGJ7CGLyGCQRByAgTYSE6iBFijtgizggXmY4EImFINJKApCDpiBRRIsXIcqQCqUJqkV1II/ItchQ5jVxA+pDbyCAyivyKvEcxlIGyUQPUAnVAuagfGorGoHPRdDQPXYCWomvRGrQePYC2oqfRS+h1dAB9io5jgNExDmaM2WFcjIdFYIlYGibHFmPlWDVWjzVjHVg3dhUbwJ5h7wgkAouAE+wIXoQQwmyCkJBHWExYQ6gl7CO0EroIVwmDhDHCJyKTqE+0JXoS+cR4YjqxkFhGrCbuIR4hniVeJw4TX5NIJA7JkuROCiElkDJJC0lrSNtILaRTpD7SEGmcTCbrkG3J3uQIsoCsIJeRt5APkE+S+8nD5LcUOsWI4kwJoiRSpJQSSjVlP+UEpZ8yQpmgqlHNqZ7UCKqIOp9aSW2gdlAvU4epEzR1miXNmxZDy6Qto9XQmmlnafdoL+l0ugndgx5Fl9CX0mvoB+nn6YP0dwwNhg2Dx0hiKBlrGXsZpxi3GS+ZTKYF05eZyFQw1zIbmWeYD5hvVVgq9ip8FZHKEpU6lVaVfpXnqlRVc1U/1XmqC1SrVQ+rXlZ9pkZVs1DjqQnUFqvVqR1Vu6k2rs5Sd1KPUM9RX6O+X/2C+mMNsoaFRqCGSKNUY7fGGY0hFsYyZfFYQtZyVgPrLGuYTWJbsvnsTHYF+xt2L3tMU0NzqmasZpFmneZxzQEOxrHg8DnZnErOIc4NznstAy0/LbHWaq1mrX6tN9p62r7aYu1y7Rbt69rvdXCdQJ0snfU6bTr3dQm6NrpRuoW623XP6j7TY+t56Qn1yvUO6d3RR/Vt9KP1F+rv1u/RHzcwNAg2kBlsMThj8MyQY+hrmGm40fCE4agRy2i6kcRoo9FJoye4Ju6HZ+M1eBc+ZqxvHGKsNN5l3Gs8YWJpMtukxKTF5L4pzZRrmma60bTTdMzMyCzcrNisyeyOOdWca55hvtm82/yNhaVFnMVKizaLx5balnzLBZZNlvesmFY+VnlW9VbXrEnWXOss623WV2xQG1ebDJs6m8u2qK2brcR2m23fFOIUjynSKfVTbtox7PzsCuya7AbtOfZh9iX2bfbPHcwcEh3WO3Q7fHJ0dcx2bHC866ThNMOpxKnD6VdnG2ehc53zNRemS5DLEpd2lxdTbaeKp26fesuV5RruutK10/Wjm7ub3K3ZbdTdzD3Ffav7TS6bG8ldwz3vQfTw91jicczjnaebp8LzkOcvXnZeWV77vR5Ps5wmntYwbcjbxFvgvct7YDo+PWX6zukDPsY+Ap96n4e+pr4i3z2+I37Wfpl+B/ye+zv6y/2P+L/hefIW8U4FYAHBAeUBvYEagbMDawMfBJkEpQc1BY0FuwYvDD4VQgwJDVkfcpNvwBfyG/ljM9xnLJrRFcoInRVaG/owzCZMHtYRjobPCN8Qfm+m+UzpzLYIiOBHbIi4H2kZmRf5fRQpKjKqLupRtFN0cXT3LNas5Fn7Z72O8Y+pjLk722q2cnZnrGpsUmxj7Ju4gLiquIF4h/hF8ZcSdBMkCe2J5MTYxD2J43MC52yaM5zkmlSWdGOu5dyiuRfm6c7Lnnc8WTVZkHw4hZgSl7I/5YMgQlAvGE/lp25NHRPyhJuFT0W+oo2iUbG3uEo8kuadVpX2ON07fUP6aIZPRnXGMwlPUit5kRmSuSPzTVZE1t6sz9lx2S05lJyUnKNSDWmWtCvXMLcot09mKyuTDeR55m3KG5OHyvfkI/lz89sVbIVM0aO0Uq5QDhZML6greFsYW3i4SL1IWtQz32b+6vkjC4IWfL2QsFC4sLPYuHhZ8eAiv0W7FiOLUxd3LjFdUrpkeGnw0n3LaMuylv1Q4lhSVfJqedzyjlKD0qWlQyuCVzSVqZTJy26u9Fq5YxVhlWRV72qX1VtWfyoXlV+scKyorviwRrjm4ldOX9V89Xlt2treSrfK7etI66Trbqz3Wb+vSr1qQdXQhvANrRvxjeUbX21K3nShemr1js20zcrNAzVhNe1bzLas2/KhNqP2ep1/XctW/a2rt77ZJtrWv913e/MOgx0VO97vlOy8tSt4V2u9RX31btLugt2PGmIbur/mft24R3dPxZ6Pe6V7B/ZF7+tqdG9s3K+/v7IJbVI2jR5IOnDlm4Bv2pvtmne1cFoqDsJB5cEn36Z8e+NQ6KHOw9zDzd+Zf7f1COtIeSvSOr91rC2jbaA9ob3v6IyjnR1eHUe+t/9+7zHjY3XHNY9XnqCdKD3x+eSCk+OnZKeenU4/PdSZ3Hn3TPyZa11RXb1nQ8+ePxd07ky3X/fJ897nj13wvHD0Ivdi2yW3S609rj1HfnD94UivW2/rZffL7Vc8rnT0Tes70e/Tf/pqwNVz1/jXLl2feb3vxuwbt24m3Ry4Jbr1+Hb27Rd3Cu5M3F16j3iv/L7a/eoH+g/qf7T+sWXAbeD4YMBgz8NZD+8OCYee/pT/04fh0kfMR9UjRiONj50fHxsNGr3yZM6T4aeypxPPyn5W/3nrc6vn3/3i+0vPWPzY8Av5i8+/rnmp83Lvq6mvOscjxx+8znk98ab8rc7bfe+477rfx70fmSj8QP5Q89H6Y8en0E/3Pud8/vwv94Tz+4A5JREAAAAGYktHRAD/AP8A/6C9p5MAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfcAgcQLxxUBNp/AAAQZ0lEQVR42u2be3QVVZbGv1N17829eRLyIKAEOiISEtPhJTJAYuyBDmhWjAEx4iAGBhxA4wABbVAMWUAeykMCM+HRTcBRWkNH2l5moS0LCCrQTkYeQWBQSCAIgYRXEpKbW/XNH5zS4noR7faPEeu31l0h4dSpvc+t/Z199jkFWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhY/H9D/MR9qfKnLj/00U71aqfJn9+HCkCR/Wk36ddsgyJ/1wF4fkDfqqm9/gPsUeTnVr6a2xlQfnxdI7zs0W7irzD17Ytb2WT7EeNv/r4ox1O3Quf2QP2pgt9utwfout4FQE8AVBSlnaRmfvAURQkg2RlAbwB9AThlW5L0GaiKojhJhgOIBqDa7XaPrusdPtr5kQwF0BVAAoBIABRCKDd5aFUhRDAAw57eAOwAhKIoupft3zoqhB1AqLwuHIBut9uFt02qqvqRDJR2dAEQJj/BAOjn56dqmma+xiaECAEQAWAggLsB6A6HQ2iaZggBhBAqgEAAnQB0kzaEmT4hAITT6VQ8Ho/HJAKKECJQtr8LwD1y/A1/vcdfEUIEyfZ9AcQbYvZ942Px88L2UwlJR0dH0EMPPbRj5syZPUeNGrXR7Xb/641xIwJ1XY9NSUlZm52dfW+XLl1w8uRJzJ8//+OGhoYJqqqe1TSt1Wsm9NN1PSIqKmr12rVrR5WUlHy1bdu2AQCumWc3IYRD1/UwVVXnFRQUTIuNjUVzczN2797dWFJSkq8oymZd15sAGAEnFEUJ1nX9nzIzM1dnZmZGh4SE4OTJk5g5c+Zf29vbp9pstrMej6fVOyhIhgAYU1hY+B+hoaGoqKg4XVlZea+XTULTNFdCQsLGiRMnPuR2u3UhBOV9eeDAAWXTpk095DUe6WsoyRE5OTlr0tLSAux2O/bs2cO5c+e+pijKUpIXSHaQVAGkvPLKK++6XK4OksJLCFlXV2cvKSlJBFAjhU+x2WwhHo9nUHp6+urMzMy7wsLCUF9fjxdffPHjxsbGiTab7WuPx9NiEutOuq4PyMjI+M+srKyYqKgoHD58GDNmzNjq8XhyVFU9b/q+LH7hBAEYu3PnTlZVVRFAGgCX6f/tAHoOHDjwa0p27txp/JO9e/f+QM7cipw9nfL3kQBKt2zZQpJ87rnn6mQmoHilw2EACs+cOUOSrK+vZ1NTE0nyo48+IoBpxswoBcMJ4Ndjx471kOTFixe5d+9ekqTH42H//v13A4jyzpAURfEH0H/OnDnthu1z5sw558MmFUCPWbNmnaMP3nrrLZoyDmP8Hl68eDFJ8siRI9/Yc+zYMQKYKdtAztrTrl27xptRXV1NAKMAOAyBBBA/Y8aMdpLs6Ojgxx9//E37+++//29yvFXppwvAwMcee8xjtDHsuXLlCqOjo//ia3wsfpkoALqFhoZuIckJEyackimm3dQmEMDUmpoakmRISMhhAHOHDx/eQJIbN24kgKEyMAHAFRMTs2XXrl1saWkhSZ0kp0+ffhrAr3wEW/S8efOukORLL72kA1gKYMPWrVtJkk899dRJAHeYrgsEsIQkjx8/TgDvAPjd448/3kaSb7zxBmUa7vC6z53BwcFbSHL9+vU6Sc6aNes8gF5ewWAH0PfVV18lSQL4DMBGIcQ6AKtcLleBFC2jXtFt8ODBe0iyoqKCAJYByC8qKmJDQwOzsrK+MAmqo1OnTveHhoa+GRkZ+XZkZOSWiIiIvzgcjk9mzpypkWRmZuZpmbYbGV4AgPnNzc1sa2sjgN0A5iQmJtaSZHl5OQHcb/K3s81mW0uSTU1NBFAFYFbfvn1Pk+Tbb79NAA8IIVzW42/hByA+Pz/fLR/2ZXIda05NI/z9/TeR5J49ewhgqlxTrtI0jY2NjQQw3zTLuWJiYjaUlJToS5Ys6fjkk080kwDEeAmADcA9GzZsIElGRUW9CyAWwLApU6Y0kOSKFSsog9QICGdERMTGsrIyZmVlEcC9AB4IDw/fTpLbtm0jgN94CUAnAJmVlZVcs2aNZ/LkyRdJcvbs2b4EwAkgZfPmzTxw4AABFAN4BkC6vFeUSewcAO5duXIlSTIhIaEawGMAxgKYAmAGgCS73e5vrKVk/yGythANYEhCQsIhkly+fDkBpKqqGmL6DgIALDKN/3yZpVWQZGVlJQE8aPI3KiMjo5okV61aRQAjAPQBMPfIkSN0u90EUCBtsPiFEwpgbn19PdetW2fM5N4zQ9ekpKQqkty0aRMBpMjiWM6JEydIkoqirJUFJ6iq6pAPVy8A6cZMehMBUACEuVyuFwG8HBwcPEIWx367ZMkSjSQXLVrUJouTRorrkAHdA8BdQogsAOsKCwtJkmPGjDkvMw2bDDo/ADEjRoz4XylyFbm5uY0mAbjLyyZ/AOOrq6tZVlbWsWDBgo69e/eyoqKCgwcPPg4gSQaoIRbp27dvN7KF+tLSUr28vJwFBQXtMpvpYRIM7+wrAkDeqVOnePbsWQIoNKfzpiXPg8uXLydJJicnNwF4f+nSpW6STEtLq5fjYwhk1wkTJtSQ5Ouvv04AqTKj+N2xY8dIkgEBAW/Ie1v8wncRegwZMmQvSfbr12+3Ua33WqPfOWbMmP0kWVpaSgCDZAqcfejQIWNZsEGKgvnh9gfQb9myZd8nAEJVVZtMkUNk8CcNHTq0liR1XWdYWNhmH1mJIme80OnTp18x1rp5eXkEsNJms92Fb7e/IgEsvHz5Mp999tkmAI/l5uZeMC0B7vEqqAYAyL106RJJsra2lpWVld+sucePH38ZQG+5NncBeOrgwYMkqbe3t/Po0aOsra011wAWyl0H7x0JJ4DE+fPnu0kyPT29DsDdUrBuyNKEEAkAdpw/f/6GeoEM8GUmfwEgPCIiopwkGxsbabPZPgOw6L777vvm4p49e26VGYjFLxUhhD+ApLKyMp44ccIoVnXybgbgzkcfffRzklyzZg0BDJYCMMmoCwQFBXkLgLGWvvcWAgBToSsKwNPTp09vMR7UuLi4rwH0lgU8c/Db5ezbeeTIkRWzZ8++aMxu+fn5BPCADBwHgP4LFy701NXVEUAJgAnPP/98kyxMNgHo53A4zH77BQQETMvPz7+Um5vbBuAlAFMSExPPmdbVL0qh8Acw8fDhw5SCchVAEYAVb775JknyhRdeaJYztHfxMwLAaqNwCGC2FArv8x0hAHKNLGPKlCme5OTk/Zs3bzb7O0wKiiG8KXl5ed8IxenTp0mSR48e1UmyW7duWywBuD2xyQcgFECgoih+8H1gyJgZV5Lkyy+/3CbTRIePtl2HDBmyw1QBHyGDdXZdXR1JUghRKkXBjOMHCoBdpr0L3nvvPZLkF198wejo6O0A4lVVDTb74HQ6AwD8Wq7Jh8rgGgDgQ13XjVR8qaxJuADMbmlpYXl5uV5UVNRWUFDgfv/993Vj/ZydnU1c37eHXML4S3viAcQqitJD2l104cIFY8lTKsXSBWBMVVWVcd9yed2A1NTUQ6Zl00CvLMMOoHdubm6zFIlWOf5+PsY/Kj09vdrU11QAwwGsv3jxIk21m2DZr10I0RXAuAcffPBgaWkpV69eTYfDcdiwUxY0w6xw+flX8L1xApjevXv3lREREaW6rofB93aPDUDQpEmTMgHgtddeqwBwEd/utZvpqK6uPgEAcXFxkA94NwB9unfvjrNnz4LklwDcf08iIqv66Zs2bXrl4YcfxooVKxAbG7uqrq5uAYA2TdOEqqpGYIi2tjbl6aeffu/YsWPv5uTk7JaC1wHg4Pnz542MwoVvTx+21dbWYvjw4WLixIl+2dnZ9lGjRgmSTE1NRUpKCkwFTGiaxtTU1OXTpk3707Bhw/6g67pDipnT4biuj7qut+Lbk3Vf1tTUXI9qu91Pjq1QFEUBgJaWFgBo8yGOQ8eNGxcAAOvXr/8QwBUfYygAKL169eoCABcuXACAWtn2hOGv0+kMNO1KiPDw8F4A4rZv3/7R1KlTR0+bNu1ht9u9r1+/fqitrQXJgwDarRC6/QjPzs4+QJIffPCB9/aQmSAA43ft2mW0e1QGoi8CAPyLsZccExNTC2BlRkbGRdOyYJCP2csBIN6UAZzCd7cBbQCijYp/dXU1ExMTz6SmptaMHj36f9LS0vYlJCRsl6mxIWSdu3fv/g5J7t+/nwC2AShMTk6+SJKff/45AWRLYbD7+fndAeDf5BJnLoCCyZMnt5JkdnZ2C4B/F0KEm1Pu+Pj4rST55ZdfEsBWAK+mpaVdMo3raDn7KwDuSEpK+m+S3LBhAwG8DuCtHTt2UBbpjgC408vvcFVV15HkuXPnjMp+p5uMf0RcXNyHJNnQ0EBVVfcCWBQXF3fG+Jv0yxABPwB5LS0tRmFxN4BlTzzxxGWSXLx4sS5F3GGFy+1Hp5SUlJq6ujoWFxdTpsZ2H+0iIyMj/0iSWVlZX5mr5jfJFroPGzasxlhTnjp1iiTZ3NxMl8tlrCd9pfa9SkpKSJI5OTmnZOageLUZZqxvfVFWVkZcPwdgNwnSCKPqb17jkmR8fPzfZMDZ5CRsFBmNI7h95s2b1yhT7/MAYmStwCx4vy0uLqa3v5qmEcCfvSr1QQAeXb16NY3Cm3HQ55133iGAp+SxZTNhKSkpfzUddkrFjYevzAQCeGjp0qXfsYckY2NjTwD4leGDLCL2HTdunNtoY+zWSHFcIHdsFCtcfuZ1vO9Eqs3m7/F47sb1k2qX/f3997W2tl7BjWfpBYDOzzzzzIVJkyZh0KBBCwEsB3AJvl9AETabLcDj8dwRFRW1ctasWb8JCgpSzp07d62wsPC/Wltb8xRFadR1/ZqPXYbgAQMGbI2Pjw/+6quv9ldVVT0r01ezuPRJSUn5Y9euXXVd11WzDaqq6kePHm3+7LPPRgO4KlNuxWazhXo8nuTk5OSXMjIyEl0uFxoaGtqKior+dPXq1VdUVT0jj7r68ieoT58+vx8yZMjdx48fP1JVVTVF9m20VW02WyfZf97YsWPjXS4X6urqWvPy8jYCWCyEuEDS8FdVFKWzruv//OSTTy5OTk7uqWkaPv3007qysrJ8RVH+LI8ym8/rB3Tu3HnRI488knLo0KG2ffv2ZQI4C98vP6mqqoZqmpaclpa2cOTIkX39/f3R0NDQUVxc/G5TU9PLqqrWa5rWLH1QVFUN0TStX1JSUvH48eP7BwYG4uDBg1cKCgpeBbBe2u+2Qug2EwD5N5sMPuNtMe8XP4TT6Qxoa2sbIGeXvUKIK7d4IISiKC5d1wPljOfA9bPwzYqiXNV13dd6Uqiq6qdpml2mpe02m63d4/G4vcTF5fF47LJf71nJA6BZVVW3pmntuPHlmAD5wk6Q9NnbHp9vHaqq6tA0zU/64PZhk1FfCZB9G/23ALiqKEqzD39tpvbGUqoFwFUhRLP3yzpCCDtJpxyXDulfG27+pqRR3DXsUWVd4Yq0x/taVQjhIhksC8L+ABpM9ljBf5sKwI8pIBr75L5E4vvu+UNeG/a+hv+AL7yFH8qPtOfHjtOP6V/Bja8D6z/B2Nys/1u9Xv33tLf4GfF/LC4GCJwByWIAAAAASUVORK5CYII\x3d";
cc._loaderImage="data:image/jpeg;base64,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\x3d\x3d";var cc=cc||{},ClassManager={id:0|998*Math.random(),instanceId:0|998*Math.random(),compileSuper:function(a,b,c){a=a.toString();var d=a.indexOf("("),e=a.indexOf(")"),d=a.substring(d+1,e),d=d.trim(),e=a.indexOf("{"),f=a.lastIndexOf("}");for(a=a.substring(e+1,f);-1!==a.indexOf("this._super");){var e=a.indexOf("this._super"),f=a.indexOf("(",e),g=a.indexOf(")",f),g=a.substring(f+1,g),g=(g=g.trim())?",":"";a=a.substring(0,e)+"ClassManager["+c+"]."+b+".call(this"+g+a.substring(f+1)}return Function(d,a)},
getNewID:function(){return this.id++},getNewInstanceId:function(){return this.instanceId++}};ClassManager.compileSuper.ClassManager=ClassManager;
(function(){var a=/\b_super\b/,b=cc.game.config[cc.game.CONFIG_KEY.classReleaseMode];b&&console.log("release Mode");cc.Class=function(){};cc.Class.extend=function(c){function d(){this.__instanceId=ClassManager.getNewInstanceId();this.ctor&&this.ctor.apply(this,arguments)}var e=this.prototype,f=Object.create(e),g=ClassManager.getNewID();ClassManager[g]=e;var h={writable:!0,enumerable:!1,configurable:!0};f.__instanceId=null;d.id=g;h.value=g;Object.defineProperty(f,"__pid",h);d.prototype=f;h.value=d;
Object.defineProperty(d.prototype,"constructor",h);this.__getters__&&(d.__getters__=cc.clone(this.__getters__));this.__setters__&&(d.__setters__=cc.clone(this.__setters__));for(var k=0,m=arguments.length;k=b.x||a.y>=b.y||a.x+a.width<=b.x+b.width||a.y+a.height<=b.y+b.height):!1};cc.rectGetMaxX=function(a){return a.x+a.width};cc.rectGetMidX=function(a){return a.x+a.width/2};cc.rectGetMinX=function(a){return a.x};cc.rectGetMaxY=function(a){return a.y+a.height};cc.rectGetMidY=function(a){return a.y+a.height/2};cc.rectGetMinY=function(a){return a.y};
cc.rectContainsPoint=function(a,b){return b.x>=cc.rectGetMinX(a)&&b.x<=cc.rectGetMaxX(a)&&b.y>=cc.rectGetMinY(a)&&b.y<=cc.rectGetMaxY(a)};cc.rectIntersectsRect=function(a,b){var c=a.y+a.height,d=b.x+b.width,e=b.y+b.height;return!(a.x+a.widtha?0:a};a._getG=function(){return this._gU8[0]};a._setG=function(a){this._gU8[0]=0>a?0:a};a._getB=function(){return this._bU8[0]};a._setB=function(a){this._bU8[0]=0>a?0:a};a._getA=
function(){return this._aU8[0]};a._setA=function(a){this._aU8[0]=0>a?0:a};cc.defineGetterSetter(a,"r",a._getR,a._setR);cc.defineGetterSetter(a,"g",a._getG,a._setG);cc.defineGetterSetter(a,"b",a._getB,a._setB);cc.defineGetterSetter(a,"a",a._getA,a._setA);cc.Vertex2F=function(a,c,d,e){this._arrayBuffer=d||new ArrayBuffer(cc.Vertex2F.BYTES_PER_ELEMENT);this._offset=e||0;this._xF32=new Float32Array(this._arrayBuffer,this._offset,1);this._yF32=new Float32Array(this._arrayBuffer,this._offset+4,1);this._xF32[0]=
a||0;this._yF32[0]=c||0};cc.Vertex2F.BYTES_PER_ELEMENT=8;a=cc.Vertex2F.prototype;a._getX=function(){return this._xF32[0]};a._setX=function(a){this._xF32[0]=a};a._getY=function(){return this._yF32[0]};a._setY=function(a){this._yF32[0]=a};cc.defineGetterSetter(a,"x",a._getX,a._setX);cc.defineGetterSetter(a,"y",a._getY,a._setY);cc.Vertex3F=function(a,c,d,e,f){this._arrayBuffer=e||new ArrayBuffer(cc.Vertex3F.BYTES_PER_ELEMENT);this._offset=f||0;e=this._arrayBuffer;f=this._offset;this._xF32=new Float32Array(e,
f,1);this._xF32[0]=a||0;this._yF32=new Float32Array(e,f+Float32Array.BYTES_PER_ELEMENT,1);this._yF32[0]=c||0;this._zF32=new Float32Array(e,f+2*Float32Array.BYTES_PER_ELEMENT,1);this._zF32[0]=d||0};cc.Vertex3F.BYTES_PER_ELEMENT=12;a=cc.Vertex3F.prototype;a._getX=function(){return this._xF32[0]};a._setX=function(a){this._xF32[0]=a};a._getY=function(){return this._yF32[0]};a._setY=function(a){this._yF32[0]=a};a._getZ=function(){return this._zF32[0]};a._setZ=function(a){this._zF32[0]=a};cc.defineGetterSetter(a,
"x",a._getX,a._setX);cc.defineGetterSetter(a,"y",a._getY,a._setY);cc.defineGetterSetter(a,"z",a._getZ,a._setZ);cc.Tex2F=function(a,c,d,e){this._arrayBuffer=d||new ArrayBuffer(cc.Tex2F.BYTES_PER_ELEMENT);this._offset=e||0;this._uF32=new Float32Array(this._arrayBuffer,this._offset,1);this._vF32=new Float32Array(this._arrayBuffer,this._offset+4,1);this._uF32[0]=a||0;this._vF32[0]=c||0};cc.Tex2F.BYTES_PER_ELEMENT=8;a=cc.Tex2F.prototype;a._getU=function(){return this._uF32[0]};a._setU=function(a){this._uF32[0]=
a};a._getV=function(){return this._vF32[0]};a._setV=function(a){this._vF32[0]=a};cc.defineGetterSetter(a,"u",a._getU,a._setU);cc.defineGetterSetter(a,"v",a._getV,a._setV);cc.Quad2=function(a,c,d,e,f,g){this._arrayBuffer=f||new ArrayBuffer(cc.Quad2.BYTES_PER_ELEMENT);this._offset=g||0;f=this._arrayBuffer;g=cc.Vertex2F.BYTES_PER_ELEMENT;this._tl=a?new cc.Vertex2F(a.x,a.y,f,0):new cc.Vertex2F(0,0,f,0);this._tr=c?new cc.Vertex2F(c.x,c.y,f,g):new cc.Vertex2F(0,0,f,g);this._bl=d?new cc.Vertex2F(d.x,d.y,
f,2*g):new cc.Vertex2F(0,0,f,2*g);this._br=e?new cc.Vertex2F(e.x,e.y,f,3*g):new cc.Vertex2F(0,0,f,3*g)};cc.Quad2.BYTES_PER_ELEMENT=32;a=cc.Quad2.prototype;a._getTL=function(){return this._tl};a._setTL=function(a){this._tl.x=a.x;this._tl.y=a.y};a._getTR=function(){return this._tr};a._setTR=function(a){this._tr.x=a.x;this._tr.y=a.y};a._getBL=function(){return this._bl};a._setBL=function(a){this._bl.x=a.x;this._bl.y=a.y};a._getBR=function(){return this._br};a._setBR=function(a){this._br.x=a.x;this._br.y=
a.y};cc.defineGetterSetter(a,"tl",a._getTL,a._setTL);cc.defineGetterSetter(a,"tr",a._getTR,a._setTR);cc.defineGetterSetter(a,"bl",a._getBL,a._setBL);cc.defineGetterSetter(a,"br",a._getBR,a._setBR);cc.Quad3=function(a,c,d,e){this.bl=a||new cc.Vertex3F(0,0,0);this.br=c||new cc.Vertex3F(0,0,0);this.tl=d||new cc.Vertex3F(0,0,0);this.tr=e||new cc.Vertex3F(0,0,0)};cc.V3F_C4B_T2F=function(a,c,d,e,f){this._arrayBuffer=e||new ArrayBuffer(cc.V3F_C4B_T2F.BYTES_PER_ELEMENT);this._offset=f||0;e=this._arrayBuffer;
f=this._offset;var g=cc.Vertex3F.BYTES_PER_ELEMENT;this._vertices=a?new cc.Vertex3F(a.x,a.y,a.z,e,f):new cc.Vertex3F(0,0,0,e,f);this._colors=c?cc.color(c.r,c.g,c.b,c.a,e,f+g):cc.color(0,0,0,0,e,f+g);this._texCoords=d?new cc.Tex2F(d.u,d.v,e,f+g+cc.Color.BYTES_PER_ELEMENT):new cc.Tex2F(0,0,e,f+g+cc.Color.BYTES_PER_ELEMENT)};cc.V3F_C4B_T2F.BYTES_PER_ELEMENT=24;a=cc.V3F_C4B_T2F.prototype;a._getVertices=function(){return this._vertices};a._setVertices=function(a){var c=this._vertices;c.x=a.x;c.y=a.y;c.z=
a.z};a._getColor=function(){return this._colors};a._setColor=function(a){var c=this._colors;c.r=a.r;c.g=a.g;c.b=a.b;c.a=a.a};a._getTexCoords=function(){return this._texCoords};a._setTexCoords=function(a){this._texCoords.u=a.u;this._texCoords.v=a.v};cc.defineGetterSetter(a,"vertices",a._getVertices,a._setVertices);cc.defineGetterSetter(a,"colors",a._getColor,a._setColor);cc.defineGetterSetter(a,"texCoords",a._getTexCoords,a._setTexCoords);cc.V3F_C4B_T2F_Quad=function(a,c,d,e,f,g){this._arrayBuffer=
f||new ArrayBuffer(cc.V3F_C4B_T2F_Quad.BYTES_PER_ELEMENT);this._offset=g||0;f=this._arrayBuffer;g=this._offset;var h=cc.V3F_C4B_T2F.BYTES_PER_ELEMENT;this._tl=a?new cc.V3F_C4B_T2F(a.vertices,a.colors,a.texCoords,f,g):new cc.V3F_C4B_T2F(null,null,null,f,g);this._bl=c?new cc.V3F_C4B_T2F(c.vertices,c.colors,c.texCoords,f,g+h):new cc.V3F_C4B_T2F(null,null,null,f,g+h);this._tr=d?new cc.V3F_C4B_T2F(d.vertices,d.colors,d.texCoords,f,g+2*h):new cc.V3F_C4B_T2F(null,null,null,f,g+2*h);this._br=e?new cc.V3F_C4B_T2F(e.vertices,
e.colors,e.texCoords,f,g+3*h):new cc.V3F_C4B_T2F(null,null,null,f,g+3*h)};cc.V3F_C4B_T2F_Quad.BYTES_PER_ELEMENT=96;a=cc.V3F_C4B_T2F_Quad.prototype;a._getTL=function(){return this._tl};a._setTL=function(a){var c=this._tl;c.vertices=a.vertices;c.colors=a.colors;c.texCoords=a.texCoords};a._getBL=function(){return this._bl};a._setBL=function(a){var c=this._bl;c.vertices=a.vertices;c.colors=a.colors;c.texCoords=a.texCoords};a._getTR=function(){return this._tr};a._setTR=function(a){var c=this._tr;c.vertices=
a.vertices;c.colors=a.colors;c.texCoords=a.texCoords};a._getBR=function(){return this._br};a._setBR=function(a){var c=this._br;c.vertices=a.vertices;c.colors=a.colors;c.texCoords=a.texCoords};a._getArrayBuffer=function(){return this._arrayBuffer};cc.defineGetterSetter(a,"tl",a._getTL,a._setTL);cc.defineGetterSetter(a,"tr",a._getTR,a._setTR);cc.defineGetterSetter(a,"bl",a._getBL,a._setBL);cc.defineGetterSetter(a,"br",a._getBR,a._setBR);cc.defineGetterSetter(a,"arrayBuffer",a._getArrayBuffer,null);
cc.V3F_C4B_T2F_QuadZero=function(){return new cc.V3F_C4B_T2F_Quad};cc.V3F_C4B_T2F_QuadCopy=function(a){if(!a)return cc.V3F_C4B_T2F_QuadZero();var c=a.tl,d=a.bl,e=a.tr;a=a.br;return{tl:{vertices:{x:c.vertices.x,y:c.vertices.y,z:c.vertices.z},colors:{r:c.colors.r,g:c.colors.g,b:c.colors.b,a:c.colors.a},texCoords:{u:c.texCoords.u,v:c.texCoords.v}},bl:{vertices:{x:d.vertices.x,y:d.vertices.y,z:d.vertices.z},colors:{r:d.colors.r,g:d.colors.g,b:d.colors.b,a:d.colors.a},texCoords:{u:d.texCoords.u,v:d.texCoords.v}},
tr:{vertices:{x:e.vertices.x,y:e.vertices.y,z:e.vertices.z},colors:{r:e.colors.r,g:e.colors.g,b:e.colors.b,a:e.colors.a},texCoords:{u:e.texCoords.u,v:e.texCoords.v}},br:{vertices:{x:a.vertices.x,y:a.vertices.y,z:a.vertices.z},colors:{r:a.colors.r,g:a.colors.g,b:a.colors.b,a:a.colors.a},texCoords:{u:a.texCoords.u,v:a.texCoords.v}}}};cc.V3F_C4B_T2F_QuadsCopy=function(a){if(!a)return[];for(var c=[],d=0;d>16,(a>>8)%256,a%256)};
cc.colorToHex=function(a){var b=a.r.toString(16),c=a.g.toString(16),d=a.b.toString(16);return"#"+(16>a.r?"0"+b:b)+(16>a.g?"0"+c:c)+(16>a.b?"0"+d:d)};cc.TEXT_ALIGNMENT_LEFT=0;cc.TEXT_ALIGNMENT_CENTER=1;cc.TEXT_ALIGNMENT_RIGHT=2;cc.VERTICAL_TEXT_ALIGNMENT_TOP=0;cc.VERTICAL_TEXT_ALIGNMENT_CENTER=1;cc.VERTICAL_TEXT_ALIGNMENT_BOTTOM=2;
cc._Dictionary=cc.Class.extend({_keyMapTb:null,_valueMapTb:null,__currId:0,ctor:function(){this._keyMapTb={};this._valueMapTb={};this.__currId=2<<(0|10*Math.random())},__getKey:function(){this.__currId++;return"key_"+this.__currId},setObject:function(a,b){if(null!=b){var c=this.__getKey();this._keyMapTb[c]=b;this._valueMapTb[c]=a}},objectForKey:function(a){if(null==a)return null;var b=this._keyMapTb,c;for(c in b)if(b[c]===a)return this._valueMapTb[c];return null},valueForKey:function(a){return this.objectForKey(a)},
removeObjectForKey:function(a){if(null!=a){var b=this._keyMapTb,c;for(c in b)if(b[c]===a){delete this._valueMapTb[c];delete b[c];break}}},removeObjectsForKeys:function(a){if(null!=a)for(var b=0;bMath.abs(a-c)&&(c=a);2>Math.abs(b-d)&&(d=b);a=cc.rect(Math.round((a-c)/2),Math.round((b-d)/2),c,d);this._result.scale=[e,f];this._result.viewport=a;return this._result},preApply:function(a){},apply:function(a,b){return{scale:[1,1]}},postApply:function(a){}});
(function(){var a=cc.ContainerStrategy.extend({apply:function(a){this._setupContainer(a,a._frameSize.width,a._frameSize.height)}}),b=cc.ContainerStrategy.extend({apply:function(a,b){var c=a._frameSize.width,d=a._frameSize.height,e=cc.container.style,n=b.width,p=b.height,t=c/n,r=d/p,v,s;t>=1}return-1},_removeUsedIndexBit:function(a){0>a||
a>=this._maxTouches||(a=~(1<=c.length?c.push(a):(c[this._preTouchPoolPointer]=a,this._preTouchPoolPointer=(this._preTouchPoolPointer+1)%50))},getTouchByXY:function(a,
b,c){var d=this._preTouchPoint;a=this._glView.convertToLocationInView(a,b,c);b=new cc.Touch(a.x,a.y);b._setPrevPoint(d.x,d.y);d.x=a.x;d.y=a.y;return b},getMouseEvent:function(a,b,c){var d=this._prevMousePoint;this._glView._convertMouseToLocationInView(a,b);b=new cc.EventMouse(c);b.setLocation(a.x,a.y);b._setPrevCursor(d.x,d.y);d.x=a.x;d.y=a.y;return b},getPointByEvent:function(a,b){if(null!=a.pageX)return{x:a.pageX,y:a.pageY};b.left-=document.body.scrollLeft;b.top-=document.body.scrollTop;return{x:a.clientX,
y:a.clientY}},getTouchesByEvent:function(a,b){for(var c=[],d=this._glView,e,f,g=this._preTouchPoint,h=a.changedTouches.length,k=0;kthis._accelInterval&&(this._accelCurTime-=this._accelInterval,cc.eventManager.dispatchEvent(new cc.EventAcceleration(this._acceleration)));
this._accelCurTime+=a}};var _p=cc.inputManager;_p.setAccelerometerEnabled=function(a){this._accelEnabled!==a&&(this._accelEnabled=a,a=cc.director.getScheduler(),this._accelCurTime=0,a.scheduleUpdate(this))};_p.setAccelerometerInterval=function(a){this._accelInterval!==a&&(this._accelInterval=a)};
_p._registerKeyboardEvent=function(){cc._addEventListener(cc._canvas,"keydown",function(a){cc.eventManager.dispatchEvent(new cc.EventKeyboard(a.keyCode,!0));a.stopPropagation();a.preventDefault()},!1);cc._addEventListener(cc._canvas,"keyup",function(a){cc.eventManager.dispatchEvent(new cc.EventKeyboard(a.keyCode,!1));a.stopPropagation();a.preventDefault()},!1)};
_p._registerAccelerometerEvent=function(){var a=window;this._acceleration=new cc.Acceleration;this._accelDeviceEvent=a.DeviceMotionEvent||a.DeviceOrientationEvent;cc.sys.browserType===cc.sys.BROWSER_TYPE_MOBILE_QQ&&(this._accelDeviceEvent=window.DeviceOrientationEvent);var b=this._accelDeviceEvent===a.DeviceMotionEvent?"devicemotion":"deviceorientation",c=navigator.userAgent;if(/Android/.test(c)||/Adr/.test(c)&&cc.sys.browserType===cc.BROWSER_TYPE_UC)this._minus=-1;cc._addEventListener(a,b,this.didAccelerate.bind(this),
!1)};
_p.didAccelerate=function(a){var b=window;if(this._accelEnabled){var c=this._acceleration,d,e,f;this._accelDeviceEvent===window.DeviceMotionEvent?(f=a.accelerationIncludingGravity,d=this._accelMinus*f.x*0.1,e=this._accelMinus*f.y*0.1,f=0.1*f.z):(d=a.gamma/90*0.981,e=0.981*-(a.beta/90),f=a.alpha/90*0.981);cc.sys.os===cc.sys.OS_ANDROID?(c.x=-d,c.y=-e):(c.x=d,c.y=e);c.z=f;c.timestamp=a.timeStamp||Date.now();a=c.x;b.orientation===cc.UIInterfaceOrientationLandscapeRight?(c.x=-c.y,c.y=a):b.orientation===cc.UIInterfaceOrientationLandscapeLeft?
(c.x=c.y,c.y=-a):b.orientation===cc.UIInterfaceOrientationPortraitUpsideDown&&(c.x=-c.x,c.y=-c.y)}};delete _p;cc.AffineTransform=function(a,b,c,d,e,f){this.a=a;this.b=b;this.c=c;this.d=d;this.tx=e;this.ty=f};cc.affineTransformMake=function(a,b,c,d,e,f){return{a:a,b:b,c:c,d:d,tx:e,ty:f}};cc.pointApplyAffineTransform=function(a,b,c){var d;void 0===c?(c=b,d=a.x,a=a.y):(d=a,a=b);return{x:c.a*d+c.c*a+c.tx,y:c.b*d+c.d*a+c.ty}};cc._pointApplyAffineTransform=function(a,b,c){return cc.pointApplyAffineTransform(a,b,c)};
cc.sizeApplyAffineTransform=function(a,b){return{width:b.a*a.width+b.c*a.height,height:b.b*a.width+b.d*a.height}};cc.affineTransformMakeIdentity=function(){return{a:1,b:0,c:0,d:1,tx:0,ty:0}};cc.affineTransformIdentity=function(){return{a:1,b:0,c:0,d:1,tx:0,ty:0}};
cc.rectApplyAffineTransform=function(a,b){var c=cc.rectGetMinY(a),d=cc.rectGetMinX(a),e=cc.rectGetMaxX(a),f=cc.rectGetMaxY(a),g=cc.pointApplyAffineTransform(d,c,b),c=cc.pointApplyAffineTransform(e,c,b),d=cc.pointApplyAffineTransform(d,f,b),h=cc.pointApplyAffineTransform(e,f,b),e=Math.min(g.x,c.x,d.x,h.x),f=Math.max(g.x,c.x,d.x,h.x),k=Math.min(g.y,c.y,d.y,h.y),g=Math.max(g.y,c.y,d.y,h.y);return cc.rect(e,k,f-e,g-k)};
cc._rectApplyAffineTransformIn=function(a,b){var c=cc.rectGetMinY(a),d=cc.rectGetMinX(a),e=cc.rectGetMaxX(a),f=cc.rectGetMaxY(a),g=cc.pointApplyAffineTransform(d,c,b),c=cc.pointApplyAffineTransform(e,c,b),d=cc.pointApplyAffineTransform(d,f,b),h=cc.pointApplyAffineTransform(e,f,b),e=Math.min(g.x,c.x,d.x,h.x),f=Math.max(g.x,c.x,d.x,h.x),k=Math.min(g.y,c.y,d.y,h.y),g=Math.max(g.y,c.y,d.y,h.y);a.x=e;a.y=k;a.width=f-e;a.height=g-k;return a};
cc.affineTransformTranslate=function(a,b,c){return{a:a.a,b:a.b,c:a.c,d:a.d,tx:a.tx+a.a*b+a.c*c,ty:a.ty+a.b*b+a.d*c}};cc.affineTransformScale=function(a,b,c){return{a:a.a*b,b:a.b*b,c:a.c*c,d:a.d*c,tx:a.tx,ty:a.ty}};cc.affineTransformRotate=function(a,b){var c=Math.sin(b),d=Math.cos(b);return{a:a.a*d+a.c*c,b:a.b*d+a.d*c,c:a.c*d-a.a*c,d:a.d*d-a.b*c,tx:a.tx,ty:a.ty}};
cc.affineTransformConcat=function(a,b){return{a:a.a*b.a+a.b*b.c,b:a.a*b.b+a.b*b.d,c:a.c*b.a+a.d*b.c,d:a.c*b.b+a.d*b.d,tx:a.tx*b.a+a.ty*b.c+b.tx,ty:a.tx*b.b+a.ty*b.d+b.ty}};cc.affineTransformConcatIn=function(a,b){var c=a.a,d=a.b,e=a.c,f=a.d,g=a.tx,h=a.ty;a.a=c*b.a+d*b.c;a.b=c*b.b+d*b.d;a.c=e*b.a+f*b.c;a.d=e*b.b+f*b.d;a.tx=g*b.a+h*b.c+b.tx;a.ty=g*b.b+h*b.d+b.ty;return a};cc.affineTransformEqualToTransform=function(a,b){return a.a===b.a&&a.b===b.b&&a.c===b.c&&a.d===b.d&&a.tx===b.tx&&a.ty===b.ty};
cc.affineTransformInvert=function(a){var b=1/(a.a*a.d-a.b*a.c);return{a:b*a.d,b:-b*a.b,c:-b*a.c,d:b*a.a,tx:b*(a.c*a.ty-a.d*a.tx),ty:b*(a.b*a.tx-a.a*a.ty)}};cc.POINT_EPSILON=parseFloat("1.192092896e-07F");cc.pNeg=function(a){return cc.p(-a.x,-a.y)};cc.pAdd=function(a,b){return cc.p(a.x+b.x,a.y+b.y)};cc.pSub=function(a,b){return cc.p(a.x-b.x,a.y-b.y)};cc.pMult=function(a,b){return cc.p(a.x*b,a.y*b)};cc.pMidpoint=function(a,b){return cc.pMult(cc.pAdd(a,b),0.5)};cc.pDot=function(a,b){return a.x*b.x+a.y*b.y};cc.pCross=function(a,b){return a.x*b.y-a.y*b.x};cc.pPerp=function(a){return cc.p(-a.y,a.x)};cc.pRPerp=function(a){return cc.p(a.y,-a.x)};
cc.pProject=function(a,b){return cc.pMult(b,cc.pDot(a,b)/cc.pDot(b,b))};cc.pRotate=function(a,b){return cc.p(a.x*b.x-a.y*b.y,a.x*b.y+a.y*b.x)};cc.pUnrotate=function(a,b){return cc.p(a.x*b.x+a.y*b.y,a.y*b.x-a.x*b.y)};cc.pLengthSQ=function(a){return cc.pDot(a,a)};cc.pDistanceSQ=function(a,b){return cc.pLengthSQ(cc.pSub(a,b))};cc.pLength=function(a){return Math.sqrt(cc.pLengthSQ(a))};cc.pDistance=function(a,b){return cc.pLength(cc.pSub(a,b))};
cc.pNormalize=function(a){var b=cc.pLength(a);return 0===b?cc.p(a):cc.pMult(a,1/b)};cc.pForAngle=function(a){return cc.p(Math.cos(a),Math.sin(a))};cc.pToAngle=function(a){return Math.atan2(a.y,a.x)};cc.clampf=function(a,b,c){if(b>c){var d=b;b=c;c=d}return a=e.x&&0<=e.y&&1>=e.y?!0:!1};cc.pIntersectPoint=function(a,b,c,d){var e=cc.p(0,0);return cc.pLineIntersect(a,b,c,d,e)?(c=cc.p(0,0),c.x=a.x+e.x*(b.x-a.x),c.y=a.y+e.x*(b.y-a.y),c):cc.p(0,0)};cc.pSameAs=function(a,b){return null!=a&&null!=b?a.x===b.x&&a.y===b.y:!1};cc.pZeroIn=function(a){a.x=0;a.y=0};cc.pIn=function(a,b){a.x=b.x;a.y=b.y};cc.pMultIn=function(a,b){a.x*=b;a.y*=b};
cc.pSubIn=function(a,b){a.x-=b.x;a.y-=b.y};cc.pAddIn=function(a,b){a.x+=b.x;a.y+=b.y};cc.pNormalizeIn=function(a){cc.pMultIn(a,1/Math.sqrt(a.x*a.x+a.y*a.y))};cc.vertexLineToPolygon=function(a,b,c,d,e){e+=d;if(!(1>=e)){b*=0.5;for(var f,g=e-1,h=d;hb.value||1h.getLocalZOrder())this._visitTarget(h,!1);else break;null!=g[a.__instanceId]&&(f[a.getGlobalZOrder()]||(f[a.getGlobalZOrder()]=[]),f[a.getGlobalZOrder()].push(a.__instanceId));for(;dh&&-1E-6k&&-1E-6e._localZOrder)e._renderCmd.visit(this);else break;for(cc.renderer.pushRenderCommand(this);ca[c]._localZOrder)a[c]._renderCmd.visit(this);else break;for(cc.renderer.pushRenderCommand(this);cd||c>d)return cc.log(cc._LogInfos.Texture2D_initWithImage_2,b,c,d,d),!1;this._textureLoaded=!0;return this._initPremultipliedATextureWithImage(a,b,c)},initWithElement:function(a){a&&(this._webTextureObj=cc._renderContext.createTexture(),this._htmlElementObj=a,this._textureLoaded=
!0)},getHtmlElementObj:function(){return this._htmlElementObj},isLoaded:function(){return this._textureLoaded},handleLoadedTexture:function(a){a=void 0===a?!1:a;if(cc._rendererInitialized){if(!this._htmlElementObj){var b=cc.loader.getRes(this.url);if(!b)return;this.initWithElement(b)}this._htmlElementObj.width&&this._htmlElementObj.height&&(b=cc._renderContext,cc.glBindTexture2D(this),b.pixelStorei(b.UNPACK_ALIGNMENT,4),a&&b.pixelStorei(b.UNPACK_PREMULTIPLY_ALPHA_WEBGL,1),b.texImage2D(b.TEXTURE_2D,
0,b.RGBA,b.RGBA,b.UNSIGNED_BYTE,this._htmlElementObj),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,b.LINEAR),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,b.LINEAR),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,b.CLAMP_TO_EDGE),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,b.CLAMP_TO_EDGE),this.shaderProgram=cc.shaderCache.programForKey(cc.SHADER_POSITION_TEXTURE),cc.glBindTexture2D(null),a&&b.pixelStorei(b.UNPACK_PREMULTIPLY_ALPHA_WEBGL,0),b=this._htmlElementObj.height,this._pixelsWide=
this._contentSize.width=this._htmlElementObj.width,this._pixelsHigh=this._contentSize.height=b,this._pixelFormat=cc.Texture2D.PIXEL_FORMAT_RGBA8888,this.maxT=this.maxS=1,this._hasPremultipliedAlpha=a,this._hasMipmaps=!1,this.dispatchEvent("load"))}},initWithString:function(a,b,c,d,e,f){cc.log(cc._LogInfos.Texture2D_initWithString);return null},initWithETCFile:function(a){cc.log(cc._LogInfos.Texture2D_initWithETCFile_2);return!1},initWithPVRFile:function(a){cc.log(cc._LogInfos.Texture2D_initWithPVRFile_2);
return!1},initWithPVRTCData:function(a,b,c,d,e,f){cc.log(cc._LogInfos.Texture2D_initWithPVRTCData_2);return!1},setTexParameters:function(a,b,c,d){var e=cc._renderContext;void 0!==b&&(a={minFilter:a,magFilter:b,wrapS:c,wrapT:d});cc.assert(this._pixelsWide===cc.NextPOT(this._pixelsWide)&&this._pixelsHigh===cc.NextPOT(this._pixelsHigh)||a.wrapS===e.CLAMP_TO_EDGE&&a.wrapT===e.CLAMP_TO_EDGE,"WebGLRenderingContext.CLAMP_TO_EDGE should be used in NPOT textures");cc.glBindTexture2D(this);e.texParameteri(e.TEXTURE_2D,
e.TEXTURE_MIN_FILTER,a.minFilter);e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,a.magFilter);e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,a.wrapS);e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,a.wrapT)},setAntiAliasTexParameters:function(){var a=cc._renderContext;cc.glBindTexture2D(this);this._hasMipmaps?a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,a.LINEAR_MIPMAP_NEAREST):a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,a.LINEAR);a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,a.LINEAR)},
setAliasTexParameters:function(){var a=cc._renderContext;cc.glBindTexture2D(this);this._hasMipmaps?a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,a.NEAREST_MIPMAP_NEAREST):a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,a.NEAREST);a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,a.NEAREST)},generateMipmap:function(){cc.assert(this._pixelsWide===cc.NextPOT(this._pixelsWide)&&this._pixelsHigh===cc.NextPOT(this._pixelsHigh),"Mimpap texture only works in POT textures");cc.glBindTexture2D(this);
cc._renderContext.generateMipmap(cc._renderContext.TEXTURE_2D);this._hasMipmaps=!0},stringForFormat:function(){return cc.Texture2D._M[this._pixelFormat]},bitsPerPixelForFormat:function(a){a=a||this._pixelFormat;var b=cc.Texture2D._B[a];if(null!=b)return b;cc.log(cc._LogInfos.Texture2D_bitsPerPixelForFormat,a);return-1},_initPremultipliedATextureWithImage:function(a,b,c){var d=cc.Texture2D,e=a.getData(),f=null,f=null,g=a.hasAlpha(),h=cc.size(a.getWidth(),a.getHeight()),k=d.defaultPixelFormat,m=a.getBitsPerComponent();
g||(8<=m?k=d.PIXEL_FORMAT_RGB888:(cc.log(cc._LogInfos.Texture2D__initPremultipliedATextureWithImage),k=d.PIXEL_FORMAT_RGB565));var n=b*c;if(k===d.PIXEL_FORMAT_RGB565)if(g)for(e=new Uint16Array(b*c),f=a.getData(),m=0;m>0&255)>>3<<11|(f[m]>>8&255)>>2<<5|(f[m]>>16&255)>>3<<0;else for(e=new Uint16Array(b*c),f=a.getData(),m=0;m>3<<11|(f[m]&255)>>2<<5|(f[m]&255)>>3<<0;else if(k===d.PIXEL_FORMAT_RGBA4444)for(e=new Uint16Array(b*c),f=a.getData(),m=0;m>
0&255)>>4<<12|(f[m]>>8&255)>>4<<8|(f[m]>>16&255)>>4<<4|(f[m]>>24&255)>>4<<0;else if(k===d.PIXEL_FORMAT_RGB5A1)for(e=new Uint16Array(b*c),f=a.getData(),m=0;m>0&255)>>3<<11|(f[m]>>8&255)>>3<<6|(f[m]>>16&255)>>3<<1|(f[m]>>24&255)>>7<<0;else if(k===d.PIXEL_FORMAT_A8)for(e=new Uint8Array(b*c),f=a.getData(),m=0;m>24&255;if(g&&k===d.PIXEL_FORMAT_RGB888)for(f=a.getData(),e=new Uint8Array(b*c*3),m=0;m>0&255,e[3*m+1]=f>>8&255,e[3*m+2]=f>>16&255;this.initWithData(e,
k,b,c,h);a.getData();this._hasPremultipliedAlpha=a.isPremultipliedAlpha();return!0},addLoadedEventListener:function(a,b){this.addEventListener("load",a,b)},removeLoadedEventListener:function(a){this.removeEventListener("load",a)}})};
cc._tmp.WebGLTextureAtlas=function(){var a=cc.TextureAtlas.prototype;a._setupVBO=function(){var a=cc._renderContext;this._buffersVBO[0]=a.createBuffer();this._buffersVBO[1]=a.createBuffer();this._quadsWebBuffer=a.createBuffer();this._mapBuffers()};a._mapBuffers=function(){var a=cc._renderContext;a.bindBuffer(a.ARRAY_BUFFER,this._quadsWebBuffer);a.bufferData(a.ARRAY_BUFFER,this._quadsArrayBuffer,a.DYNAMIC_DRAW);a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,this._buffersVBO[1]);a.bufferData(a.ELEMENT_ARRAY_BUFFER,
this._indices,a.STATIC_DRAW)};a.drawNumberOfQuads=function(a,c){c=c||0;if(0!==a&&this.texture&&this.texture.isLoaded()){var d=cc._renderContext;cc.glBindTexture2D(this.texture);cc.glEnableVertexAttribs(cc.VERTEX_ATTRIB_FLAG_POS_COLOR_TEX);d.bindBuffer(d.ARRAY_BUFFER,this._quadsWebBuffer);this.dirty&&(d.bufferData(d.ARRAY_BUFFER,this._quadsArrayBuffer,d.DYNAMIC_DRAW),this.dirty=!1);d.vertexAttribPointer(cc.VERTEX_ATTRIB_POSITION,3,d.FLOAT,!1,24,0);d.vertexAttribPointer(cc.VERTEX_ATTRIB_COLOR,4,d.UNSIGNED_BYTE,
!0,24,12);d.vertexAttribPointer(cc.VERTEX_ATTRIB_TEX_COORDS,2,d.FLOAT,!1,24,16);d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,this._buffersVBO[1]);cc.TEXTURE_ATLAS_USE_TRIANGLE_STRIP?d.drawElements(d.TRIANGLE_STRIP,6*a,d.UNSIGNED_SHORT,6*c*this._indices.BYTES_PER_ELEMENT):d.drawElements(d.TRIANGLES,6*a,d.UNSIGNED_SHORT,6*c*this._indices.BYTES_PER_ELEMENT);cc.g_NumberOfDraws++}}};
cc._tmp.WebGLTextureCache=function(){var a=cc.textureCache;a.handleLoadedTexture=function(a){var c=this._textures,d;cc._rendererInitialized||(c=this._loadedTexturesBefore);d=c[a];d||(d=c[a]=new cc.Texture2D,d.url=a);".png"===cc.path.extname(a)?d.handleLoadedTexture(!0):d.handleLoadedTexture()};a.addImage=function(a,c,d){cc.assert(a,cc._LogInfos.Texture2D_addImage_2);var e=this._textures;cc._rendererInitialized||(e=this._loadedTexturesBefore);var f=e[a]||e[cc.loader._aliases[a]];if(f)return f.isLoaded()?
c&&c.call(d,f):f.addEventListener("load",function(){c&&c.call(d,f)},d),f;f=e[a]=new cc.Texture2D;f.url=a;(cc.loader._checkIsImageURL(a)?cc.loader.load:cc.loader.loadImg).call(cc.loader,a,function(f,h){if(f)return c&&c.call(d,f);cc.textureCache.handleLoadedTexture(a);var k=e[a];c&&c.call(d,k)});return f};a.addImageAsync=a.addImage;a=null};cc._tmp.PrototypeTexture2D=function(){var a=cc.Texture2D;a.PVRImagesHavePremultipliedAlpha=function(a){cc.PVRHaveAlphaPremultiplied_=a};a.PIXEL_FORMAT_RGBA8888=2;a.PIXEL_FORMAT_RGB888=3;a.PIXEL_FORMAT_RGB565=4;a.PIXEL_FORMAT_A8=5;a.PIXEL_FORMAT_I8=6;a.PIXEL_FORMAT_AI88=7;a.PIXEL_FORMAT_RGBA4444=8;a.PIXEL_FORMAT_RGB5A1=7;a.PIXEL_FORMAT_PVRTC4=9;a.PIXEL_FORMAT_PVRTC2=10;a.PIXEL_FORMAT_DEFAULT=a.PIXEL_FORMAT_RGBA8888;a.defaultPixelFormat=a.PIXEL_FORMAT_DEFAULT;var b=cc.Texture2D._M={};b[a.PIXEL_FORMAT_RGBA8888]=
"RGBA8888";b[a.PIXEL_FORMAT_RGB888]="RGB888";b[a.PIXEL_FORMAT_RGB565]="RGB565";b[a.PIXEL_FORMAT_A8]="A8";b[a.PIXEL_FORMAT_I8]="I8";b[a.PIXEL_FORMAT_AI88]="AI88";b[a.PIXEL_FORMAT_RGBA4444]="RGBA4444";b[a.PIXEL_FORMAT_RGB5A1]="RGB5A1";b[a.PIXEL_FORMAT_PVRTC4]="PVRTC4";b[a.PIXEL_FORMAT_PVRTC2]="PVRTC2";b=cc.Texture2D._B={};b[a.PIXEL_FORMAT_RGBA8888]=32;b[a.PIXEL_FORMAT_RGB888]=24;b[a.PIXEL_FORMAT_RGB565]=16;b[a.PIXEL_FORMAT_A8]=8;b[a.PIXEL_FORMAT_I8]=8;b[a.PIXEL_FORMAT_AI88]=16;b[a.PIXEL_FORMAT_RGBA4444]=
16;b[a.PIXEL_FORMAT_RGB5A1]=16;b[a.PIXEL_FORMAT_PVRTC4]=4;b[a.PIXEL_FORMAT_PVRTC2]=3;a=cc.Texture2D.prototype;cc.defineGetterSetter(a,"name",a.getName);cc.defineGetterSetter(a,"pixelFormat",a.getPixelFormat);cc.defineGetterSetter(a,"pixelsWidth",a.getPixelsWide);cc.defineGetterSetter(a,"pixelsHeight",a.getPixelsHigh);cc.defineGetterSetter(a,"width",a._getWidth);cc.defineGetterSetter(a,"height",a._getHeight)};
cc._tmp.PrototypeTextureAtlas=function(){var a=cc.TextureAtlas.prototype;cc.defineGetterSetter(a,"totalQuads",a.getTotalQuads);cc.defineGetterSetter(a,"capacity",a.getCapacity);cc.defineGetterSetter(a,"quads",a.getQuads,a.setQuads)};cc.ALIGN_CENTER=51;cc.ALIGN_TOP=19;cc.ALIGN_TOP_RIGHT=18;cc.ALIGN_RIGHT=50;cc.ALIGN_BOTTOM_RIGHT=34;cc.ALIGN_BOTTOM=35;cc.ALIGN_BOTTOM_LEFT=33;cc.ALIGN_LEFT=49;cc.ALIGN_TOP_LEFT=17;cc.PVRHaveAlphaPremultiplied_=!1;
cc._renderType===cc._RENDER_TYPE_CANVAS?(cc.Texture2D=cc.Class.extend({_contentSize:null,_textureLoaded:!1,_htmlElementObj:null,url:null,_pattern:null,ctor:function(){this._contentSize=cc.size(0,0);this._textureLoaded=!1;this._htmlElementObj=null;this._pattern=""},getPixelsWide:function(){return this._contentSize.width},getPixelsHigh:function(){return this._contentSize.height},getContentSize:function(){var a=cc.contentScaleFactor();return cc.size(this._contentSize.width/a,this._contentSize.height/
a)},_getWidth:function(){return this._contentSize.width/cc.contentScaleFactor()},_getHeight:function(){return this._contentSize.height/cc.contentScaleFactor()},getContentSizeInPixels:function(){return this._contentSize},initWithElement:function(a){a&&(this._htmlElementObj=a,this._contentSize.width=a.width,this._contentSize.height=a.height,this._textureLoaded=!0)},getHtmlElementObj:function(){return this._htmlElementObj},isLoaded:function(){return this._textureLoaded},handleLoadedTexture:function(){if(!this._textureLoaded){if(!this._htmlElementObj){var a=
cc.loader.getRes(this.url);if(!a)return;this.initWithElement(a)}a=this._htmlElementObj;this._contentSize.width=a.width;this._contentSize.height=a.height;this.dispatchEvent("load")}},description:function(){return"\x3ccc.Texture2D | width \x3d "+this._contentSize.width+" height "+this._contentSize.height+"\x3e"},initWithData:function(a,b,c,d,e){return!1},initWithImage:function(a){return!1},initWithString:function(a,b,c,d,e,f){return!1},releaseTexture:function(){cc.loader.release(this.url)},getName:function(){return null},
getMaxS:function(){return 1},setMaxS:function(a){},getMaxT:function(){return 1},setMaxT:function(a){},getPixelFormat:function(){return null},getShaderProgram:function(){return null},setShaderProgram:function(a){},hasPremultipliedAlpha:function(){return!1},hasMipmaps:function(){return!1},releaseData:function(a){},keepData:function(a,b){return a},drawAtPoint:function(a){},drawInRect:function(a){},initWithETCFile:function(a){cc.log(cc._LogInfos.Texture2D_initWithETCFile);return!1},initWithPVRFile:function(a){cc.log(cc._LogInfos.Texture2D_initWithPVRFile);
return!1},initWithPVRTCData:function(a,b,c,d,e,f){cc.log(cc._LogInfos.Texture2D_initWithPVRTCData);return!1},setTexParameters:function(a,b,c,d){void 0!==b&&(a={minFilter:a,magFilter:b,wrapS:c,wrapT:d});this._pattern=a.wrapS===cc.REPEAT&&a.wrapT===cc.REPEAT?"repeat":a.wrapS===cc.REPEAT?"repeat-x":a.wrapT===cc.REPEAT?"repeat-y":""},setAntiAliasTexParameters:function(){},setAliasTexParameters:function(){},generateMipmap:function(){},stringForFormat:function(){return""},bitsPerPixelForFormat:function(a){return-1},
addLoadedEventListener:function(a,b){this.addEventListener("load",a,b)},removeLoadedEventListener:function(a){this.removeEventListener("load",a)},_grayElementObj:null,_backupElement:null,_isGray:!1,_switchToGray:function(a){this._textureLoaded&&this._isGray!==a&&((this._isGray=a)?(this._backupElement=this._htmlElementObj,this._grayElementObj||(this._grayElementObj=cc.Texture2D._generateGrayTexture(this._htmlElementObj)),this._htmlElementObj=this._grayElementObj):null!==this._backupElement&&(this._htmlElementObj=
this._backupElement))}}),cc.Texture2D._generateGrayTexture=function(a,b,c){if(null===a)return null;c=c||cc.newElement("canvas");b=b||cc.rect(0,0,a.width,a.height);c.width=b.width;c.height=b.height;var d=c.getContext("2d");d.drawImage(a,b.x,b.y,b.width,b.height,0,0,b.width,b.height);a=d.getImageData(0,0,b.width,b.height);b=a.data;for(var e=0,f=b.length;ethis._capacity)cc.log(cc._LogInfos.TextureAtlas_insertQuad);else{var c=cc.V3F_C4B_T2F_Quad.BYTES_PER_ELEMENT,d=b*c,e=(this._totalQuads-
1-b)*c;this._quads[this._totalQuads-1]=new cc.V3F_C4B_T2F_Quad(null,null,null,null,this._quadsArrayBuffer,(this._totalQuads-1)*c);this._quadsReader.set(this._quadsReader.subarray(d,d+e),d+c);this._setQuadToArray(a,b);this.dirty=!0}},insertQuads:function(a,b,c){c=c||a.length;cc.assert(b+c<=this._capacity,cc._LogInfos.TextureAtlas_insertQuads);var d=cc.V3F_C4B_T2F_Quad.BYTES_PER_ELEMENT;this._totalQuads+=c;if(this._totalQuads>this._capacity)cc.log(cc._LogInfos.TextureAtlas_insertQuad);else{var e=b*
d,f=(this._totalQuads-1-b-c)*d,g=this._totalQuads-1-c,h;for(h=0;hb?(f=b*c,d.set(d.subarray(f,f+(a-b)*c),f+c),d.set(e,f)):(f=(a+1)*c,d.set(d.subarray(f,f+(b-a)*c),f-c),d.set(e,b*c));this.dirty=!0}},removeQuadAtIndex:function(a){cc.assert(ac){f=[];g=new ArrayBuffer(b*d);for(a=0;ac?(b=new Uint16Array(6*d),b.set(this._indices,0),this._indices=b):this._indices=this._indices.subarray(0,6*d);this._setupIndices();this._mapBuffers();
return this.dirty=!0},increaseTotalQuadsWith:function(a){this._totalQuads+=a},moveQuadsFromIndex:function(a,b,c){if(void 0===c){if(c=b,b=this._totalQuads-a,cc.assert(c+(this._totalQuads-a)<=this._capacity,cc._LogInfos.TextureAtlas_moveQuadsFromIndex),0===b)return}else if(cc.assert(c+b<=this._totalQuads,cc._LogInfos.TextureAtlas_moveQuadsFromIndex_2),cc.assert(a=this._layers.length?cc.log(cc._LogInfos.LayerMultiplex_switchTo):(this.removeChild(this._layers[this._enabledLayer],!0),this._enabledLayer=a,this.addChild(this._layers[a]))},switchToAndReleaseMe:function(a){a>=this._layers.length?cc.log(cc._LogInfos.LayerMultiplex_switchToAndReleaseMe):(this.removeChild(this._layers[this._enabledLayer],!0),this._layers[this._enabledLayer]=null,this._enabledLayer=a,this.addChild(this._layers[a]))},addLayer:function(a){a?this._layers.push(a):
cc.log(cc._LogInfos.LayerMultiplex_addLayer)}});cc.LayerMultiplex.create=function(){return new cc.LayerMultiplex(Array.prototype.slice.call(arguments))};(function(){cc.Layer.CanvasRenderCmd=function(a){cc.Node.CanvasRenderCmd.call(this,a);this._isBaked=!1;this._bakeSprite=null;this._updateCache=2};var a=cc.Layer.CanvasRenderCmd.prototype=Object.create(cc.Node.CanvasRenderCmd.prototype);a.constructor=cc.Layer.CanvasRenderCmd;a._setCacheDirty=function(a){a&&0===this._updateCache&&(this._updateCache=2);!1===this._cacheDirty&&(this._cacheDirty=!0,(a=this._cachedParent)&&a!==this&&a._setNodeDirtyForCache&&a._setNodeDirtyForCache())};a.transform=function(a,
c){var d=this._worldTransform,e=d.a,f=d.b,g=d.c,h=d.d;cc.Node.CanvasRenderCmd.prototype.transform.call(this,a,c);d.a===e&&d.b===f&&d.c===g&&d.d===h||0!==this._updateCache||(this._updateCache=2)};a.bake=function(){if(!this._isBaked){this._needDraw=!0;this._isBaked=this._cacheDirty=cc.renderer.childrenOrderDirty=!0;0===this._updateCache&&(this._updateCache=2);for(var a=this._node._children,c=0,d=a.length;cf._localZOrder)f._renderCmd.visit(this);else break;for(cc.renderer.pushRenderCommand(this);ae;e++)d[e].r=a.r,d[e].g=a.g,d[e].b=a.b,d[e].a=
c;this._bindLayerColorsBufferData()};a._bindLayerVerticesBufferData=function(){var a=cc._renderContext;a.bindBuffer(a.ARRAY_BUFFER,this._verticesFloat32Buffer);a.bufferData(a.ARRAY_BUFFER,this._squareVerticesAB,a.STATIC_DRAW)};a._bindLayerColorsBufferData=function(){var a=cc._renderContext;a.bindBuffer(a.ARRAY_BUFFER,this._colorsUint8Buffer);a.bufferData(a.ARRAY_BUFFER,this._squareColorsAB,a.STATIC_DRAW)};a.updateBlendFunc=function(a){}})();
(function(){cc.LayerGradient.WebGLRenderCmd=function(a){cc.LayerColor.WebGLRenderCmd.call(this,a);this._needDraw=!0;this._clipRect=new cc.Rect;this._clippingRectDirty=!1};var a=cc.LayerGradient.WebGLRenderCmd.prototype=Object.create(cc.LayerColor.WebGLRenderCmd.prototype);cc.inject(cc.LayerGradient.RenderCmd,a);a.constructor=cc.LayerGradient.WebGLRenderCmd;a._syncStatus=function(a){var c=cc.Node._dirtyFlags,d=this._dirtyFlag,e=a?a._node:null;e&&e._cascadeColorEnabled&&a._dirtyFlag&c.colorDirty&&(d|=
c.colorDirty);e&&e._cascadeOpacityEnabled&&a._dirtyFlag&c.opacityDirty&&(d|=c.opacityDirty);a&&a._dirtyFlag&c.transformDirty&&(d|=c.transformDirty);var e=d&c.colorDirty,f=d&c.opacityDirty;this._dirtyFlag=d;e&&this._syncDisplayColor();f&&this._syncDisplayOpacity();this.transform(a);(e||f||d&c.gradientDirty)&&this._updateColor()};a._updateColor=function(){this._dirtyFlag^=this._dirtyFlag&cc.Node._dirtyFlags.gradientDirty;var a=this._node,c=a._colorStops;if(c&&!(2>c.length)){this._clippingRectDirty=
!0;var d=c.length,e=2*d,f,g=a._contentSize;this._squareVerticesAB=new ArrayBuffer(8*e);this._squareColorsAB=new ArrayBuffer(4*e);var h=this._squareVertices,k=this._squareColors;h.length=0;k.length=0;var m=this._squareVerticesAB,n=this._squareColorsAB,p=cc.Vertex2F.BYTES_PER_ELEMENT,t=cc.Color.BYTES_PER_ELEMENT;for(f=0;ff?(p=cc.p(-a.x,a.y),f=cc.p(a.x,a.y)):180>f?(p=cc.p(a.x,a.y),f=cc.p(a.x,-a.y)):270>f?(p=cc.p(a.x,-a.y),f=cc.p(-a.x,-a.y)):(p=cc.p(-a.x,-a.y),f=cc.p(-a.x,a.y));m=Math.sin(n);n=Math.cos(n);p=Math.abs((p.x*n-p.y*m)/a.x);f=Math.abs((f.x*m+f.y*n)/a.y);e=cc.affineTransformScale(e,p,f);for(f=0;fa.width&&cc.error(cc._LogInfos.RectWidth,a.url),d>a.height&&cc.error(cc._LogInfos.RectHeight,
a.url));this._node._originalTexture=a};a.rendering=function(a,c,d){var e=this._node,f=this._textureCoord,g=this._displayedOpacity/255;if((!e._texture||0!==f.width&&0!==f.height&&e._texture._textureLoaded)&&0!==g){a=a||cc._renderContext;var h=a.getContext(),k=e._offsetPosition.x,m=e._rect.height,n=e._rect.width,p=-e._offsetPosition.y-m;a.setTransform(this._worldTransform,c,d);a.setCompositeOperation(this._blendFuncStr);a.setGlobalAlpha(g);(e._flippedX||e._flippedY)&&a.save();e._flippedX&&(k=-k-n,h.scale(-1,
1));e._flippedY&&(p=e._offsetPosition.y,h.scale(1,-1));e._texture?(g=e._texture._htmlElementObj,""!==e._texture._pattern?(a.setFillStyle(h.createPattern(g,e._texture._pattern)),h.fillRect(k*c,p*d,n*c,m*d)):this._colorized?h.drawImage(g,0,0,f.width,f.height,k*c,p*d,n*c,m*d):h.drawImage(g,f.renderX,f.renderY,f.width,f.height,k*c,p*d,n*c,m*d)):(g=e._contentSize,f.validRect&&(f=this._displayedColor,a.setFillStyle("rgba("+f.r+","+f.g+","+f.b+",1)"),h.fillRect(k*c,p*d,g.width*c,g.height*d)));(e._flippedX||
e._flippedY)&&a.restore();cc.g_NumberOfDraws++}};a._updateColor=cc.sys._supportCanvasNewBlendModes?function(){var a=this._node,c=this._displayedColor;if(255===c.r&&255===c.g&&255===c.b)this._setOriginalTexture();else{var d,e=a._texture,f=this._textureCoord;e&&f.validRect&&this._originalTexture&&(d=e.getHtmlElementObj())&&(this._colorized=!0,d instanceof HTMLCanvasElement&&!this._rectRotated&&!this._newTextureWhenChangeColor&&this._originalTexture._htmlElementObj!==d?cc.Sprite.CanvasRenderCmd._generateTintImageWithMultiply(this._originalTexture._htmlElementObj,
c,f,d):(d=cc.Sprite.CanvasRenderCmd._generateTintImageWithMultiply(this._originalTexture._htmlElementObj,c,f),e=new cc.Texture2D,e.initWithElement(d),e.handleLoadedTexture(),a.setTexture(e)))}}:function(){var a=this._node,c=this._displayedColor;if(255===c.r&&255===c.g&&255===c.b)this._setOriginalTexture();else{var d,e=a._texture,f=this._textureCoord;e&&f.validRect&&this._originalTexture&&(d=e.getHtmlElementObj())&&(e=cc.textureCache.getTextureColors(this._originalTexture.getHtmlElementObj()))&&(this._colorized=
!0,d instanceof HTMLCanvasElement&&!this._rectRotated&&!this._newTextureWhenChangeColor?cc.Sprite.CanvasRenderCmd._generateTintImage(d,e,c,f,d):(d=cc.Sprite.CanvasRenderCmd._generateTintImage(d,e,c,f),e=new cc.Texture2D,e.initWithElement(d),e.handleLoadedTexture(),a.texture=e))}};a._setOriginalTexture=function(){if(this._colorized){this._colorized=!1;var a=this._node,c=cc.rect(a._rect),d=cc.size(a._contentSize),e=a._rectRotated;a.setTexture(this._originalTexture);a.setTextureRect(c,e,d)}};a.getQuad=
function(){return null};a._updateForSetSpriteFrame=function(a,c){this._originalTexture=a;this._colorized=!1;this._textureCoord.renderX=this._textureCoord.x;this._textureCoord.renderY=this._textureCoord.y;if(c=c||a._textureLoaded){var d=this._node.getColor();255===d.r&&255===d.g&&255===d.b||this._updateColor()}};a.updateTransform=function(){var a=this._node;if(a.dirty){var c=a._parent;!a._visible||c&&c!==a._batchNode&&c._shouldBeHidden?a._shouldBeHidden=!0:(a._shouldBeHidden=!1,a._transformToBatch=
c&&c!==a._batchNode?cc.affineTransformConcat(this.getNodeToParentTransform(),c._transformToBatch):this.getNodeToParentTransform());a._recursiveDirty=!1;a.dirty=!1}a._hasChildren&&a._arrayMakeObjectsPerformSelector(a._children,cc.Node._stateCallbackType.updateTransform)};a._updateDisplayColor=function(a){cc.Node.CanvasRenderCmd.prototype._updateDisplayColor.call(this,a)};a._spriteFrameLoadedCallback=function(a){this.setTextureRect(a.getRect(),a.isRotated(),a.getOriginalSize());this._renderCmd._updateColor();
this.dispatchEvent("load")};a._textureLoadedCallback=function(a){if(!this._textureLoaded){this._textureLoaded=!0;var c=this._rect,d=this._renderCmd;c?cc._rectEqualToZero(c)&&(c.width=a.width,c.height=a.height):c=cc.rect(0,0,a.width,a.height);this.texture=d._originalTexture=a;this.setTextureRect(c,this._rectRotated);a=d._displayedColor;255===a.r&&255===a.g&&255===a.b||d._updateColor();this.setBatchNode(this._batchNode);this.dispatchEvent("load")}};a._setTextureCoords=function(a,c){void 0===c&&(c=!0);
var d=this._textureCoord,e=c?cc.contentScaleFactor():1;d.renderX=d.x=0|a.x*e;d.renderY=d.y=0|a.y*e;d.width=0|a.width*e;d.height=0|a.height*e;d.validRect=!(0===d.width||0===d.height||0>d.x||0>d.y)};cc.Sprite.CanvasRenderCmd._generateTintImageWithMultiply=function(a,c,d,e){e=e||cc.newElement("canvas");d=d||cc.rect(0,0,a.width,a.height);var f=e.getContext("2d");e.width!==d.width||e.height!==d.height?(e.width=d.width,e.height=d.height):f.globalCompositeOperation="source-over";f.fillStyle="rgb("+(0|c.r)+
","+(0|c.g)+","+(0|c.b)+")";f.fillRect(0,0,d.width,d.height);f.globalCompositeOperation="multiply";f.drawImage(a,d.x,d.y,d.width,d.height,0,0,d.width,d.height);f.globalCompositeOperation="destination-atop";f.drawImage(a,d.x,d.y,d.width,d.height,0,0,d.width,d.height);return e};cc.Sprite.CanvasRenderCmd._generateTintImage=function(a,c,d,e,f){e||(e=cc.rect(0,0,a.width,a.height));a=d.r/255;var g=d.g/255;d=d.b/255;var h=Math.min(e.width,c[0].width),k=Math.min(e.height,c[0].height),m;f?(m=f.getContext("2d"),
m.clearRect(0,0,h,k)):(f=cc.newElement("canvas"),f.width=h,f.height=k,m=f.getContext("2d"));m.save();m.globalCompositeOperation="lighter";var n=m.globalAlpha;0a+g+d&&(m.globalAlpha=n,m.drawImage(c[3],e.x,e.y,h,k,0,0,h,k));m.restore();return f};cc.Sprite.CanvasRenderCmd._generateTextureCacheForColor=function(a){function c(){var c=
cc.Sprite.CanvasRenderCmd._generateTextureCacheForColor,e=a.width,h=a.height;d[0].width=e;d[0].height=h;d[1].width=e;d[1].height=h;d[2].width=e;d[2].height=h;d[3].width=e;d[3].height=h;c.canvas.width=e;c.canvas.height=h;var k=c.canvas.getContext("2d");k.drawImage(a,0,0);c.tempCanvas.width=e;c.tempCanvas.height=h;for(var k=k.getImageData(0,0,e,h).data,m=0;4>m;m++){var n=d[m].getContext("2d");n.getImageData(0,0,e,h).data;c.tempCtx.drawImage(a,0,0);for(var p=c.tempCtx.getImageData(0,0,e,h),t=p.data,
r=0;ra.width&&cc.error(cc._LogInfos.RectWidth,a.url),c>a.height&&cc.error(cc._LogInfos.RectHeight,a.url))};a.rendering=function(a){var c=this._node,d=c._texture;d&&!d._textureLoaded||0===this._displayedOpacity||(a=a||cc._renderContext,d?d._textureLoaded&&(this._shaderProgram.use(),this._shaderProgram._setUniformForMVPMatrixWithMat4(this._stackMatrix),
cc.glBlendFunc(c._blendFunc.src,c._blendFunc.dst),cc.glBindTexture2DN(0,d),cc.glEnableVertexAttribs(cc.VERTEX_ATTRIB_FLAG_POS_COLOR_TEX),a.bindBuffer(a.ARRAY_BUFFER,this._quadWebBuffer),this._quadDirty&&(a.bufferData(a.ARRAY_BUFFER,this._quad.arrayBuffer,a.DYNAMIC_DRAW),this._quadDirty=!1),a.vertexAttribPointer(0,3,a.FLOAT,!1,24,0),a.vertexAttribPointer(1,4,a.UNSIGNED_BYTE,!0,24,12),a.vertexAttribPointer(2,2,a.FLOAT,!1,24,16),a.drawArrays(a.TRIANGLE_STRIP,0,4)):(this._shaderProgram.use(),this._shaderProgram._setUniformForMVPMatrixWithMat4(this._stackMatrix),
cc.glBlendFunc(c._blendFunc.src,c._blendFunc.dst),cc.glBindTexture2D(null),cc.glEnableVertexAttribs(cc.VERTEX_ATTRIB_FLAG_POSITION|cc.VERTEX_ATTRIB_FLAG_COLOR),a.bindBuffer(a.ARRAY_BUFFER,this._quadWebBuffer),this._quadDirty&&(a.bufferData(a.ARRAY_BUFFER,this._quad.arrayBuffer,a.STATIC_DRAW),this._quadDirty=!1),a.vertexAttribPointer(cc.VERTEX_ATTRIB_POSITION,3,a.FLOAT,!1,24,0),a.vertexAttribPointer(cc.VERTEX_ATTRIB_COLOR,4,a.UNSIGNED_BYTE,!0,24,12),a.drawArrays(a.TRIANGLE_STRIP,0,4)),cc.g_NumberOfDraws++,
0===cc.SPRITE_DEBUG_DRAW&&!c._showNode)||(cc.kmGLMatrixMode(cc.KM_GL_MODELVIEW),cc.current_stack.stack.push(cc.current_stack.top),cc.current_stack.top=this._stackMatrix,1===cc.SPRITE_DEBUG_DRAW||c._showNode?(c=this._quad,c=[cc.p(c.tl.vertices.x,c.tl.vertices.y),cc.p(c.bl.vertices.x,c.bl.vertices.y),cc.p(c.br.vertices.x,c.br.vertices.y),cc.p(c.tr.vertices.x,c.tr.vertices.y)],cc._drawingUtil.drawPoly(c,4,!0)):2===cc.SPRITE_DEBUG_DRAW&&(d=c.getTextureRect(),c=c.getOffsetPosition(),c=[cc.p(c.x,c.y),cc.p(c.x+
d.width,c.y),cc.p(c.x+d.width,c.y+d.height),cc.p(c.x,c.y+d.height)],cc._drawingUtil.drawPoly(c,4,!0)),cc.current_stack.top=cc.current_stack.stack.pop())}})();cc.SpriteBatchNode=cc.Node.extend({_blendFunc:null,_descendants:null,_className:"SpriteBatchNode",ctor:function(a,b){cc.Node.prototype.ctor.call(this);this._descendants=[];this._blendFunc=new cc.BlendFunc(cc.BLEND_SRC,cc.BLEND_DST);var c;b=b||cc.SpriteBatchNode.DEFAULT_CAPACITY;cc.isString(a)?(c=cc.textureCache.getTextureForKey(a))||(c=cc.textureCache.addImage(a)):a instanceof cc.Texture2D&&(c=a);c&&this.initWithTexture(c,b)},addSpriteWithoutQuad:function(a,b,c){cc.assert(a,cc._LogInfos.SpriteBatchNode_addSpriteWithoutQuad_2);
if(!(a instanceof cc.Sprite))return cc.log(cc._LogInfos.SpriteBatchNode_addSpriteWithoutQuad),null;a.atlasIndex=b;var d=0,e,f=this._descendants;if(f&&0=b)break}f.splice(d,0,a);cc.Node.prototype.addChild.call(this,a,b,c);this.reorderBatch(!1);return this},getTextureAtlas:function(){return this._renderCmd.getTextureAtlas()},setTextureAtlas:function(a){this._renderCmd.getTextureAtlas(a)},getDescendants:function(){return this._descendants},
initWithFile:function(a,b){var c=cc.textureCache.getTextureForKey(a);c||(c=cc.textureCache.addImage(a));return this.initWithTexture(c,b)},_setNodeDirtyForCache:function(){this._renderCmd&&this._renderCmd._setNodeDirtyForCache&&this._renderCmd._setNodeDirtyForCache()},init:function(a,b){var c=cc.textureCache.getTextureForKey(a);c||(c=cc.textureCache.addImage(a));return this.initWithTexture(c,b)},increaseAtlasCapacity:function(){this._renderCmd.increaseAtlasCapacity()},removeChildAtIndex:function(a,
b){this.removeChild(this._children[a],b)},rebuildIndexInOrder:function(a,b){var c=a.children;if(c&&0e.zIndex&&(b=this.rebuildIndexInOrder(e,b))}!a===this&&(a.atlasIndex=b,b++);if(c&&0b?c.atlasIndex:c.atlasIndex+1:0>f.zIndex&&0>b||0<=f.zIndex&&0<=b?this.highestAtlasIndexInChild(f)+1:c.atlasIndex+1},reorderBatch:function(a){this._reorderChildDirty=a},setBlendFunc:function(a,b){this._blendFunc=void 0===b?a:{src:a,
dst:b}},getBlendFunc:function(){return new cc.BlendFunc(this._blendFunc.src,this._blendFunc.dst)},reorderChild:function(a,b){cc.assert(a,cc._LogInfos.SpriteBatchNode_reorderChild_2);-1===this._children.indexOf(a)?cc.log(cc._LogInfos.SpriteBatchNode_reorderChild):b!==a.zIndex&&cc.Node.prototype.reorderChild.call(this,a,b)},removeChild:function(a,b){null!=a&&(-1===this._children.indexOf(a)?cc.log(cc._LogInfos.SpriteBatchNode_removeChild):(this.removeSpriteFromAtlas(a),cc.Node.prototype.removeChild.call(this,
a,b)))},updateQuadFromSprite:function(a,b){cc.assert(a,cc._LogInfos.CCSpriteBatchNode_updateQuadFromSprite_2);a instanceof cc.Sprite?(this._renderCmd.checkAtlasCapacity(),a.batchNode=this,a.atlasIndex=b,a.dirty=!0,a.updateTransform()):cc.log(cc._LogInfos.CCSpriteBatchNode_updateQuadFromSprite)},insertQuadFromSprite:function(a,b){cc.assert(a,cc._LogInfos.CCSpriteBatchNode_insertQuadFromSprite_2);a instanceof cc.Sprite?(this._renderCmd.insertQuad(a,b),a.batchNode=this,a.atlasIndex=b,a.dirty=!0,a.updateTransform(),
this._renderCmd.cutting(a,b)):cc.log(cc._LogInfos.CCSpriteBatchNode_insertQuadFromSprite)},initWithTexture:function(a,b){this._children.length=0;this._descendants.length=0;b=b||cc.SpriteBatchNode.DEFAULT_CAPACITY;this._renderCmd.initWithTexture(a,b);return!0},insertChild:function(a,b){a.batchNode=this;a.atlasIndex=b;a.dirty=!0;this._renderCmd.insertQuad(a,b);this._descendants.splice(b,0,a);var c=b+1,d=this._descendants;if(d&&0d[e]._localZOrder)c.push(d[e]);else break;for(c.push(a);e=c.capacity||c.capacity===c.totalQuads;)this.increaseAtlasCapacity()};a.increaseAtlasCapacity=function(){var a=this._textureAtlas.capacity,c=Math.floor(4*(a+1)/3);cc.log(cc._LogInfos.SpriteBatchNode_increaseAtlasCapacity,a,c);this._textureAtlas.resizeCapacity(c)||
cc.log(cc._LogInfos.SpriteBatchNode_increaseAtlasCapacity_2)};a.initWithTexture=function(a,c){this._textureAtlas=new cc.TextureAtlas;this._textureAtlas.initWithTexture(a,c);this._updateBlendFunc();this._shaderProgram=cc.shaderCache.programForKey(cc.SHADER_POSITION_TEXTURECOLOR)};a.insertQuad=function(a,c){var d=this._textureAtlas;d.totalQuads>=d.capacity&&this.increaseAtlasCapacity();d.insertQuad(a.quad,c)};a.removeQuadAtIndex=function(a){this._textureAtlas.removeQuadAtIndex(a)};a.getTexture=function(){return this._textureAtlas.texture};
a.setTexture=function(a){this._textureAtlas.setTexture(a);a&&this._updateBlendFunc()};a.removeAllQuads=function(){this._textureAtlas.removeAllQuads()};a._swap=function(a,c){var d=this._node._descendants,e=this._textureAtlas,f=e.quads,g=d[a],h=cc.V3F_C4B_T2F_QuadCopy(f[a]);d[c].atlasIndex=a;d[a]=d[c];e.updateQuad(f[c],a);d[c]=g;e.updateQuad(h,c)};a._updateAtlasIndex=function(a,c){var d=0,e=a.children;e&&(d=e.length);var f=0;if(0===d)f=a.atlasIndex,a.atlasIndex=c,a.arrivalOrder=0,f!==c&&this._swap(f,
c),c++;else{f=!0;0<=e[0].zIndex&&(f=a.atlasIndex,a.atlasIndex=c,a.arrivalOrder=0,f!==c&&this._swap(f,c),c++,f=!1);for(d=0;da.getPixelsWide()&&cc.error(cc._LogInfos.RectWidth,a.url);g>a.getPixelsHigh()&&cc.error(cc._LogInfos.RectHeight,a.url)}this._offsetInPixels.x=
d.x;this._offsetInPixels.y=d.y;cc._pointPixelsToPointsOut(d,this._offset);this._originalSizeInPixels.width=e.width;this._originalSizeInPixels.height=e.height;cc._sizePixelsToPointsOut(e,this._originalSize);this._rotated=c;return!0}});cc.EventHelper.prototype.apply(cc.SpriteFrame.prototype);cc.SpriteFrame.create=function(a,b,c,d,e){return new cc.SpriteFrame(a,b,c,d,e)};cc.SpriteFrame.createWithTexture=cc.SpriteFrame.create;
cc.SpriteFrame._frameWithTextureForCanvas=function(a,b,c,d,e){var f=new cc.SpriteFrame;f._texture=a;f._rectInPixels=b;f._rect=cc.rectPixelsToPoints(b);f._offsetInPixels.x=d.x;f._offsetInPixels.y=d.y;cc._pointPixelsToPointsOut(f._offsetInPixels,f._offset);f._originalSizeInPixels.width=e.width;f._originalSizeInPixels.height=e.height;cc._sizePixelsToPointsOut(f._originalSizeInPixels,f._originalSize);f._rotated=c;return f};cc.spriteFrameCache={_CCNS_REG1:/^\s*\{\s*([\-]?\d+[.]?\d*)\s*,\s*([\-]?\d+[.]?\d*)\s*\}\s*$/,_CCNS_REG2:/^\s*\{\s*\{\s*([\-]?\d+[.]?\d*)\s*,\s*([\-]?\d+[.]?\d*)\s*\}\s*,\s*\{\s*([\-]?\d+[.]?\d*)\s*,\s*([\-]?\d+[.]?\d*)\s*\}\s*\}\s*$/,_spriteFrames:{},_spriteFramesAliases:{},_frameConfigCache:{},_rectFromString:function(a){return(a=this._CCNS_REG2.exec(a))?cc.rect(parseFloat(a[1]),parseFloat(a[2]),parseFloat(a[3]),parseFloat(a[4])):cc.rect(0,0,0,0)},_pointFromString:function(a){return(a=this._CCNS_REG1.exec(a))?
cc.p(parseFloat(a[1]),parseFloat(a[2])):cc.p(0,0)},_sizeFromString:function(a){return(a=this._CCNS_REG1.exec(a))?cc.size(parseFloat(a[1]),parseFloat(a[2])):cc.size(0,0)},_getFrameConfig:function(a){var b=cc.loader.getRes(a);cc.assert(b,cc._LogInfos.spriteFrameCache__getFrameConfig_2,a);cc.loader.release(a);if(b._inited)return this._frameConfigCache[a]=b;this._frameConfigCache[a]=this._parseFrameConfig(b);return this._frameConfigCache[a]},_getFrameConfigByJsonObject:function(a,b){cc.assert(b,cc._LogInfos.spriteFrameCache__getFrameConfig_2,
a);this._frameConfigCache[a]=this._parseFrameConfig(b);return this._frameConfigCache[a]},_parseFrameConfig:function(a){var b=a.frames,c=a.metadata||a.meta;a={};var d={},e=0;c&&(e=c.format,e=1>=e.length?parseInt(e):e,d.image=c.textureFileName||c.textureFileName||c.image);for(var f in b){var g=b[f];if(g){c={};if(0==e){c.rect=cc.rect(g.x,g.y,g.width,g.height);c.rotated=!1;c.offset=cc.p(g.offsetX,g.offsetY);var h=g.originalWidth,g=g.originalHeight;h&&g||cc.log(cc._LogInfos.spriteFrameCache__getFrameConfig);
h=Math.abs(h);g=Math.abs(g);c.size=cc.size(h,g)}else if(1==e||2==e)c.rect=this._rectFromString(g.frame),c.rotated=g.rotated||!1,c.offset=this._pointFromString(g.offset),c.size=this._sizeFromString(g.sourceSize);else if(3==e){var h=this._sizeFromString(g.spriteSize),k=this._rectFromString(g.textureRect);h&&(k=cc.rect(k.x,k.y,h.width,h.height));c.rect=k;c.rotated=g.textureRotated||!1;c.offset=this._pointFromString(g.spriteOffset);c.size=this._sizeFromString(g.spriteSourceSize);c.aliases=g.aliases}else h=
g.frame,k=g.sourceSize,f=g.filename||f,c.rect=cc.rect(h.x,h.y,h.w,h.h),c.rotated=g.rotated||!1,c.offset=cc.p(0,0),c.size=cc.size(k.w,k.h);a[f]=c}}return{_inited:!0,frames:a,meta:d}},_addSpriteFramesByObject:function(a,b,c){cc.assert(a,cc._LogInfos.spriteFrameCache_addSpriteFrames_2);b&&b.frames&&(b=this._frameConfigCache[a]||this._getFrameConfigByJsonObject(a,b),this._createSpriteFrames(a,b,c))},_createSpriteFrames:function(a,b,c){var d=b.frames;b=b.meta;c?c instanceof cc.Texture2D||(cc.isString(c)?
c=cc.textureCache.addImage(c):cc.assert(0,cc._LogInfos.spriteFrameCache_addSpriteFrames_3)):(c=cc.path.changeBasename(a,b.image||".png"),c=cc.textureCache.addImage(c));a=this._spriteFramesAliases;b=this._spriteFrames;for(var e in d){var f=d[e],g=b[e];if(!g){g=new cc.SpriteFrame(c,f.rect,f.rotated,f.offset,f.size);if(f=f.aliases)for(var h=0,k=f.length;hcc.DIRECTOR_FPS_INTERVAL&&(this._SPFLabel.string=this._secondsPerFrame.toFixed(3),this._frameRate=this._frames/this._accumDt,this._accumDt=this._frames=0,this._FPSLabel.string=this._frameRate.toFixed(1),this._drawsLabel.string=(0|cc.g_NumberOfDraws).toString()),this._FPSLabel.visit(),this._SPFLabel.visit(),this._drawsLabel.visit()):this._createStatsLabel();cc.g_NumberOfDraws=0},isSendCleanupToScene:function(){return this._sendCleanupToScene},
getRunningScene:function(){return this._runningScene},getAnimationInterval:function(){return this._animationInterval},isDisplayStats:function(){return this._displayStats},setDisplayStats:function(a){this._displayStats=a},getSecondsPerFrame:function(){return this._secondsPerFrame},isNextDeltaTimeZero:function(){return this._nextDeltaTimeZero},isPaused:function(){return this._paused},getTotalFrames:function(){return this._totalFrames},popToRootScene:function(){this.popToSceneStackLevel(1)},popToSceneStackLevel:function(a){cc.assert(this._runningScene,
cc._LogInfos.Director_popToSceneStackLevel_2);var b=this._scenesStack,c=b.length;if(0===c)this.end();else if(!(a>c)){for(;c>a;){var d=b.pop();d.running&&(d.onExitTransitionDidStart(),d.onExit());d.cleanup();c--}this._nextScene=b[b.length-1];this._sendCleanupToScene=!1}},getScheduler:function(){return this._scheduler},setScheduler:function(a){this._scheduler!==a&&(this._scheduler=a)},getActionManager:function(){return this._actionManager},setActionManager:function(a){this._actionManager!==a&&(this._actionManager=
a)},getDeltaTime:function(){return this._deltaTime},_createStatsLabel:null,_calculateMPF:function(){this._secondsPerFrame=(Date.now()-this._lastUpdate)/1E3}});cc.Director.EVENT_PROJECTION_CHANGED="director_projection_changed";cc.Director.EVENT_AFTER_DRAW="director_after_draw";cc.Director.EVENT_AFTER_VISIT="director_after_visit";cc.Director.EVENT_AFTER_UPDATE="director_after_update";
cc.DisplayLinkDirector=cc.Director.extend({invalid:!1,startAnimation:function(){this._nextDeltaTimeZero=!0;this.invalid=!1},mainLoop:function(){this._purgeDirectorInNextLoop?(this._purgeDirectorInNextLoop=!1,this.purgeDirector()):this.invalid||this.drawScene()},stopAnimation:function(){this.invalid=!0},setAnimationInterval:function(a){this._animationInterval=a;this.invalid||(this.stopAnimation(),this.startAnimation())}});cc.Director.sharedDirector=null;cc.Director.firstUseDirector=!0;
cc.Director._getInstance=function(){cc.Director.firstUseDirector&&(cc.Director.firstUseDirector=!1,cc.Director.sharedDirector=new cc.DisplayLinkDirector,cc.Director.sharedDirector.init());return cc.Director.sharedDirector};cc.defaultFPS=60;cc.Director.PROJECTION_2D=0;cc.Director.PROJECTION_3D=1;cc.Director.PROJECTION_CUSTOM=3;cc.Director.PROJECTION_DEFAULT=cc.Director.PROJECTION_3D;cc._renderType===cc._RENDER_TYPE_CANVAS?(_p=cc.Director.prototype,_p.setProjection=function(a){this._projection=a;cc.eventManager.dispatchEvent(this._eventProjectionChanged)},_p.setDepthTest=function(){},_p.setClearColor=function(a){cc.renderer._clearColor=a;cc.renderer._clearFillStyle="rgb("+a.r+","+a.g+","+a.b+")"},_p.setOpenGLView=function(a){this._winSizeInPoints.width=cc._canvas.width;this._winSizeInPoints.height=cc._canvas.height;this._openGLView=a||cc.view;cc.eventManager&&cc.eventManager.setEnabled(!0)},
_p._createStatsLabel=function(){var a=0,a=this._winSizeInPoints.width>this._winSizeInPoints.height?0|this._winSizeInPoints.height/320*24:0|this._winSizeInPoints.width/320*24;this._FPSLabel=new cc.LabelTTF("000.0","Arial",a);this._SPFLabel=new cc.LabelTTF("0.000","Arial",a);this._drawsLabel=new cc.LabelTTF("0000","Arial",a);a=cc.DIRECTOR_STATS_POSITION;this._drawsLabel.setPosition(this._drawsLabel.width/2+a.x,5*this._drawsLabel.height/2+a.y);this._SPFLabel.setPosition(this._SPFLabel.width/2+a.x,3*
this._SPFLabel.height/2+a.y);this._FPSLabel.setPosition(this._FPSLabel.width/2+a.x,this._FPSLabel.height/2+a.y)},_p.getVisibleSize=function(){return this.getWinSize()},_p.getVisibleOrigin=function(){return cc.p(0,0)}):(cc.Director._fpsImage=new Image,cc._addEventListener(cc.Director._fpsImage,"load",function(){cc.Director._fpsImageLoaded=!0}),cc._fpsImage&&(cc.Director._fpsImage.src=cc._fpsImage));cc._renderType===cc._RENDER_TYPE_WEBGL&&function(){cc.DirectorDelegate=cc.Class.extend({updateProjection:function(){}});var a=cc.Director.prototype;a.setProjection=function(a){var c=this._winSizeInPoints;this.setViewport();var d=this._openGLView,e=d._viewPortRect.x/d._scaleX,f=d._viewPortRect.y/d._scaleY;switch(a){case cc.Director.PROJECTION_2D:cc.kmGLMatrixMode(cc.KM_GL_PROJECTION);cc.kmGLLoadIdentity();d=cc.math.Matrix4.createOrthographicProjection(-e,c.width-e,-f,c.height-f,-1024,1024);cc.kmGLMultMatrix(d);
cc.kmGLMatrixMode(cc.KM_GL_MODELVIEW);cc.kmGLLoadIdentity();break;case cc.Director.PROJECTION_3D:var g=this.getZEye(),h=new cc.math.Matrix4,d=new cc.math.Matrix4;cc.kmGLMatrixMode(cc.KM_GL_PROJECTION);cc.kmGLLoadIdentity();h=cc.math.Matrix4.createPerspectiveProjection(60,c.width/c.height,0.1,2*g);cc.kmGLMultMatrix(h);cc.kmGLMatrixMode(cc.KM_GL_MODELVIEW);cc.kmGLLoadIdentity();g=new cc.math.Vec3(-e+c.width/2,-f+c.height/2,g);c=new cc.math.Vec3(-e+c.width/2,-f+c.height/2,0);e=new cc.math.Vec3(0,1,0);
d.lookAt(g,c,e);cc.kmGLMultMatrix(d);break;case cc.Director.PROJECTION_CUSTOM:this._projectionDelegate&&this._projectionDelegate.updateProjection();break;default:cc.log(cc._LogInfos.Director_setProjection)}this._projection=a;cc.eventManager.dispatchEvent(this._eventProjectionChanged);cc.setProjectionMatrixDirty();cc.renderer.childrenOrderDirty=!0};a.setDepthTest=function(a){cc.renderer.setDepthTest(a)};a.setClearColor=function(a){cc.renderer._clearColor=a};a.setOpenGLView=function(a){this._winSizeInPoints.width=
cc._canvas.width;this._winSizeInPoints.height=cc._canvas.height;this._openGLView=a||cc.view;a=cc.configuration;a.gatherGPUInfo();a.dumpInfo();this._createStatsLabel();this.setGLDefaultValues();cc.eventManager&&cc.eventManager.setEnabled(!0)};a._clear=function(){var a=cc._renderContext;a.clear(a.COLOR_BUFFER_BIT|a.DEPTH_BUFFER_BIT)};a._beforeVisitScene=function(){cc.kmGLPushMatrix()};a._afterVisitScene=function(){cc.kmGLPopMatrix()};a._createStatsLabel=function(){if(!cc.LabelAtlas)this._createStatsLabelForCanvas();
else if(null!=cc.Director._fpsImageLoaded&&!1!==cc.Director._fpsImageLoaded){var a=new cc.Texture2D;a.initWithElement(cc.Director._fpsImage);a.handleLoadedTexture();var c=cc.view.getDesignResolutionSize().height/320;0===c&&(c=this._winSizeInPoints.height/320);var d=new cc.LabelAtlas;d._setIgnoreContentScaleFactor(!0);d.initWithString("00.0",a,12,32,".");d.scale=c;this._FPSLabel=d;d=new cc.LabelAtlas;d._setIgnoreContentScaleFactor(!0);d.initWithString("0.000",a,12,32,".");d.scale=c;this._SPFLabel=
d;d=new cc.LabelAtlas;d._setIgnoreContentScaleFactor(!0);d.initWithString("000",a,12,32,".");d.scale=c;this._drawsLabel=d;a=cc.DIRECTOR_STATS_POSITION;this._drawsLabel.setPosition(a.x,34*c+a.y);this._SPFLabel.setPosition(a.x,17*c+a.y);this._FPSLabel.setPosition(a)}};a._createStatsLabelForCanvas=function(){var a=0,a=this._winSizeInPoints.width>this._winSizeInPoints.height?0|this._winSizeInPoints.height/320*24:0|this._winSizeInPoints.width/320*24;this._FPSLabel=new cc.LabelTTF("000.0","Arial",a);this._SPFLabel=
new cc.LabelTTF("0.000","Arial",a);this._drawsLabel=new cc.LabelTTF("0000","Arial",a);a=cc.DIRECTOR_STATS_POSITION;this._drawsLabel.setPosition(this._drawsLabel.width/2+a.x,5*this._drawsLabel.height/2+a.y);this._SPFLabel.setPosition(this._SPFLabel.width/2+a.x,3*this._SPFLabel.height/2+a.y);this._FPSLabel.setPosition(this._FPSLabel.width/2+a.x,this._FPSLabel.height/2+a.y)};a.convertToGL=function(a){var c=new cc.math.Matrix4;cc.GLToClipTransform(c);var d=c.inverse(),c=c.mat[14]/c.mat[15],e=this._openGLView.getDesignResolutionSize();
a=new cc.math.Vec3(2*a.x/e.width-1,1-2*a.y/e.height,c);a.transformCoord(d);return cc.p(a.x,a.y)};a.convertToUI=function(a){var c=new cc.math.Matrix4;cc.GLToClipTransform(c);a=new cc.math.Vec3(a.x,a.y,0);a.transformCoord(c);c=this._openGLView.getDesignResolutionSize();return cc.p(c.width*(0.5*a.x+0.5),c.height*(0.5*-a.y+0.5))};a.getVisibleSize=function(){return this._openGLView.getVisibleSize()};a.getVisibleOrigin=function(){return this._openGLView.getVisibleOrigin()};a.getZEye=function(){return this._winSizeInPoints.height/
1.1566};a.setViewport=function(){var a=this._openGLView;if(a){var c=this._winSizeInPoints;a.setViewPortInPoints(-a._viewPortRect.x/a._scaleX,-a._viewPortRect.y/a._scaleY,c.width,c.height)}};a.getOpenGLView=function(){return this._openGLView};a.getProjection=function(){return this._projection};a.setAlphaBlending=function(a){a?cc.glBlendFunc(cc.BLEND_SRC,cc.BLEND_DST):cc.glBlendFunc(cc._renderContext.ONE,cc._renderContext.ZERO)};a.setGLDefaultValues=function(){this.setAlphaBlending(!0);this.setDepthTest(!1);
this.setProjection(this._projection);cc._renderContext.clearColor(0,0,0,0)}}();cc.Camera=cc.Class.extend({_eyeX:null,_eyeY:null,_eyeZ:null,_centerX:null,_centerY:null,_centerZ:null,_upX:null,_upY:null,_upZ:null,_dirty:!1,_lookupMatrix:null,ctor:function(){this._lookupMatrix=new cc.math.Matrix4;this.restore()},description:function(){return"\x3cCCCamera | center \x3d("+this._centerX+","+this._centerY+","+this._centerZ+")\x3e"},setDirty:function(a){this._dirty=a},isDirty:function(){return this._dirty},restore:function(){this._eyeX=this._eyeY=0;this._eyeZ=cc.Camera.getZEye();this._upX=
this._centerX=this._centerY=this._centerZ=0;this._upY=1;this._upZ=0;this._lookupMatrix.identity();this._dirty=!1},locate:function(){if(this._dirty){var a=new cc.math.Vec3(this._eyeX,this._eyeY,this._eyeZ),b=new cc.math.Vec3(this._centerX,this._centerY,this._centerZ),c=new cc.math.Vec3(this._upX,this._upY,this._upZ);this._lookupMatrix.lookAt(a,b,c);this._dirty=!1}cc.kmGLMultMatrix(this._lookupMatrix)},_locateForRenderer:function(a){if(this._dirty){var b=new cc.math.Vec3(this._eyeX,this._eyeY,this._eyeZ),
c=new cc.math.Vec3(this._centerX,this._centerY,this._centerZ),d=new cc.math.Vec3(this._upX,this._upY,this._upZ);this._lookupMatrix.lookAt(b,c,d);this._dirty=!1}a.multiply(this._lookupMatrix)},setEyeXYZ:function(a,b,c){this.setEye(a,b,c)},setEye:function(a,b,c){this._eyeX=a;this._eyeY=b;this._eyeZ=c;this._dirty=!0},setCenterXYZ:function(a,b,c){this.setCenter(a,b,c)},setCenter:function(a,b,c){this._centerX=a;this._centerY=b;this._centerZ=c;this._dirty=!0},setUpXYZ:function(a,b,c){this.setUp(a,b,c)},
setUp:function(a,b,c){this._upX=a;this._upY=b;this._upZ=c;this._dirty=!0},getEyeXYZ:function(a,b,c){return{x:this._eyeX,y:this._eyeY,z:this._eyeZ}},getEye:function(){return{x:this._eyeX,y:this._eyeY,z:this._eyeZ}},getCenterXYZ:function(a,b,c){return{x:this._centerX,y:this._centerY,z:this._centerZ}},getCenter:function(){return{x:this._centerX,y:this._centerY,z:this._centerZ}},getUpXYZ:function(a,b,c){return{x:this._upX,y:this._upY,z:this._upZ}},getUp:function(){return{x:this._upX,y:this._upY,z:this._upZ}},
_DISALLOW_COPY_AND_ASSIGN:function(a){}});cc.Camera.getZEye=function(){return cc.FLT_EPSILON};cc.PRIORITY_NON_SYSTEM=cc.PRIORITY_SYSTEM+1;cc.ListEntry=function(a,b,c,d,e,f,g){this.prev=a;this.next=b;this.callback=c;this.target=d;this.priority=e;this.paused=f;this.markedForDeletion=g};cc.HashUpdateEntry=function(a,b,c,d,e){this.list=a;this.entry=b;this.target=c;this.callback=d;this.hh=e};cc.HashTimerEntry=cc.hashSelectorEntry=function(a,b,c,d,e,f,g){this.timers=a;this.target=b;this.timerIndex=c;this.currentTimer=d;this.currentTimerSalvaged=e;this.paused=f;this.hh=g};
cc.Timer=cc.Class.extend({_scheduler:null,_elapsed:0,_runForever:!1,_useDelay:!1,_timesExecuted:0,_repeat:0,_delay:0,_interval:0,getInterval:function(){return this._interval},setInterval:function(a){this._interval=a},setupTimerWithInterval:function(a,b,c){this._elapsed=-1;this._interval=a;this._delay=c;this._useDelay=0=this._interval&&(this.trigger(),this._elapsed=0):(this._useDelay?this._elapsed>=this._delay&&(this.trigger(),this._elapsed-=this._delay,this._timesExecuted+=1,this._useDelay=!1):this._elapsed>=this._interval&&(this.trigger(),this._elapsed=0,this._timesExecuted+=
1),!this._runForever&&this._timesExecuted>this._repeat&&this.cancel()))}});
cc.TimerTargetSelector=cc.Timer.extend({_target:null,_selector:null,ctor:function(){this._selector=this._target=null},initWithSelector:function(a,b,c,d,e,f){this._scheduler=a;this._target=c;this._selector=b;this.setupTimerWithInterval(d,e,f);return!0},getSelector:function(){return this._selector},trigger:function(){this._target&&this._selector&&this._target.call(this._selector,this._elapsed)},cancel:function(){this._scheduler.unschedule(this._selector,this._target)}});
cc.TimerTargetCallback=cc.Timer.extend({_target:null,_callback:null,_key:null,ctor:function(){this._callback=this._target=null},initWithCallback:function(a,b,c,d,e,f,g){this._scheduler=a;this._target=c;this._callback=b;this._key=d;this.setupTimerWithInterval(e,f,g);return!0},getCallback:function(){return this._callback},getKey:function(){return this._key},trigger:function(){this._callback&&this._callback.call(this._target,this._elapsed)},cancel:function(){this._scheduler.unschedule(this._callback,
this._target)}});
cc.Scheduler=cc.Class.extend({_timeScale:1,_updatesNegList:null,_updates0List:null,_updatesPosList:null,_hashForTimers:null,_arrayForTimers:null,_hashForUpdates:null,_currentTarget:null,_currentTargetSalvaged:!1,_updateHashLocked:!1,ctor:function(){this._timeScale=1;this._updatesNegList=[];this._updates0List=[];this._updatesPosList=[];this._hashForUpdates={};this._hashForTimers={};this._currentTarget=null;this._updateHashLocked=this._currentTargetSalvaged=!1;this._arrayForTimers=[]},_schedulePerFrame:function(a,
b,c,d){var e=this._hashForUpdates[b.__instanceId];if(e&&e.entry)if(e.entry.priority!==c){if(this._updateHashLocked){cc.log("warning: you CANNOT change update priority in scheduled function");e.entry.markedForDeletion=!1;e.entry.paused=d;return}this.unscheduleUpdate(b)}else{e.entry.markedForDeletion=!1;e.entry.paused=d;return}0===c?this._appendIn(this._updates0List,a,b,d):0>c?this._priorityIn(this._updatesNegList,a,b,c,d):this._priorityIn(this._updatesPosList,a,b,c,d)},_removeHashElement:function(a){delete this._hashForTimers[a.target.__instanceId];
cc.arrayRemoveObject(this._arrayForTimers,a);a.Timer=null;a.target=null},_removeUpdateFromHash:function(a){if(a=this._hashForUpdates[a.target.__instanceId])cc.arrayRemoveObject(a.list,a.entry),delete this._hashForUpdates[a.target.__instanceId],a.entry=null,a.target=null},_priorityIn:function(a,b,c,d,e){b=new cc.ListEntry(null,null,b,c,d,e,!1);if(a){e=a.length-1;for(var f=0;f<=e&&!(d=e&&c.timerIndex--;0===d.length&&(this._currentTarget===c?this._currentTargetSalvaged=!0:this._removeHashElement(c));break}}}},unscheduleUpdate:function(a){null!=a&&(a=this._hashForUpdates[a.__instanceId])&&(this._updateHashLocked?a.entry.markedForDeletion=!0:this._removeUpdateFromHash(a.entry))},unscheduleAllForTarget:function(a){if(null!=a){var b=this._hashForTimers[a.__instanceId];b&&(-1a)for(b=0;b=a&&this.unscheduleUpdate(c.target),d==this._updatesNegList.length&&b++;if(0>=a)for(b=0;b=a&&this.unscheduleUpdate(c.target),d==this._updatesPosList.length&&b++},isScheduled:function(a,b){cc.assert(a,"Argument key must not be empty");
cc.assert(b,"Argument target must be non-nullptr");var c=this._hashForUpdates[b.__instanceId];if(!c)return!1;if(null!=c.timers)for(var c=c.timers,d=0;da)for(e=0;e=a&&(c.paused=!0,b.push(c.target));if(0>=a)for(e=0;e=a&&(c.paused=!0,b.push(c.target));return b},resumeTargets:function(a){if(a)for(var b=0;ba.length)throw Error("Polygon's point must greater than 2");var e=a[0];b=this._renderContext.getContext();var f=cc.view.getScaleX(),g=cc.view.getScaleY();b.beginPath();b.moveTo(e.x*f,-e.y*g);for(var e=1,h=a.length;e\u3001\u2018\u201c\u300b\uff1f\u3002\uff0c\uff01]/;cc.LabelTTF._lastWordRex=/([a-zA-Z0-9\u00c4\u00d6\u00dc\u00e4\u00f6\u00fc\u00df\u00e9\u00e8\u00e7\u00e0\u00f9\u00ea\u00e2\u00ee\u00f4\u00fb]+|\S)$/;
cc.LabelTTF._lastEnglish=/[a-zA-Z0-9\u00c4\u00d6\u00dc\u00e4\u00f6\u00fc\u00df\u00e9\u00e8\u00e7\u00e0\u00f9\u00ea\u00e2\u00ee\u00f4\u00fb]+$/;cc.LabelTTF._firsrEnglish=/^[a-zA-Z0-9\u00c4\u00d6\u00dc\u00e4\u00f6\u00fc\u00df\u00e9\u00e8\u00e7\u00e0\u00f9\u00ea\u00e2\u00ee\u00f4\u00fb]/;
(function(){cc.LabelTTF.RenderCmd=function(){this._fontClientHeight=18;this._fontStyleStr="";this._shadowColorStr="rgba(128, 128, 128, 0.5)";this._strokeColorStr="";this._fillColorStr="rgba(255,255,255,1)";this._labelContext=this._labelCanvas=null;this._lineWidths=[];this._strings=[];this._isMultiLine=!1};var a=cc.LabelTTF.RenderCmd.prototype;a.constructor=cc.LabelTTF.RenderCmd;a._getLabelContext=function(){if(this._labelContext)return this._labelContext;var a=this._node;if(!this._labelCanvas){var c=
cc.newElement("canvas");c.width=1;c.height=1;var d=new cc.Texture2D;d.initWithElement(c);a.setTexture(d);this._labelCanvas=c}return this._labelContext=this._labelCanvas.getContext("2d")};a._setFontStyle=function(a,c,d,e){a instanceof cc.FontDefinition?(this._fontStyleStr=a._getCanvasFontStr(),this._fontClientHeight=cc.LabelTTF.__getFontHeightByDiv(a)):(this._fontStyleStr=d+" "+e+" "+c+"px '"+a+"'",this._fontClientHeight=cc.LabelTTF.__getFontHeightByDiv(a,c))};a._getFontStyle=function(){return this._fontStyleStr};
a._getFontClientHeight=function(){return this._fontClientHeight};a._updateTexture=function(){this._dirtyFlag^=this._dirtyFlag&cc.Node._dirtyFlags.textDirty;var a=this._node,c=this._getLabelContext(),d=this._labelCanvas,e=a._contentSize;if(0===a._string.length)return d.width=1,d.height=e.height||1,a._texture&&a._texture.handleLoadedTexture(),a.setTextureRect(cc.rect(0,0,1,e.height)),!0;c.font=this._fontStyleStr;this._updateTTF();var f=e.width,e=e.height,g=d.width===f&&d.height===e;d.width=f;d.height=
e;g&&c.clearRect(0,0,f,e);this._drawTTFInCanvas(c);a._texture&&a._texture.handleLoadedTexture();a.setTextureRect(cc.rect(0,0,f,e));return!0};a._measureConfig=function(){this._getLabelContext().font=this._fontStyleStr};a._measure=function(a){return this._getLabelContext().measureText(a).width};a._updateTTF=function(){var a=this._node,c=a._dimensions.width,d,e,f=this._lineWidths;f.length=0;this._isMultiLine=!1;this._measureConfig();if(0!==c)for(this._strings=a._string.split("\n"),d=0;dd&&1d&&100>p++;)g*=d/k,g|=0,h=e.substr(g),k=f-this._measure(h);for(p=0;kp++;)h&&(n=(m=cc.LabelTTF._wordRex.exec(h))?m[0].length:1,m=h),g+=n,h=e.substr(g),k=f-this._measure(h);g-=n;0===g&&(g=1,m=m.substr(1));d=e.substr(0,g);cc.LabelTTF.wrapInspection&&
cc.LabelTTF._symbolRex.test(m||h)&&(f=cc.LabelTTF._lastWordRex.exec(d),g-=f?f[0].length:0,m=e.substr(g),d=e.substr(0,g));cc.LabelTTF._firsrEnglish.test(m)&&(f=cc.LabelTTF._lastEnglish.exec(d))&&d!==f[0]&&(g-=f[0].length,m=e.substr(g),d=e.substr(0,g));a[c]=m||h;a.splice(c,0,d)}}})();
(function(){cc.LabelTTF.CanvasRenderCmd=function(a){cc.Sprite.CanvasRenderCmd.call(this,a);cc.LabelTTF.RenderCmd.call(this)};cc.LabelTTF.CanvasRenderCmd.prototype=Object.create(cc.Sprite.CanvasRenderCmd.prototype);cc.inject(cc.LabelTTF.RenderCmd.prototype,cc.LabelTTF.CanvasRenderCmd.prototype);var a=cc.LabelTTF.CanvasRenderCmd.prototype;a.constructor=cc.LabelTTF.CanvasRenderCmd;a.updateStatus=function(){var a=cc.Node._dirtyFlags,c=this._dirtyFlag,d=c&a.colorDirty,e=c&a.opacityDirty;d&&this._updateDisplayColor();
e&&this._updateDisplayOpacity();d?this._updateColor():c&a.textDirty&&this._updateTexture();this._dirtyFlag&a.transformDirty&&(this.transform(this.getParentRenderCmd(),!0),this._dirtyFlag^=this._dirtyFlag&cc.Node._dirtyFlags.transformDirty)};a._syncStatus=function(a){var c=cc.Node._dirtyFlags,d=this._dirtyFlag,e=a?a._node:null;e&&e._cascadeColorEnabled&&a._dirtyFlag&c.colorDirty&&(d|=c.colorDirty);e&&e._cascadeOpacityEnabled&&a._dirtyFlag&c.opacityDirty&&(d|=c.opacityDirty);a&&a._dirtyFlag&c.transformDirty&&
(d|=c.transformDirty);var e=d&c.colorDirty,f=d&c.opacityDirty;this._dirtyFlag=d;e&&this._syncDisplayColor();f&&this._syncDisplayOpacity();e?this._updateColor():d&c.textDirty&&this._updateTexture();d&c.transformDirty&&this.transform(a)};a._setColorsString=function(){var a=this._displayedColor,c=this._node,d=c._shadowColor||this._displayedColor,e=c._strokeColor,f=c._textFillColor,g=a.r/255,h=a.g/255,a=a.b/255;this._shadowColorStr="rgba("+(0|g*d.r)+","+(0|h*d.g)+","+(0|a*d.b)+","+c._shadowOpacity+")";
this._fillColorStr="rgba("+(0|g*f.r)+","+(0|h*f.g)+","+(0|a*f.b)+", 1)";this._strokeColorStr="rgba("+(0|g*e.r)+","+(0|h*e.g)+","+(0|a*e.b)+", 1)"};a._updateColor=function(){this._setColorsString();this._updateTexture()}})();(function(){cc.LabelTTF.WebGLRenderCmd=function(a){cc.Sprite.WebGLRenderCmd.call(this,a);cc.LabelTTF.RenderCmd.call(this);this.setShaderProgram(cc.shaderCache.programForKey(cc.LabelTTF._SHADER_PROGRAM))};var a=cc.LabelTTF.WebGLRenderCmd.prototype=Object.create(cc.Sprite.WebGLRenderCmd.prototype);cc.inject(cc.LabelTTF.RenderCmd.prototype,a);a.constructor=cc.LabelTTF.WebGLRenderCmd;a._setColorsString=function(){this.setDirtyFlag(cc.Node._dirtyFlags.textDirty);var a=this._node,c=a._strokeColor,d=a._textFillColor,
e=a._shadowColor||this._displayedColor;this._shadowColorStr="rgba("+(0|e.r)+","+(0|e.g)+","+(0|e.b)+","+a._shadowOpacity+")";this._fillColorStr="rgba("+(0|d.r)+","+(0|d.g)+","+(0|d.b)+", 1)";this._strokeColorStr="rgba("+(0|c.r)+","+(0|c.g)+","+(0|c.b)+", 1)"};a.updateStatus=function(){var a=cc.Node._dirtyFlags,c=this._dirtyFlag,d=c&a.colorDirty,e=c&a.opacityDirty;d&&this._updateDisplayColor();e&&this._updateDisplayOpacity();d||e?(this._setColorsString(),this._updateColor(),this._updateTexture()):
c&a.textDirty&&this._updateTexture();this._dirtyFlag&a.transformDirty&&(this.transform(this.getParentRenderCmd(),!0),this._dirtyFlag^=this._dirtyFlag&cc.Node._dirtyFlags.transformDirty)};a._syncStatus=function(a){var c=cc.Node._dirtyFlags,d=this._dirtyFlag,e=a?a._node:null;e&&e._cascadeColorEnabled&&a._dirtyFlag&c.colorDirty&&(d|=c.colorDirty);e&&e._cascadeOpacityEnabled&&a._dirtyFlag&c.opacityDirty&&(d|=c.opacityDirty);a&&a._dirtyFlag&c.transformDirty&&(d|=c.transformDirty);var e=d&c.colorDirty,
f=d&c.opacityDirty;this._dirtyFlag=d;e&&this._syncDisplayColor();f&&this._syncDisplayOpacity();e||f?(this._setColorsString(),this._updateColor(),this._updateTexture()):d&c.textDirty&&this._updateTexture();this.transform(a)}})();cc.HashElement=cc.Class.extend({actions:null,target:null,actionIndex:0,currentAction:null,currentActionSalvaged:!1,paused:!1,hh:null,ctor:function(){this.actions=[];this.target=null;this.actionIndex=0;this.currentAction=null;this.paused=this.currentActionSalvaged=!1;this.hh=null}});
cc.ActionManager=cc.Class.extend({_hashTargets:null,_arrayTargets:null,_currentTarget:null,_currentTargetSalvaged:!1,_searchElementByTarget:function(a,b){for(var c=0;c=a&&b.actionIndex--;0===b.actions.length&&(this._currentTarget===b?this._currentTargetSalvaged=!0:this._deleteHashElement(b))},_deleteHashElement:function(a){var b=!1;a&&(this._hashTargets[a.target.__instanceId]&&(delete this._hashTargets[a.target.__instanceId],
cc.arrayRemoveObject(this._arrayTargets,a),b=!0),a.actions=null,a.target=null);return b},_actionAllocWithHashElement:function(a){null==a.actions&&(a.actions=[])},update:function(a){for(var b=this._arrayTargets,c,d=0;db&&a-cc.math.EPSILONb.x-a.math.EPSILON&&this.yb.y-a.math.EPSILON}})(cc);(function(a){a.kmVec3=a.math.Vec3=function(a,b,e){a&&void 0===b?(this.x=a.x,this.y=a.y,this.z=a.z):(this.x=a||0,this.y=b||0,this.z=e||0)};a.math.vec3=function(b,d,e){return new a.math.Vec3(b,d,e)};var b=a.math.Vec3.prototype;b.fill=function(a,b,e){a&&void 0===b?(this.x=a.x,this.y=a.y,this.z=a.z):(this.x=a,this.y=b,this.z=e);return this};b.length=function(){return Math.sqrt(a.math.square(this.x)+a.math.square(this.y)+a.math.square(this.z))};b.lengthSq=function(){return a.math.square(this.x)+a.math.square(this.y)+
a.math.square(this.z)};b.normalize=function(){var a=1/this.length();this.x*=a;this.y*=a;this.z*=a;return this};b.cross=function(a){var b=this.x,e=this.y,f=this.z;this.x=e*a.z-f*a.y;this.y=f*a.x-b*a.z;this.z=b*a.y-e*a.x;return this};b.dot=function(a){return this.x*a.x+this.y*a.y+this.z*a.z};b.add=function(a){this.x+=a.x;this.y+=a.y;this.z+=a.z;return this};b.subtract=function(a){this.x-=a.x;this.y-=a.y;this.z-=a.z;return this};b.transform=function(a){var b=this.x,e=this.y,f=this.z;a=a.mat;this.x=b*
a[0]+e*a[4]+f*a[8]+a[12];this.y=b*a[1]+e*a[5]+f*a[9]+a[13];this.z=b*a[2]+e*a[6]+f*a[10]+a[14];return this};b.transformNormal=function(a){var b=this.x,e=this.y,f=this.z;a=a.mat;this.x=b*a[0]+e*a[4]+f*a[8];this.y=b*a[1]+e*a[5]+f*a[9];this.z=b*a[2]+e*a[6]+f*a[10];return this};b.transformCoord=function(b){var d=new a.math.Vec4(this.x,this.y,this.z,1);d.transform(b);this.x=d.x/d.w;this.y=d.y/d.w;this.z=d.z/d.w;return this};b.scale=function(a){this.x*=a;this.y*=a;this.z*=a;return this};b.equals=function(b){var d=
a.math.EPSILON;return this.xb.x-d&&this.yb.y-d&&this.zb.z-d};b.inverseTransform=function(b){b=b.mat;var d=new a.math.Vec3(this.x-b[12],this.y-b[13],this.z-b[14]);this.x=d.x*b[0]+d.y*b[1]+d.z*b[2];this.y=d.x*b[4]+d.y*b[5]+d.z*b[6];this.z=d.x*b[8]+d.y*b[9]+d.z*b[10];return this};b.inverseTransformNormal=function(a){var b=this.x,e=this.y,f=this.z;a=a.mat;this.x=b*a[0]+e*a[1]+f*a[2];this.y=b*a[4]+e*a[5]+f*a[6];this.z=b*a[8]+e*a[9]+f*a[10];return this};b.assignFrom=
function(a){if(!a)return this;this.x=a.x;this.y=a.y;this.z=a.z;return this};a.math.Vec3.zero=function(a){a.x=a.y=a.z=0;return a};b.toTypeArray=function(){var a=new Float32Array(3);a[0]=this.x;a[1]=this.y;a[2]=this.z;return a}})(cc);(function(a){a.math.Vec4=function(a,b,e,f){a&&void 0===b?(this.x=a.x,this.y=a.y,this.z=a.z,this.w=a.w):(this.x=a||0,this.y=b||0,this.z=e||0,this.w=f||0)};a.kmVec4=a.math.Vec4;var b=a.math.Vec4.prototype;b.fill=function(a,b,e,f){a&&void 0===b?(this.x=a.x,this.y=a.y,this.z=a.z,this.w=a.w):(this.x=a,this.y=b,this.z=e,this.w=f)};b.add=function(a){if(!a)return this;this.x+=a.x;this.y+=a.y;this.z+=a.z;this.w+=a.w;return this};b.dot=function(a){return this.x*a.x+this.y*a.y+this.z*a.z+this.w*a.w};b.length=
function(){return Math.sqrt(a.math.square(this.x)+a.math.square(this.y)+a.math.square(this.z)+a.math.square(this.w))};b.lengthSq=function(){return a.math.square(this.x)+a.math.square(this.y)+a.math.square(this.z)+a.math.square(this.w)};b.lerp=function(a,b){return this};b.normalize=function(){var a=1/this.length();this.x*=a;this.y*=a;this.z*=a;this.w*=a;return this};b.scale=function(a){this.normalize();this.x*=a;this.y*=a;this.z*=a;this.w*=a;return this};b.subtract=function(a){this.x-=a.x;this.y-=
a.y;this.z-=a.z;this.w-=a.w};b.transform=function(a){var b=this.x,e=this.y,f=this.z,g=this.w;a=a.mat;this.x=b*a[0]+e*a[4]+f*a[8]+g*a[12];this.y=b*a[1]+e*a[5]+f*a[9]+g*a[13];this.z=b*a[2]+e*a[6]+f*a[10]+g*a[14];this.w=b*a[3]+e*a[7]+f*a[11]+g*a[15];return this};a.math.Vec4.transformArray=function(b,d){for(var e=[],f=0;fb.x-d&&this.yb.y-d&&
this.zb.z-d&&this.wb.w-d};b.assignFrom=function(a){this.x=a.x;this.y=a.y;this.z=a.z;this.w=a.w;return this};b.toTypeArray=function(){var a=new Float32Array(4);a[0]=this.x;a[1]=this.y;a[2]=this.z;a[3]=this.w;return a}})(cc);(function(a){function b(b,d,e){d=new a.math.Vec2(d);d.subtract(b);e.x=-d.y;e.y=d.x;e.normalize()}a.math.Ray2=function(b,d){this.start=b||new a.math.Vec2;this.dir=d||new a.math.Vec2};a.math.Ray2.prototype.fill=function(a,b,e,f){this.start.x=a;this.start.y=b;this.dir.x=e;this.dir.y=f};a.math.Ray2.prototype.intersectLineSegment=function(b,d,e){var f=this.start.x,g=this.start.y,h=this.start.x+this.dir.x,k=this.start.y+this.dir.y,m=b.x,n=b.y,p=d.x,t=d.y,r=(t-n)*(h-f)-(p-m)*(k-g);if(r>-a.math.EPSILON&&
rMath.max(b.x,d.x)+a.math.EPSILON||nMath.max(b.y,d.y)+a.math.EPSILON||mMath.max(f,h)+a.math.EPSILON||nMath.max(g,k)+a.math.EPSILON)return!1;e.x=m;e.y=n;return!0};a.math.Ray2.prototype.intersectTriangle=function(c,d,e,f,g){var h=new a.math.Vec2,k=new a.math.Vec2,m=new a.math.Vec2,
n=1E4,p=!1,t;this.intersectLineSegment(c,d,h)&&(p=!0,t=h.subtract(this.start).length(),tg;++g)if(!(f[g]+c>b[g]&&f[g]-cc;c++)b[c]=a[c];return this};a.kmMat4Identity=function(a){var b=a.mat;b[1]=b[2]=b[3]=b[4]=b[6]=b[7]=b[8]=b[9]=b[11]=b[12]=b[13]=b[14]=0;b[0]=b[5]=b[10]=b[15]=1;return a};b.identity=function(){var a=this.mat;a[1]=a[2]=a[3]=a[4]=a[6]=a[7]=a[8]=a[9]=a[11]=a[12]=a[13]=a[14]=0;a[0]=a[5]=a[10]=a[15]=1;
return this};b.get=function(a,b){return this.mat[a+4*b]};b.set=function(a,b,c){this.mat[a+4*b]=c};b.swap=function(a,b,c,d){var k=this.mat,m=k[a+4*b];k[a+4*b]=k[c+4*d];k[c+4*d]=m};a.math.Matrix4._gaussj=function(a,b){var c,d=0,k=0,m,n,p,t,r=[0,0,0,0],v=[0,0,0,0],s=[0,0,0,0];for(c=0;4>c;c++){for(m=t=0;4>m;m++)if(1!==s[m])for(n=0;4>n;n++)0===s[n]&&(p=Math.abs(a.get(m,n)),p>=t&&(t=p,k=m,d=n));++s[d];if(k!==d){for(m=0;4>m;m++)a.swap(k,m,d,m);for(m=0;4>m;m++)b.swap(k,m,d,m)}v[c]=k;r[c]=d;if(0===a.get(d,
d))return!1;n=1/a.get(d,d);a.set(d,d,1);for(m=0;4>m;m++)a.set(d,m,a.get(d,m)*n);for(m=0;4>m;m++)b.set(d,m,b.get(d,m)*n);for(n=0;4>n;n++)if(n!==d){p=a.get(n,d);a.set(n,d,0);for(m=0;4>m;m++)a.set(n,m,a.get(n,m)-a.get(d,m)*p);for(m=0;4>m;m++)b.set(n,m,a.get(n,m)-b.get(d,m)*p)}}for(m=3;0<=m;m--)if(v[m]!==r[m])for(n=0;4>n;n++)a.swap(n,v[m],n,r[m]);return!0};var c=(new a.math.Matrix4).identity();a.kmMat4Inverse=function(b,d){var g=new a.math.Matrix4(d),h=new a.math.Matrix4(c);if(!1===a.math.Matrix4._gaussj(g,
h))return null;b.assignFrom(g);return b};b.inverse=function(){var b=new a.math.Matrix4(this),d=new a.math.Matrix4(c);return!1===a.math.Matrix4._gaussj(b,d)?null:b};b.isIdentity=function(){var a=this.mat;return 1===a[0]&&0===a[1]&&0===a[2]&&0===a[3]&&0===a[4]&&1===a[5]&&0===a[6]&&0===a[7]&&0===a[8]&&0===a[9]&&1===a[10]&&0===a[11]&&0===a[12]&&0===a[13]&&0===a[14]&&1===a[15]};b.transpose=function(){var a=this.mat,b=a[1],c=a[2],d=a[3],k=a[6],m=a[7],n=a[8],p=a[9],t=a[11],r=a[12],v=a[13],s=a[14];a[1]=a[4];
a[2]=n;a[3]=r;a[4]=b;a[6]=p;a[7]=v;a[8]=c;a[9]=k;a[11]=s;a[12]=d;a[13]=m;a[14]=t;return this};a.kmMat4Multiply=function(a,b,c){var d=a.mat,k=b.mat,m=c.mat;c=k[0];b=k[1];var n=k[2],p=k[3],t=k[4],r=k[5],v=k[6],s=k[7],u=k[8],w=k[9],z=k[10],F=k[11],x=k[12],y=k[13],A=k[14],k=k[15],C=m[0],I=m[1],D=m[2],M=m[3],J=m[4],E=m[5],G=m[6],L=m[7],P=m[8],K=m[9],U=m[10],Q=m[11],B=m[12],H=m[13],S=m[14],m=m[15];d[0]=C*c+I*t+D*u+M*x;d[1]=C*b+I*r+D*w+M*y;d[2]=C*n+I*v+D*z+M*A;d[3]=C*p+I*s+D*F+M*k;d[4]=J*c+E*t+G*u+L*x;d[5]=
J*b+E*r+G*w+L*y;d[6]=J*n+E*v+G*z+L*A;d[7]=J*p+E*s+G*F+L*k;d[8]=P*c+K*t+U*u+Q*x;d[9]=P*b+K*r+U*w+Q*y;d[10]=P*n+K*v+U*z+Q*A;d[11]=P*p+K*s+U*F+Q*k;d[12]=B*c+H*t+S*u+m*x;d[13]=B*b+H*r+S*w+m*y;d[14]=B*n+H*v+S*z+m*A;d[15]=B*p+H*s+S*F+m*k;return a};b.multiply=function(a){var b=this.mat,c=a.mat;a=b[0];var d=b[1],k=b[2],m=b[3],n=b[4],p=b[5],t=b[6],r=b[7],v=b[8],s=b[9],u=b[10],w=b[11],z=b[12],F=b[13],x=b[14],y=b[15],A=c[0],C=c[1],I=c[2],D=c[3],M=c[4],J=c[5],E=c[6],G=c[7],L=c[8],P=c[9],K=c[10],U=c[11],Q=c[12],
B=c[13],H=c[14],c=c[15];b[0]=A*a+C*n+I*v+D*z;b[1]=A*d+C*p+I*s+D*F;b[2]=A*k+C*t+I*u+D*x;b[3]=A*m+C*r+I*w+D*y;b[4]=M*a+J*n+E*v+G*z;b[5]=M*d+J*p+E*s+G*F;b[6]=M*k+J*t+E*u+G*x;b[7]=M*m+J*r+E*w+G*y;b[8]=L*a+P*n+K*v+U*z;b[9]=L*d+P*p+K*s+U*F;b[10]=L*k+P*t+K*u+U*x;b[11]=L*m+P*r+K*w+U*y;b[12]=Q*a+B*n+H*v+c*z;b[13]=Q*d+B*p+H*s+c*F;b[14]=Q*k+B*t+H*u+c*x;b[15]=Q*m+B*r+H*w+c*y;return this};a.getMat4MultiplyValue=function(a,b){var c=a.mat,d=b.mat,k=new Float32Array(16);k[0]=c[0]*d[0]+c[4]*d[1]+c[8]*d[2]+c[12]*d[3];
k[1]=c[1]*d[0]+c[5]*d[1]+c[9]*d[2]+c[13]*d[3];k[2]=c[2]*d[0]+c[6]*d[1]+c[10]*d[2]+c[14]*d[3];k[3]=c[3]*d[0]+c[7]*d[1]+c[11]*d[2]+c[15]*d[3];k[4]=c[0]*d[4]+c[4]*d[5]+c[8]*d[6]+c[12]*d[7];k[5]=c[1]*d[4]+c[5]*d[5]+c[9]*d[6]+c[13]*d[7];k[6]=c[2]*d[4]+c[6]*d[5]+c[10]*d[6]+c[14]*d[7];k[7]=c[3]*d[4]+c[7]*d[5]+c[11]*d[6]+c[15]*d[7];k[8]=c[0]*d[8]+c[4]*d[9]+c[8]*d[10]+c[12]*d[11];k[9]=c[1]*d[8]+c[5]*d[9]+c[9]*d[10]+c[13]*d[11];k[10]=c[2]*d[8]+c[6]*d[9]+c[10]*d[10]+c[14]*d[11];k[11]=c[3]*d[8]+c[7]*d[9]+c[11]*
d[10]+c[15]*d[11];k[12]=c[0]*d[12]+c[4]*d[13]+c[8]*d[14]+c[12]*d[15];k[13]=c[1]*d[12]+c[5]*d[13]+c[9]*d[14]+c[13]*d[15];k[14]=c[2]*d[12]+c[6]*d[13]+c[10]*d[14]+c[14]*d[15];k[15]=c[3]*d[12]+c[7]*d[13]+c[11]*d[14]+c[15]*d[15];return k};a.kmMat4Assign=function(b,c){if(b===c)return a.log("cc.kmMat4Assign(): pOut equals pIn"),b;var d=b.mat,h=c.mat;d[0]=h[0];d[1]=h[1];d[2]=h[2];d[3]=h[3];d[4]=h[4];d[5]=h[5];d[6]=h[6];d[7]=h[7];d[8]=h[8];d[9]=h[9];d[10]=h[10];d[11]=h[11];d[12]=h[12];d[13]=h[13];d[14]=h[14];
d[15]=h[15];return b};b.assignFrom=function(b){if(this===b)return a.log("cc.mat.Matrix4.assignFrom(): mat4 equals current matrix"),this;var c=this.mat;b=b.mat;c[0]=b[0];c[1]=b[1];c[2]=b[2];c[3]=b[3];c[4]=b[4];c[5]=b[5];c[6]=b[6];c[7]=b[7];c[8]=b[8];c[9]=b[9];c[10]=b[10];c[11]=b[11];c[12]=b[12];c[13]=b[13];c[14]=b[14];c[15]=b[15];return this};b.equals=function(b){if(this===b)return a.log("cc.kmMat4AreEqual(): pMat1 and pMat2 are same object."),!0;var c=this.mat;b=b.mat;for(var d=a.math.EPSILON,h=0;16>
h;h++)if(!(c[h]+d>b[h]&&c[h]-db?a.math.Plane.POINT_BEHIND_PLANE:a.math.Plane.POINT_ON_PLANE}})(cc);(function(a){a.math.Quaternion=function(a,b,e,f){a&&void 0===b?(this.x=a.x,this.y=a.y,this.z=a.z,this.w=a.w):(this.x=a||0,this.y=b||0,this.z=e||0,this.w=f||0)};a.kmQuaternion=a.math.Quaternion;var b=a.math.Quaternion.prototype;b.conjugate=function(a){this.x=-a.x;this.y=-a.y;this.z=-a.z;this.w=a.w;return this};b.dot=function(a){return this.w*a.w+this.x*a.x+this.y*a.y+this.z*a.z};b.exponential=function(){return this};b.identity=function(){this.z=this.y=this.x=0;this.w=1;return this};b.inverse=function(){var b=
this.length();if(Math.abs(b)>a.math.EPSILON)return this.w=this.z=this.y=this.x=0,this;this.conjugate(this).scale(1/b);return this};b.isIdentity=function(){return 0===this.x&&0===this.y&&0===this.z&&1===this.w};b.length=function(){return Math.sqrt(this.lengthSq())};b.lengthSq=function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w};b.multiply=function(a){var b=this.x,e=this.y,f=this.z,g=this.w;this.w=g*a.w-b*a.x-e*a.y-f*a.z;this.x=g*a.x+b*a.w+e*a.z-f*a.y;this.y=g*a.y+e*a.w+f*a.x-
b*a.z;this.z=g*a.z+f*a.w+b*a.y-e*a.x;return this};b.normalize=function(){var b=this.length();if(Math.abs(b)<=a.math.EPSILON)throw Error("current quaternion is an invalid value");this.scale(1/b);return this};b.rotationAxis=function(a,b){var e=0.5*b,f=Math.sin(e);this.w=Math.cos(e);this.x=a.x*f;this.y=a.y*f;this.z=a.z*f;return this};a.math.Quaternion.rotationMatrix=function(b){if(!b)return null;var d,e,f;d=[];e=b.mat;b=0;d[0]=e[0];d[1]=e[3];d[2]=e[6];d[4]=e[1];d[5]=e[4];d[6]=e[7];d[8]=e[2];d[9]=e[5];
d[10]=e[8];d[15]=1;var g=d[0];b=g[0]+g[5]+g[10]+1;b>a.math.EPSILON?(b=2*Math.sqrt(b),d=(g[9]-g[6])/b,e=(g[2]-g[8])/b,f=(g[4]-g[1])/b,b*=0.25):g[0]>g[5]&&g[0]>g[10]?(b=2*Math.sqrt(1+g[0]-g[5]-g[10]),d=0.25*b,e=(g[4]+g[1])/b,f=(g[2]+g[8])/b,b=(g[9]-g[6])/b):g[5]>g[10]?(b=2*Math.sqrt(1+g[5]-g[0]-g[10]),d=(g[4]+g[1])/b,e=0.25*b,f=(g[9]+g[6])/b,b=(g[2]-g[8])/b):(b=2*Math.sqrt(1+g[10]-g[0]-g[5]),d=(g[2]+g[8])/b,e=(g[9]+g[6])/b,f=0.25*b,b=(g[4]-g[1])/b);return new a.math.Quaternion(d,e,f,b)};a.math.Quaternion.rotationYawPitchRoll=
function(b,d,e){var f,g,h,k,m;f=a.degreesToRadians(d)/2;g=a.degreesToRadians(b)/2;h=a.degreesToRadians(e)/2;e=Math.cos(f);b=Math.cos(g);d=Math.cos(h);f=Math.sin(f);g=Math.sin(g);h=Math.sin(h);k=b*d;m=g*h;var n=new a.math.Quaternion;n.w=e*k+f*m;n.x=f*k-e*m;n.y=e*g*d+f*b*h;n.z=e*b*h-f*g*d;n.normalize();return n};b.slerp=function(b,d){if(this.x===b.x&&this.y===b.y&&this.z===b.z&&this.w===b.w)return this;var e=this.dot(b),f=Math.acos(e),g=Math.sqrt(1-a.math.square(e)),e=Math.sin(d*f)/g,f=Math.sin((1-
d)*f)/g,g=new a.math.Quaternion(b);this.scale(f);g.scale(e);this.add(g);return this};b.toAxisAndAngle=function(){var b,d,e=new a.math.Vec3;b=Math.acos(this.w);d=Math.sqrt(a.math.square(this.x)+a.math.square(this.y)+a.math.square(this.z));d>-a.math.EPSILON&&d2*Math.PI-a.math.EPSILON?(b=0,e.x=0,e.y=0,e.z=1):(b*=2,e.x=this.x/d,e.y=this.y/d,e.z=this.z/d,e.normalize());return{axis:e,angle:b}};b.scale=function(a){this.x*=a;this.y*=a;this.z*=a;this.w*=a;return this};
b.assignFrom=function(a){this.x=a.x;this.y=a.y;this.z=a.z;this.w=a.w;return this};b.add=function(a){this.x+=a.x;this.y+=a.y;this.z+=a.z;this.w+=a.w;return this};a.math.Quaternion.rotationBetweenVec3=function(b,d,e){var f=new a.math.Vec3(b),g=new a.math.Vec3(d);f.normalize();g.normalize();var h=f.dot(g);d=new a.math.Quaternion;if(1<=h)return d.identity(),d;-0.999999>h?Math.abs(e.lengthSq())=this.min.x&&a.x<=this.max.x&&a.y>=this.min.y&&a.y<=this.max.y&&a.z>=this.min.z&&a.z<=this.max.z};cc.math.AABB.containsPoint=function(a,b){return a.x>=b.min.x&&a.x<=b.max.x&&a.y>=b.min.y&&a.y<=b.max.y&&a.z>=b.min.z&&a.z<=b.max.z};cc.math.AABB.prototype.assignFrom=function(a){this.min.assignFrom(a.min);this.max.assignFrom(a.max)};
cc.math.AABB.assign=function(a,b){a.min.assignFrom(b.min);a.max.assignFrom(b.max);return a};(function(a){a.math.Matrix4Stack=function(a,b){this.top=a;this.stack=b||[]};a.km_mat4_stack=a.math.Matrix4Stack;var b=a.math.Matrix4Stack.prototype;b.initialize=function(){this.stack.length=0;this.top=null};a.km_mat4_stack_push=function(b,d){b.stack.push(b.top);b.top=new a.math.Matrix4(d)};a.km_mat4_stack_pop=function(a,b){a.top=a.stack.pop()};a.km_mat4_stack_release=function(a){a.stack=null;a.top=null};b.push=function(b){b=b||this.top;this.stack.push(this.top);this.top=new a.math.Matrix4(b)};b.pop=
function(){this.top=this.stack.pop()};b.release=function(){this._matrixPool=this.top=this.stack=null};b._getFromPool=function(b){var d=this._matrixPool;if(0===d.length)return new a.math.Matrix4(b);d=d.pop();d.assignFrom(b);return d};b._putInPool=function(a){this._matrixPool.push(a)}})(cc);(function(a){a.KM_GL_MODELVIEW=5888;a.KM_GL_PROJECTION=5889;a.KM_GL_TEXTURE=5890;a.modelview_matrix_stack=new a.math.Matrix4Stack;a.projection_matrix_stack=new a.math.Matrix4Stack;a.texture_matrix_stack=new a.math.Matrix4Stack;a.current_stack=null;a.lazyInitialize=function(){var b=new a.math.Matrix4;a.modelview_matrix_stack.initialize();a.projection_matrix_stack.initialize();a.texture_matrix_stack.initialize();a.current_stack=a.modelview_matrix_stack;a.initialized=!0;b.identity();a.modelview_matrix_stack.push(b);
a.projection_matrix_stack.push(b);a.texture_matrix_stack.push(b)};a.lazyInitialize();a.kmGLFreeAll=function(){a.modelview_matrix_stack.release();a.modelview_matrix_stack=null;a.projection_matrix_stack.release();a.projection_matrix_stack=null;a.texture_matrix_stack.release();a.texture_matrix_stack=null;a.initialized=!1;a.current_stack=null};a.kmGLPushMatrix=function(){a.current_stack.push(a.current_stack.top)};a.kmGLPushMatrixWitMat4=function(b){a.current_stack.stack.push(a.current_stack.top);b.assignFrom(a.current_stack.top);
a.current_stack.top=b};a.kmGLPopMatrix=function(){a.current_stack.top=a.current_stack.stack.pop()};a.kmGLMatrixMode=function(b){switch(b){case a.KM_GL_MODELVIEW:a.current_stack=a.modelview_matrix_stack;break;case a.KM_GL_PROJECTION:a.current_stack=a.projection_matrix_stack;break;case a.KM_GL_TEXTURE:a.current_stack=a.texture_matrix_stack;break;default:throw Error("Invalid matrix mode specified");}};a.kmGLLoadIdentity=function(){a.current_stack.top.identity()};a.kmGLLoadMatrix=function(b){a.current_stack.top.assignFrom(b)};
a.kmGLMultMatrix=function(b){a.current_stack.top.multiply(b)};var b=new a.math.Matrix4;a.kmGLTranslatef=function(c,e,f){c=a.math.Matrix4.createByTranslation(c,e,f,b);a.current_stack.top.multiply(c)};var c=new a.math.Vec3;a.kmGLRotatef=function(d,e,f,g){c.fill(e,f,g);d=a.math.Matrix4.createByAxisAndAngle(c,a.degreesToRadians(d),b);a.current_stack.top.multiply(d)};a.kmGLScalef=function(c,e,f){c=a.math.Matrix4.createByScale(c,e,f,b);a.current_stack.top.multiply(c)};a.kmGLGetMatrix=function(b,c){switch(b){case a.KM_GL_MODELVIEW:c.assignFrom(a.modelview_matrix_stack.top);
break;case a.KM_GL_PROJECTION:c.assignFrom(a.projection_matrix_stack.top);break;case a.KM_GL_TEXTURE:c.assignFrom(a.texture_matrix_stack.top);break;default:throw Error("Invalid matrix mode specified");}}})(cc);cc.SHADER_POSITION_UCOLOR_FRAG="precision lowp float;\nvarying vec4 v_fragmentColor;\nvoid main() \n{ \n gl_FragColor \x3d v_fragmentColor; \n}\n";cc.SHADER_POSITION_UCOLOR_VERT="attribute vec4 a_position;\nuniform vec4 u_color;\nuniform float u_pointSize;\nvarying lowp vec4 v_fragmentColor; \nvoid main(void) \n{\n gl_Position \x3d (CC_PMatrix * CC_MVMatrix) * a_position; \n gl_PointSize \x3d u_pointSize; \n v_fragmentColor \x3d u_color; \n}";
cc.SHADER_POSITION_COLOR_FRAG="precision lowp float; \nvarying vec4 v_fragmentColor; \nvoid main() \n{ \n gl_FragColor \x3d v_fragmentColor; \n} ";cc.SHADER_POSITION_COLOR_VERT="attribute vec4 a_position;\nattribute vec4 a_color;\nvarying lowp vec4 v_fragmentColor;\nvoid main()\n{\n gl_Position \x3d (CC_PMatrix * CC_MVMatrix) * a_position; \n v_fragmentColor \x3d a_color; \n}";cc.SHADER_POSITION_COLOR_LENGTH_TEXTURE_FRAG="// #extension GL_OES_standard_derivatives : enable\nvarying mediump vec4 v_color;\nvarying mediump vec2 v_texcoord;\nvoid main()\t\n{ \n// #if defined GL_OES_standard_derivatives\t\n// gl_FragColor \x3d v_color*smoothstep(0.0, length(fwidth(v_texcoord)), 1.0 - length(v_texcoord)); \n// #else\t\ngl_FragColor \x3d v_color * step(0.0, 1.0 - length(v_texcoord)); \n// #endif \n}";
cc.SHADER_POSITION_COLOR_LENGTH_TEXTURE_VERT="attribute mediump vec4 a_position; \nattribute mediump vec2 a_texcoord; \nattribute mediump vec4 a_color;\t\nvarying mediump vec4 v_color; \nvarying mediump vec2 v_texcoord;\t\nvoid main() \n{ \n v_color \x3d a_color;//vec4(a_color.rgb * a_color.a, a_color.a); \n v_texcoord \x3d a_texcoord; \n gl_Position \x3d (CC_PMatrix * CC_MVMatrix) * a_position; \n}";cc.SHADER_POSITION_TEXTURE_FRAG="precision lowp float; \nvarying vec2 v_texCoord; \nvoid main() \n{ \n gl_FragColor \x3d texture2D(CC_Texture0, v_texCoord); \n}";
cc.SHADER_POSITION_TEXTURE_VERT="attribute vec4 a_position; \nattribute vec2 a_texCoord; \nvarying mediump vec2 v_texCoord; \nvoid main() \n{ \n gl_Position \x3d (CC_PMatrix * CC_MVMatrix) * a_position; \n v_texCoord \x3d a_texCoord; \n}";cc.SHADER_POSITION_TEXTURE_UCOLOR_FRAG="precision lowp float; \nuniform vec4 u_color; \nvarying vec2 v_texCoord; \nvoid main() \n{ \n gl_FragColor \x3d texture2D(CC_Texture0, v_texCoord) * u_color; \n}";
cc.SHADER_POSITION_TEXTURE_UCOLOR_VERT="attribute vec4 a_position;\nattribute vec2 a_texCoord; \nvarying mediump vec2 v_texCoord; \nvoid main() \n{ \n gl_Position \x3d (CC_PMatrix * CC_MVMatrix) * a_position; \n v_texCoord \x3d a_texCoord; \n}";cc.SHADER_POSITION_TEXTURE_A8COLOR_FRAG="precision lowp float; \nvarying vec4 v_fragmentColor; \nvarying vec2 v_texCoord; \nvoid main() \n{ \n gl_FragColor \x3d vec4( v_fragmentColor.rgb, \n v_fragmentColor.a * texture2D(CC_Texture0, v_texCoord).a \n ); \n}";
cc.SHADER_POSITION_TEXTURE_A8COLOR_VERT="attribute vec4 a_position; \nattribute vec2 a_texCoord; \nattribute vec4 a_color; \nvarying lowp vec4 v_fragmentColor; \nvarying mediump vec2 v_texCoord; \nvoid main() \n{ \n gl_Position \x3d (CC_PMatrix * CC_MVMatrix) * a_position; \n v_fragmentColor \x3d a_color; \n v_texCoord \x3d a_texCoord; \n}";cc.SHADER_POSITION_TEXTURE_COLOR_FRAG="precision lowp float;\nvarying vec4 v_fragmentColor; \nvarying vec2 v_texCoord; \nvoid main() \n{ \n gl_FragColor \x3d v_fragmentColor * texture2D(CC_Texture0, v_texCoord); \n}";
cc.SHADER_POSITION_TEXTURE_COLOR_VERT="attribute vec4 a_position; \nattribute vec2 a_texCoord; \nattribute vec4 a_color; \nvarying lowp vec4 v_fragmentColor; \nvarying mediump vec2 v_texCoord; \nvoid main() \n{ \n gl_Position \x3d (CC_PMatrix * CC_MVMatrix) * a_position; \n v_fragmentColor \x3d a_color; \n v_texCoord \x3d a_texCoord; \n}";cc.SHADER_POSITION_TEXTURE_COLOR_ALPHATEST_FRAG="precision lowp float; \nvarying vec4 v_fragmentColor; \nvarying vec2 v_texCoord; \nuniform float CC_alpha_value; \nvoid main() \n{ \n vec4 texColor \x3d texture2D(CC_Texture0, v_texCoord); \n if ( texColor.a \x3c\x3d CC_alpha_value ) \n discard; \n gl_FragColor \x3d texColor * v_fragmentColor; \n}";
cc.SHADEREX_SWITCHMASK_FRAG="precision lowp float; \nvarying vec4 v_fragmentColor; \nvarying vec2 v_texCoord; \nuniform sampler2D u_texture; \nuniform sampler2D u_mask; \nvoid main() \n{ \n vec4 texColor \x3d texture2D(u_texture, v_texCoord); \n vec4 maskColor \x3d texture2D(u_mask, v_texCoord); \n vec4 finalColor \x3d vec4(texColor.r, texColor.g, texColor.b, maskColor.a * texColor.a); \n gl_FragColor \x3d v_fragmentColor * finalColor; \n}";cc.shaderCache={TYPE_POSITION_TEXTURECOLOR:0,TYPE_POSITION_TEXTURECOLOR_ALPHATEST:1,TYPE_POSITION_COLOR:2,TYPE_POSITION_TEXTURE:3,TYPE_POSITION_TEXTURE_UCOLOR:4,TYPE_POSITION_TEXTURE_A8COLOR:5,TYPE_POSITION_UCOLOR:6,TYPE_POSITION_LENGTH_TEXTURECOLOR:7,TYPE_MAX:8,_programs:{},_init:function(){this.loadDefaultShaders();return!0},_loadDefaultShader:function(a,b){switch(b){case this.TYPE_POSITION_TEXTURECOLOR:a.initWithVertexShaderByteArray(cc.SHADER_POSITION_TEXTURE_COLOR_VERT,cc.SHADER_POSITION_TEXTURE_COLOR_FRAG);
a.addAttribute(cc.ATTRIBUTE_NAME_POSITION,cc.VERTEX_ATTRIB_POSITION);a.addAttribute(cc.ATTRIBUTE_NAME_COLOR,cc.VERTEX_ATTRIB_COLOR);a.addAttribute(cc.ATTRIBUTE_NAME_TEX_COORD,cc.VERTEX_ATTRIB_TEX_COORDS);break;case this.TYPE_POSITION_TEXTURECOLOR_ALPHATEST:a.initWithVertexShaderByteArray(cc.SHADER_POSITION_TEXTURE_COLOR_VERT,cc.SHADER_POSITION_TEXTURE_COLOR_ALPHATEST_FRAG);a.addAttribute(cc.ATTRIBUTE_NAME_POSITION,cc.VERTEX_ATTRIB_POSITION);a.addAttribute(cc.ATTRIBUTE_NAME_COLOR,cc.VERTEX_ATTRIB_COLOR);
a.addAttribute(cc.ATTRIBUTE_NAME_TEX_COORD,cc.VERTEX_ATTRIB_TEX_COORDS);break;case this.TYPE_POSITION_COLOR:a.initWithVertexShaderByteArray(cc.SHADER_POSITION_COLOR_VERT,cc.SHADER_POSITION_COLOR_FRAG);a.addAttribute(cc.ATTRIBUTE_NAME_POSITION,cc.VERTEX_ATTRIB_POSITION);a.addAttribute(cc.ATTRIBUTE_NAME_COLOR,cc.VERTEX_ATTRIB_COLOR);break;case this.TYPE_POSITION_TEXTURE:a.initWithVertexShaderByteArray(cc.SHADER_POSITION_TEXTURE_VERT,cc.SHADER_POSITION_TEXTURE_FRAG);a.addAttribute(cc.ATTRIBUTE_NAME_POSITION,
cc.VERTEX_ATTRIB_POSITION);a.addAttribute(cc.ATTRIBUTE_NAME_TEX_COORD,cc.VERTEX_ATTRIB_TEX_COORDS);break;case this.TYPE_POSITION_TEXTURE_UCOLOR:a.initWithVertexShaderByteArray(cc.SHADER_POSITION_TEXTURE_UCOLOR_VERT,cc.SHADER_POSITION_TEXTURE_UCOLOR_FRAG);a.addAttribute(cc.ATTRIBUTE_NAME_POSITION,cc.VERTEX_ATTRIB_POSITION);a.addAttribute(cc.ATTRIBUTE_NAME_TEX_COORD,cc.VERTEX_ATTRIB_TEX_COORDS);break;case this.TYPE_POSITION_TEXTURE_A8COLOR:a.initWithVertexShaderByteArray(cc.SHADER_POSITION_TEXTURE_A8COLOR_VERT,
cc.SHADER_POSITION_TEXTURE_A8COLOR_FRAG);a.addAttribute(cc.ATTRIBUTE_NAME_POSITION,cc.VERTEX_ATTRIB_POSITION);a.addAttribute(cc.ATTRIBUTE_NAME_COLOR,cc.VERTEX_ATTRIB_COLOR);a.addAttribute(cc.ATTRIBUTE_NAME_TEX_COORD,cc.VERTEX_ATTRIB_TEX_COORDS);break;case this.TYPE_POSITION_UCOLOR:a.initWithVertexShaderByteArray(cc.SHADER_POSITION_UCOLOR_VERT,cc.SHADER_POSITION_UCOLOR_FRAG);a.addAttribute("aVertex",cc.VERTEX_ATTRIB_POSITION);break;case this.TYPE_POSITION_LENGTH_TEXTURECOLOR:a.initWithVertexShaderByteArray(cc.SHADER_POSITION_COLOR_LENGTH_TEXTURE_VERT,
cc.SHADER_POSITION_COLOR_LENGTH_TEXTURE_FRAG);a.addAttribute(cc.ATTRIBUTE_NAME_POSITION,cc.VERTEX_ATTRIB_POSITION);a.addAttribute(cc.ATTRIBUTE_NAME_TEX_COORD,cc.VERTEX_ATTRIB_TEX_COORDS);a.addAttribute(cc.ATTRIBUTE_NAME_COLOR,cc.VERTEX_ATTRIB_COLOR);break;default:cc.log("cocos2d: cc.shaderCache._loadDefaultShader, error shader type");return}a.link();a.updateUniforms()},loadDefaultShaders:function(){var a=new cc.GLProgram;this._loadDefaultShader(a,this.TYPE_POSITION_TEXTURECOLOR);this._programs[cc.SHADER_POSITION_TEXTURECOLOR]=
a;this._programs.ShaderPositionTextureColor=a;a=new cc.GLProgram;this._loadDefaultShader(a,this.TYPE_POSITION_TEXTURECOLOR_ALPHATEST);this._programs[cc.SHADER_POSITION_TEXTURECOLORALPHATEST]=a;this._programs.ShaderPositionTextureColorAlphaTest=a;a=new cc.GLProgram;this._loadDefaultShader(a,this.TYPE_POSITION_COLOR);this._programs[cc.SHADER_POSITION_COLOR]=a;this._programs.ShaderPositionColor=a;a=new cc.GLProgram;this._loadDefaultShader(a,this.TYPE_POSITION_TEXTURE);this._programs[cc.SHADER_POSITION_TEXTURE]=
a;this._programs.ShaderPositionTexture=a;a=new cc.GLProgram;this._loadDefaultShader(a,this.TYPE_POSITION_TEXTURE_UCOLOR);this._programs[cc.SHADER_POSITION_TEXTURE_UCOLOR]=a;this._programs.ShaderPositionTextureUColor=a;a=new cc.GLProgram;this._loadDefaultShader(a,this.TYPE_POSITION_TEXTURE_A8COLOR);this._programs[cc.SHADER_POSITION_TEXTUREA8COLOR]=a;this._programs.ShaderPositionTextureA8Color=a;a=new cc.GLProgram;this._loadDefaultShader(a,this.TYPE_POSITION_UCOLOR);this._programs[cc.SHADER_POSITION_UCOLOR]=
a;this._programs.ShaderPositionUColor=a;a=new cc.GLProgram;this._loadDefaultShader(a,this.TYPE_POSITION_LENGTH_TEXTURECOLOR);this._programs[cc.SHADER_POSITION_LENGTHTEXTURECOLOR]=a;this._programs.ShaderPositionLengthTextureColor=a},reloadDefaultShaders:function(){var a=this.programForKey(cc.SHADER_POSITION_TEXTURECOLOR);a.reset();this._loadDefaultShader(a,this.TYPE_POSITION_TEXTURECOLOR);a=this.programForKey(cc.SHADER_POSITION_TEXTURECOLORALPHATEST);a.reset();this._loadDefaultShader(a,this.TYPE_POSITION_TEXTURECOLOR_ALPHATEST);
a=this.programForKey(cc.SHADER_POSITION_COLOR);a.reset();this._loadDefaultShader(a,this.TYPE_POSITION_COLOR);a=this.programForKey(cc.SHADER_POSITION_TEXTURE);a.reset();this._loadDefaultShader(a,this.TYPE_POSITION_TEXTURE);a=this.programForKey(cc.SHADER_POSITION_TEXTURE_UCOLOR);a.reset();this._loadDefaultShader(a,this.TYPE_POSITION_TEXTURE_UCOLOR);a=this.programForKey(cc.SHADER_POSITION_TEXTUREA8COLOR);a.reset();this._loadDefaultShader(a,this.TYPE_POSITION_TEXTURE_A8COLOR);a=this.programForKey(cc.SHADER_POSITION_UCOLOR);
a.reset();this._loadDefaultShader(a,this.TYPE_POSITION_UCOLOR)},programForKey:function(a){return this._programs[a]},getProgram:function(a){return this._programs[a]},addProgram:function(a,b){this._programs[b]=a}};cc.HashUniformEntry=function(a,b,c){this.value=a;this.location=b;this.hh=c||{}};
cc.GLProgram=cc.Class.extend({_glContext:null,_programObj:null,_vertShader:null,_fragShader:null,_uniforms:null,_hashForUniforms:null,_usesTime:!1,_updateUniformLocation:function(a,b,c){if(null==a)return!1;c=!0;for(var d=null,e=0;earguments.length))switch(arguments.length){case 2:this.setUniformLocationWith1f(arguments[0],arguments[1]);break;case 3:this.setUniformLocationWith2f(arguments[0],arguments[1],arguments[2]);break;
case 4:this.setUniformLocationWith3f(arguments[0],arguments[1],arguments[2],arguments[3]);break;case 5:this.setUniformLocationWith4f(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4])}},setUniformsForBuiltins:function(){var a=new cc.math.Matrix4,b=new cc.math.Matrix4,c=new cc.math.Matrix4;cc.kmGLGetMatrix(cc.KM_GL_PROJECTION,a);cc.kmGLGetMatrix(cc.KM_GL_MODELVIEW,b);cc.kmMat4Multiply(c,a,b);this.setUniformLocationWithMatrix4fv(this._uniforms[cc.UNIFORM_PMATRIX],a.mat,1);this.setUniformLocationWithMatrix4fv(this._uniforms[cc.UNIFORM_MVMATRIX],
b.mat,1);this.setUniformLocationWithMatrix4fv(this._uniforms[cc.UNIFORM_MVPMATRIX],c.mat,1);this._usesTime&&(a=cc.director,a=a.getTotalFrames()*a.getAnimationInterval(),this.setUniformLocationWith4f(this._uniforms[cc.UNIFORM_TIME],a/10,a,2*a,4*a),this.setUniformLocationWith4f(this._uniforms[cc.UNIFORM_SINTIME],a/8,a/4,a/2,Math.sin(a)),this.setUniformLocationWith4f(this._uniforms[cc.UNIFORM_COSTIME],a/8,a/4,a/2,Math.cos(a)));-1!==this._uniforms[cc.UNIFORM_RANDOM01]&&this.setUniformLocationWith4f(this._uniforms[cc.UNIFORM_RANDOM01],
Math.random(),Math.random(),Math.random(),Math.random())},_setUniformsForBuiltinsForRenderer:function(a){if(a&&a._renderCmd){var b=new cc.math.Matrix4,c=new cc.math.Matrix4;cc.kmGLGetMatrix(cc.KM_GL_PROJECTION,b);cc.kmMat4Multiply(c,b,a._renderCmd._stackMatrix);this.setUniformLocationWithMatrix4fv(this._uniforms[cc.UNIFORM_PMATRIX],b.mat,1);this.setUniformLocationWithMatrix4fv(this._uniforms[cc.UNIFORM_MVMATRIX],a._renderCmd._stackMatrix.mat,1);this.setUniformLocationWithMatrix4fv(this._uniforms[cc.UNIFORM_MVPMATRIX],
c.mat,1);this._usesTime&&(a=cc.director,a=a.getTotalFrames()*a.getAnimationInterval(),this.setUniformLocationWith4f(this._uniforms[cc.UNIFORM_TIME],a/10,a,2*a,4*a),this.setUniformLocationWith4f(this._uniforms[cc.UNIFORM_SINTIME],a/8,a/4,a/2,Math.sin(a)),this.setUniformLocationWith4f(this._uniforms[cc.UNIFORM_COSTIME],a/8,a/4,a/2,Math.cos(a)));-1!==this._uniforms[cc.UNIFORM_RANDOM01]&&this.setUniformLocationWith4f(this._uniforms[cc.UNIFORM_RANDOM01],Math.random(),Math.random(),Math.random(),Math.random())}},
setUniformForModelViewProjectionMatrix:function(){this._glContext.uniformMatrix4fv(this._uniforms[cc.UNIFORM_MVPMATRIX],!1,cc.getMat4MultiplyValue(cc.projection_matrix_stack.top,cc.modelview_matrix_stack.top))},setUniformForModelViewProjectionMatrixWithMat4:function(a){cc.kmMat4Multiply(a,cc.projection_matrix_stack.top,cc.modelview_matrix_stack.top);this._glContext.uniformMatrix4fv(this._uniforms[cc.UNIFORM_MVPMATRIX],!1,a.mat)},setUniformForModelViewAndProjectionMatrixWithMat4:function(){this._glContext.uniformMatrix4fv(this._uniforms[cc.UNIFORM_MVMATRIX],
!1,cc.modelview_matrix_stack.top.mat);this._glContext.uniformMatrix4fv(this._uniforms[cc.UNIFORM_PMATRIX],!1,cc.projection_matrix_stack.top.mat)},_setUniformForMVPMatrixWithMat4:function(a){if(!a)throw Error("modelView matrix is undefined.");this._glContext.uniformMatrix4fv(this._uniforms[cc.UNIFORM_MVMATRIX],!1,a.mat);this._glContext.uniformMatrix4fv(this._uniforms[cc.UNIFORM_PMATRIX],!1,cc.projection_matrix_stack.top.mat)},vertexShaderLog:function(){return this._glContext.getShaderInfoLog(this._vertShader)},
getVertexShaderLog:function(){return this._glContext.getShaderInfoLog(this._vertShader)},getFragmentShaderLog:function(){return this._glContext.getShaderInfoLog(this._vertShader)},fragmentShaderLog:function(){return this._glContext.getShaderInfoLog(this._fragShader)},programLog:function(){return this._glContext.getProgramInfoLog(this._programObj)},getProgramLog:function(){return this._glContext.getProgramInfoLog(this._programObj)},reset:function(){this._fragShader=this._vertShader=null;this._uniforms.length=
0;this._glContext.deleteProgram(this._programObj);this._programObj=null;for(var a=0;a>1;a|=a>>2;a|=a>>4;a|=a>>8;return(a|a>>16)+1};
cc.RenderTexture=cc.Node.extend({sprite:null,clearFlags:0,clearDepthVal:0,autoDraw:!1,_texture:null,_pixelFormat:cc.Texture2D.PIXEL_FORMAT_RGBA8888,clearStencilVal:0,_clearColor:null,_className:"RenderTexture",ctor:function(a,b,c,d){cc.Node.prototype.ctor.call(this);this._cascadeOpacityEnabled=this._cascadeColorEnabled=!0;this._clearColor=new cc.Color(0,0,0,255);void 0!==a&&void 0!==b&&(c=c||cc.Texture2D.PIXEL_FORMAT_RGBA8888,this.initWithWidthAndHeight(a,b,c,d||0));this.setAnchorPoint(0,0)},_createRenderCmd:function(){return cc._renderType===
cc._RENDER_TYPE_CANVAS?new cc.RenderTexture.CanvasRenderCmd(this):new cc.RenderTexture.WebGLRenderCmd(this)},cleanup:function(){cc.Node.prototype.onExit.call(this);this._renderCmd.cleanup()},getSprite:function(){return this.sprite},setSprite:function(a){this.sprite=a},setVirtualViewport:function(a,b,c){this._renderCmd.setVirtualViewport(a,b,c)},initWithWidthAndHeight:function(a,b,c,d){return this._renderCmd.initWithWidthAndHeight(a,b,c,d)},begin:function(){cc.renderer._turnToCacheMode(this.__instanceId);
this._renderCmd.begin()},beginWithClear:function(a,b,c,d,e,f){var g=cc._renderContext;e=e||g.COLOR_BUFFER_BIT;f=f||g.COLOR_BUFFER_BIT|g.DEPTH_BUFFER_BIT;this._beginWithClear(a,b,c,d,e,f,g.COLOR_BUFFER_BIT|g.DEPTH_BUFFER_BIT|g.STENCIL_BUFFER_BIT)},_beginWithClear:function(a,b,c,d,e,f,g){this.begin();this._renderCmd._beginWithClear(a,b,c,d,e,f,g)},end:function(){this._renderCmd.end()},clear:function(a,b,c,d){this.beginWithClear(a,b,c,d);this.end()},clearRect:function(a,b,c,d){this._renderCmd.clearRect(a,
b,c,d)},clearDepth:function(a){this._renderCmd.clearDepth(a)},clearStencil:function(a){this._renderCmd.clearStencil(a)},getClearFlags:function(){return this.clearFlags},setClearFlags:function(a){this.clearFlags=a},getClearColor:function(){return this._clearColor},setClearColor:function(a){var b=this._clearColor;b.r=a.r;b.g=a.g;b.b=a.b;b.a=a.a;this._renderCmd.updateClearColor(a)},getClearDepth:function(){return this.clearDepthVal},setClearDepth:function(a){this.clearDepthVal=a},getClearStencil:function(){return this.clearStencilVal},
setClearStencil:function(a){this.clearStencilVal=a},isAutoDraw:function(){return this.autoDraw},setAutoDraw:function(a){this.autoDraw=a},saveToFile:function(a,b){cc.log("saveToFile isn't supported on Cocos2d-Html5")},newCCImage:function(a){cc.log("saveToFile isn't supported on cocos2d-html5");return null},listenToBackground:function(a){},listenToForeground:function(a){}});_p=cc.RenderTexture.prototype;cc.defineGetterSetter(_p,"clearColorVal",_p.getClearColor,_p.setClearColor);
cc.RenderTexture.create=function(a,b,c,d){return new cc.RenderTexture(a,b,c,d)};(function(){cc.RenderTexture.CanvasRenderCmd=function(a){cc.Node.CanvasRenderCmd.call(this,a);this._needDraw=!0;this._clearColorStr="rgba(255,255,255,1)";this._cacheCanvas=cc.newElement("canvas");this._cacheContext=new cc.CanvasContextWrapper(this._cacheCanvas.getContext("2d"))};var a=cc.RenderTexture.CanvasRenderCmd.prototype=Object.create(cc.Node.CanvasRenderCmd.prototype);a.constructor=cc.RenderTexture.CanvasRenderCmd;a.cleanup=function(){this._cacheCanvas=this._cacheContext=null};a.clearStencil=
function(a){};a.setVirtualViewport=function(a,c,d){};a.updateClearColor=function(a){this._clearColorStr="rgba("+(0|a.r)+","+(0|a.g)+","+(0|a.b)+","+a.a/255+")"};a.initWithWidthAndHeight=function(a,c,d,e){d=this._node;e=this._cacheCanvas;var f=cc.contentScaleFactor();e.width=0|a*f;e.height=0|c*f;a=new cc.Texture2D;a.initWithElement(e);a.handleLoadedTexture();a=d.sprite=new cc.Sprite(a);a.setBlendFunc(cc.ONE,cc.ONE_MINUS_SRC_ALPHA);d.autoDraw=!1;d.addChild(a);return!0};a.begin=function(){};a._beginWithClear=
function(a,c,d,e,f,g,h){a=a||0;c=c||0;d=d||0;e=isNaN(e)?255:e;f=this._cacheContext.getContext();g=this._cacheCanvas;f.setTransform(1,0,0,1,0,0);this._cacheContext.setFillStyle("rgba("+(0|a)+","+(0|c)+","+(0|d)+","+e/255+")");f.clearRect(0,0,g.width,g.height);f.fillRect(0,0,g.width,g.height)};a.end=function(){var a=this._node,c=cc.contentScaleFactor();cc.renderer._renderingToCacheCanvas(this._cacheContext,a.__instanceId,c,c)};a.clearRect=function(a,c,d,e){this._cacheContext.clearRect(a,c,d,-e)};a.clearDepth=
function(a){cc.log("clearDepth isn't supported on Cocos2d-Html5")};a.visit=function(a){var c=this._node;this._syncStatus(a);c.sprite.visit(this);this._dirtyFlag=0}})();(function(){cc.RenderTexture.WebGLRenderCmd=function(a){cc.Node.WebGLRenderCmd.call(this,a);this._needDraw=!0;this._depthRenderBuffer=this._textureCopy=this._oldFBO=this._fBO=null;this._rtTextureRect=new cc.Rect;this._fullRect=new cc.Rect;this._fullViewport=new cc.Rect};var a=cc.RenderTexture.WebGLRenderCmd.prototype=Object.create(cc.Node.WebGLRenderCmd.prototype);a.constructor=cc.RenderTexture.WebGLRenderCmd;a.setVirtualViewport=function(a,c,d){this._rtTextureRect.x=a.x;this._rtTextureRect.y=a.y;
this._fullRect=c;this._fullViewport=d};a.rendering=function(a){var c=a||cc._renderContext;a=this._node;if(a.autoDraw){a.begin();var d=a.clearFlags;if(d){var e=[0,0,0,0],f=0,g=0;d&c.COLOR_BUFFER_BIT&&(e=c.getParameter(c.COLOR_CLEAR_VALUE),c.clearColor(a._clearColor.r/255,a._clearColor.g/255,a._clearColor.b/255,a._clearColor.a/255));d&c.DEPTH_BUFFER_BIT&&(f=c.getParameter(c.DEPTH_CLEAR_VALUE),c.clearDepth(a.clearDepthVal));d&c.STENCIL_BUFFER_BIT&&(g=c.getParameter(c.STENCIL_CLEAR_VALUE),c.clearStencil(a.clearStencilVal));
c.clear(d);d&c.COLOR_BUFFER_BIT&&c.clearColor(e[0],e[1],e[2],e[3]);d&c.DEPTH_BUFFER_BIT&&c.clearDepth(f);d&c.STENCIL_BUFFER_BIT&&c.clearStencil(g)}a.sortAllChildren();c=a._children;for(d=0;dn||0>m||(n=cc.rect(n*f,m*g,f,g),m=e._contentSize,0>n.x||0>n.y||n.x+n.width>m.width||n.y+n.height>m.height))){k++;var m=c.charCodeAt(h),p=a.getChildByTag(h);p?32===m?(p.init(),p.setTextureRect(cc.rect(0,0,10,10),!1,cc.size(0,0))):(p.initWithTexture(e,n),p.visible=!0):(p=new cc.Sprite,32===m?(p.init(),p.setTextureRect(cc.rect(0,0,10,10),!1,cc.size(0,0))):p.initWithTexture(e,n),cc.Node.prototype.addChild.call(a,
p,0,h));p.setPosition(k*f+f/2,g/2)}}this.updateContentSize(h,k+1)};a.updateContentSize=function(a,c){var d=this._node,e=d._contentSize;a!==c&&a*d._itemWidth===e.width&&d._itemHeight===e.height&&d.setContentSize(c*d._itemWidth,d._itemHeight)};a.setString=function(a){a=this._node;if(a._children){a=a._children;for(var c=a.length,d=0;de.getCapacity()&&cc.log("cc.LabelAtlas._updateAtlasValues(): Invalid String length");for(var m=e.quads,n=this._displayedColor,
n={r:n.r,g:n.g,b:n.b,a:a._displayedOpacity},p=a._itemWidth,t=a._itemHeight,r=0,v=-1;ru||0>w||u*p+p>g||w*t+t>f)){v++;var z;cc.FIX_ARTIFACTS_BY_STRECHING_TEXEL?(u=(2*u*h+1)/(2*g),s=u+(2*h-2)/(2*g),w=(2*w*k+1)/(2*f),z=w+(2*k-2)/(2*f)):(u=u*h/g,s=u+h/g,w=w*k/f,z=w+k/f);var F=m[r],x=F.tl,y=F.tr,A=F.bl,F=F.br;x.texCoords.u=u;x.texCoords.v=w;y.texCoords.u=s;y.texCoords.v=w;A.texCoords.u=u;A.texCoords.v=
z;F.texCoords.u=s;F.texCoords.v=z;A.vertices.x=v*p;A.vertices.y=0;A.vertices.z=0;F.vertices.x=v*p+p;F.vertices.y=0;F.vertices.z=0;x.vertices.x=v*p;x.vertices.y=a._itemHeight;x.vertices.z=0;y.vertices.x=v*p+p;y.vertices.y=a._itemHeight;y.vertices.z=0;x.colors=n;y.colors=n;A.colors=n;F.colors=n}}this.updateContentSize(r,v+1);0a&&e.increaseTotalQuadsWith(d-a))};a.updateContentSize=function(a,c){var d=this._node,e=d._contentSize;a!==c&&a*d._itemWidth===e.width&&d._itemHeight===
e.height&&d.setContentSize(c*d._itemWidth,d._itemHeight)};a.setString=function(a){a=a.length;a>this._textureAtlas.totalQuads&&this._textureAtlas.resizeCapacity(a)};a._addChild=function(){}})();cc.LABEL_AUTOMATIC_WIDTH=-1;
cc.LabelBMFont=cc.SpriteBatchNode.extend({_opacityModifyRGB:!1,_string:"",_config:null,_fntFile:"",_initialString:"",_alignment:cc.TEXT_ALIGNMENT_CENTER,_width:-1,_lineBreakWithoutSpaces:!1,_imageOffset:null,_reusedChar:null,_textureLoaded:!1,_className:"LabelBMFont",_createRenderCmd:function(){return cc._renderType===cc._RENDER_TYPE_WEBGL?new cc.LabelBMFont.WebGLRenderCmd(this):new cc.LabelBMFont.CanvasRenderCmd(this)},_setString:function(a,b){b?this._initialString=a:this._string=a;var c=this._children;
if(c)for(var d=0;d=b)return 0;var c=this.getChildByTag(a),d=this.getChildByTag(a+b);return this._getLetterPosXLeft(d)-
this._getLetterPosXLeft(c)},_checkWarp:function(a,b,c,d){for(var e=a[b],f=0,g=0;gc&&1c&&100>p++;)d*=c/k,d|=0,g=e.substr(d),k=h-this._getCharsWidth(f+d,g.length-1);for(p=0;kp++;)g&&(n=(m=cc.LabelTTF._wordRex.exec(g))?m[0].length:1,m=g),this._lineBreakWithoutSpaces&&(n=0),d+=n,g=e.substr(d),k=h-this._getCharsWidth(f+
d,g.length-1);d-=n;0===d&&(d=1,m=m.substr(1));c=e.substr(0,d);cc.LabelTTF.wrapInspection&&cc.LabelTTF._symbolRex.test(m||g)&&(n=(f=cc.LabelTTF._lastWordRex.exec(c))?f[0].length:0,this._lineBreakWithoutSpaces&&(n=0),d-=n,m=e.substr(d),c=e.substr(0,d));cc.LabelTTF._firsrEnglish.test(m)&&(f=cc.LabelTTF._lastEnglish.exec(c))&&c!==f[0]&&(n=f[0].length,this._lineBreakWithoutSpaces&&(n=0),d-=n,m=e.substr(d),c=e.substr(0,d));a[b]=m||g;a.splice(b,0,c)}},updateLabel:function(){this.string=this._initialString;
var a,b,c;if(0c)){var k=this.getChildByTag(c);if(null!=
k){b=k.getPositionX()+k._getWidth()/2;k=0;switch(this._alignment){case cc.TEXT_ALIGNMENT_CENTER:k=this.width/2-b/2;break;case cc.TEXT_ALIGNMENT_RIGHT:k=this.width-b}if(0!==k)for(b=0;bc||(c=this.getChildByTag(c))&&(c.x+=k);a+=h;d++;f.length=0}}}else f.push(this._string[a])},setAlignment:function(a){this._alignment=a;this.updateLabel()},_getAlignment:function(){return this._alignment},setBoundingWidth:function(a){this._width=a;this.updateLabel()},_getBoundingWidth:function(){return this._width},
setLineBreakWithoutSpace:function(a){this._lineBreakWithoutSpaces=a;this.updateLabel()},setScale:function(a,b){cc.Node.prototype.setScale.call(this,a,b);this.updateLabel()},setScaleX:function(a){cc.Node.prototype.setScaleX.call(this,a);this.updateLabel()},setScaleY:function(a){cc.Node.prototype.setScaleY.call(this,a);this.updateLabel()},setFntFile:function(a){if(null!=a&&a!==this._fntFile){var b=cc.loader.getRes(a);b?(this._fntFile=a,this._config=b,a=cc.textureCache.addImage(b.atlasName),this._textureLoaded=
b=a.isLoaded(),this.texture=a,this._renderCmd._updateFntFileTexture(),b?this.createFontChars():a.addEventListener("load",function(a){this._textureLoaded=!0;this.texture=a;this.createFontChars();this._changeTextureColor();this.updateLabel();this.dispatchEvent("load")},this)):cc.log("cc.LabelBMFont.setFntFile() : Impossible to create font. Please check file")}},getFntFile:function(){return this._fntFile},setTexture:function(a){this._renderCmd.setTexture(a)},setAnchorPoint:function(a,b){cc.Node.prototype.setAnchorPoint.call(this,
a,b);this.updateLabel()},_setAnchorX:function(a){cc.Node.prototype._setAnchorX.call(this,a);this.updateLabel()},_setAnchorY:function(a){cc.Node.prototype._setAnchorY.call(this,a);this.updateLabel()},_atlasNameFromFntFile:function(a){},_kerningAmountForFirst:function(a,b){var c=0;if(this._configuration.kerningDictionary){var d=this._configuration.kerningDictionary[(a<<16|b&65535).toString()];d&&(c=d.amount)}return c},_getLetterPosXLeft:function(a){return a.getPositionX()*this._scaleX-a._getWidth()*
this._scaleX*a._getAnchorX()},_getLetterPosXRight:function(a){return a.getPositionX()*this._scaleX+a._getWidth()*this._scaleX*a._getAnchorX()},_isspace_unicode:function(a){a=a.charCodeAt(0);return 9<=a&&13>=a||32===a||133===a||160===a||5760===a||8192<=a&&8202>=a||8232===a||8233===a||8239===a||8287===a||12288===a},_utf8_trim_ws:function(a){var b=a.length;if(!(0>=b)&&(b-=1,this._isspace_unicode(a[b]))){for(var c=b-1;0<=c;--c)if(this._isspace_unicode(a[c]))b=c;else break;this._utf8_trim_from(a,b)}},
_utf8_trim_from:function(a,b){var c=a.length;b>=c||0>b||a.splice(b,c)}});(function(){var a=cc.LabelBMFont.prototype;cc.EventHelper.prototype.apply(a);cc.defineGetterSetter(a,"string",a.getString,a._setStringForSetter);cc.defineGetterSetter(a,"boundingWidth",a._getBoundingWidth,a.setBoundingWidth);cc.defineGetterSetter(a,"textAlign",a._getAlignment,a.setAlignment)})();cc.LabelBMFont.create=function(a,b,c,d,e){return new cc.LabelBMFont(a,b,c,d,e)};
cc._fntLoader={INFO_EXP:/info [^\n]*(\n|$)/gi,COMMON_EXP:/common [^\n]*(\n|$)/gi,PAGE_EXP:/page [^\n]*(\n|$)/gi,CHAR_EXP:/char [^\n]*(\n|$)/gi,KERNING_EXP:/kerning [^\n]*(\n|$)/gi,ITEM_EXP:/\w+=[^ \r\n]+/gi,INT_EXP:/^[\-]?\d+$/,_parseStrToObj:function(a){a=a.match(this.ITEM_EXP);var b={};if(a)for(var c=0,d=a.length;ce.width||d.scaleH>e.height)&&cc.log("cc.LabelBMFont._parseCommonArguments(): page can't be larger than supported")}1!==d.pages&&cc.log("cc.LabelBMFont._parseCommonArguments(): only supports 1 page");
d=this._parseStrToObj(a.match(this.PAGE_EXP)[0]);0!==d.id&&cc.log("cc.LabelBMFont._parseImageFileName() : file could not be found");c.atlasName=cc.path.changeBasename(b,d.file);for(var f=a.match(this.CHAR_EXP),g=c.fontDefDictionary={},d=0,e=f.length;d=h[d]?f++:(b=d-f,0=this._maxPoints?d=!1:0=b._nuPoints||!b.texture||!b.texture.isLoaded()||(a=a||cc._renderContext,this._shaderProgram.use(),this._shaderProgram._setUniformForMVPMatrixWithMat4(this._stackMatrix),cc.glEnableVertexAttribs(cc.VERTEX_ATTRIB_FLAG_POS_COLOR_TEX),cc.glBlendFunc(b._blendFunc.src,b._blendFunc.dst),cc.glBindTexture2D(b.texture),a.bindBuffer(a.ARRAY_BUFFER,b._verticesBuffer),a.bufferData(a.ARRAY_BUFFER,b._vertices,a.DYNAMIC_DRAW),a.vertexAttribPointer(cc.VERTEX_ATTRIB_POSITION,
2,a.FLOAT,!1,0,0),a.bindBuffer(a.ARRAY_BUFFER,b._texCoordsBuffer),a.bufferData(a.ARRAY_BUFFER,b._texCoords,a.DYNAMIC_DRAW),a.vertexAttribPointer(cc.VERTEX_ATTRIB_TEX_COORDS,2,a.FLOAT,!1,0,0),a.bindBuffer(a.ARRAY_BUFFER,b._colorPointerBuffer),a.bufferData(a.ARRAY_BUFFER,b._colorPointer,a.DYNAMIC_DRAW),a.vertexAttribPointer(cc.VERTEX_ATTRIB_COLOR,4,a.UNSIGNED_BYTE,!0,0,0),a.drawArrays(a.TRIANGLE_STRIP,0,2*b._nuPoints),cc.g_NumberOfDraws++)};cc.NodeGrid=cc.Node.extend({grid:null,_target:null,_gridRect:null,ctor:function(a){cc.Node.prototype.ctor.call(this);void 0===a&&(a=cc.rect());this._gridRect=a},getGrid:function(){return this.grid},setGrid:function(a){this.grid=a},setGridRect:function(a){this._gridRect=a},getGridRect:function(){return this._gridRect},setTarget:function(a){this._target=a},_transformForWebGL:function(){var a=this._transform4x4,b=cc.current_stack.top,c=this.getNodeToParentTransform(),d=a.mat;d[0]=c.a;d[4]=c.c;d[12]=
c.tx;d[1]=c.b;d[5]=c.d;d[13]=c.ty;d[14]=this._vertexZ;b.multiply(a);null===this._camera||this.grid&&this.grid.isActive()||(b=this._renderCmd._anchorPointInPoints,a=b.x,b=b.y,0!==a||0!==b?(cc.SPRITEBATCHNODE_RENDER_SUBPIXEL||(a|=0,b|=0),cc.kmGLTranslatef(a,b,0),this._camera.locate(),cc.kmGLTranslatef(-a,-b,0)):this._camera.locate())},_createRenderCmd:function(){return cc._renderType===cc._RENDER_TYPE_WEBGL?new cc.NodeGrid.WebGLRenderCmd(this):new cc.Node.CanvasRenderCmd(this)}});_p=cc.NodeGrid.prototype;
cc.defineGetterSetter(_p,"target",null,_p.setTarget);cc.NodeGrid.create=function(){return new cc.NodeGrid};(function(){cc.NodeGrid.WebGLRenderCmd=function(a){cc.Node.WebGLRenderCmd.call(this,a);this._needDraw=!1;this._gridBeginCommand=new cc.CustomRenderCmd(this,this.onGridBeginDraw);this._gridEndCommand=new cc.CustomRenderCmd(this,this.onGridEndDraw)};var a=cc.NodeGrid.WebGLRenderCmd.prototype=Object.create(cc.Node.WebGLRenderCmd.prototype);a.constructor=cc.NodeGrid.WebGLRenderCmd;a.visit=function(a){var c=this._node;if(c._visible){a=a||this.getParentRenderCmd();c._parent&&c._parent._renderCmd&&(this._curLevel=
c._parent._renderCmd._curLevel+1);var d=cc.current_stack;d.stack.push(d.top);this._syncStatus(a);d.top=this._stackMatrix;cc.renderer.pushRenderCommand(this._gridBeginCommand);c._target&&c._target.visit();if((a=c._children)&&0this._bufferCapacity){var c=cc.V2F_C4B_T2F_Triangle.BYTES_PER_ELEMENT;this._bufferCapacity+=Math.max(this._bufferCapacity,a);if(null==b||0===b.length)this._buffer=
[],this._trianglesArrayBuffer=new ArrayBuffer(c*this._bufferCapacity),this._trianglesReader=new Uint8Array(this._trianglesArrayBuffer);else{a=[];for(var d=new ArrayBuffer(c*this._bufferCapacity),e=0;e=b)){c={r:0|c.r,g:0|c.g,b:0|c.b,a:0|c.a};var e=[],f,g,h,k,m=a.length;for(f=0;f=cc.stencilBits&&cc.log("Stencil buffer is not enabled."),cc.ClippingNode.WebGLRenderCmd._init_once=!1)};a.transform=function(a,c){var d=this._node;cc.Node.WebGLRenderCmd.prototype.transform.call(this,a,c);d._stencil&&d._stencil._renderCmd.transform(this,c)};a.visit=function(a){var c=this._node;if(c._visible)if(c._parent&&c._parent._renderCmd&&(this._curLevel=c._parent._renderCmd._curLevel+1),1>cc.stencilBits)cc.Node.WebGLRenderCmd.prototype.visit.call(this,
a);else if(c._stencil&&c._stencil.visible)if(cc.ClippingNode.WebGLRenderCmd._layer+1===cc.stencilBits)cc.ClippingNode.WebGLRenderCmd._visit_once=!0,cc.ClippingNode.WebGLRenderCmd._visit_once&&(cc.log("Nesting more than "+cc.stencilBits+"stencils is not supported. Everything will be drawn without stencil for this node and its children."),cc.ClippingNode.WebGLRenderCmd._visit_once=!1),cc.Node.WebGLRenderCmd.prototype.visit.call(this,a);else{cc.renderer.pushRenderCommand(this._beforeVisitCmd);var d=
cc.current_stack;d.stack.push(d.top);this._syncStatus(a);d.top=this._stackMatrix;c._stencil._renderCmd.visit(this);cc.renderer.pushRenderCommand(this._afterDrawStencilCmd);if((a=c._children)&&0a.alphaThreshold&&(d=cc.shaderCache.programForKey(cc.SHADER_POSITION_TEXTURECOLORALPHATEST),c=c.getUniformLocation(d.getProgram(),cc.UNIFORM_ALPHA_TEST_VALUE_S),cc.glUseProgram(d.getProgram()),d.setUniformLocationWith1f(c,
a.alphaThreshold),cc.setProgram(a._stencil,d))};a._onAfterDrawStencil=function(a){a=a||cc._renderContext;a.depthMask(this._currentDepthWriteMask);a.stencilFunc(a.EQUAL,this._mask_layer_le,this._mask_layer_le);a.stencilOp(a.KEEP,a.KEEP,a.KEEP)};a._onAfterVisit=function(a){a=a||cc._renderContext;a.stencilFunc(this._currentStencilFunc,this._currentStencilRef,this._currentStencilValueMask);a.stencilOp(this._currentStencilFail,this._currentStencilPassDepthFail,this._currentStencilPassDepthPass);a.stencilMask(this._currentStencilWriteMask);
this._currentStencilEnabled||a.disable(a.STENCIL_TEST);cc.ClippingNode.WebGLRenderCmd._layer--}})();cc.GridBase=cc.Class.extend({_active:!1,_reuseGrid:0,_gridSize:null,_gridRect:null,_texture:null,_step:null,_grabber:null,_isTextureFlipped:!1,_shaderProgram:null,_directorProjection:0,_dirty:!1,ctor:function(a,b,c,d){cc._checkWebGLRenderMode();this._active=!1;this._reuseGrid=0;this._gridSize=null;this._gridRect=new cc.rect;this._texture=null;this._step=cc.p(0,0);this._grabber=null;this._isTextureFlipped=!1;this._shaderProgram=null;this._directorProjection=0;this._dirty=!1;void 0!==a&&this.initWithSize(a,
b,c,d)},isActive:function(){return this._active},setActive:function(a){this._active=a;if(!a){a=cc.director;var b=a.getProjection();a.setProjection(b)}},getReuseGrid:function(){return this._reuseGrid},setReuseGrid:function(a){this._reuseGrid=a},getGridSize:function(){return cc.size(this._gridSize.width,this._gridSize.height)},setGridSize:function(a){this._gridSize.width=parseInt(a.width);this._gridSize.height=parseInt(a.height)},setGridRect:function(a){this._gridRect=a},getGridRect:function(){return this._gridRect},
getStep:function(){return cc.p(this._step.x,this._step.y)},setStep:function(a){this._step.x=a.x;this._step.y=a.y},isTextureFlipped:function(){return this._isTextureFlipped},setTextureFlipped:function(a){this._isTextureFlipped!==a&&(this._isTextureFlipped=a,this.calculateVertexPoints())},initWithSize:function(a,b,c,d){if(!b){var e=cc.director.getWinSizeInPixels(),f=cc.NextPOT(e.width),g=cc.NextPOT(e.height),h=new Uint8Array(f*g*4);if(!h)return cc.log("cocos2d: CCGrid: not enough memory."),!1;b=new cc.Texture2D;
b.initWithData(h,cc.Texture2D.PIXEL_FORMAT_RGBA8888,f,g,e);if(!b)return cc.log("cocos2d: CCGrid: error creating texture"),!1}this._active=!1;this._reuseGrid=0;this._gridSize=a;this._texture=b;this._isTextureFlipped=c||!1;if(void 0===d||cc._rectEqualToZero(d))b=this._texture.getContentSize(),d=new cc.rect(0,0,b.width,b.height);this._gridRect=d;this._step.x=this._gridRect.width/a.width;this._step.y=this._gridRect.height/a.height;this._grabber=new cc.Grabber;if(!this._grabber)return!1;this._grabber.grab(this._texture);
this._shaderProgram=cc.shaderCache.programForKey(cc.SHADER_POSITION_TEXTURE);this.calculateVertexPoints();return!0},beforeDraw:function(){this._directorProjection=cc.director.getProjection();this._grabber.beforeRender(this._texture)},afterDraw:function(a){this._grabber.afterRender(this._texture);if(a&&a.getCamera().isDirty()){var b=a.getAnchorPointInPoints(),c=a._renderCmd._stackMatrix,d=cc.math.Matrix4.createByTranslation(b.x,b.y,0);c.multiply(d);a._camera._locateForRenderer(c);d=cc.math.Matrix4.createByTranslation(-b.x,
-b.y,0,d);c.multiply(d)}cc.glBindTexture2D(this._texture);this.beforeBlit();this.blit(a);this.afterBlit()},beforeBlit:function(){},afterBlit:function(){},blit:function(){cc.log("cc.GridBase.blit(): Shall be overridden in subclass.")},reuse:function(){cc.log("cc.GridBase.reuse(): Shall be overridden in subclass.")},calculateVertexPoints:function(){cc.log("cc.GridBase.calculateVertexPoints(): Shall be overridden in subclass.")},set2DProjection:function(){var a=cc.director.getWinSizeInPixels();cc._renderContext.viewport(0,
0,a.width,a.height);cc.kmGLMatrixMode(cc.KM_GL_PROJECTION);cc.kmGLLoadIdentity();a=cc.math.Matrix4.createOrthographicProjection(0,a.width,0,a.height,-1,1);cc.kmGLMultMatrix(a);cc.kmGLMatrixMode(cc.KM_GL_MODELVIEW);cc.kmGLLoadIdentity();cc.setProjectionMatrixDirty()}});cc.GridBase.create=function(a,b,c,d){return new cc.GridBase(a,b,c,d)};
cc.Grid3D=cc.GridBase.extend({_texCoordinates:null,_vertices:null,_originalVertices:null,_indices:null,_texCoordinateBuffer:null,_verticesBuffer:null,_indicesBuffer:null,_needDepthTestForBlit:!1,_oldDepthTestValue:!1,_oldDepthWriteValue:!1,ctor:function(a,b,c,d){cc.GridBase.prototype.ctor.call(this);this._indicesBuffer=this._verticesBuffer=this._texCoordinateBuffer=this._indices=this._originalVertices=this._vertices=this._texCoordinates=null;void 0!==a&&this.initWithSize(a,b,c,d)},vertex:function(a){return this.getVertex(a)},
getVertex:function(a){a.x===(0|a.x)&&a.y===(0|a.y)||cc.log("cc.Grid3D.vertex() : Numbers must be integers");a=0|3*(a.x*(this._gridSize.height+1)+a.y);var b=this._vertices;return new cc.Vertex3F(b[a],b[a+1],b[a+2])},originalVertex:function(a){return this.getOriginalVertex(a)},getOriginalVertex:function(a){a.x===(0|a.x)&&a.y===(0|a.y)||cc.log("cc.Grid3D.originalVertex() : Numbers must be integers");a=0|3*(a.x*(this._gridSize.height+1)+a.y);var b=this._originalVertices;return new cc.Vertex3F(b[a],b[a+
1],b[a+2])},setVertex:function(a,b){a.x===(0|a.x)&&a.y===(0|a.y)||cc.log("cc.Grid3D.setVertex() : Numbers must be integers");var c=0|3*(a.x*(this._gridSize.height+1)+a.y),d=this._vertices;d[c]=b.x;d[c+1]=b.y;d[c+2]=b.z;this._dirty=!0},beforeBlit:function(){if(this._needDepthTestForBlit){var a=cc._renderContext;this._oldDepthTestValue=a.isEnabled(a.DEPTH_TEST);this._oldDepthWriteValue=a.getParameter(a.DEPTH_WRITEMASK);a.enable(a.DEPTH_TEST);a.depthMask(!0)}},afterBlit:function(){if(this._needDepthTestForBlit){var a=
cc._renderContext;this._oldDepthTestValue?a.enable(a.DEPTH_TEST):a.disable(a.DEPTH_TEST);a.depthMask(this._oldDepthWriteValue)}},blit:function(a){var b=this._gridSize.width*this._gridSize.height;cc.glEnableVertexAttribs(cc.VERTEX_ATTRIB_FLAG_POSITION|cc.VERTEX_ATTRIB_FLAG_TEX_COORDS);this._shaderProgram.use();this._shaderProgram._setUniformForMVPMatrixWithMat4(a._renderCmd._stackMatrix);a=cc._renderContext;var c=this._dirty;a.bindBuffer(a.ARRAY_BUFFER,this._verticesBuffer);c&&a.bufferData(a.ARRAY_BUFFER,
this._vertices,a.DYNAMIC_DRAW);a.vertexAttribPointer(cc.VERTEX_ATTRIB_POSITION,3,a.FLOAT,!1,0,0);a.bindBuffer(a.ARRAY_BUFFER,this._texCoordinateBuffer);c&&a.bufferData(a.ARRAY_BUFFER,this._texCoordinates,a.DYNAMIC_DRAW);a.vertexAttribPointer(cc.VERTEX_ATTRIB_TEX_COORDS,2,a.FLOAT,!1,0,0);a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,this._indicesBuffer);c&&a.bufferData(a.ELEMENT_ARRAY_BUFFER,this._indices,a.STATIC_DRAW);a.drawElements(a.TRIANGLES,6*b,a.UNSIGNED_SHORT,0);c&&(this._dirty=!1);cc.incrementGLDraws(1)},
reuse:function(){if(0h;++h)p[t[h]]=x[h].x,p[t[h]+1]=x[h].y,p[t[h]+2]=x[h].z,m[u[h]]=r[h].x/b,m[u[h]+1]=n?(d-r[h].y)/c:r[h].y/c}this._originalVertices=new Float32Array(this._vertices);
a.bindBuffer(a.ARRAY_BUFFER,this._verticesBuffer);a.bufferData(a.ARRAY_BUFFER,this._vertices,a.DYNAMIC_DRAW);a.bindBuffer(a.ARRAY_BUFFER,this._texCoordinateBuffer);a.bufferData(a.ARRAY_BUFFER,this._texCoordinates,a.DYNAMIC_DRAW);a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,this._indicesBuffer);a.bufferData(a.ELEMENT_ARRAY_BUFFER,this._indices,a.STATIC_DRAW);this._dirty=!0},setNeedDepthTestForBlit:function(a){this._needDepthTestForBlit=a},getNeedDepthTestForBlit:function(){return this._needDepthTestForBlit}});
cc.Grid3D.create=function(a,b,c){return new cc.Grid3D(a,b,c)};
cc.TiledGrid3D=cc.GridBase.extend({_texCoordinates:null,_vertices:null,_originalVertices:null,_indices:null,_texCoordinateBuffer:null,_verticesBuffer:null,_indicesBuffer:null,ctor:function(a,b,c,d){cc.GridBase.prototype.ctor.call(this);this._indicesBuffer=this._verticesBuffer=this._texCoordinateBuffer=this._indices=this._originalVertices=this._vertices=this._texCoordinates=null;void 0!==a&&this.initWithSize(a,b,c,d)},tile:function(a){return this.getTile(a)},getTile:function(a){a.x===(0|a.x)&&a.y===
(0|a.y)||cc.log("cc.TiledGrid3D.tile() : Numbers must be integers");a=12*(this._gridSize.height*a.x+a.y);var b=this._vertices;return new cc.Quad3(new cc.Vertex3F(b[a],b[a+1],b[a+2]),new cc.Vertex3F(b[a+3],b[a+4],b[a+5]),new cc.Vertex3F(b[a+6],b[a+7],b[a+8]),new cc.Vertex3F(b[a+9],b[a+10],b[a+11]))},getOriginalTile:function(a){a.x===(0|a.x)&&a.y===(0|a.y)||cc.log("cc.TiledGrid3D.originalTile() : Numbers must be integers");a=12*(this._gridSize.height*a.x+a.y);var b=this._originalVertices;return new cc.Quad3(new cc.Vertex3F(b[a],
b[a+1],b[a+2]),new cc.Vertex3F(b[a+3],b[a+4],b[a+5]),new cc.Vertex3F(b[a+6],b[a+7],b[a+8]),new cc.Vertex3F(b[a+9],b[a+10],b[a+11]))},originalTile:function(a){return this.getOriginalTile(a)},setTile:function(a,b){a.x===(0|a.x)&&a.y===(0|a.y)||cc.log("cc.TiledGrid3D.setTile() : Numbers must be integers");var c=12*(this._gridSize.height*a.x+a.y),d=this._vertices;d[c]=b.bl.x;d[c+1]=b.bl.y;d[c+2]=b.bl.z;d[c+3]=b.br.x;d[c+4]=b.br.y;d[c+5]=b.br.z;d[c+6]=b.tl.x;d[c+7]=b.tl.y;d[c+8]=b.tl.z;d[c+9]=b.tr.x;d[c+
10]=b.tr.y;d[c+11]=b.tr.z;this._dirty=!0},blit:function(a){var b=this._gridSize.width*this._gridSize.height;this._shaderProgram.use();this._shaderProgram._setUniformForMVPMatrixWithMat4(a._renderCmd._stackMatrix);a=cc._renderContext;var c=this._dirty;cc.glEnableVertexAttribs(cc.VERTEX_ATTRIB_FLAG_POSITION|cc.VERTEX_ATTRIB_FLAG_TEX_COORDS);a.bindBuffer(a.ARRAY_BUFFER,this._verticesBuffer);c&&a.bufferData(a.ARRAY_BUFFER,this._vertices,a.DYNAMIC_DRAW);a.vertexAttribPointer(cc.VERTEX_ATTRIB_POSITION,
3,a.FLOAT,!1,0,this._vertices);a.bindBuffer(a.ARRAY_BUFFER,this._texCoordinateBuffer);c&&a.bufferData(a.ARRAY_BUFFER,this._texCoordinates,a.DYNAMIC_DRAW);a.vertexAttribPointer(cc.VERTEX_ATTRIB_TEX_COORDS,2,a.FLOAT,!1,0,this._texCoordinates);a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,this._indicesBuffer);c&&a.bufferData(a.ELEMENT_ARRAY_BUFFER,this._indices,a.STATIC_DRAW);a.drawElements(a.TRIANGLES,6*b,a.UNSIGNED_SHORT,0);c&&(this._dirty=!1);cc.incrementGLDraws(1)},reuse:function(){if(0=this._duration},_cloneDecoration:function(a){a._repeatForever=this._repeatForever;a._speed=this._speed;a._timesForRepeat=this._timesForRepeat;a._easeList=this._easeList;a._speedMethod=this._speedMethod;a._repeatMethod=this._repeatMethod},_reverseEaseList:function(a){if(this._easeList){a._easeList=[];for(var b=0;ba?
a:1;this.update(0=a)return cc.log("The speed parameter error"),this;this._speedMethod=!0;this._speed*=a;return this},getSpeed:function(){return this._speed},setSpeed:function(a){this._speed=a;return this},repeat:function(a){a=Math.round(a);if(isNaN(a)||1>a)return cc.log("The repeat parameter error"),this;this._repeatMethod=!0;this._timesForRepeat*=a;return this},repeatForever:function(){this._repeatMethod=
!0;this._timesForRepeat=this.MAX_VALUE;this._repeatForever=!0;return this}});cc.actionInterval=function(a){return new cc.ActionInterval(a)};cc.ActionInterval.create=cc.actionInterval;
cc.Sequence=cc.ActionInterval.extend({_actions:null,_split:null,_last:0,ctor:function(a){cc.ActionInterval.prototype.ctor.call(this);this._actions=[];var b=a instanceof Array?a:arguments,c=b.length-1;0<=c&&null==b[c]&&cc.log("parameters should not be ending with null in Javascript");if(0<=c){for(var d=b[0],e=1;e=e){for(;a>e&&this._totale?this._two=cc.Sequence._actionOneTwo(b,cc.delayTime(d-e)):dc&&(c+=360);this._startAngleX=b;this._diffAngleX=c;this._startAngleY=a.rotationY%360;a=this._dstAngleY-this._startAngleY;180a&&(a+=360);this._diffAngleY=a},reverse:function(){cc.log("cc.RotateTo.reverse(): it should be overridden in subclass.")},update:function(a){a=this._computeEaseTime(a);this.target&&(this.target.rotationX=
this._startAngleX+this._diffAngleX*a,this.target.rotationY=this._startAngleY+this._diffAngleY*a)}});cc.rotateTo=function(a,b,c){return new cc.RotateTo(a,b,c)};cc.RotateTo.create=cc.rotateTo;
cc.RotateBy=cc.ActionInterval.extend({_angleX:0,_startAngleX:0,_angleY:0,_startAngleY:0,ctor:function(a,b,c){cc.ActionInterval.prototype.ctor.call(this);void 0!==b&&this.initWithDuration(a,b,c)},initWithDuration:function(a,b,c){return cc.ActionInterval.prototype.initWithDuration.call(this,a)?(this._angleX=b||0,this._angleY=c||this._angleX,!0):!1},clone:function(){var a=new cc.RotateBy;this._cloneDecoration(a);a.initWithDuration(this._duration,this._angleX,this._angleY);return a},startWithTarget:function(a){cc.ActionInterval.prototype.startWithTarget.call(this,
a);this._startAngleX=a.rotationX;this._startAngleY=a.rotationY},update:function(a){a=this._computeEaseTime(a);this.target&&(this.target.rotationX=this._startAngleX+this._angleX*a,this.target.rotationY=this._startAngleY+this._angleY*a)},reverse:function(){var a=new cc.RotateBy(this._duration,-this._angleX,-this._angleY);this._cloneDecoration(a);this._reverseEaseList(a);return a}});cc.rotateBy=function(a,b,c){return new cc.RotateBy(a,b,c)};cc.RotateBy.create=cc.rotateBy;
cc.MoveBy=cc.ActionInterval.extend({_positionDelta:null,_startPosition:null,_previousPosition:null,ctor:function(a,b,c){cc.ActionInterval.prototype.ctor.call(this);this._positionDelta=cc.p(0,0);this._startPosition=cc.p(0,0);this._previousPosition=cc.p(0,0);void 0!==b&&this.initWithDuration(a,b,c)},initWithDuration:function(a,b,c){return cc.ActionInterval.prototype.initWithDuration.call(this,a)?(void 0!==b.x&&(c=b.y,b=b.x),this._positionDelta.x=b,this._positionDelta.y=c,!0):!1},clone:function(){var a=
new cc.MoveBy;this._cloneDecoration(a);a.initWithDuration(this._duration,this._positionDelta);return a},startWithTarget:function(a){cc.ActionInterval.prototype.startWithTarget.call(this,a);var b=a.getPositionX();a=a.getPositionY();this._previousPosition.x=b;this._previousPosition.y=a;this._startPosition.x=b;this._startPosition.y=a},update:function(a){a=this._computeEaseTime(a);if(this.target){var b=this._positionDelta.x*a;a*=this._positionDelta.y;var c=this._startPosition;if(cc.ENABLE_STACKABLE_ACTIONS){var d=
this.target.getPositionX(),e=this.target.getPositionY(),f=this._previousPosition;c.x=c.x+d-f.x;c.y=c.y+e-f.y;b+=c.x;a+=c.y;f.x=b;f.y=a;this.target.setPosition(b,a)}else this.target.setPosition(c.x+b,c.y+a)}},reverse:function(){var a=new cc.MoveBy(this._duration,cc.p(-this._positionDelta.x,-this._positionDelta.y));this._cloneDecoration(a);this._reverseEaseList(a);return a}});cc.moveBy=function(a,b,c){return new cc.MoveBy(a,b,c)};cc.MoveBy.create=cc.moveBy;
cc.MoveTo=cc.MoveBy.extend({_endPosition:null,ctor:function(a,b,c){cc.MoveBy.prototype.ctor.call(this);this._endPosition=cc.p(0,0);void 0!==b&&this.initWithDuration(a,b,c)},initWithDuration:function(a,b,c){return cc.MoveBy.prototype.initWithDuration.call(this,a,b,c)?(void 0!==b.x&&(c=b.y,b=b.x),this._endPosition.x=b,this._endPosition.y=c,!0):!1},clone:function(){var a=new cc.MoveTo;this._cloneDecoration(a);a.initWithDuration(this._duration,this._endPosition);return a},startWithTarget:function(a){cc.MoveBy.prototype.startWithTarget.call(this,
a);this._positionDelta.x=this._endPosition.x-a.getPositionX();this._positionDelta.y=this._endPosition.y-a.getPositionY()}});cc.moveTo=function(a,b,c){return new cc.MoveTo(a,b,c)};cc.MoveTo.create=cc.moveTo;
cc.SkewTo=cc.ActionInterval.extend({_skewX:0,_skewY:0,_startSkewX:0,_startSkewY:0,_endSkewX:0,_endSkewY:0,_deltaX:0,_deltaY:0,ctor:function(a,b,c){cc.ActionInterval.prototype.ctor.call(this);void 0!==c&&this.initWithDuration(a,b,c)},initWithDuration:function(a,b,c){var d=!1;cc.ActionInterval.prototype.initWithDuration.call(this,a)&&(this._endSkewX=b,this._endSkewY=c,d=!0);return d},clone:function(){var a=new cc.SkewTo;this._cloneDecoration(a);a.initWithDuration(this._duration,this._endSkewX,this._endSkewY);
return a},startWithTarget:function(a){cc.ActionInterval.prototype.startWithTarget.call(this,a);this._startSkewX=a.skewX%180;this._deltaX=this._endSkewX-this._startSkewX;180this._deltaX&&(this._deltaX+=360);this._startSkewY=a.skewY%360;this._deltaY=this._endSkewY-this._startSkewY;180this._deltaY&&(this._deltaY+=360)},update:function(a){a=this._computeEaseTime(a);this.target.skewX=this._startSkewX+this._deltaX*a;this.target.skewY=
this._startSkewY+this._deltaY*a}});cc.skewTo=function(a,b,c){return new cc.SkewTo(a,b,c)};cc.SkewTo.create=cc.skewTo;
cc.SkewBy=cc.SkewTo.extend({ctor:function(a,b,c){cc.SkewTo.prototype.ctor.call(this);void 0!==c&&this.initWithDuration(a,b,c)},initWithDuration:function(a,b,c){var d=!1;cc.SkewTo.prototype.initWithDuration.call(this,a,b,c)&&(this._skewX=b,this._skewY=c,d=!0);return d},clone:function(){var a=new cc.SkewBy;this._cloneDecoration(a);a.initWithDuration(this._duration,this._skewX,this._skewY);return a},startWithTarget:function(a){cc.SkewTo.prototype.startWithTarget.call(this,a);this._deltaX=this._skewX;
this._deltaY=this._skewY;this._endSkewX=this._startSkewX+this._deltaX;this._endSkewY=this._startSkewY+this._deltaY},reverse:function(){var a=new cc.SkewBy(this._duration,-this._skewX,-this._skewY);this._cloneDecoration(a);this._reverseEaseList(a);return a}});cc.skewBy=function(a,b,c){return new cc.SkewBy(a,b,c)};cc.SkewBy.create=cc.skewBy;
cc.JumpBy=cc.ActionInterval.extend({_startPosition:null,_delta:null,_height:0,_jumps:0,_previousPosition:null,ctor:function(a,b,c,d,e){cc.ActionInterval.prototype.ctor.call(this);this._startPosition=cc.p(0,0);this._previousPosition=cc.p(0,0);this._delta=cc.p(0,0);void 0!==d&&this.initWithDuration(a,b,c,d,e)},initWithDuration:function(a,b,c,d,e){return cc.ActionInterval.prototype.initWithDuration.call(this,a)?(void 0===e&&(e=d,d=c,c=b.y,b=b.x),this._delta.x=b,this._delta.y=c,this._height=d,this._jumps=
e,!0):!1},clone:function(){var a=new cc.JumpBy;this._cloneDecoration(a);a.initWithDuration(this._duration,this._delta,this._height,this._jumps);return a},startWithTarget:function(a){cc.ActionInterval.prototype.startWithTarget.call(this,a);var b=a.getPositionX();a=a.getPositionY();this._previousPosition.x=b;this._previousPosition.y=a;this._startPosition.x=b;this._startPosition.y=a},update:function(a){a=this._computeEaseTime(a);if(this.target){var b=a*this._jumps%1,b=4*this._height*b*(1-b),b=b+this._delta.y*
a;a*=this._delta.x;var c=this._startPosition;if(cc.ENABLE_STACKABLE_ACTIONS){var d=this.target.getPositionX(),e=this.target.getPositionY(),f=this._previousPosition;c.x=c.x+d-f.x;c.y=c.y+e-f.y;a+=c.x;b+=c.y;f.x=a;f.y=b;this.target.setPosition(a,b)}else this.target.setPosition(c.x+a,c.y+b)}},reverse:function(){var a=new cc.JumpBy(this._duration,cc.p(-this._delta.x,-this._delta.y),this._height,this._jumps);this._cloneDecoration(a);this._reverseEaseList(a);return a}});
cc.jumpBy=function(a,b,c,d,e){return new cc.JumpBy(a,b,c,d,e)};cc.JumpBy.create=cc.jumpBy;
cc.JumpTo=cc.JumpBy.extend({_endPosition:null,ctor:function(a,b,c,d,e){cc.JumpBy.prototype.ctor.call(this);this._endPosition=cc.p(0,0);void 0!==d&&this.initWithDuration(a,b,c,d,e)},initWithDuration:function(a,b,c,d,e){return cc.JumpBy.prototype.initWithDuration.call(this,a,b,c,d,e)?(void 0===e&&(c=b.y,b=b.x),this._endPosition.x=b,this._endPosition.y=c,!0):!1},startWithTarget:function(a){cc.JumpBy.prototype.startWithTarget.call(this,a);this._delta.x=this._endPosition.x-this._startPosition.x;this._delta.y=
this._endPosition.y-this._startPosition.y},clone:function(){var a=new cc.JumpTo;this._cloneDecoration(a);a.initWithDuration(this._duration,this._endPosition,this._height,this._jumps);return a}});cc.jumpTo=function(a,b,c,d,e){return new cc.JumpTo(a,b,c,d,e)};cc.JumpTo.create=cc.jumpTo;cc.bezierAt=function(a,b,c,d,e){return Math.pow(1-e,3)*a+3*e*Math.pow(1-e,2)*b+3*Math.pow(e,2)*(1-e)*c+Math.pow(e,3)*d};
cc.BezierBy=cc.ActionInterval.extend({_config:null,_startPosition:null,_previousPosition:null,ctor:function(a,b){cc.ActionInterval.prototype.ctor.call(this);this._config=[];this._startPosition=cc.p(0,0);this._previousPosition=cc.p(0,0);b&&this.initWithDuration(a,b)},initWithDuration:function(a,b){return cc.ActionInterval.prototype.initWithDuration.call(this,a)?(this._config=b,!0):!1},clone:function(){var a=new cc.BezierBy;this._cloneDecoration(a);for(var b=[],c=0;cb/2}},startWithTarget:function(a){cc.ActionInterval.prototype.startWithTarget.call(this,a);this._originalState=a.visible},stop:function(){this.target.visible=this._originalState;cc.ActionInterval.prototype.stop.call(this)},reverse:function(){var a=new cc.Blink(this._duration,this._times);this._cloneDecoration(a);this._reverseEaseList(a);return a}});cc.blink=function(a,b){return new cc.Blink(a,b)};cc.Blink.create=cc.blink;
cc.FadeTo=cc.ActionInterval.extend({_toOpacity:0,_fromOpacity:0,ctor:function(a,b){cc.ActionInterval.prototype.ctor.call(this);void 0!==b&&this.initWithDuration(a,b)},initWithDuration:function(a,b){return cc.ActionInterval.prototype.initWithDuration.call(this,a)?(this._toOpacity=b,!0):!1},clone:function(){var a=new cc.FadeTo;this._cloneDecoration(a);a.initWithDuration(this._duration,this._toOpacity);return a},update:function(a){a=this._computeEaseTime(a);var b=void 0!==this._fromOpacity?this._fromOpacity:
255;this.target.opacity=b+(this._toOpacity-b)*a},startWithTarget:function(a){cc.ActionInterval.prototype.startWithTarget.call(this,a);this._fromOpacity=a.opacity}});cc.fadeTo=function(a,b){return new cc.FadeTo(a,b)};cc.FadeTo.create=cc.fadeTo;
cc.FadeIn=cc.FadeTo.extend({_reverseAction:null,ctor:function(a){cc.FadeTo.prototype.ctor.call(this);null==a&&(a=0);this.initWithDuration(a,255)},reverse:function(){var a=new cc.FadeOut;a.initWithDuration(this._duration,0);this._cloneDecoration(a);this._reverseEaseList(a);return a},clone:function(){var a=new cc.FadeIn;this._cloneDecoration(a);a.initWithDuration(this._duration,this._toOpacity);return a},startWithTarget:function(a){this._reverseAction&&(this._toOpacity=this._reverseAction._fromOpacity);
cc.FadeTo.prototype.startWithTarget.call(this,a)}});cc.fadeIn=function(a){return new cc.FadeIn(a)};cc.FadeIn.create=cc.fadeIn;
cc.FadeOut=cc.FadeTo.extend({ctor:function(a){cc.FadeTo.prototype.ctor.call(this);null==a&&(a=0);this.initWithDuration(a,0)},reverse:function(){var a=new cc.FadeIn;a._reverseAction=this;a.initWithDuration(this._duration,255);this._cloneDecoration(a);this._reverseEaseList(a);return a},clone:function(){var a=new cc.FadeOut;this._cloneDecoration(a);a.initWithDuration(this._duration,this._toOpacity);return a}});cc.fadeOut=function(a){return new cc.FadeOut(a)};cc.FadeOut.create=cc.fadeOut;
cc.TintTo=cc.ActionInterval.extend({_to:null,_from:null,ctor:function(a,b,c,d){cc.ActionInterval.prototype.ctor.call(this);this._to=cc.color(0,0,0);this._from=cc.color(0,0,0);void 0!==d&&this.initWithDuration(a,b,c,d)},initWithDuration:function(a,b,c,d){return cc.ActionInterval.prototype.initWithDuration.call(this,a)?(this._to=cc.color(b,c,d),!0):!1},clone:function(){var a=new cc.TintTo;this._cloneDecoration(a);var b=this._to;a.initWithDuration(this._duration,b.r,b.g,b.b);return a},startWithTarget:function(a){cc.ActionInterval.prototype.startWithTarget.call(this,
a);this._from=this.target.color},update:function(a){a=this._computeEaseTime(a);var b=this._from,c=this._to;b&&this.target.setColor(cc.color(b.r+(c.r-b.r)*a,b.g+(c.g-b.g)*a,b.b+(c.b-b.b)*a))}});cc.tintTo=function(a,b,c,d){return new cc.TintTo(a,b,c,d)};cc.TintTo.create=cc.tintTo;
cc.TintBy=cc.ActionInterval.extend({_deltaR:0,_deltaG:0,_deltaB:0,_fromR:0,_fromG:0,_fromB:0,ctor:function(a,b,c,d){cc.ActionInterval.prototype.ctor.call(this);void 0!==d&&this.initWithDuration(a,b,c,d)},initWithDuration:function(a,b,c,d){return cc.ActionInterval.prototype.initWithDuration.call(this,a)?(this._deltaR=b,this._deltaG=c,this._deltaB=d,!0):!1},clone:function(){var a=new cc.TintBy;this._cloneDecoration(a);a.initWithDuration(this._duration,this._deltaR,this._deltaG,this._deltaB);return a},
startWithTarget:function(a){cc.ActionInterval.prototype.startWithTarget.call(this,a);a=a.color;this._fromR=a.r;this._fromG=a.g;this._fromB=a.b},update:function(a){a=this._computeEaseTime(a);this.target.color=cc.color(this._fromR+this._deltaR*a,this._fromG+this._deltaG*a,this._fromB+this._deltaB*a)},reverse:function(){var a=new cc.TintBy(this._duration,-this._deltaR,-this._deltaG,-this._deltaB);this._cloneDecoration(a);this._reverseEaseList(a);return a}});
cc.tintBy=function(a,b,c,d){return new cc.TintBy(a,b,c,d)};cc.TintBy.create=cc.tintBy;cc.DelayTime=cc.ActionInterval.extend({update:function(a){},reverse:function(){var a=new cc.DelayTime(this._duration);this._cloneDecoration(a);this._reverseEaseList(a);return a},clone:function(){var a=new cc.DelayTime;this._cloneDecoration(a);a.initWithDuration(this._duration);return a}});cc.delayTime=function(a){return new cc.DelayTime(a)};cc.DelayTime.create=cc.delayTime;
cc.ReverseTime=cc.ActionInterval.extend({_other:null,ctor:function(a){cc.ActionInterval.prototype.ctor.call(this);this._other=null;a&&this.initWithAction(a)},initWithAction:function(a){if(!a)throw Error("cc.ReverseTime.initWithAction(): action must be non null");if(a===this._other)throw Error("cc.ReverseTime.initWithAction(): the action was already passed in.");return cc.ActionInterval.prototype.initWithDuration.call(this,a._duration)?(this._other=a,!0):!1},clone:function(){var a=new cc.ReverseTime;
this._cloneDecoration(a);a.initWithAction(this._other.clone());return a},startWithTarget:function(a){cc.ActionInterval.prototype.startWithTarget.call(this,a);this._other.startWithTarget(a)},update:function(a){a=this._computeEaseTime(a);this._other&&this._other.update(1-a)},reverse:function(){return this._other.clone()},stop:function(){this._other.stop();cc.Action.prototype.stop.call(this)}});cc.reverseTime=function(a){return new cc.ReverseTime(a)};cc.ReverseTime.create=cc.reverseTime;
cc.Animate=cc.ActionInterval.extend({_animation:null,_nextFrame:0,_origFrame:null,_executedLoops:0,_splitTimes:null,_currFrameIndex:0,ctor:function(a){cc.ActionInterval.prototype.ctor.call(this);this._splitTimes=[];a&&this.initWithAnimation(a)},getAnimation:function(){return this._animation},setAnimation:function(a){this._animation=a},getCurrentFrameIndex:function(){return this._currFrameIndex},initWithAnimation:function(a){if(!a)throw Error("cc.Animate.initWithAnimation(): animation must be non-NULL");
var b=a.getDuration();if(this.initWithDuration(b*a.getLoops())){this._nextFrame=0;this.setAnimation(a);this._origFrame=null;this._executedLoops=0;var c=this._splitTimes,d=c.length=0,e=b/a.getTotalDelayUnits();a=a.getFrames();cc.arrayVerifyType(a,cc.AnimationFrame);for(var f=0;fa&&(a*=this._animation.getLoops(),(0|a)>this._executedLoops&&(this._nextFrame=0,this._executedLoops++),a%=1);for(var b=this._animation.getFrames(),c=b.length,d=this._splitTimes,e=this._nextFrame;eb?Math.PI-Math.asin(d/e):Math.asin(d/e);return{newRadius:c/cc.Camera.getZEye(),zenith:a,azimuth:b}},startWithTarget:function(a){cc.ActionInterval.prototype.startWithTarget.call(this,
a);a=this.sphericalRadius();isNaN(this._radius)&&(this._radius=a.newRadius);isNaN(this._angleZ)&&(this._angleZ=cc.radiansToDegrees(a.zenith));isNaN(this._angleX)&&(this._angleX=cc.radiansToDegrees(a.azimuth));this._radZ=cc.degreesToRadians(this._angleZ);this._radX=cc.degreesToRadians(this._angleX)},clone:function(){var a=new cc.OrbitCamera;a.initWithDuration(this._duration,this._radius,this._deltaRadius,this._angleZ,this._deltaAngleZ,this._angleX,this._deltaAngleX);return a},update:function(a){a=
this._computeEaseTime(a);var b=(this._radius+this._deltaRadius*a)*cc.Camera.getZEye(),c=this._radZ+this._radDeltaZ*a,d=this._radX+this._radDeltaX*a;a=Math.sin(c)*Math.cos(d)*b+this._centerXOrig;d=Math.sin(c)*Math.sin(d)*b+this._centerYOrig;b=Math.cos(c)*b+this._centerZOrig;this.target.getCamera().setEye(a,d,b);this.target.setNodeDirty()}});cc.orbitCamera=function(a,b,c,d,e,f,g){return new cc.OrbitCamera(a,b,c,d,e,f,g)};cc.OrbitCamera.create=cc.orbitCamera;cc.ActionEase=cc.ActionInterval.extend({_inner:null,ctor:function(a){cc.ActionInterval.prototype.ctor.call(this);a&&this.initWithAction(a)},initWithAction:function(a){if(!a)throw Error("cc.ActionEase.initWithAction(): action must be non nil");return this.initWithDuration(a.getDuration())?(this._inner=a,!0):!1},clone:function(){var a=new cc.ActionEase;a.initWithAction(this._inner.clone());return a},startWithTarget:function(a){cc.ActionInterval.prototype.startWithTarget.call(this,a);this._inner.startWithTarget(this.target)},
stop:function(){this._inner.stop();cc.ActionInterval.prototype.stop.call(this)},update:function(a){this._inner.update(a)},reverse:function(){return new cc.ActionEase(this._inner.reverse())},getInnerAction:function(){return this._inner}});cc.actionEase=function(a){return new cc.ActionEase(a)};cc.ActionEase.create=cc.actionEase;
cc.EaseRateAction=cc.ActionEase.extend({_rate:0,ctor:function(a,b){cc.ActionEase.prototype.ctor.call(this);void 0!==b&&this.initWithAction(a,b)},setRate:function(a){this._rate=a},getRate:function(){return this._rate},initWithAction:function(a,b){return cc.ActionEase.prototype.initWithAction.call(this,a)?(this._rate=b,!0):!1},clone:function(){var a=new cc.EaseRateAction;a.initWithAction(this._inner.clone(),this._rate);return a},reverse:function(){return new cc.EaseRateAction(this._inner.reverse(),
1/this._rate)}});cc.easeRateAction=function(a,b){return new cc.EaseRateAction(a,b)};cc.EaseRateAction.create=cc.easeRateAction;cc.EaseIn=cc.EaseRateAction.extend({update:function(a){this._inner.update(Math.pow(a,this._rate))},reverse:function(){return new cc.EaseIn(this._inner.reverse(),1/this._rate)},clone:function(){var a=new cc.EaseIn;a.initWithAction(this._inner.clone(),this._rate);return a}});cc.EaseIn.create=function(a,b){return new cc.EaseIn(a,b)};
cc.easeIn=function(a){return{_rate:a,easing:function(a){return Math.pow(a,this._rate)},reverse:function(){return cc.easeIn(1/this._rate)}}};cc.EaseOut=cc.EaseRateAction.extend({update:function(a){this._inner.update(Math.pow(a,1/this._rate))},reverse:function(){return new cc.EaseOut(this._inner.reverse(),1/this._rate)},clone:function(){var a=new cc.EaseOut;a.initWithAction(this._inner.clone(),this._rate);return a}});cc.EaseOut.create=function(a,b){return new cc.EaseOut(a,b)};
cc.easeOut=function(a){return{_rate:a,easing:function(a){return Math.pow(a,1/this._rate)},reverse:function(){return cc.easeOut(1/this._rate)}}};cc.EaseInOut=cc.EaseRateAction.extend({update:function(a){a*=2;1>a?this._inner.update(0.5*Math.pow(a,this._rate)):this._inner.update(1-0.5*Math.pow(2-a,this._rate))},clone:function(){var a=new cc.EaseInOut;a.initWithAction(this._inner.clone(),this._rate);return a},reverse:function(){return new cc.EaseInOut(this._inner.reverse(),this._rate)}});
cc.EaseInOut.create=function(a,b){return new cc.EaseInOut(a,b)};cc.easeInOut=function(a){return{_rate:a,easing:function(a){a*=2;return 1>a?0.5*Math.pow(a,this._rate):1-0.5*Math.pow(2-a,this._rate)},reverse:function(){return cc.easeInOut(this._rate)}}};
cc.EaseExponentialIn=cc.ActionEase.extend({update:function(a){this._inner.update(0===a?0:Math.pow(2,10*(a-1)))},reverse:function(){return new cc.EaseExponentialOut(this._inner.reverse())},clone:function(){var a=new cc.EaseExponentialIn;a.initWithAction(this._inner.clone());return a}});cc.EaseExponentialIn.create=function(a){return new cc.EaseExponentialIn(a)};cc._easeExponentialInObj={easing:function(a){return 0===a?0:Math.pow(2,10*(a-1))},reverse:function(){return cc._easeExponentialOutObj}};
cc.easeExponentialIn=function(){return cc._easeExponentialInObj};cc.EaseExponentialOut=cc.ActionEase.extend({update:function(a){this._inner.update(1===a?1:-Math.pow(2,-10*a)+1)},reverse:function(){return new cc.EaseExponentialIn(this._inner.reverse())},clone:function(){var a=new cc.EaseExponentialOut;a.initWithAction(this._inner.clone());return a}});cc.EaseExponentialOut.create=function(a){return new cc.EaseExponentialOut(a)};
cc._easeExponentialOutObj={easing:function(a){return 1===a?1:-Math.pow(2,-10*a)+1},reverse:function(){return cc._easeExponentialInObj}};cc.easeExponentialOut=function(){return cc._easeExponentialOutObj};
cc.EaseExponentialInOut=cc.ActionEase.extend({update:function(a){1!==a&&0!==a&&(a*=2,a=1>a?0.5*Math.pow(2,10*(a-1)):0.5*(-Math.pow(2,-10*(a-1))+2));this._inner.update(a)},reverse:function(){return new cc.EaseExponentialInOut(this._inner.reverse())},clone:function(){var a=new cc.EaseExponentialInOut;a.initWithAction(this._inner.clone());return a}});cc.EaseExponentialInOut.create=function(a){return new cc.EaseExponentialInOut(a)};
cc._easeExponentialInOutObj={easing:function(a){return 1!==a&&0!==a?(a*=2,1>a?0.5*Math.pow(2,10*(a-1)):0.5*(-Math.pow(2,-10*(a-1))+2)):a},reverse:function(){return cc._easeExponentialInOutObj}};cc.easeExponentialInOut=function(){return cc._easeExponentialInOutObj};
cc.EaseSineIn=cc.ActionEase.extend({update:function(a){a=0===a||1===a?a:-1*Math.cos(a*Math.PI/2)+1;this._inner.update(a)},reverse:function(){return new cc.EaseSineOut(this._inner.reverse())},clone:function(){var a=new cc.EaseSineIn;a.initWithAction(this._inner.clone());return a}});cc.EaseSineIn.create=function(a){return new cc.EaseSineIn(a)};cc._easeSineInObj={easing:function(a){return 0===a||1===a?a:-1*Math.cos(a*Math.PI/2)+1},reverse:function(){return cc._easeSineOutObj}};cc.easeSineIn=function(){return cc._easeSineInObj};
cc.EaseSineOut=cc.ActionEase.extend({update:function(a){a=0===a||1===a?a:Math.sin(a*Math.PI/2);this._inner.update(a)},reverse:function(){return new cc.EaseSineIn(this._inner.reverse())},clone:function(){var a=new cc.EaseSineOut;a.initWithAction(this._inner.clone());return a}});cc.EaseSineOut.create=function(a){return new cc.EaseSineOut(a)};cc._easeSineOutObj={easing:function(a){return 0===a||1===a?a:Math.sin(a*Math.PI/2)},reverse:function(){return cc._easeSineInObj}};cc.easeSineOut=function(){return cc._easeSineOutObj};
cc.EaseSineInOut=cc.ActionEase.extend({update:function(a){a=0===a||1===a?a:-0.5*(Math.cos(Math.PI*a)-1);this._inner.update(a)},clone:function(){var a=new cc.EaseSineInOut;a.initWithAction(this._inner.clone());return a},reverse:function(){return new cc.EaseSineInOut(this._inner.reverse())}});cc.EaseSineInOut.create=function(a){return new cc.EaseSineInOut(a)};cc._easeSineInOutObj={easing:function(a){return 0===a||1===a?a:-0.5*(Math.cos(Math.PI*a)-1)},reverse:function(){return cc._easeSineInOutObj}};
cc.easeSineInOut=function(){return cc._easeSineInOutObj};
cc.EaseElastic=cc.ActionEase.extend({_period:0.3,ctor:function(a,b){cc.ActionEase.prototype.ctor.call(this);a&&this.initWithAction(a,b)},getPeriod:function(){return this._period},setPeriod:function(a){this._period=a},initWithAction:function(a,b){cc.ActionEase.prototype.initWithAction.call(this,a);this._period=null==b?0.3:b;return!0},reverse:function(){cc.log("cc.EaseElastic.reverse(): it should be overridden in subclass.");return null},clone:function(){var a=new cc.EaseElastic;a.initWithAction(this._inner.clone(),
this._period);return a}});cc.EaseElastic.create=function(a,b){return new cc.EaseElastic(a,b)};cc.EaseElasticIn=cc.EaseElastic.extend({update:function(a){var b=0;0===a||1===a?b=a:(b=this._period/4,a-=1,b=-Math.pow(2,10*a)*Math.sin((a-b)*Math.PI*2/this._period));this._inner.update(b)},reverse:function(){return new cc.EaseElasticOut(this._inner.reverse(),this._period)},clone:function(){var a=new cc.EaseElasticIn;a.initWithAction(this._inner.clone(),this._period);return a}});
cc.EaseElasticIn.create=function(a,b){return new cc.EaseElasticIn(a,b)};cc._easeElasticInObj={easing:function(a){if(0===a||1===a)return a;a-=1;return-Math.pow(2,10*a)*Math.sin((a-0.075)*Math.PI*2/0.3)},reverse:function(){return cc._easeElasticOutObj}};cc.easeElasticIn=function(a){return a&&0.3!==a?{_period:a,easing:function(a){if(0===a||1===a)return a;a-=1;return-Math.pow(2,10*a)*Math.sin((a-this._period/4)*Math.PI*2/this._period)},reverse:function(){return cc.easeElasticOut(this._period)}}:cc._easeElasticInObj};
cc.EaseElasticOut=cc.EaseElastic.extend({update:function(a){var b=0;0===a||1===a?b=a:(b=this._period/4,b=Math.pow(2,-10*a)*Math.sin((a-b)*Math.PI*2/this._period)+1);this._inner.update(b)},reverse:function(){return new cc.EaseElasticIn(this._inner.reverse(),this._period)},clone:function(){var a=new cc.EaseElasticOut;a.initWithAction(this._inner.clone(),this._period);return a}});cc.EaseElasticOut.create=function(a,b){return new cc.EaseElasticOut(a,b)};
cc._easeElasticOutObj={easing:function(a){return 0===a||1===a?a:Math.pow(2,-10*a)*Math.sin((a-0.075)*Math.PI*2/0.3)+1},reverse:function(){return cc._easeElasticInObj}};cc.easeElasticOut=function(a){return a&&0.3!==a?{_period:a,easing:function(a){return 0===a||1===a?a:Math.pow(2,-10*a)*Math.sin((a-this._period/4)*Math.PI*2/this._period)+1},reverse:function(){return cc.easeElasticIn(this._period)}}:cc._easeElasticOutObj};
cc.EaseElasticInOut=cc.EaseElastic.extend({update:function(a){var b=0,b=this._period;if(0===a||1===a)b=a;else{b||(b=this._period=0.3*1.5);var c=b/4;a=2*a-1;b=0>a?-0.5*Math.pow(2,10*a)*Math.sin((a-c)*Math.PI*2/b):Math.pow(2,-10*a)*Math.sin((a-c)*Math.PI*2/b)*0.5+1}this._inner.update(b)},reverse:function(){return new cc.EaseElasticInOut(this._inner.reverse(),this._period)},clone:function(){var a=new cc.EaseElasticInOut;a.initWithAction(this._inner.clone(),this._period);return a}});
cc.EaseElasticInOut.create=function(a,b){return new cc.EaseElasticInOut(a,b)};cc.easeElasticInOut=function(a){return{_period:a||0.3,easing:function(a){var c=0,c=this._period;if(0===a||1===a)c=a;else{c||(c=this._period=0.3*1.5);var d=c/4;a=2*a-1;c=0>a?-0.5*Math.pow(2,10*a)*Math.sin((a-d)*Math.PI*2/c):Math.pow(2,-10*a)*Math.sin((a-d)*Math.PI*2/c)*0.5+1}return c},reverse:function(){return cc.easeElasticInOut(this._period)}}};
cc.EaseBounce=cc.ActionEase.extend({bounceTime:function(a){if(a<1/2.75)return 7.5625*a*a;if(a<2/2.75)return a-=1.5/2.75,7.5625*a*a+0.75;if(a<2.5/2.75)return a-=2.25/2.75,7.5625*a*a+0.9375;a-=2.625/2.75;return 7.5625*a*a+0.984375},clone:function(){var a=new cc.EaseBounce;a.initWithAction(this._inner.clone());return a},reverse:function(){return new cc.EaseBounce(this._inner.reverse())}});cc.EaseBounce.create=function(a){return new cc.EaseBounce(a)};
cc.EaseBounceIn=cc.EaseBounce.extend({update:function(a){a=1-this.bounceTime(1-a);this._inner.update(a)},reverse:function(){return new cc.EaseBounceOut(this._inner.reverse())},clone:function(){var a=new cc.EaseBounceIn;a.initWithAction(this._inner.clone());return a}});cc.EaseBounceIn.create=function(a){return new cc.EaseBounceIn(a)};
cc._bounceTime=function(a){if(a<1/2.75)return 7.5625*a*a;if(a<2/2.75)return a-=1.5/2.75,7.5625*a*a+0.75;if(a<2.5/2.75)return a-=2.25/2.75,7.5625*a*a+0.9375;a-=2.625/2.75;return 7.5625*a*a+0.984375};cc._easeBounceInObj={easing:function(a){return 1-cc._bounceTime(1-a)},reverse:function(){return cc._easeBounceOutObj}};cc.easeBounceIn=function(){return cc._easeBounceInObj};
cc.EaseBounceOut=cc.EaseBounce.extend({update:function(a){a=this.bounceTime(a);this._inner.update(a)},reverse:function(){return new cc.EaseBounceIn(this._inner.reverse())},clone:function(){var a=new cc.EaseBounceOut;a.initWithAction(this._inner.clone());return a}});cc.EaseBounceOut.create=function(a){return new cc.EaseBounceOut(a)};cc._easeBounceOutObj={easing:function(a){return cc._bounceTime(a)},reverse:function(){return cc._easeBounceInObj}};cc.easeBounceOut=function(){return cc._easeBounceOutObj};
cc.EaseBounceInOut=cc.EaseBounce.extend({update:function(a){var b=0,b=0.5>a?0.5*(1-this.bounceTime(1-2*a)):0.5*this.bounceTime(2*a-1)+0.5;this._inner.update(b)},clone:function(){var a=new cc.EaseBounceInOut;a.initWithAction(this._inner.clone());return a},reverse:function(){return new cc.EaseBounceInOut(this._inner.reverse())}});cc.EaseBounceInOut.create=function(a){return new cc.EaseBounceInOut(a)};
cc._easeBounceInOutObj={easing:function(a){return a=0.5>a?0.5*(1-cc._bounceTime(1-2*a)):0.5*cc._bounceTime(2*a-1)+0.5},reverse:function(){return cc._easeBounceInOutObj}};cc.easeBounceInOut=function(){return cc._easeBounceInOutObj};cc.EaseBackIn=cc.ActionEase.extend({update:function(a){this._inner.update(0===a||1===a?a:a*a*(2.70158*a-1.70158))},reverse:function(){return new cc.EaseBackOut(this._inner.reverse())},clone:function(){var a=new cc.EaseBackIn;a.initWithAction(this._inner.clone());return a}});
cc.EaseBackIn.create=function(a){return new cc.EaseBackIn(a)};cc._easeBackInObj={easing:function(a){return 0===a||1===a?a:a*a*(2.70158*a-1.70158)},reverse:function(){return cc._easeBackOutObj}};cc.easeBackIn=function(){return cc._easeBackInObj};
cc.EaseBackOut=cc.ActionEase.extend({update:function(a){a-=1;this._inner.update(a*a*(2.70158*a+1.70158)+1)},reverse:function(){return new cc.EaseBackIn(this._inner.reverse())},clone:function(){var a=new cc.EaseBackOut;a.initWithAction(this._inner.clone());return a}});cc.EaseBackOut.create=function(a){return new cc.EaseBackOut(a)};cc._easeBackOutObj={easing:function(a){a-=1;return a*a*(2.70158*a+1.70158)+1},reverse:function(){return cc._easeBackInObj}};cc.easeBackOut=function(){return cc._easeBackOutObj};
cc.EaseBackInOut=cc.ActionEase.extend({update:function(a){a*=2;1>a?this._inner.update(a*a*(3.5949095*a-2.5949095)/2):(a-=2,this._inner.update(a*a*(3.5949095*a+2.5949095)/2+1))},clone:function(){var a=new cc.EaseBackInOut;a.initWithAction(this._inner.clone());return a},reverse:function(){return new cc.EaseBackInOut(this._inner.reverse())}});cc.EaseBackInOut.create=function(a){return new cc.EaseBackInOut(a)};
cc._easeBackInOutObj={easing:function(a){a*=2;if(1>a)return a*a*(3.5949095*a-2.5949095)/2;a-=2;return a*a*(3.5949095*a+2.5949095)/2+1},reverse:function(){return cc._easeBackInOutObj}};cc.easeBackInOut=function(){return cc._easeBackInOutObj};
cc.EaseBezierAction=cc.ActionEase.extend({_p0:null,_p1:null,_p2:null,_p3:null,ctor:function(a){cc.ActionEase.prototype.ctor.call(this,a)},_updateTime:function(a,b,c,d,e){return Math.pow(1-e,3)*a+3*e*Math.pow(1-e,2)*b+3*Math.pow(e,2)*(1-e)*c+Math.pow(e,3)*d},update:function(a){a=this._updateTime(this._p0,this._p1,this._p2,this._p3,a);this._inner.update(a)},clone:function(){var a=new cc.EaseBezierAction;a.initWithAction(this._inner.clone());a.setBezierParamer(this._p0,this._p1,this._p2,this._p3);return a},
reverse:function(){var a=new cc.EaseBezierAction(this._inner.reverse());a.setBezierParamer(this._p3,this._p2,this._p1,this._p0);return a},setBezierParamer:function(a,b,c,d){this._p0=a||0;this._p1=b||0;this._p2=c||0;this._p3=d||0}});cc.EaseBezierAction.create=function(a){return new cc.EaseBezierAction(a)};cc.easeBezierAction=function(a,b,c,d){return{easing:function(e){return cc.EaseBezierAction.prototype._updateTime(a,b,c,d,e)},reverse:function(){return cc.easeBezierAction(d,c,b,a)}}};
cc.EaseQuadraticActionIn=cc.ActionEase.extend({_updateTime:function(a){return Math.pow(a,2)},update:function(a){this._inner.update(this._updateTime(a))},clone:function(){var a=new cc.EaseQuadraticActionIn;a.initWithAction(this._inner.clone());return a},reverse:function(){return new cc.EaseQuadraticActionIn(this._inner.reverse())}});cc.EaseQuadraticActionIn.create=function(a){return new cc.EaseQuadraticActionIn(a)};cc._easeQuadraticActionIn={easing:cc.EaseQuadraticActionIn.prototype._updateTime,reverse:function(){return cc._easeQuadraticActionIn}};
cc.easeQuadraticActionIn=function(){return cc._easeQuadraticActionIn};cc.EaseQuadraticActionOut=cc.ActionEase.extend({_updateTime:function(a){return-a*(a-2)},update:function(a){this._inner.update(this._updateTime(a))},clone:function(){var a=new cc.EaseQuadraticActionOut;a.initWithAction();return a},reverse:function(){return new cc.EaseQuadraticActionOut(this._inner.reverse())}});cc.EaseQuadraticActionOut.create=function(a){return new cc.EaseQuadraticActionOut(a)};
cc._easeQuadraticActionOut={easing:cc.EaseQuadraticActionOut.prototype._updateTime,reverse:function(){return cc._easeQuadraticActionOut}};cc.easeQuadraticActionOut=function(){return cc._easeQuadraticActionOut};
cc.EaseQuadraticActionInOut=cc.ActionEase.extend({_updateTime:function(a){var b=a;a*=2;1>a?b=a*a*0.5:(--a,b=-0.5*(a*(a-2)-1));return b},update:function(a){this._inner.update(this._updateTime(a))},clone:function(){var a=new cc.EaseQuadraticActionInOut;a.initWithAction(this._inner.clone());return a},reverse:function(){return new cc.EaseQuadraticActionInOut(this._inner.reverse())}});cc.EaseQuadraticActionInOut.create=function(a){return new cc.EaseQuadraticActionInOut(a)};
cc._easeQuadraticActionInOut={easing:cc.EaseQuadraticActionInOut.prototype._updateTime,reverse:function(){return cc._easeQuadraticActionInOut}};cc.easeQuadraticActionInOut=function(){return cc._easeQuadraticActionInOut};cc.EaseQuarticActionIn=cc.ActionEase.extend({_updateTime:function(a){return a*a*a*a},update:function(a){this._inner.update(this._updateTime(a))},clone:function(){var a=new cc.EaseQuarticActionIn;a.initWithAction(this._inner.clone());return a},reverse:function(){return new cc.EaseQuarticActionIn(this._inner.reverse())}});
cc.EaseQuarticActionIn.create=function(a){return new cc.EaseQuarticActionIn(a)};cc._easeQuarticActionIn={easing:cc.EaseQuarticActionIn.prototype._updateTime,reverse:function(){return cc._easeQuarticActionIn}};cc.easeQuarticActionIn=function(){return cc._easeQuarticActionIn};
cc.EaseQuarticActionOut=cc.ActionEase.extend({_updateTime:function(a){a-=1;return-(a*a*a*a-1)},update:function(a){this._inner.update(this._updateTime(a))},clone:function(){var a=new cc.EaseQuarticActionOut;a.initWithAction(this._inner.clone());return a},reverse:function(){return new cc.EaseQuarticActionOut(this._inner.reverse())}});cc.EaseQuarticActionOut.create=function(a){return new cc.EaseQuarticActionOut(a)};cc._easeQuarticActionOut={easing:cc.EaseQuarticActionOut.prototype._updateTime,reverse:function(){return cc._easeQuarticActionOut}};
cc.easeQuarticActionOut=function(){return cc._easeQuarticActionOut};cc.EaseQuarticActionInOut=cc.ActionEase.extend({_updateTime:function(a){a*=2;if(1>a)return 0.5*a*a*a*a;a-=2;return-0.5*(a*a*a*a-2)},update:function(a){this._inner.update(this._updateTime(a))},clone:function(){var a=new cc.EaseQuarticActionInOut;a.initWithAction(this._inner.clone());return a},reverse:function(){return new cc.EaseQuarticActionInOut(this._inner.reverse())}});cc.EaseQuarticActionInOut.create=function(a){return new cc.EaseQuarticActionInOut(a)};
cc._easeQuarticActionInOut={easing:cc.EaseQuarticActionInOut.prototype._updateTime,reverse:function(){return cc._easeQuarticActionInOut}};cc.easeQuarticActionInOut=function(){return cc._easeQuarticActionInOut};cc.EaseQuinticActionIn=cc.ActionEase.extend({_updateTime:function(a){return a*a*a*a*a},update:function(a){this._inner.update(this._updateTime(a))},clone:function(){var a=new cc.EaseQuinticActionIn;a.initWithAction(this._inner.clone());return a},reverse:function(){return new cc.EaseQuinticActionIn(this._inner.reverse())}});
cc.EaseQuinticActionIn.create=function(a){return new cc.EaseQuinticActionIn(a)};cc._easeQuinticActionIn={easing:cc.EaseQuinticActionIn.prototype._updateTime,reverse:function(){return cc._easeQuinticActionIn}};cc.easeQuinticActionIn=function(){return cc._easeQuinticActionIn};
cc.EaseQuinticActionOut=cc.ActionEase.extend({_updateTime:function(a){a-=1;return a*a*a*a*a+1},update:function(a){this._inner.update(this._updateTime(a))},clone:function(){var a=new cc.EaseQuinticActionOut;a.initWithAction(this._inner.clone());return a},reverse:function(){return new cc.EaseQuinticActionOut(this._inner.reverse())}});cc.EaseQuinticActionOut.create=function(a){return new cc.EaseQuinticActionOut(a)};cc._easeQuinticActionOut={easing:cc.EaseQuinticActionOut.prototype._updateTime,reverse:function(){return cc._easeQuinticActionOut}};
cc.easeQuinticActionOut=function(){return cc._easeQuinticActionOut};cc.EaseQuinticActionInOut=cc.ActionEase.extend({_updateTime:function(a){a*=2;if(1>a)return 0.5*a*a*a*a*a;a-=2;return 0.5*(a*a*a*a*a+2)},update:function(a){this._inner.update(this._updateTime(a))},clone:function(){var a=new cc.EaseQuinticActionInOut;a.initWithAction(this._inner.clone());return a},reverse:function(){return new cc.EaseQuinticActionInOut(this._inner.reverse())}});cc.EaseQuinticActionInOut.create=function(a){return new cc.EaseQuinticActionInOut(a)};
cc._easeQuinticActionInOut={easing:cc.EaseQuinticActionInOut.prototype._updateTime,reverse:function(){return cc._easeQuinticActionInOut}};cc.easeQuinticActionInOut=function(){return cc._easeQuinticActionInOut};cc.EaseCircleActionIn=cc.ActionEase.extend({_updateTime:function(a){return-1*(Math.sqrt(1-a*a)-1)},update:function(a){this._inner.update(this._updateTime(a))},clone:function(){var a=new cc.EaseCircleActionIn;a.initWithAction(this._inner.clone());return a},reverse:function(){return new cc.EaseCircleActionIn(this._inner.reverse())}});
cc.EaseCircleActionIn.create=function(a){return new cc.EaseCircleActionIn(a)};cc._easeCircleActionIn={easing:cc.EaseCircleActionIn.prototype._updateTime,reverse:function(){return cc._easeCircleActionIn}};cc.easeCircleActionIn=function(){return cc._easeCircleActionIn};
cc.EaseCircleActionOut=cc.ActionEase.extend({_updateTime:function(a){a-=1;return Math.sqrt(1-a*a)},update:function(a){this._inner.update(this._updateTime(a))},clone:function(){var a=new cc.EaseCircleActionOut;a.initWithAction(this._inner.clone());return a},reverse:function(){return new cc.EaseCircleActionOut(this._inner.reverse())}});cc.EaseCircleActionOut.create=function(a){return new cc.EaseCircleActionOut(a)};cc._easeCircleActionOut={easing:cc.EaseCircleActionOut.prototype._updateTime,reverse:function(){return cc._easeCircleActionOut}};
cc.easeCircleActionOut=function(){return cc._easeCircleActionOut};cc.EaseCircleActionInOut=cc.ActionEase.extend({_updateTime:function(a){a*=2;if(1>a)return-0.5*(Math.sqrt(1-a*a)-1);a-=2;return 0.5*(Math.sqrt(1-a*a)+1)},update:function(a){this._inner.update(this._updateTime(a))},clone:function(){var a=new cc.EaseCircleActionInOut;a.initWithAction(this._inner.clone());return a},reverse:function(){return new cc.EaseCircleActionInOut(this._inner.reverse())}});cc.EaseCircleActionInOut.create=function(a){return new cc.EaseCircleActionInOut(a)};
cc._easeCircleActionInOut={easing:cc.EaseCircleActionInOut.prototype._updateTime,reverse:function(){return cc._easeCircleActionInOut}};cc.easeCircleActionInOut=function(){return cc._easeCircleActionInOut};cc.EaseCubicActionIn=cc.ActionEase.extend({_updateTime:function(a){return a*a*a},update:function(a){this._inner.update(this._updateTime(a))},clone:function(){var a=new cc.EaseCubicActionIn;a.initWithAction(this._inner.clone());return a},reverse:function(){return new cc.EaseCubicActionIn(this._inner.reverse())}});
cc.EaseCubicActionIn.create=function(a){return new cc.EaseCubicActionIn(a)};cc._easeCubicActionIn={easing:cc.EaseCubicActionIn.prototype._updateTime,reverse:function(){return cc._easeCubicActionIn}};cc.easeCubicActionIn=function(){return cc._easeCubicActionIn};
cc.EaseCubicActionOut=cc.ActionEase.extend({_updateTime:function(a){a-=1;return a*a*a+1},update:function(a){this._inner.update(this._updateTime(a))},clone:function(){var a=new cc.EaseCubicActionOut;a.initWithAction(this._inner.clone());return a},reverse:function(){return new cc.EaseCubicActionOut(this._inner.reverse())}});cc.EaseCubicActionOut.create=function(a){return new cc.EaseCubicActionOut(a)};cc._easeCubicActionOut={easing:cc.EaseCubicActionOut.prototype._updateTime,reverse:function(){return cc._easeCubicActionOut}};
cc.easeCubicActionOut=function(){return cc._easeCubicActionOut};cc.EaseCubicActionInOut=cc.ActionEase.extend({_updateTime:function(a){a*=2;if(1>a)return 0.5*a*a*a;a-=2;return 0.5*(a*a*a+2)},update:function(a){this._inner.update(this._updateTime(a))},clone:function(){var a=new cc.EaseCubicActionInOut;a.initWithAction(this._inner.clone());return a},reverse:function(){return new cc.EaseCubicActionInOut(this._inner.reverse())}});cc.EaseCubicActionInOut.create=function(a){return new cc.EaseCubicActionInOut(a)};
cc._easeCubicActionInOut={easing:cc.EaseCubicActionInOut.prototype._updateTime,reverse:function(){return cc._easeCubicActionInOut}};cc.easeCubicActionInOut=function(){return cc._easeCubicActionInOut};cc.cardinalSplineAt=function(a,b,c,d,e,f){var g=f*f,h=g*f,k=(1-e)/2;e=k*(-h+2*g-f);var m=k*(-h+g)+(2*h-3*g+1);f=k*(h-2*g+f)+(-2*h+3*g);g=k*(h-g);return cc.p(a.x*e+b.x*m+c.x*f+d.x*g,a.y*e+b.y*m+c.y*f+d.y*g)};cc.reverseControlPoints=function(a){for(var b=[],c=a.length-1;0<=c;c--)b.push(cc.p(a[c].x,a[c].y));return b};cc.cloneControlPoints=function(a){for(var b=[],c=0;cg?(e=cc.p(0,0),d=cc.p(0,1),h=cc.p(1,0),k=cc.p(1,1)):(h=cc.p(0,0),k=cc.p(0,1),e=cc.p(1,0),d=cc.p(1,1),f=g);b.x=f-f*c;b.z=Math.abs(parseFloat(f*a/4));a=this.originalVertex(e);a.x=b.x;a.z+=b.z;this.setVertex(e,a);a=this.originalVertex(d);a.x=b.x;a.z+=b.z;this.setVertex(d,a);a=this.originalVertex(h);a.x-=b.x;a.z-=b.z;this.setVertex(h,a);a=this.originalVertex(k);a.x-=b.x;a.z-=b.z;this.setVertex(k,
a)}});cc.flipX3D=function(a){return new cc.FlipX3D(a)};cc.FlipX3D.create=cc.flipX3D;
cc.FlipY3D=cc.FlipX3D.extend({ctor:function(a){void 0!==a?cc.GridAction.prototype.ctor.call(this,a,cc.size(1,1)):cc.GridAction.prototype.ctor.call(this)},update:function(a){var b=Math.PI*a;a=Math.sin(b);var c=Math.cos(b/2),b=new cc.Vertex3F,d=cc.p(0,0);d.x=d.y=1;var e=this.originalVertex(d);d.x=d.y=0;var d=this.originalVertex(d),f=e.y,g=d.y,h,k;f>g?(e=cc.p(0,0),d=cc.p(0,1),h=cc.p(1,0),k=cc.p(1,1)):(d=cc.p(0,0),e=cc.p(0,1),k=cc.p(1,0),h=cc.p(1,1),f=g);b.y=f-f*c;b.z=Math.abs(parseFloat(f*a)/4);a=this.originalVertex(e);
a.y=b.y;a.z+=b.z;this.setVertex(e,a);a=this.originalVertex(d);a.y-=b.y;a.z-=b.z;this.setVertex(d,a);a=this.originalVertex(h);a.y=b.y;a.z+=b.z;this.setVertex(h,a);a=this.originalVertex(k);a.y-=b.y;a.z-=b.z;this.setVertex(k,a)}});cc.flipY3D=function(a){return new cc.FlipY3D(a)};cc.FlipY3D.create=cc.flipY3D;
cc.Lens3D=cc.Grid3DAction.extend({_position:null,_radius:0,_lensEffect:0,_concave:!1,_dirty:!1,ctor:function(a,b,c,d){cc.GridAction.prototype.ctor.call(this);this._position=cc.p(0,0);void 0!==d&&this.initWithDuration(a,b,c,d)},getLensEffect:function(){return this._lensEffect},setLensEffect:function(a){this._lensEffect=a},setConcave:function(a){this._concave=a},getPosition:function(){return this._position},setPosition:function(a){cc.pointEqualToPoint(a,this._position)||(this._position.x=a.x,this._position.y=
a.y,this._dirty=!0)},initWithDuration:function(a,b,c,d){return cc.Grid3DAction.prototype.initWithDuration.call(this,a,b)?(this.setPosition(c),this._radius=d,this._lensEffect=0.7,this._dirty=!0):!1},update:function(a){if(this._dirty){a=this._gridSize.width;for(var b=this._gridSize.height,c=this._radius,d=this._lensEffect,e=cc.p(0,0),f=cc.p(0,0),g,h,k,m=0;md?this.transformTile(c,d):this.turnOnTile(c)}});cc.fadeOutTRTiles=function(a,b){return new cc.FadeOutTRTiles(a,b)};cc.FadeOutTRTiles.create=cc.fadeOutTRTiles;
cc.FadeOutBLTiles=cc.FadeOutTRTiles.extend({testFunc:function(a,b){var c=this._gridSize.width*(1-b),d=this._gridSize.height*(1-b);return 0===c+d?0:0===a.x+a.y?1:Math.pow((c+d)/(a.x+a.y),6)}});cc.fadeOutBLTiles=function(a,b){return new cc.FadeOutBLTiles(a,b)};cc.FadeOutBLTiles.create=cc.fadeOutBLTiles;
cc.FadeOutUpTiles=cc.FadeOutTRTiles.extend({testFunc:function(a,b){var c=this._gridSize.height*b;return c===this._gridSize.height?0:0===c?1:Math.pow(a.y/c,6)},transformTile:function(a,b){var c=this.originalTile(a),d=this.target.grid.getStep();c.bl.y+=d.y/2*(1-b);c.br.y+=d.y/2*(1-b);c.tl.y-=d.y/2*(1-b);c.tr.y-=d.y/2*(1-b);this.setTile(a,c)}});cc.fadeOutUpTiles=function(a,b){return new cc.FadeOutUpTiles(a,b)};cc.FadeOutUpTiles.create=cc.fadeOutUpTiles;
cc.FadeOutDownTiles=cc.FadeOutUpTiles.extend({testFunc:function(a,b){var c=this._gridSize.height*(1-b);return 0===c?0:0===a.y?1:Math.pow(c/a.y,6)}});cc.fadeOutDownTiles=function(a,b){return new cc.FadeOutDownTiles(a,b)};cc.FadeOutDownTiles.create=cc.fadeOutDownTiles;
cc.TurnOffTiles=cc.TiledGrid3DAction.extend({_seed:null,_tilesCount:0,_tilesOrder:null,ctor:function(a,b,c){cc.GridAction.prototype.ctor.call(this);this._tilesOrder=[];void 0!==b&&this.initWithDuration(a,b,c)},initWithDuration:function(a,b,c){return cc.TiledGrid3DAction.prototype.initWithDuration.call(this,a,b)?(this._seed=c||0,this._tilesOrder.length=0,!0):!1},shuffle:function(a,b){for(var c=b-1;0<=c;c--){var d=0|cc.rand()%(c+1),e=a[c];a[c]=a[d];a[d]=e}},turnOnTile:function(a){this.setTile(a,this.originalTile(a))},
turnOffTile:function(a){this.setTile(a,new cc.Quad3)},startWithTarget:function(a){cc.TiledGrid3DAction.prototype.startWithTarget.call(this,a);this._tilesCount=this._gridSize.width*this._gridSize.height;a=this._tilesOrder;for(var b=a.length=0;bk.z&&(k.z=0.5);k.x+=this.getGridRect().x;this.setVertex(f,k)}}});cc.pageTurn3D=function(a,b){return new cc.PageTurn3D(a,b)};cc.PageTurn3D.create=cc.pageTurn3D;cc.ProgressTimer=cc.Node.extend({_type:null,_percentage:0,_sprite:null,_midPoint:null,_barChangeRate:null,_reverseDirection:!1,_className:"ProgressTimer",ctor:function(a){cc.Node.prototype.ctor.call(this);this._type=cc.ProgressTimer.TYPE_RADIAL;this._percentage=0;this._midPoint=cc.p(0,0);this._barChangeRate=cc.p(0,0);this._reverseDirection=!1;this._sprite=null;a&&this.initWithSprite(a)},getMidpoint:function(){return cc.p(this._midPoint.x,this._midPoint.y)},setMidpoint:function(a){this._midPoint=cc.pClamp(a,
cc.p(0,0),cc.p(1,1))},getBarChangeRate:function(){return cc.p(this._barChangeRate.x,this._barChangeRate.y)},setBarChangeRate:function(a){this._barChangeRate=cc.pClamp(a,cc.p(0,0),cc.p(1,1))},getType:function(){return this._type},getPercentage:function(){return this._percentage},getSprite:function(){return this._sprite},setPercentage:function(a){this._percentage!==a&&(this._percentage=cc.clampf(a,0,100),this._renderCmd._updateProgress())},setOpacityModifyRGB:function(a){},isOpacityModifyRGB:function(){return!1},
isReverseDirection:function(){return this._reverseDirection},setColor:function(a){this._sprite.color=a;this._renderCmd.setDirtyFlag(cc.Node._dirtyFlags.colorDirty)},setOpacity:function(a){this._sprite.opacity=a;this._renderCmd.setDirtyFlag(cc.Node._dirtyFlags.opacityDirty)},getColor:function(){return this._sprite.color},getOpacity:function(){return this._sprite.opacity},setReverseProgress:function(a){this._reverseDirection!==a&&(this._reverseDirection=a,this._renderCmd.releaseData())},setSprite:function(a){this._sprite!==
a&&((this._sprite=a)?this.setContentSize(a.width,a.height):this.setContentSize(0,0),this._renderCmd.releaseData())},setType:function(a){a!==this._type&&(this._type=a,this._renderCmd.releaseData())},setReverseDirection:function(a){this._reverseDirection!==a&&(this._reverseDirection=a,this._renderCmd.releaseData())},initWithSprite:function(a){this.percentage=0;this.setAnchorPoint(0.5,0.5);this._type=cc.ProgressTimer.TYPE_RADIAL;this._reverseDirection=!1;this.midPoint=cc.p(0.5,0.5);this.barChangeRate=
cc.p(1,1);this.setSprite(a);this._renderCmd.initCmd();return!0},_createRenderCmd:function(){return cc._renderType===cc._RENDER_TYPE_CANVAS?new cc.ProgressTimer.CanvasRenderCmd(this):new cc.ProgressTimer.WebGLRenderCmd(this)}});_p=cc.ProgressTimer.prototype;cc.defineGetterSetter(_p,"midPoint",_p.getMidpoint,_p.setMidpoint);cc.defineGetterSetter(_p,"barChangeRate",_p.getBarChangeRate,_p.setBarChangeRate);cc.defineGetterSetter(_p,"type",_p.getType,_p.setType);
cc.defineGetterSetter(_p,"percentage",_p.getPercentage,_p.setPercentage);cc.defineGetterSetter(_p,"sprite",_p.getSprite,_p.setSprite);cc.defineGetterSetter(_p,"reverseDir",_p.isReverseDirection,_p.setReverseDirection);cc.ProgressTimer.create=function(a){return new cc.ProgressTimer(a)};cc.ProgressTimer.TEXTURE_COORDS_COUNT=4;cc.ProgressTimer.TEXTURE_COORDS=75;cc.ProgressTimer.TYPE_RADIAL=0;cc.ProgressTimer.TYPE_BAR=1;cc.ProgressTo=cc.ActionInterval.extend({_to:0,_from:0,ctor:function(a,b){cc.ActionInterval.prototype.ctor.call(this);this._from=this._to=0;void 0!==b&&this.initWithDuration(a,b)},initWithDuration:function(a,b){return cc.ActionInterval.prototype.initWithDuration.call(this,a)?(this._to=b,!0):!1},clone:function(){var a=new cc.ProgressTo;a.initWithDuration(this._duration,this._to);return a},reverse:function(){cc.log("cc.ProgressTo.reverse(): reverse hasn't been supported.");return null},startWithTarget:function(a){cc.ActionInterval.prototype.startWithTarget.call(this,
a);this._from=a.percentage},update:function(a){this.target instanceof cc.ProgressTimer&&(this.target.percentage=this._from+(this._to-this._from)*a)}});cc.progressTo=function(a,b){return new cc.ProgressTo(a,b)};cc.ProgressTo.create=cc.progressTo;
cc.ProgressFromTo=cc.ActionInterval.extend({_to:0,_from:0,ctor:function(a,b,c){cc.ActionInterval.prototype.ctor.call(this);this._from=this._to=0;void 0!==c&&this.initWithDuration(a,b,c)},initWithDuration:function(a,b,c){return cc.ActionInterval.prototype.initWithDuration.call(this,a)?(this._to=c,this._from=b,!0):!1},clone:function(){var a=new cc.ProgressFromTo;a.initWithDuration(this._duration,this._from,this._to);return a},reverse:function(){return cc.progressFromTo(this._duration,this._to,this._from)},
startWithTarget:function(a){cc.ActionInterval.prototype.startWithTarget.call(this,a)},update:function(a){this.target instanceof cc.ProgressTimer&&(this.target.percentage=this._from+(this._to-this._from)*a)}});cc.progressFromTo=function(a,b,c){return new cc.ProgressFromTo(a,b,c)};cc.ProgressFromTo.create=cc.progressFromTo;(function(){cc.ProgressTimer.CanvasRenderCmd=function(a){cc.Node.CanvasRenderCmd.call(this,a);this._needDraw=!0;this._PI180=Math.PI/180;this._barRect=cc.rect(0,0,0,0);this._origin=cc.p(0,0);this._radius=0;this._endAngle=this._startAngle=270;this._counterClockWise=!1};var a=cc.ProgressTimer.CanvasRenderCmd.prototype=Object.create(cc.Node.CanvasRenderCmd.prototype);a.constructor=cc.ProgressTimer.CanvasRenderCmd;a.rendering=function(a,c,d){a=a||cc._renderContext;var e=a.getContext(),f=this._node,g=f._sprite,
h=g._renderCmd._textureCoord,k=g._renderCmd._displayedOpacity/255;if(0!==h.width&&0!==h.height&&g._texture&&h.validRect&&0!==k){a.setTransform(this._worldTransform,c,d);a.setCompositeOperation(g._blendFuncStr);a.setGlobalAlpha(k);var m=g._rect,n=g._offsetPosition,k=n.x,p=-n.y-m.height,t=m.width,m=m.height;a.save();g._flippedX&&(k=-k-t,e.scale(-1,1));g._flippedY&&(p=n.y,e.scale(1,-1));f._type===cc.ProgressTimer.TYPE_BAR?(f=this._barRect,e.beginPath(),e.rect(f.x*c,f.y*d,f.width*c,f.height*d),e.clip(),
e.closePath()):f._type===cc.ProgressTimer.TYPE_RADIAL&&(f=this._origin.x*c,n=this._origin.y*d,e.beginPath(),e.arc(f,n,this._radius*d,this._PI180*this._startAngle,this._PI180*this._endAngle,this._counterClockWise),e.lineTo(f,n),e.clip(),e.closePath());f=g._texture.getHtmlElementObj();g._renderCmd._colorized?e.drawImage(f,0,0,h.width,h.height,k*c,p*d,t*c,m*d):e.drawImage(f,h.renderX,h.renderY,h.width,h.height,k*c,p*d,t*c,m*d);a.restore();cc.g_NumberOfDraws++}};a.releaseData=function(){};a.initCmd=function(){};
a._updateProgress=function(){var a=this._node,c=a._sprite,d=c.width,e=c.height,f=a._midPoint;if(a._type===cc.ProgressTimer.TYPE_RADIAL){this._radius=Math.round(Math.sqrt(d*d+e*e));var g,h=!1,k=this._origin;k.x=d*f.x;k.y=-e*f.y;a._reverseDirection?(g=270,f=270-3.6*a._percentage):(f=-90,g=-90+3.6*a._percentage);c._flippedX&&(k.x-=2*d*a._midPoint.x,f=-f-180,g=-g-180,h=!h);c._flippedY&&(k.y+=2*e*a._midPoint.y,h=!h,f=-f,g=-g);this._startAngle=f;this._endAngle=g;this._counterClockWise=h}else h=a._barChangeRate,
k=a._percentage/100,a=this._barRect,h=cc.size(d*(1-h.x),e*(1-h.y)),k=cc.size((d-h.width)*k,(e-h.height)*k),h=cc.size(h.width+k.width,h.height+k.height),g=cc.p(d*f.x,e*f.y),k=g.x-h.width/2,0.5=d-g.x&&(k=d-h.width),d=g.y-h.height/2,0.5=e-g.y&&(d=e-h.height),a.x=0,e=1,c._flippedX&&(a.x-=h.width,e=-1),0d.x&&(a.x+=-d.x,d.x=0);1d.y&&(a.y+=-d.y,d.y=0);1c;c++)f[c]=new cc.V2F_C4B_T2F(null,null,null,this._vertexArrayBuffer,c*e);f[0].texCoords=this._textureCoordFromAlphaPoint(cc.p(0,
1));f[0].vertices=this._vertexFromAlphaPoint(cc.p(0,1));f[1].texCoords=this._textureCoordFromAlphaPoint(cc.p(0,0));f[1].vertices=this._vertexFromAlphaPoint(cc.p(0,0));f[6].texCoords=this._textureCoordFromAlphaPoint(cc.p(1,1));f[6].vertices=this._vertexFromAlphaPoint(cc.p(1,1));f[7].texCoords=this._textureCoordFromAlphaPoint(cc.p(1,0));f[7].vertices=this._vertexFromAlphaPoint(cc.p(1,0));this._vertexData=f}c=this._vertexData;c[2].texCoords=this._textureCoordFromAlphaPoint(cc.p(d.x,a.y));c[2].vertices=
this._vertexFromAlphaPoint(cc.p(d.x,a.y));c[3].texCoords=this._textureCoordFromAlphaPoint(cc.p(d.x,d.y));c[3].vertices=this._vertexFromAlphaPoint(cc.p(d.x,d.y));c[4].texCoords=this._textureCoordFromAlphaPoint(cc.p(a.x,a.y));c[4].vertices=this._vertexFromAlphaPoint(cc.p(a.x,a.y));c[5].texCoords=this._textureCoordFromAlphaPoint(cc.p(a.x,d.y));c[5].vertices=this._vertexFromAlphaPoint(cc.p(a.x,d.y))}else{if(!this._vertexData)for(this._vertexDataCount=4,e=cc.V2F_C4B_T2F.BYTES_PER_ELEMENT,this._vertexArrayBuffer=
new ArrayBuffer(4*e),this._vertexData=[],c=0;4>c;c++)this._vertexData[c]=new cc.V2F_C4B_T2F(null,null,null,this._vertexArrayBuffer,c*e);c=this._vertexData;c[0].texCoords=this._textureCoordFromAlphaPoint(cc.p(d.x,a.y));c[0].vertices=this._vertexFromAlphaPoint(cc.p(d.x,a.y));c[1].texCoords=this._textureCoordFromAlphaPoint(cc.p(d.x,d.y));c[1].vertices=this._vertexFromAlphaPoint(cc.p(d.x,d.y));c[2].texCoords=this._textureCoordFromAlphaPoint(cc.p(a.x,a.y));c[2].vertices=this._vertexFromAlphaPoint(cc.p(a.x,
a.y));c[3].texCoords=this._textureCoordFromAlphaPoint(cc.p(a.x,d.y));c[3].vertices=this._vertexFromAlphaPoint(cc.p(a.x,d.y))}this._updateColor()}};a._updateRadial=function(){var a=this._node;if(a._sprite){var c,d=a._midPoint;c=a._percentage/100;var e=2*cc.PI*(a._reverseDirection?c:1-c),a=cc.p(d.x,1),f=cc.pRotateByAngle(a,d,e),e=0;if(0===c)f=a,e=0;else if(1===c)f=a,e=4;else{var g=cc.FLT_MAX,h=cc.ProgressTimer.TEXTURE_COORDS_COUNT;for(c=0;c<=h;++c){var k=(c+(h-1))%h,m=this._boundaryTexCoord(c%h),k=
this._boundaryTexCoord(k);0===c?k=cc.pLerp(m,k,1-d.x):4===c&&(m=cc.pLerp(m,k,1-d.x));var n=cc.p(0,0);cc.pLineIntersect(m,k,d,f,n)&&(0!==c&&4!==c||0<=n.x&&1>=n.x)&&0<=n.y&&n.y>7-(a<<1)&1,c>>7-((a<<1)+1)&1):cc.p(c>>(a<<1)+1&1,c>>(a<<1)&1)}return cc.p(0,0)};a._textureCoordFromAlphaPoint=function(a){var c=this._node._sprite;if(!c)return{u:0,v:0};var d=c.quad,e=cc.p(d.bl.texCoords.u,
d.bl.texCoords.v),d=cc.p(d.tr.texCoords.u,d.tr.texCoords.v);c.textureRectRotated&&(c=a.x,a.x=a.y,a.y=c);return{u:e.x*(1-a.x)+d.x*a.x,v:e.y*(1-a.y)+d.y*a.y}};a._vertexFromAlphaPoint=function(a){var c=this._node._sprite;if(!c)return{x:0,y:0};var d=c.quad,c=cc.p(d.bl.vertices.x,d.bl.vertices.y),d=cc.p(d.tr.vertices.x,d.tr.vertices.y);return{x:c.x*(1-a.x)+d.x*a.x,y:c.y*(1-a.y)+d.y*a.y}};a._updateColor=function(){var a=this._node;if(a._sprite&&this._vertexData){for(var a=a._sprite.quad.tl.colors,c=this._vertexData,
d=0,e=this._vertexDataCount;da.height?(a=16,b=12):(a=12,b=16);a=this.actionWithSize(cc.size(a,b));b=this._gridProxy;this._back?(b.setTarget(this._inScene),b.onEnter(),this._inScene.visible=!1,b.runAction(cc.sequence(a,cc.callFunc(this.finish,this),cc.stopGrid())),this._inScene.runAction(cc.show())):(b.setTarget(this._outScene),b.onEnter(),b.runAction(cc.sequence(a,cc.callFunc(this.finish,this),cc.stopGrid())))},visit:function(){this._back?this._outScene.visit():this._inScene.visit();this._gridProxy.visit()},
_sceneOrder:function(){this._isInSceneOnTop=this._back}});cc.TransitionPageTurn.create=function(a,b,c){return new cc.TransitionPageTurn(a,b,c)};cc.Codec={name:"Jacob__Codec"};cc.unzip=function(){return cc.Codec.GZip.gunzip.apply(cc.Codec.GZip,arguments)};cc.unzipBase64=function(){var a=cc.Codec.Base64.decode.apply(cc.Codec.Base64,arguments);return cc.Codec.GZip.gunzip.apply(cc.Codec.GZip,[a])};cc.unzipBase64AsArray=function(a,b){b=b||1;var c=this.unzipBase64(a),d=[],e,f,g;e=0;for(g=c.length/b;e>4,d=(d&15)<<4|f>>2,e=(f&3)<<6|g,b.push(String.fromCharCode(c)),64!==f&&b.push(String.fromCharCode(d)),64!==g&&b.push(String.fromCharCode(e));return b=b.join("")};
cc.Codec.Base64.decodeAsArray=function(a,b){var c=this.decode(a),d=[],e,f,g;e=0;for(g=c.length/b;e>=1;0===this.bb&&(this.bb=this.readByte(),a=this.bb&1,this.bb=this.bb>>1|128);return a};
cc.Codec.GZip.prototype.readBits=function(a){for(var b=0,c=a;c--;)b=b<<1|this.readBit();a&&(b=cc.Codec.GZip.bitReverse[b]>>8-a);return b};cc.Codec.GZip.prototype.flushBuffer=function(){this.bIdx=0};cc.Codec.GZip.prototype.addBuffer=function(a){this.buf32k[this.bIdx++]=a;this.outputArr.push(String.fromCharCode(a));32768===this.bIdx&&(this.bIdx=0)};
cc.Codec.GZip.prototype.IsPat=function(){for(;;){if(this.fpos[this.len]>=this.fmax)return-1;if(this.flens[this.fpos[this.len]]===this.len)return this.fpos[this.len]++;this.fpos[this.len]++}};
cc.Codec.GZip.prototype.Rec=function(){var a=this.Places[this.treepos],b;if(17===this.len)return-1;this.treepos++;this.len++;b=this.IsPat();if(0<=b)a.b0=b;else if(a.b0=32768,this.Rec())return-1;b=this.IsPat();if(0<=b)a.b1=b,a.jump=null;else if(a.b1=32768,a.jump=this.Places[this.treepos],a.jumppos=this.treepos,this.Rec())return-1;this.len--;return 0};
cc.Codec.GZip.prototype.CreateTree=function(a,b,c,d){this.Places=a;this.treepos=0;this.flens=c;this.fmax=b;for(a=0;17>a;a++)this.fpos[a]=0;this.len=0;return this.Rec()?-1:0};cc.Codec.GZip.prototype.DecodeValue=function(a){for(var b,c,d=0,e=a[d];;)if(b=this.readBit()){if(!(e.b1&32768))return e.b1;e=e.jump;b=a.length;for(c=0;c>1,23c)this.addBuffer(c);
else if(256===c)break;else{var f;c-=257;e=this.readBits(cc.Codec.GZip.cplext[c])+cc.Codec.GZip.cplens[c];c=cc.Codec.GZip.bitReverse[this.readBits(5)]>>3;8c;c++)g[c]=
0;for(c=0;cc)g[d++]=c;else if(16===c){var k;c=3+this.readBits(2);if(d+c>e)return this.flushBuffer(),1;for(k=d?g[d-1]:0;c--;)g[d++]=k}else{c=17===c?3+this.readBits(3):11+this.readBits(7);if(d+c>e)return this.flushBuffer(),
1;for(;c--;)g[d++]=0}e=this.literalTree.length;for(d=0;d>>0}b=1;c=0;for(var d=a.length,e,f=0;0>>0}function d(b,c){this.index="number"===typeof c?c:0;
this.i=0;this.buffer=b instanceof(y?Uint8Array:Array)?b:new (y?Uint8Array:Array)(32768);2*this.buffer.length<=this.index&&a(Error("invalid index"));this.buffer.length<=this.index&&this.f()}function e(a){this.buffer=new (y?Uint16Array:Array)(2*a);this.length=0}function f(a){var b=a.length,c=0,d=Number.POSITIVE_INFINITY,e,f,g,h,k,m,n,r,p;for(r=0;rc&&(c=a[r]),a[r]>=1;for(p=m;p=b:return[265,b-11,1];case 14>=b:return[266,b-13,1];case 16>=b:return[267,b-15,1];case 18>=b:return[268,b-17,1];case 22>=b:return[269,b-19,2];case 26>=b:return[270,b-23,2];case 30>=b:return[271,b-27,2];case 34>=b:return[272,b-31,2];case 42>=b:return[273,b-35,3];case 50>=
b:return[274,b-43,3];case 58>=b:return[275,b-51,3];case 66>=b:return[276,b-59,3];case 82>=b:return[277,b-67,4];case 98>=b:return[278,b-83,4];case 114>=b:return[279,b-99,4];case 130>=b:return[280,b-115,4];case 162>=b:return[281,b-131,5];case 194>=b:return[282,b-163,5];case 226>=b:return[283,b-195,5];case 257>=b:return[284,b-227,5];case 258===b:return[285,b-258,0];default:a("invalid length: "+b)}}function m(b,c){function d(b,c){var e=b.G,f=[],g=0,h;h=P[b.length];f[g++]=h&65535;f[g++]=h>>16&255;f[g++]=
h>>24;var k;switch(F){case 1===e:k=[0,e-1,0];break;case 2===e:k=[1,e-2,0];break;case 3===e:k=[2,e-3,0];break;case 4===e:k=[3,e-4,0];break;case 6>=e:k=[4,e-5,1];break;case 8>=e:k=[5,e-7,1];break;case 12>=e:k=[6,e-9,2];break;case 16>=e:k=[7,e-13,2];break;case 24>=e:k=[8,e-17,3];break;case 32>=e:k=[9,e-25,3];break;case 48>=e:k=[10,e-33,4];break;case 64>=e:k=[11,e-49,4];break;case 96>=e:k=[12,e-65,5];break;case 128>=e:k=[13,e-97,5];break;case 192>=e:k=[14,e-129,6];break;case 256>=e:k=[15,e-193,6];break;
case 384>=e:k=[16,e-257,7];break;case 512>=e:k=[17,e-385,7];break;case 768>=e:k=[18,e-513,8];break;case 1024>=e:k=[19,e-769,8];break;case 1536>=e:k=[20,e-1025,9];break;case 2048>=e:k=[21,e-1537,9];break;case 3072>=e:k=[22,e-2049,10];break;case 4096>=e:k=[23,e-3073,10];break;case 6144>=e:k=[24,e-4097,11];break;case 8192>=e:k=[25,e-6145,11];break;case 12288>=e:k=[26,e-8193,12];break;case 16384>=e:k=[27,e-12289,12];break;case 24576>=e:k=[28,e-16385,13];break;case 32768>=e:k=[29,e-24577,13];break;default:a("invalid distance")}h=
k;f[g++]=h[0];f[g++]=h[1];f[g++]=h[2];e=0;for(g=f.length;e=g;)s[g++]=0;for(g=0;29>=g;)u[g++]=0}s[256]=1;e=0;for(f=c.length;e=f){r&&d(r,-1);g=0;
for(k=f-e;gt&&e+tv&&(m=k,v=t);if(258===t)break}k=new h(v,e-m);r?r.length2*k[u-1]+f[u]&&(k[u]=2*k[u-1]+f[u]),m[u]=Array(k[u]),p[u]=Array(k[u]);for(N=0;Nh[N]?(m[u][s]=H,p[u][s]=n,E+=2):(m[u][s]=h[N],
p[u][s]=N,++N);B[u]=0;1===f[u]&&c(u)}h=r;k=0;for(m=d.length;k1<f&&a("undercommitted");g=0;for(h=b.length;g>>=1;return c}function t(a,b){this.input=a;this.a=new (y?Uint8Array:Array)(32768);this.h=
K.j;var c={},d;!b&&(b={})||"number"!==typeof b.compressionType||(this.h=b.compressionType);for(d in b)c[d]=b[d];c.outputBuffer=this.a;this.z=new g(this.input,c)}function r(b,c){this.k=[];this.l=32768;this.e=this.g=this.c=this.q=0;this.input=y?new Uint8Array(b):b;this.s=!1;this.m=Q;this.B=!1;if(c||!(c={}))c.index&&(this.c=c.index),c.bufferSize&&(this.l=c.bufferSize),c.bufferType&&(this.m=c.bufferType),c.resize&&(this.B=c.resize);switch(this.m){case U:this.b=32768;this.a=new (y?Uint8Array:Array)(32768+
this.l+258);break;case Q:this.b=0;this.a=new (y?Uint8Array:Array)(this.l);this.f=this.J;this.t=this.H;this.o=this.I;break;default:a(Error("invalid inflate mode"))}}function v(b,c){for(var d=b.g,e=b.e,f=b.input,g=b.c,h;e>>c;b.e=e-c;b.c=g;return d&(1<>>16;b.g=d>>h;b.e=
e-h;b.c=g;return f&65535}function u(a){function b(a,c,d){var e,f,g,h;for(h=0;h>>8&255]<<16|J[a>>>16&255]<<8|J[a>>>24&255])>>32-b:J[a]>>8-b);if(8>b+f)g=g<>b-c-1&1,8===++f&&(f=0,d[e++]=J[g],g=0,e===d.length&&(d=this.f()));
d[e]=g;this.buffer=d;this.i=f;this.index=e};d.prototype.finish=function(){var a=this.buffer,b=this.index,c;0C;++C){for(var I=C,D=I,M=7,I=I>>>1;I;I>>>=1)D<<=1,D|=I&1,--M;A[C]=(D<>>0}var J=A,A=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,
498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,
3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,
2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,
2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,
2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918E3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,
711928724,3020668471,3272380065,1510334235,755167117];y&&new Uint32Array(A);e.prototype.getParent=function(a){return 2*((a-2)/4|0)};e.prototype.push=function(a,b){var c,d,e=this.buffer,f;c=this.length;e[this.length++]=b;for(e[this.length++]=a;0e[d])f=e[c],e[c]=e[d],e[d]=f,f=e[c+1],e[c+1]=e[d+1],e[d+1]=f,c=d;else break;return this.length};e.prototype.pop=function(){var a,b,c=this.buffer,d,e,f;b=c[0];a=c[1];this.length-=2;c[0]=c[this.length];c[1]=c[this.length+1];for(f=
0;;){e=2*f+2;if(e>=this.length)break;e+2c[e]&&(e+=2);if(c[e]>c[f])d=c[f],c[f]=c[e],c[e]=d,d=c[f+1],c[f+1]=c[e+1],c[e+1]=d;else break;f=e}return{index:a,value:b,length:this.length}};var E=2,A={NONE:0,r:1,j:E,N:3},G=[];for(C=0;288>C;C++)switch(F){case 143>=C:G.push([C+48,8]);break;case 255>=C:G.push([C-144+400,9]);break;case 279>=C:G.push([C-256+0,7]);break;case 287>=C:G.push([C-280+192,8]);break;default:a("invalid literal: "+C)}g.prototype.n=function(){var b,c,e,f,g=this.input;
switch(this.h){case 0:e=0;for(f=g.length;e>>8&255;B[N++]=r&255;B[N++]=r>>>8&255;if(y)B.set(c,N),N+=c.length,B=B.subarray(0,N);else{k=0;for(r=c.length;kS)for(;0S?S:138,Q>S-3&&Q=Q?(P[K++]=17,P[K++]=Q-3,T[17]++):(P[K++]=18,P[K++]=Q-11,T[18]++),S-=Q;else if(P[K++]=
b[w],T[b[w]]++,S--,3>S)for(;0S?S:6,Q>S-3&&Qw;w++)k[w]=T[v[w]];for(H=19;4=L;L++)I=k(),C[L]=I[2]<<24|I[1]<<16|I[0];var P=y?new Uint32Array(C):C,K=A;t.prototype.n=function(){var b,d,e,f,g=0;f=this.a;b=ia;switch(b){case ia:d=Math.LOG2E*Math.log(32768)-8;break;default:a(Error("invalid compression method"))}d=
d<<4|b;f[g++]=d;switch(b){case ia:switch(this.h){case K.NONE:e=0;break;case K.r:e=1;break;case K.j:e=2;break;default:a(Error("unsupported compression type"))}break;default:a(Error("invalid compression method"))}b=e<<6|0;f[g++]=b|31-(256*d+b)%31;b=c(this.input);this.z.b=g;f=this.z.n();g=f.length;y&&(f=new Uint8Array(f.buffer),f.length<=g+4&&(this.a=new Uint8Array(f.length+4),this.a.set(f),f=this.a),f=f.subarray(0,g+4));f[g++]=b>>24&255;f[g++]=b>>16&255;f[g++]=b>>8&255;f[g++]=b&255;return f};b("Zlib.Deflate",
t);b("Zlib.Deflate.compress",function(a,b){return(new t(a,b)).n()});b("Zlib.Deflate.CompressionType",K);b("Zlib.Deflate.CompressionType.NONE",K.NONE);b("Zlib.Deflate.CompressionType.FIXED",K.r);b("Zlib.Deflate.CompressionType.DYNAMIC",K.j);var U=0,Q=1,A={D:U,C:Q};r.prototype.p=function(){for(;!this.s;){var b=v(this,3);b&1&&(this.s=F);b>>>=1;switch(b){case 0:var b=this.input,c=this.c,d=this.a,e=this.b,f=z,g=z,h=z,k=d.length,f=z;this.e=this.g=0;f=b[c++];f===z&&a(Error("invalid uncompressed block header: LEN (first byte)"));
g=f;f=b[c++];f===z&&a(Error("invalid uncompressed block header: LEN (second byte)"));g|=f<<8;f=b[c++];f===z&&a(Error("invalid uncompressed block header: NLEN (first byte)"));h=f;f=b[c++];f===z&&a(Error("invalid uncompressed block header: NLEN (second byte)"));h|=f<<8;g===~h&&a(Error("invalid uncompressed block header: length verify"));c+g>b.length&&a(Error("input buffer is broken"));switch(this.m){case U:for(;e+g>d.length;){f=k-e;g-=f;if(y)d.set(b.subarray(c,c+f),e),e+=f,c+=f;else for(;f--;)d[e++]=
b[c++];this.b=e;d=this.f();e=this.b}break;case Q:for(;e+g>d.length;)d=this.f({v:2});break;default:a(Error("invalid inflate mode"))}if(y)d.set(b.subarray(c,c+g),e),e+=g,c+=g;else for(;g--;)d[e++]=b[c++];this.c=c;this.b=e;this.a=d;break;case 1:this.o(ba,oa);break;case 2:u(this);break;default:a(Error("unknown BTYPE: "+b))}}return this.t()};C=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];var B=y?new Uint16Array(C):C;C=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,
258,258,258];var H=y?new Uint16Array(C):C;C=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0];var S=y?new Uint8Array(C):C;C=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577];var N=y?new Uint16Array(C):C;C=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];var T=y?new Uint8Array(C):C;C=new (y?Uint8Array:Array)(288);I=0;for(D=C.length;I=I?8:255>=I?9:279>=I?7:8;var ba=f(C);C=new (y?Uint8Array:
Array)(30);I=0;for(D=C.length;If)d>=e&&(this.b=d,c=this.f(),d=this.b),c[d++]=f;else for(f-=257,h=H[f],0=e&&(this.b=d,c=this.f(),d=this.b);h--;)c[d]=c[d++-g];for(;8<=this.e;)this.e-=8,this.c--;this.b=d};r.prototype.I=function(a,b){var c=this.a,d=this.b;this.u=a;for(var e=c.length,f,g,h;256!==
(f=s(this,a));)if(256>f)d>=e&&(c=this.f(),e=c.length),c[d++]=f;else for(f-=257,h=H[f],0e&&(c=this.f(),e=c.length);h--;)c[d]=c[d++-g];for(;8<=this.e;)this.e-=8,this.c--;this.b=d};r.prototype.f=function(){var a=new (y?Uint8Array:Array)(this.b-32768),b=this.b-32768,c,d,e=this.a;if(y)a.set(e.subarray(32768,a.length));else for(c=0,d=a.length;cc;++c)e[c]=e[b+c];this.b=32768;return e};r.prototype.J=function(a){var b,c=this.input.length/this.c+1|0,d,e,f,g=this.input,h=this.a;a&&("number"===typeof a.v&&(c=a.v),"number"===typeof a.F&&(c+=a.F));2>c?(d=(g.length-this.c)/this.u[2],f=d/2*258|0,e=fb&&(this.a.length=b),a=this.a);return this.buffer=a};w.prototype.p=function(){var b=this.input,d,e;d=this.A.p();this.c=this.A.c;this.M&&(e=(b[this.c++]<<24|b[this.c++]<<
16|b[this.c++]<<8|b[this.c++])>>>0,e!==c(d)&&a(Error("invalid adler-32 checksum")));return d};b("Zlib.Inflate",w);b("Zlib.Inflate.BufferType",A);A.ADAPTIVE=A.C;A.BLOCK=A.D;b("Zlib.Inflate.prototype.decompress",w.prototype.p);A=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];y&&new Uint16Array(A);A=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,258,258];y&&new Uint16Array(A);A=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0];y&&new Uint8Array(A);
A=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577];y&&new Uint16Array(A);A=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];y&&new Uint8Array(A);A=new (y?Uint8Array:Array)(288);C=0;for(I=A.length;C=C?8:255>=C?9:279>=C?7:8;f(A);A=new (y?Uint8Array:Array)(30);C=0;for(I=A.length;Ca;++a)e.push(String.fromCharCode(this.data[this.pos++]));a=e.join("");switch(a){case "IHDR":this.width=this.readUInt32();this.height=this.readUInt32();this.bits=this.data[this.pos++];this.colorType=this.data[this.pos++];this.compressionMethod=this.data[this.pos++];this.filterMethod=
this.data[this.pos++];this.interlaceMethod=this.data[this.pos++];break;case "acTL":this.animation={numFrames:this.readUInt32(),numPlays:this.readUInt32()||Infinity,frames:[]};break;case "PLTE":this.palette=this.read(b);break;case "fcTL":d&&this.animation.frames.push(d);this.pos+=4;d={width:this.readUInt32(),height:this.readUInt32(),xOffset:this.readUInt32(),yOffset:this.readUInt32()};a=this.readUInt16();b=this.readUInt16()||100;d.delay=1E3*a/b;d.disposeOp=this.data[this.pos++];d.blendOp=this.data[this.pos++];
d.data=[];break;case "IDAT":case "fdAT":"fdAT"===a&&(this.pos+=4,b-=4);a=(null!=d?d.data:void 0)||this.imgData;for(e=0;0<=b?eb;0<=b?++e:--e)a.push(this.data[this.pos++]);break;case "tRNS":this.transparency={};switch(this.colorType){case 3:this.transparency.indexed=this.read(b);b=255-this.transparency.indexed.length;if(0b;0<=b?++a:--a)this.transparency.indexed.push(255);break;case 0:this.transparency.grayscale=this.read(b)[0];break;case 2:this.transparency.rgb=this.read(b)}break;
case "tEXt":e=this.read(b);b=e.indexOf(0);a=String.fromCharCode.apply(String,e.slice(0,b));this.text[a]=String.fromCharCode.apply(String,e.slice(b+1));break;case "IEND":d&&this.animation.frames.push(d);a:{switch(this.colorType){case 0:case 3:case 4:d=1;break a;case 2:case 6:d=3;break a}d=void 0}this.colors=d;this.hasAlphaChannel=4===(c=this.colorType)||6===c;c=this.colors+(this.hasAlphaChannel?1:0);this.pixelBitlength=this.bits*c;a:{switch(this.colors){case 1:c="DeviceGray";break a;case 3:c="DeviceRGB";
break a}c=void 0}this.colorSpace=c;Uint8Array!=Array&&(this.imgData=new Uint8Array(this.imgData));return;default:this.pos+=b}this.pos+=4;if(this.pos>this.data.length)throw Error("Incomplete or corrupt PNG file");}},read:function(a){var b,c;c=[];for(b=0;0<=a?ba;0<=a?++b:--b)c.push(this.data[this.pos++]);return c},readUInt32:function(){var a,b,c,d;a=this.data[this.pos++]<<24;b=this.data[this.pos++]<<16;c=this.data[this.pos++]<<8;d=this.data[this.pos++];return a|b|c|d},readUInt16:function(){var a,
b;a=this.data[this.pos++]<<8;b=this.data[this.pos++];return a|b},decodePixels:function(a){var b,c,d,e,f,g,h,k,m,n,p,t,r,v,s;null==a&&(a=this.imgData);if(0===a.length)return new Uint8Array(0);a=(new Zlib.Inflate(a,{index:0,verify:!1})).decompress();k=this.pixelBitlength/8;t=k*this.width;m=new Uint8Array(t*this.height);g=a.length;for(c=n=p=0;n=e*c)!1===this.littleEndian?a.push(d>>>8*(4-e)):a.push(d);else for(var f=0;f=a)cc.log("No bytes requested");else{if(1>=a)return this.getUint8(b);if(2>=a)return this.getUint16(b);if(3>=a)return this.getUint32(b)>>>8;if(4>=a)return this.getUint32(b);cc.log("Too many bytes requested")}},getBits:function(a,b,c){c=c||0;b+=Math.floor(c/8);var d=c+a;a=32-a;var e,f;0>=d?console.log("No bits requested"):8>=d?(e=24+c,f=this.getUint8(b)):16>=d?(e=16+c,f=this.getUint16(b)):32>=d?(e=c,f=this.getUint32(b)):console.log("Too many bits requested");
return{bits:f<>>a,byteOffset:b+Math.floor(d/8),bitOffset:d%8}},parseFileDirectory:function(a){var b=this.getUint16(a),c=[];a+=2;for(var d=0;d=x?J=x+1:-127<=x&&-1>=x?E=-x+1:y=!0}else{for(var G=this.getUint8(u+z),x=0;x=this._totalParticles},updateQuadWithParticle:function(a,b){this._renderCmd.updateQuadWithParticle(a,b)},postStep:function(){this._renderCmd.postStep()},update:function(a){if(this._isActive&&this.emissionRate){var b=1/this.emissionRate;this.particleCountb;)this.addParticle(),this._emitCounter-=b;this._elapsed+=a;-1!==this.duration&&this.duration<
this._elapsed&&this.stopSystem()}this._particleIdx=0;b=cc.Particle.TemporaryPoints[0];this.positionType===cc.ParticleSystem.TYPE_FREE?cc.pIn(b,this.convertToWorldSpace(this._pointZeroForParticle)):this.positionType===cc.ParticleSystem.TYPE_RELATIVE&&(b.x=this._position.x,b.y=this._position.y);if(this._visible){for(var c=cc.Particle.TemporaryPoints[1],d=cc.Particle.TemporaryPoints[2],e=cc.Particle.TemporaryPoints[3],f=this._particles;this._particleIdxa?a:200};a.addParticle=function(){var a=this._node,c=a._particles;a.particleCountc._allocatedParticles){var d=cc.V3F_C4B_T2F_Quad.BYTES_PER_ELEMENT;this._indices=new Uint16Array(6*a);var e=new ArrayBuffer(a*d),f=c._particles;f.length=0;for(var g=this._quads,h=g.length=0;hd.getCapacity()&&(this._increaseAtlasCapacityTo(e+c),d.fillWithEmptyQuadsFromIndex(d.getCapacity()-c,c));a.getAtlasIndex()+c!==e&&d.moveQuadsFromIndex(b,b+c);d.increaseTotalQuadsWith(c);this._updateAllAtlasIndexes()},removeChild:function(a,b){if(null!=a){if(!(a instanceof cc.ParticleSystem))throw Error("cc.ParticleBatchNode.removeChild(): only supports cc.ParticleSystem as children");
if(-1===this._children.indexOf(a))cc.log("cc.ParticleBatchNode.removeChild(): doesn't contain the sprite. Can't remove it");else{cc.Node.prototype.removeChild.call(this,a,b);var c=this.textureAtlas;c.removeQuadsAtIndex(a.getAtlasIndex(),a.getTotalParticles());c.fillWithEmptyQuadsFromIndex(c.totalQuads,a.getTotalParticles());a.setBatchNode(null);this._updateAllAtlasIndexes()}}},reorderChild:function(a,b){if(!a)throw Error("cc.ParticleBatchNode.reorderChild(): child should be non-null");if(!(a instanceof
cc.ParticleSystem))throw Error("cc.ParticleBatchNode.reorderChild(): only supports cc.QuadParticleSystems as children");if(-1===this._children.indexOf(a))cc.log("cc.ParticleBatchNode.reorderChild(): Child doesn't belong to batch");else if(b!==a.zIndex){if(1a)return d;return c},_getCurrentIndex:function(a,b){for(var c=!1,d=!1,e=0,f=0,g=0,h=this._children,k=h.length,m=0;mb&&!d&&(e=m,d=!0,c&&d))break;if(a===n&&(f=m,c=!0,d||(g=-1),c&&d))break}d||(e=k);return{newIndex:e+g,oldIndex:f}},_addChildHelper:function(a,b,c){if(!a)throw Error("cc.ParticleBatchNode._addChildHelper(): child should be non-null");if(a.parent)return cc.log("cc.ParticleBatchNode._addChildHelper(): child already added. It can't be added again"),
null;this._children||(this._children=[]);var d=this._searchNewPositionInChildrenForZ(b);this._children.splice(d,0,a);a.tag=c;a._setLocalZOrder(b);a.parent=this;this._running&&(a.onEnter(),a.onEnterTransitionDidFinish());return d},_updateBlendFunc:function(){this.textureAtlas.texture.hasPremultipliedAlpha()||(this._blendFunc.src=cc.SRC_ALPHA,this._blendFunc.dst=cc.ONE_MINUS_SRC_ALPHA)},getTextureAtlas:function(){return this.textureAtlas},setTextureAtlas:function(a){this.textureAtlas=a}});_p=cc.ParticleBatchNode.prototype;
cc.defineGetterSetter(_p,"texture",_p.getTexture,_p.setTexture);cc.ParticleBatchNode.create=function(a,b){return new cc.ParticleBatchNode(a,b)};(function(){cc.ParticleBatchNode.CanvasRenderCmd=function(a){cc.Node.CanvasRenderCmd.call(this,a);this._needDraw=!1};var a=cc.ParticleBatchNode.CanvasRenderCmd.prototype=Object.create(cc.Node.CanvasRenderCmd.prototype);a.constructor=cc.ParticleBatchNode.CanvasRenderCmd;a._initWithTexture=function(){}})();(function(){cc.ParticleBatchNode.WebGLRenderCmd=function(a){cc.Node.WebGLRenderCmd.call(this,a);this._needDraw=!0};var a=cc.ParticleBatchNode.WebGLRenderCmd.prototype=Object.create(cc.Node.WebGLRenderCmd.prototype);a.constructor=cc.ParticleBatchNode.WebGLRenderCmd;a.rendering=function(a){a=this._node;0!==a.textureAtlas.totalQuads&&(this._shaderProgram.use(),this._shaderProgram._setUniformForMVPMatrixWithMat4(this._stackMatrix),cc.glBlendFuncForParticle(a._blendFunc.src,a._blendFunc.dst),a.textureAtlas.drawQuads())};
a._initWithTexture=function(){this._shaderProgram=cc.shaderCache.programForKey(cc.SHADER_POSITION_TEXTURECOLOR)};a.visit=function(a){if(this._node._visible){var c=cc.current_stack;c.stack.push(c.top);this._syncStatus(a);c.top=this._stackMatrix;cc.renderer.pushRenderCommand(this);this._dirtyFlag=0;cc.kmGLPopMatrix()}}})();cc.IMEKeyboardNotificationInfo=function(a,b,c){this.begin=a||cc.rect(0,0,0,0);this.end=b||cc.rect(0,0,0,0);this.duration=c||0};
cc.IMEDelegate=cc.Class.extend({ctor:function(){cc.imeDispatcher.addDelegate(this)},removeDelegate:function(){cc.imeDispatcher.removeDelegate(this)},attachWithIME:function(){return cc.imeDispatcher.attachDelegateWithIME(this)},detachWithIME:function(){return cc.imeDispatcher.detachDelegateWithIME(this)},canAttachWithIME:function(){return!1},didAttachWithIME:function(){},canDetachWithIME:function(){return!1},didDetachWithIME:function(){},insertText:function(a,b){},deleteBackward:function(){},getContentText:function(){return""},
keyboardWillShow:function(a){},keyboardDidShow:function(a){},keyboardWillHide:function(a){},keyboardDidHide:function(a){}});
cc.IMEDispatcher=cc.Class.extend({_domInputControl:null,impl:null,_currentInputString:"",_lastClickPosition:null,ctor:function(){this.impl=new cc.IMEDispatcher.Impl;this._lastClickPosition=cc.p(0,0)},init:function(){if(!cc.sys.isMobile){this._domInputControl=cc.$("#imeDispatcherInput");this._domInputControl||(this._domInputControl=cc.$new("input"),this._domInputControl.setAttribute("type","text"),this._domInputControl.setAttribute("id","imeDispatcherInput"),this._domInputControl.resize(0,0),this._domInputControl.translates(0,
0),this._domInputControl.style.opacity="0",this._domInputControl.style.fontSize="1px",this._domInputControl.setAttribute("tabindex",2),this._domInputControl.style.position="absolute",this._domInputControl.style.top=0,this._domInputControl.style.left=0,document.body.appendChild(this._domInputControl));var a=this;cc._addEventListener(this._domInputControl,"input",function(){a._processDomInputString(a._domInputControl.value)},!1);cc._addEventListener(this._domInputControl,"keydown",function(b){b.keyCode===
cc.KEY.tab?(b.stopPropagation(),b.preventDefault()):b.keyCode===cc.KEY.enter&&(a.dispatchInsertText("\n",1),b.stopPropagation(),b.preventDefault())},!1);/msie/i.test(navigator.userAgent)&&cc._addEventListener(this._domInputControl,"keyup",function(b){b.keyCode===cc.KEY.backspace&&a._processDomInputString(a._domInputControl.value)},!1);cc._addEventListener(window,"mousedown",function(b){var c=b.pageY||0;a._lastClickPosition.x=b.pageX||0;a._lastClickPosition.y=c},!1)}},_processDomInputString:function(a){var b,
c;b=this._currentInputString.length=b||this.impl._delegateWithIme&&this.impl._delegateWithIme.insertText(a,b)},dispatchDeleteBackward:function(){this.impl&&this.impl._delegateWithIme&&
this.impl._delegateWithIme.deleteBackward()},getContentText:function(){if(this.impl&&this.impl._delegateWithIme){var a=this.impl._delegateWithIme.getContentText();return a?a:""}return""},dispatchKeyboardWillShow:function(a){if(this.impl)for(var b=0;ba?a===cc.KEY.backspace?this.dispatchDeleteBackward():a===cc.KEY.enter&&this.dispatchInsertText("\n",1):255>a&&this.dispatchInsertText(String.fromCharCode(a),1)}});
cc.IMEDispatcher.Impl=cc.Class.extend({_delegateWithIme:null,_delegateList:null,ctor:function(){this._delegateList=[]},findDelegate:function(a){for(var b=0;b=a?(this._inputText="",this._charCount=0,cc.LabelTTF.prototype.setString.call(this,this._placeHolder),this.setColor(this.colorSpaceHolder)):this.string=
this._inputText.substring(0,a-1))},removeDelegate:function(){cc.imeDispatcher.removeDelegate(this)},_tipMessage:"please enter your word:",setTipMessage:function(a){null!=a&&(this._tipMessage=a)},getTipMessage:function(){return this._tipMessage},insertText:function(a,b){var c=a,d=c.indexOf("\n");-1=a.length||!(g=a[d])||(h=m[b].height,e=e>=h||isNaN(h)?e:h,++f,f>=g&&(c+=e+5,e=f=0,++d));var n=cc.director.getWinSize(),p=g=e=d=0,t=0,c=c/2;if(m&&0=h||isNaN(h)?e:h;r.setPosition(t-n.width/2,c-h/2);t+=p;++f;f>=g&&(c-=e+5,e=g=f=0,++d)}},alignItemsInRows:function(){0=a.length||!(m=a[g]))||(t=n.width,h=h>=t||isNaN(t)?h:t,f+=n.height+5,++k,k>=m&&(c.push(h),d.push(f),e+=h+10,h=k=0,f=-5,++g));f=cc.director.getWinSize();m=h=g=0;var e=-e/2,v=0;if(r&&0=t||isNaN(t)?h:t,n.setPosition(e+c[g]/2,v-f.height/2),
v-=n.height+10,++k,k>=m&&(e+=h+5,h=m=k=0,++g)},removeChild:function(a,b){null!=a&&(a instanceof cc.MenuItem?(this._selectedItem===a&&(this._selectedItem=null),cc.Node.prototype.removeChild.call(this,a,b)):cc.log("cc.Menu.removeChild():Menu only supports MenuItem objects as children"))},_onTouchBegan:function(a,b){var c=b.getCurrentTarget();if(c._state!==cc.MENU_STATE_WAITING||!c._visible||!c.enabled)return!1;for(var d=c.parent;null!=d;d=d.parent)if(!d.isVisible())return!1;c._selectedItem=c._itemForTouch(a);
return c._selectedItem?(c._state=cc.MENU_STATE_TRACKING_TOUCH,c._selectedItem.selected(),c._selectedItem.setNodeDirty(),!0):!1},_onTouchEnded:function(a,b){var c=b.getCurrentTarget();c._state!==cc.MENU_STATE_TRACKING_TOUCH?cc.log("cc.Menu.onTouchEnded(): invalid state"):(c._selectedItem&&(c._selectedItem.unselected(),c._selectedItem.setNodeDirty(),c._selectedItem.activate()),c._state=cc.MENU_STATE_WAITING)},_onTouchCancelled:function(a,b){var c=b.getCurrentTarget();c._state!==cc.MENU_STATE_TRACKING_TOUCH?
cc.log("cc.Menu.onTouchCancelled(): invalid state"):(c._selectedItem&&(c._selectedItem.unselected(),c._selectedItem.setNodeDirty()),c._state=cc.MENU_STATE_WAITING)},_onTouchMoved:function(a,b){var c=b.getCurrentTarget();if(c._state!==cc.MENU_STATE_TRACKING_TOUCH)cc.log("cc.Menu.onTouchMoved(): invalid state");else{var d=c._itemForTouch(a);d!==c._selectedItem&&(c._selectedItem&&(c._selectedItem.unselected(),c._selectedItem.setNodeDirty()),c._selectedItem=d,c._selectedItem&&(c._selectedItem.selected(),
c._selectedItem.setNodeDirty()))}},onExit:function(){this._state===cc.MENU_STATE_TRACKING_TOUCH&&(this._selectedItem&&(this._selectedItem.unselected(),this._selectedItem=null),this._state=cc.MENU_STATE_WAITING);cc.Node.prototype.onExit.call(this)},setOpacityModifyRGB:function(a){},isOpacityModifyRGB:function(){return!1},_itemForTouch:function(a){a=a.getLocation();var b=this._children,c;if(b&&0b)return!1;a=new cc.BinaryStreamReader(a);a.setOffset(d);c.type=a.readByte();d+=10;if(d+4+1>b)return!1;a.setOffset(d);c.width=a.readUnsignedShort();c.height=a.readUnsignedInteger();c.pixelDepth=a.readByte();if(d+5+1>b)return!1;b=a.readByte();c.flipped=0;b&32&&(c.flipped=1);return!0};
cc.tgaLoadImageData=function(a,b,c){var d,e;d=0|c.pixelDepth/2;e=c.height*c.width*d;if(18+e>b)return!1;c.imageData=cc.__getSubArray(a,18,18+e);if(3<=d)for(a=0;ab)break;n=a[p];p+=1;(k=n&128)&&(n-=128);h=0}if(!h){if(p+d>b)break;m=cc.__getSubArray(a,p,p+d);p+=d;3<=d&&(h=m[0],m[0]=m[2],m[2]=h)}for(h=0;h>3;this._checkSize(c);var c=Math.pow(2,b-1)-1,e=this._readBits(a+b,1,d),f=this._readBits(a,b,d),g=0,h=2,k=0;do for(var m=this._readByte(++k,
d),n=a%8||8,p=1<>=1;)m&p&&(g+=1/h),h*=2;while(a-=n);this._offset+=d;return f===(c<<1)+1?g?NaN:e?-Infinity:Infinity:(1+-2*e)*(f||g?f?Math.pow(2,f-c)*(1+g):Math.pow(2,-c+1)*g:0)},_readByte:function(a,b){return this._data[this._offset+b-a-1]},_decodeInt:function(a,b){var c=this._readBits(0,a,a/8),d=Math.pow(2,a);this._offset+=a/8;return b&&c>=d/2?c-d:c},_shl:function(a,b){for(++b;--b;a=1073741824===((a%=2147483648)&1073741824)?2*a:2*(a-1073741824)+2147483648);return a},_readBits:function(a,b,c){var d=
(a+b)%8,e=a%8,f=c-(a>>3)-1;a=c+(-(a+b)>>3);var g=f-a;b=this._readByte(f,c)>>e&(1<<(g?8-e:b))-1;for(g&&d&&(b+=(this._readByte(a++,c)&(1<>>0>=f.firstGid)return f}}cc.log("cocos2d: Warning: TMX Layer "+a.name+" has no tiles");return null}});_p=cc.TMXTiledMap.prototype;cc.defineGetterSetter(_p,"mapWidth",_p._getMapWidth,_p._setMapWidth);cc.defineGetterSetter(_p,"mapHeight",_p._getMapHeight,_p._setMapHeight);cc.defineGetterSetter(_p,"tileWidth",_p._getTileWidth,_p._setTileWidth);cc.defineGetterSetter(_p,"tileHeight",_p._getTileHeight,_p._setTileHeight);
cc.TMXTiledMap.create=function(a,b){return new cc.TMXTiledMap(a,b)};cc.TMX_PROPERTY_NONE=0;cc.TMX_PROPERTY_MAP=1;cc.TMX_PROPERTY_LAYER=2;cc.TMX_PROPERTY_OBJECTGROUP=3;cc.TMX_PROPERTY_OBJECT=4;cc.TMX_PROPERTY_TILE=5;cc.TMX_TILE_HORIZONTAL_FLAG=2147483648;cc.TMX_TILE_VERTICAL_FLAG=1073741824;cc.TMX_TILE_DIAGONAL_FLAG=536870912;cc.TMX_TILE_FLIPPED_ALL=(cc.TMX_TILE_HORIZONTAL_FLAG|cc.TMX_TILE_VERTICAL_FLAG|cc.TMX_TILE_DIAGONAL_FLAG)>>>0;cc.TMX_TILE_FLIPPED_MASK=~cc.TMX_TILE_FLIPPED_ALL>>>0;
cc.TMXLayerInfo=cc.Class.extend({properties:null,name:"",_layerSize:null,_tiles:null,visible:null,_opacity:null,ownTiles:!0,_minGID:1E5,_maxGID:0,offset:null,ctor:function(){this.properties=[];this.name="";this._layerSize=null;this._tiles=[];this.visible=!0;this._opacity=0;this.ownTiles=!0;this._minGID=1E5;this._maxGID=0;this.offset=cc.p(0,0)},getProperties:function(){return this.properties},setProperties:function(a){this.properties=a}});
cc.TMXTilesetInfo=cc.Class.extend({name:"",firstGid:0,_tileSize:null,spacing:0,margin:0,sourceImage:"",imageSize:null,ctor:function(){this._tileSize=cc.size(0,0);this.imageSize=cc.size(0,0)},rectForGID:function(a){var b=cc.rect(0,0,0,0);b.width=this._tileSize.width;b.height=this._tileSize.height;a&=cc.TMX_TILE_FLIPPED_MASK;a-=parseInt(this.firstGid,10);var c=parseInt((this.imageSize.width-2*this.margin+this.spacing)/(this._tileSize.width+this.spacing),10);b.x=parseInt(a%c*(this._tileSize.width+this.spacing)+
this.margin,10);b.y=parseInt(parseInt(a/c,10)*(this._tileSize.height+this.spacing)+this.margin,10);return b}});
cc.TMXMapInfo=cc.SAXParser.extend({properties:null,orientation:null,parentElement:null,parentGID:null,layerAttrs:0,storingCharacters:!1,tmxFileName:null,currentString:null,_objectGroups:null,_mapSize:null,_tileSize:null,_layers:null,_tilesets:null,_tileProperties:null,_resources:"",_currentFirstGID:0,ctor:function(a,b){cc.SAXParser.prototype.ctor.apply(this);this._mapSize=cc.size(0,0);this._tileSize=cc.size(0,0);this._layers=[];this._tilesets=[];this._objectGroups=[];this.properties=[];this._tileProperties=
{};this._currentFirstGID=0;void 0!==b?this.initWithXML(a,b):void 0!==a&&this.initWithTMXFile(a)},getOrientation:function(){return this.orientation},setOrientation:function(a){this.orientation=a},getMapSize:function(){return cc.size(this._mapSize.width,this._mapSize.height)},setMapSize:function(a){this._mapSize.width=a.width;this._mapSize.height=a.height},_getMapWidth:function(){return this._mapSize.width},_setMapWidth:function(a){this._mapSize.width=a},_getMapHeight:function(){return this._mapSize.height},
_setMapHeight:function(a){this._mapSize.height=a},getTileSize:function(){return cc.size(this._tileSize.width,this._tileSize.height)},setTileSize:function(a){this._tileSize.width=a.width;this._tileSize.height=a.height},_getTileWidth:function(){return this._tileSize.width},_setTileWidth:function(a){this._tileSize.width=a},_getTileHeight:function(){return this._tileSize.height},_setTileHeight:function(a){this._tileSize.height=a},getLayers:function(){return this._layers},setLayers:function(a){this._layers.push(a)},
getTilesets:function(){return this._tilesets},setTilesets:function(a){this._tilesets.push(a)},getObjectGroups:function(){return this._objectGroups},setObjectGroups:function(a){this._objectGroups.push(a)},getParentElement:function(){return this.parentElement},setParentElement:function(a){this.parentElement=a},getParentGID:function(){return this.parentGID},setParentGID:function(a){this.parentGID=a},getLayerAttribs:function(){return this.layerAttrs},setLayerAttribs:function(a){this.layerAttrs=a},getStoringCharacters:function(){return this.storingCharacters},
setStoringCharacters:function(a){this.storingCharacters=a},getProperties:function(){return this.properties},setProperties:function(a){this.properties=a},initWithTMXFile:function(a){this._internalInit(a,null);return this.parseXMLFile(a)},initWithXML:function(a,b){this._internalInit(null,b);return this.parseXMLString(a)},parseXMLFile:function(a,b){var c=(b=b||!1)?a:cc.loader.getRes(a);if(!c)throw Error("Please load the resource first : "+a);var d,e,c=this._parseXML(c).documentElement;d=c.getAttribute("version");
e=c.getAttribute("orientation");if("map"===c.nodeName&&("1.0"!==d&&null!==d&&cc.log("cocos2d: TMXFormat: Unsupported TMX version:"+d),"orthogonal"===e?this.orientation=cc.TMX_ORIENTATION_ORTHO:"isometric"===e?this.orientation=cc.TMX_ORIENTATION_ISO:"hexagonal"===e?this.orientation=cc.TMX_ORIENTATION_HEX:null!==e&&cc.log("cocos2d: TMXFomat: Unsupported orientation:"+e),d=cc.size(0,0),d.width=parseFloat(c.getAttribute("width")),d.height=parseFloat(c.getAttribute("height")),this.setMapSize(d),d=cc.size(0,
0),d.width=parseFloat(c.getAttribute("tilewidth")),d.height=parseFloat(c.getAttribute("tileheight")),this.setTileSize(d),e=c.querySelectorAll("map \x3e properties \x3e property"))){var f={};for(d=0;d=this._layerSize.width||a.y>=this._layerSize.height||
0>a.x||0>a.y)throw Error("cc.TMXLayer.getTileAt(): invalid position");if(!this.tiles||!this._atlasIndexArray)return cc.log("cc.TMXLayer.getTileAt(): TMXLayer: the tiles map has been released"),null;var c=null,d=this.getTileGIDAt(a);if(0===d)return c;var e=0|a.x+a.y*this._layerSize.width,c=this.getChildByTag(e);c||(d=this.tileset.rectForGID(d),d=cc.rectPixelsToPoints(d),c=new cc.Sprite,c.initWithTexture(this.texture,d),c.batchNode=this,c.setPosition(this.getPositionAt(a)),c.vertexZ=this._vertexZForPos(a),
c.anchorX=0,c.anchorY=0,c.opacity=this._opacity,d=this._atlasIndexForExistantZ(e),this.addSpriteWithoutQuad(c,d,e));return c},getTileGIDAt:function(a,b){if(null==a)throw Error("cc.TMXLayer.getTileGIDAt(): pos should be non-null");void 0!==b&&(a=cc.p(a,b));if(a.x>=this._layerSize.width||a.y>=this._layerSize.height||0>a.x||0>a.y)throw Error("cc.TMXLayer.getTileGIDAt(): invalid position");return this.tiles&&this._atlasIndexArray?(this.tiles[0|a.x+a.y*this._layerSize.width]&cc.TMX_TILE_FLIPPED_MASK)>>>
0:(cc.log("cc.TMXLayer.getTileGIDAt(): TMXLayer: the tiles map has been released"),null)},getTileFlagsAt:function(a,b){if(!a)throw Error("cc.TMXLayer.getTileFlagsAt(): pos should be non-null");void 0!==b&&(a=cc.p(a,b));if(a.x>=this._layerSize.width||a.y>=this._layerSize.height||0>a.x||0>a.y)throw Error("cc.TMXLayer.getTileFlagsAt(): invalid position");return this.tiles&&this._atlasIndexArray?(this.tiles[0|a.x+a.y*this._layerSize.width]&cc.TMX_TILE_FLIPPED_ALL)>>>0:(cc.log("cc.TMXLayer.getTileFlagsAt(): TMXLayer: the tiles map has been released"),
null)},setTileGID:function(a,b,c,d){if(!b)throw Error("cc.TMXLayer.setTileGID(): pos should be non-null");void 0!==d?b=cc.p(b,c):d=c;if(b.x>=this._layerSize.width||b.y>=this._layerSize.height||0>b.x||0>b.y)throw Error("cc.TMXLayer.setTileGID(): invalid position");if(this.tiles&&this._atlasIndexArray)if(0!==a&&a>>0,0===a)this.removeTileAt(b);else if(0===e)this._insertTileForGID(c,b);else{var e=b.x+b.y*this._layerSize.width,f=this.getChildByTag(e);f?(a=this.tileset.rectForGID(a),a=cc.rectPixelsToPoints(a),f.setTextureRect(a,!1),null!=d&&this._setupTileSprite(f,b,c),this.tiles[e]=c):this._updateTileForGID(c,b)}}else cc.log("cc.TMXLayer.setTileGID(): TMXLayer: the tiles map has been released")},removeTileAt:function(a,b){if(!a)throw Error("cc.TMXLayer.removeTileAt(): pos should be non-null");void 0!==b&&
(a=cc.p(a,b));if(a.x>=this._layerSize.width||a.y>=this._layerSize.height||0>a.x||0>a.y)throw Error("cc.TMXLayer.removeTileAt(): invalid position");if(!this.tiles||!this._atlasIndexArray)cc.log("cc.TMXLayer.removeTileAt(): TMXLayer: the tiles map has been released");else if(0!==this.getTileGIDAt(a)){cc._renderType===cc._RENDER_TYPE_CANVAS&&this._setNodeDirtyForCache();var c=0|a.x+a.y*this._layerSize.width,d=this._atlasIndexForExistantZ(c);this.tiles[c]=0;this._atlasIndexArray.splice(d,1);if(c=this.getChildByTag(c))cc.SpriteBatchNode.prototype.removeChild.call(this,
c,!0);else if(cc._renderType===cc._RENDER_TYPE_WEBGL&&this.textureAtlas.removeQuadAtIndex(d),this._children)for(var c=this._children,e=0,f=c.length;e=d&&(g.atlasIndex=h-1)}}}},getPositionAt:function(a,b){void 0!==b&&(a=cc.p(a,b));var c=cc.p(0,0);switch(this.layerOrientation){case cc.TMX_ORIENTATION_ORTHO:c=this._positionForOrthoAt(a);break;case cc.TMX_ORIENTATION_ISO:c=this._positionForIsoAt(a);break;case cc.TMX_ORIENTATION_HEX:c=this._positionForHexAt(a)}return cc.pointPixelsToPoints(c)},
getProperty:function(a){return this.properties[a]},setupTiles:function(){this._renderCmd.initImageSize();this._parseInternalProperties();cc._renderType===cc._RENDER_TYPE_CANVAS&&this._setNodeDirtyForCache();for(var a=this._layerSize.height,b=this._layerSize.width,c=0;c=this.tileset.firstGid&&this._minGID>=this.tileset.firstGid||
cc.log("cocos2d:TMX: Only 1 tileset per layer is supported")},addChild:function(a,b,c){cc.log("addChild: is not supported on cc.TMXLayer. Instead use setTileGID or tileAt.")},removeChild:function(a,b){if(a)if(-1===this._children.indexOf(a))cc.log("cc.TMXLayer.removeChild(): Tile does not belong to TMXLayer");else{cc._renderType===cc._RENDER_TYPE_CANVAS&&this._setNodeDirtyForCache();var c=a.atlasIndex;this.tiles[this._atlasIndexArray[c]]=0;this._atlasIndexArray.splice(c,1);cc.SpriteBatchNode.prototype.removeChild.call(this,
a,b);cc.renderer.childrenOrderDirty=!0}},getLayerName:function(){return this.layerName},setLayerName:function(a){this.layerName=a},_positionForIsoAt:function(a){return cc.p(this._mapTileSize.width/2*(this._layerSize.width+a.x-a.y-1),this._mapTileSize.height/2*(2*this._layerSize.height-a.x-a.y-2))},_positionForOrthoAt:function(a){return cc.p(a.x*this._mapTileSize.width,(this._layerSize.height-a.y-1)*this._mapTileSize.height)},_positionForHexAt:function(a){return cc.p(a.x*this._mapTileSize.width*3/
4,(this._layerSize.height-a.y-1)*this._mapTileSize.height+(1===a.x%2?-this._mapTileSize.height/2:0))},_calculateLayerOffset:function(a){var b=cc.p(0,0);switch(this.layerOrientation){case cc.TMX_ORIENTATION_ORTHO:b=cc.p(a.x*this._mapTileSize.width,-a.y*this._mapTileSize.height);break;case cc.TMX_ORIENTATION_ISO:b=cc.p(this._mapTileSize.width/2*(a.x-a.y),this._mapTileSize.height/2*(-a.x-a.y));break;case cc.TMX_ORIENTATION_HEX:0===a.x&&0===a.y||cc.log("offset for hexagonal map not implemented yet")}return b},
_appendTileForGID:function(a,b){var c=this.tileset.rectForGID(a),c=cc.rectPixelsToPoints(c),d=0|b.x+b.y*this._layerSize.width,c=this._renderCmd._reusedTileWithRect(c);this._setupTileSprite(c,b,a);var e=this._atlasIndexArray.length;this.insertQuadFromSprite(c,e);this._atlasIndexArray.splice(e,0,d);return c},_insertTileForGID:function(a,b){var c=this.tileset.rectForGID(a),c=cc.rectPixelsToPoints(c),d=0|b.x+b.y*this._layerSize.width,c=this._renderCmd._reusedTileWithRect(c);this._setupTileSprite(c,b,
a);var e=this._atlasIndexForNewZ(d);this.insertQuadFromSprite(c,e);this._atlasIndexArray.splice(e,0,d);if(this._children)for(var f=this._children,g=0,h=f.length;g=e&&(k.atlasIndex=m+1)}}this.tiles[d]=a;return c},_updateTileForGID:function(a,b){var c=this.tileset.rectForGID(a),d=this._contentScaleFactor,c=cc.rect(c.x/d,c.y/d,c.width/d,c.height/d),d=b.x+b.y*this._layerSize.width,c=this._renderCmd._reusedTileWithRect(c);this._setupTileSprite(c,b,a);c.atlasIndex=
this._atlasIndexForExistantZ(d);c.dirty=!0;c.updateTransform();this.tiles[d]=a;return c},_parseInternalProperties:function(){var a=this.getProperty("cc_vertexz");if(a)if("automatic"===a){this._useAutomaticVertexZ=!0;var b=this.getProperty("cc_alpha_func"),a=0;b&&(a=parseFloat(b));cc._renderType===cc._RENDER_TYPE_WEBGL&&(this.shaderProgram=cc.shaderCache.programForKey(cc.SHADER_POSITION_TEXTURECOLORALPHATEST),b=cc._renderContext.getUniformLocation(this.shaderProgram.getProgram(),cc.UNIFORM_ALPHA_TEST_VALUE_S),
this.shaderProgram.use(),this.shaderProgram.setUniformLocationWith1f(b,a))}else this._vertexZvalue=parseInt(a,10)},_setupTileSprite:function(a,b,c){var d=b.x+b.y*this._layerSize.width;a.setPosition(this.getPositionAt(b));cc._renderType===cc._RENDER_TYPE_WEBGL?a.vertexZ=this._vertexZForPos(b):a.tag=d;a.anchorX=0;a.anchorY=0;a.opacity=this._opacity;cc._renderType===cc._RENDER_TYPE_WEBGL&&(a.rotation=0);a.setFlippedX(!1);a.setFlippedY(!1);(c&cc.TMX_TILE_DIAGONAL_FLAG)>>>0?(a.anchorX=0.5,a.anchorY=0.5,
a.x=this.getPositionAt(b).x+a.width/2,a.y=this.getPositionAt(b).y+a.height/2,b=(c&(cc.TMX_TILE_HORIZONTAL_FLAG|cc.TMX_TILE_VERTICAL_FLAG)>>>0)>>>0,b===cc.TMX_TILE_HORIZONTAL_FLAG?a.rotation=90:b===cc.TMX_TILE_VERTICAL_FLAG?a.rotation=270:(a.rotation=b===(cc.TMX_TILE_VERTICAL_FLAG|cc.TMX_TILE_HORIZONTAL_FLAG)>>>0?90:270,a.setFlippedX(!0))):((c&cc.TMX_TILE_HORIZONTAL_FLAG)>>>0&&a.setFlippedX(!0),(c&cc.TMX_TILE_VERTICAL_FLAG)>>>0&&a.setFlippedY(!0))},_vertexZForPos:function(a){var b=0,c=0;if(this._useAutomaticVertexZ)switch(this.layerOrientation){case cc.TMX_ORIENTATION_ISO:c=
this._layerSize.width+this._layerSize.height;b=-(c-(a.x+a.y));break;case cc.TMX_ORIENTATION_ORTHO:b=-(this._layerSize.height-a.y);break;case cc.TMX_ORIENTATION_HEX:cc.log("TMX Hexa zOrder not supported");break;default:cc.log("TMX invalid value")}else b=this._vertexZvalue;return b},_atlasIndexForExistantZ:function(a){var b;if(this._atlasIndexArray)for(var c=this._atlasIndexArray,d=0,e=c.length;d=e)){var f=this._node;this._renderingChildToCache();var g=a||cc._renderContext;a=g.getContext();g.setGlobalAlpha(e);(e=this._cacheCanvas)&&0!==e.width&&0!==e.height&&(g.setTransform(this._realWorldTransform,c,d),g=e.height*d,f.layerOrientation===cc.TMX_ORIENTATION_HEX?a.drawImage(e,0,0,e.width,e.height,0,-g+0.5*f._mapTileSize.height*d,e.width*c,g):a.drawImage(e,0,0,e.width,e.height,0,-g,e.width*c,g));cc.g_NumberOfDraws++}};a._updateCacheContext=function(a,
c){var d=this._node,e=d._contentSize,f=this._cacheCanvas,g=cc.contentScaleFactor();f.width=0|1.5*e.width*g;f.height=0|1.5*e.height*g;d.layerOrientation===cc.TMX_ORIENTATION_HEX?this._cacheContext.setOffset(0,0.5*-d._mapTileSize.height):this._cacheContext.setOffset(0,0);d=this._cacheTexture._contentSize;d.width=f.width;d.height=f.height};a.getTexture=function(){return this._cacheTexture};a.visit=function(a){var c=this._node,d,e=c._children;if(c._visible&&e&&0!==e.length){if(a=a||this.getParentRenderCmd())this._curLevel=
a._curLevel+1;this._syncStatus(a);if(this._cacheDirty){a=this._cacheContext;var f=this._cacheCanvas,g=a.getContext(),h=c.__instanceId,k=cc.renderer;k._turnToCacheMode(h);c.sortAllChildren();c=0;for(d=e.length;cb?window.__audioSupport={MULTI_CHANNEL:!1,WEB_AUDIO:!0,AUTOPLAY:!1}:42===b&&(window.__audioSupport.NEED_MANUAL_LOOP=
!0);break;case a.BROWSER_TYPE_MIUI:cc.sys.isMobile&&(b=b.match(/\d+/g),2>b[0]||2===b[0]&&0===b[1]&&1>=b[2])&&(window.__audioSupport.AUTOPLAY=!1)}})();
cc.Audio=cc.Class.extend({volume:1,loop:!1,src:null,_touch:!1,_playing:!1,_AUDIO_TYPE:"AUDIO",_pause:!1,_buffer:null,_currentSource:null,_startTime:null,_currentTime:null,_context:null,_volume:null,_ignoreEnded:!1,_manualLoop:!1,_element:null,ctor:function(a,b,c){a&&(this._context=a);b&&(this._volume=b);a&&b&&(this._AUDIO_TYPE="WEBAUDIO");this.src=c},_setBufferCallback:null,setBuffer:function(a){if(a){var b=this._playing;this._AUDIO_TYPE="WEBAUDIO";this._buffer&&this._buffer!==a&&this.getPlaying()&&
this.stop();this._buffer=a;b&&this.play();this._volume.gain.value=this.volume;this._setBufferCallback&&this._setBufferCallback(a)}},_setElementCallback:null,setElement:function(a){if(a){var b=this._playing;this._AUDIO_TYPE="AUDIO";this._element&&this._element!==a&&this.getPlaying()&&this.stop();this._element=a;b&&this.play();a.volume=this.volume;a.loop=this.loop;this._setElementCallback&&this._setElementCallback(a)}},play:function(a,b){this._playing=!0;this.loop=void 0===b?this.loop:b;"AUDIO"===this._AUDIO_TYPE?
this._playOfAudio(a):this._playOfWebAudio(a)},getPlaying:function(){if(!this._playing)return!1;if("AUDIO"===this._AUDIO_TYPE){var a=this._element;return!a||this._pause||a.ended?this._playing=!1:!0}return(a=this._currentSource)&&a.playbackState?this._currentTime+this._context.currentTime-this._startTime
b.buffer.duration)this._stopOfWebAudio();else return;b=this._context.createBufferSource();b.buffer=this._buffer;b.connect(this._volume);b.loop=this._manualLoop?!1:this.loop;this._startTime=this._context.currentTime;this._currentTime=a||0;this._ignoreEnded=!1;if(b.start)b.start(0,a||0);else if(b.noteGrainOn){var c=b.buffer.duration;this.loop?b.noteGrainOn(0,a,c):b.noteGrainOn(0,a,c-a)}else b.noteOn(0);this._currentSource=b;var d=this;b.onended=function(){d._manualLoop&&d._playing&&d.loop?(d.stop(),
d.play()):d._ignoreEnded?d._ignoreEnded=!1:d._pause?d._playing=!1:d.stop()}}},_playOfAudio:function(){var a=this._element;a&&(a.loop=this.loop,a.play())},stop:function(){this._playing=!1;"AUDIO"===this._AUDIO_TYPE?this._stopOfAudio():this._stopOfWebAudio()},_stopOfWebAudio:function(){var a=this._currentSource;this._ignoreEnded=!0;a&&(a.stop(0),this._currentSource=null)},_stopOfAudio:function(){var a=this._element;a&&(a.pause(),a.duration&&Infinity!==a.duration&&(a.currentTime=0))},pause:function(){!1!==
this.getPlaying()&&(this._playing=!1,this._pause=!0,"AUDIO"===this._AUDIO_TYPE?this._pauseOfAudio():this._pauseOfWebAudio())},_pauseOfWebAudio:function(){this._currentTime+=this._context.currentTime-this._startTime;var a=this._currentSource;a&&a.stop(0)},_pauseOfAudio:function(){var a=this._element;a&&a.pause()},resume:function(){this._pause&&("AUDIO"===this._AUDIO_TYPE?this._resumeOfAudio():this._resumeOfWebAudio(),this._pause=!1,this._playing=!0)},_resumeOfWebAudio:function(){var a=this._currentSource;
a&&(this._startTime=this._context.currentTime,this._playOfWebAudio(this._currentTime%a.buffer.duration))},_resumeOfAudio:function(){var a=this._element;a&&a.play()},setVolume:function(a){1a&&(a=0);this.volume=a;"AUDIO"===this._AUDIO_TYPE?this._element&&(this._element.volume=a):this._volume&&(this._volume.gain.value=a)},getVolume:function(){return this.volume},cloneNode:function(){var a,b;if("AUDIO"===this._AUDIO_TYPE){a=new cc.Audio;var c=document.createElement("audio");c.src=this.src;
a.setElement(c)}else c=this._context.createGain(),c.gain.value=1,c.connect(this._context.destination),a=new cc.Audio(this._context,c,this.src),this._buffer?a.setBuffer(this._buffer):(b=this,this._setBufferCallback=function(c){a.setBuffer(c);b._setBufferCallback=null}),a._manualLoop=this._manualLoop;a._AUDIO_TYPE=this._AUDIO_TYPE;return a}});
(function(a){var b=a.WEB_AUDIO,c=a.MULTI_CHANNEL,d=a.AUTOPLAY,e=[];(function(){var a=document.createElement("audio");if(a.canPlayType){var b=a.canPlayType('audio/ogg; codecs\x3d"vorbis"');b&&""!==b&&e.push(".ogg");(b=a.canPlayType("audio/mpeg"))&&""!==b&&e.push(".mp3");(b=a.canPlayType('audio/wav; codecs\x3d"1"'))&&""!==b&&e.push(".wav");(b=a.canPlayType("audio/mp4"))&&""!==b&&e.push(".mp4");(a=a.canPlayType("audio/x-m4a"))&&""!==a&&e.push(".m4a")}})();try{if(b){var f=new (window.AudioContext||window.webkitAudioContext||
window.mozAudioContext);a.DELAY_CREATE_CTX&&setTimeout(function(){f=new (window.AudioContext||window.webkitAudioContext||window.mozAudioContext)},0)}}catch(g){b=!1,cc.log("browser don't support web audio")}var h={cache:{},load:function(c,d,g,k){if(0===e.length)return k("can not support audio!");cc.loader.audioPath&&(c=cc.path.join(cc.loader.audioPath,c));var r=cc.path.extname(c),v=[r];for(g=0;ga&&(a=0);this._musicVolume=
a;var b=this._currMusic;b&&b.setVolume(a)},isMusicPlaying:function(){var a=this._currMusic;return a?a.getPlaying():!1},_audioPool:{},_maxAudioInstance:5,_effectVolume:1,playEffect:function(a,d){if(!c)return null;var e=this._audioPool[a];e||(e=this._audioPool[a]=[]);var f;for(f=0;fthis._maxAudioInstance)cc.log("Error: %s greater than %d",a,this._maxAudioInstance);else{var g=h.cache[a];g||(cc.loader.load(a),
g=h.cache[a]);g=g.cloneNode();g.setVolume(this._effectVolume);g.loop=d||!1;g.play();e.push(g)}return g},setEffectsVolume:function(a){a-=0;isNaN(a)&&(a=1);1a&&(a=0);this._effectVolume=a;var b=this._audioPool,c;for(c in b){var d=b[c];if(Array.isArray(d))for(var e=0;e=d.width&&(d.width=c.width),0>=d.height&&(d.height=c.height),a.setContentSize(d));c=b?b.getBoundingBox():cc.rect(0,0,0,0);d=a?a.getBoundingBox():cc.rect(0,
0,0,0);c=cc.rectUnion(c,d);this.setContentSize(c.width,c.height);c=this.getContentSize();b&&(b.setPosition(c.width/2,c.height/2),b.setVisible(!0));a&&(a.setPosition(c.width/2,c.height/2),a.setVisible(!0))}},initWithLabelAndBackgroundSprite:function(a,b){if(!a)throw Error("cc.ControlButton.initWithLabelAndBackgroundSprite(): label should be non-null");if(!b)throw Error("cc.ControlButton.initWithLabelAndBackgroundSprite(): backgroundSprite should be non-null");if(cc.Control.prototype.init.call(this,
!0)){this._parentInited=!0;this._titleDispatchTable={};this._titleColorDispatchTable={};this._titleLabelDispatchTable={};this._backgroundSpriteDispatchTable={};this._isPushed=!1;this.zoomOnTouchDown=!0;this._currentTitle=null;this.setAdjustBackgroundImage(!0);this.setPreferredSize(cc.size(0,0));this.zoomOnTouchDown=!0;this.ignoreAnchorPointForPosition(!1);this.setAnchorPoint(0.5,0.5);this._titleLabel=a;this._backgroundSprite=b;this.setOpacity(255);this.setOpacityModifyRGB(!0);var c=a.getString();
this.setTitleForState(c,cc.CONTROL_STATE_NORMAL);this.setTitleColorForState(a.getColor(),cc.CONTROL_STATE_NORMAL);this.setTitleLabelForState(a,cc.CONTROL_STATE_NORMAL);this.setBackgroundSpriteForState(b,cc.CONTROL_STATE_NORMAL);this._state=cc.CONTROL_STATE_NORMAL;this._marginH=24;this._marginV=12;this._labelAnchorPoint=cc.p(0.5,0.5);this.setPreferredSize(cc.size(0,0));this.needsLayout();return!0}return!1},initWithTitleAndFontNameAndFontSize:function(a,b,c){a=new cc.LabelTTF(a,b,c);return this.initWithLabelAndBackgroundSprite(a,
new cc.Scale9Sprite)},initWithBackgroundSprite:function(a){var b=new cc.LabelTTF("","Arial",30);return this.initWithLabelAndBackgroundSprite(b,a)},doesAdjustBackgroundImage:function(){return this._doesAdjustBackgroundImage},setAdjustBackgroundImage:function(a){this._doesAdjustBackgroundImage=a;this.needsLayout()},getZoomOnTouchDown:function(){return this.zoomOnTouchDown},setZoomOnTouchDown:function(a){return this.zoomOnTouchDown=a},getPreferredSize:function(){return this._preferredSize},setPreferredSize:function(a){if(0===
a.width&&0===a.height)this._doesAdjustBackgroundImage=!0;else{this._doesAdjustBackgroundImage=!1;var b=this._backgroundSpriteDispatchTable,c;for(c in b)b[c].setPreferredSize(a)}this._preferredSize=a;this.needsLayout()},getLabelAnchorPoint:function(){return this._labelAnchorPoint},setLabelAnchorPoint:function(a){this._labelAnchorPoint=a;this._titleLabel&&this._titleLabel.setAnchorPoint(a)},_getCurrentTitle:function(){return this._currentTitle},_getCurrentTitleColor:function(){return this._currentTitleColor},
getOpacity:function(){return this._opacity},setOpacity:function(a){cc.Control.prototype.setOpacity.call(this,a);var b=this._backgroundSpriteDispatchTable,c;for(c in b)b[c].setOpacity(a)},setColor:function(a){cc.Control.prototype.setColor.call(this,a);var b=this._backgroundSpriteDispatchTable,c;for(c in b)b[c].setColor(a)},getColor:function(){var a=this._realColor;return cc.color(a.r,a.g,a.b,a.a)},isPushed:function(){return this._isPushed},_getVerticalMargin:function(){return this._marginV},_getHorizontalOrigin:function(){return this._marginH},
setMargins:function(a,b){this._marginV=b;this._marginH=a;this.needsLayout()},setEnabled:function(a){cc.Control.prototype.setEnabled.call(this,a);this.needsLayout()},setSelected:function(a){cc.Control.prototype.setSelected.call(this,a);this.needsLayout()},setHighlighted:function(a){this._state=a?cc.CONTROL_STATE_HIGHLIGHTED:cc.CONTROL_STATE_NORMAL;cc.Control.prototype.setHighlighted.call(this,a);(a=this.getActionByTag(cc.CONTROL_ZOOM_ACTION_TAG))&&this.stopAction(a);this.zoomOnTouchDown&&(a=this.isHighlighted()&&
this.isEnabled()&&!this.isSelected()?1.1:1,a=cc.scaleTo(0.05,a),a.setTag(cc.CONTROL_ZOOM_ACTION_TAG),this.runAction(a))},onTouchBegan:function(a,b){if(!(this.isTouchInside(a)&&this.isEnabled()&&this.isVisible()&&this.hasVisibleParents()))return!1;this._isPushed=!0;this.setHighlighted(!0);this.sendActionsForControlEvents(cc.CONTROL_EVENT_TOUCH_DOWN);return!0},onTouchMoved:function(a,b){if(this._enabled&&this._isPushed&&!this._selected){var c=this.isTouchInside(a);c&&!this._highlighted?(this.setHighlighted(!0),
this.sendActionsForControlEvents(cc.CONTROL_EVENT_TOUCH_DRAG_ENTER)):c&&this._highlighted?this.sendActionsForControlEvents(cc.CONTROL_EVENT_TOUCH_DRAG_INSIDE):!c&&this._highlighted?(this.setHighlighted(!1),this.sendActionsForControlEvents(cc.CONTROL_EVENT_TOUCH_DRAG_EXIT)):c||this._highlighted||this.sendActionsForControlEvents(cc.CONTROL_EVENT_TOUCH_DRAG_OUTSIDE)}else this._highlighted&&this.setHighlighted(!1)},onTouchEnded:function(a,b){this._isPushed=!1;this.setHighlighted(!1);this.isTouchInside(a)?
this.sendActionsForControlEvents(cc.CONTROL_EVENT_TOUCH_UP_INSIDE):this.sendActionsForControlEvents(cc.CONTROL_EVENT_TOUCH_UP_OUTSIDE)},onTouchCancelled:function(a,b){this._isPushed=!1;this.setHighlighted(!1);this.sendActionsForControlEvents(cc.CONTROL_EVENT_TOUCH_CANCEL)},getTitleForState:function(a){var b=this._titleDispatchTable;return b?b[a]?b[a]:b[cc.CONTROL_STATE_NORMAL]:""},setTitleForState:function(a,b){this._titleDispatchTable[b]=a||"";this.getState()===b&&this.needsLayout()},getTitleColorForState:function(a){return(a=
this._titleColorDispatchTable[a])?a:(a=this._titleColorDispatchTable[cc.CONTROL_STATE_NORMAL])?a:cc.color.WHITE},setTitleColorForState:function(a,b){this._titleColorDispatchTable[b]=a;this.getState()===b&&this.needsLayout()},getTitleLabelForState:function(a){var b=this._titleLabelDispatchTable;return b[a]?b[a]:b[cc.CONTROL_STATE_NORMAL]},setTitleLabelForState:function(a,b){var c=this._titleLabelDispatchTable;if(c[b]){var d=c[b];d&&this.removeChild(d,!0)}c[b]=a;a.setVisible(!1);a.setAnchorPoint(0.5,
0.5);this.addChild(a,1);this.getState()===b&&this.needsLayout()},setTitleTTFForState:function(a,b){var c=this.getTitleForState(b);c||(c="");this.setTitleLabelForState(new cc.LabelTTF(c,a,12),b)},getTitleTTFForState:function(a){a=this.getTitleLabelForState(a);return null!=a&&a instanceof cc.LabelTTF?a.getFontName():""},setTitleTTFSizeForState:function(a,b){var c=this.getTitleLabelForState(b);null!=c&&c instanceof cc.LabelTTF&&c.setFontSize(a)},getTitleTTFSizeForState:function(a){a=this.getTitleLabelForState(a);
return null!=a&&a instanceof cc.LabelTTF?a.getFontSize():0},setTitleBMFontForState:function(a,b){var c=this.getTitleForState(b);c||(c="");this.setTitleLabelForState(new cc.LabelBMFont(c,a),b)},getTitleBMFontForState:function(a){a=this.getTitleLabelForState(a);return null!=a&&a instanceof cc.LabelBMFont?a.getFntFile():""},getBackgroundSpriteForState:function(a){var b=this._backgroundSpriteDispatchTable;return b[a]?b[a]:b[cc.CONTROL_STATE_NORMAL]},setBackgroundSpriteForState:function(a,b){var c=this._backgroundSpriteDispatchTable;
if(c[b]){var d=c[b];d&&this.removeChild(d,!0)}c[b]=a;a.setVisible(!1);a.setAnchorPoint(0.5,0.5);this.addChild(a);c=this._preferredSize;0===c.width&&0===c.height||a.setPreferredSize(c);this._state===b&&this.needsLayout()},setBackgroundSpriteFrameForState:function(a,b){var c=cc.Scale9Sprite.createWithSpriteFrame(a);this.setBackgroundSpriteForState(c,b)}});_p=cc.ControlButton.prototype;cc.defineGetterSetter(_p,"adjustBackground",_p.getAdjustBackgroundImage,_p.setAdjustBackgroundImage);
cc.defineGetterSetter(_p,"preferredSize",_p.getPreferredSize,_p.setPreferredSize);cc.defineGetterSetter(_p,"labelAnchor",_p.getLabelAnchorPoint,_p.setLabelAnchorPoint);_p=null;cc.ControlButton.create=function(a,b,c){return new cc.ControlButton(a,b,c)};cc.RGBA=function(a,b,c,d){this.r=a;this.g=b;this.b=c;this.a=d};cc.HSV=function(a,b,c){this.h=a;this.s=b;this.v=c};cc.ControlUtils={};cc.ControlUtils.addSpriteToTargetWithPosAndAnchor=function(a,b,c,d){a=new cc.Sprite("#"+a);if(!a)return null;a.setPosition(c);a.setAnchorPoint(d);b.addChild(a);return a};
cc.ControlUtils.HSVfromRGB=function(a){var b=new cc.HSV,c,d;c=a.ra.g?a.r:a.g;d=d>a.b?d:a.b;b.v=d;c=d-c;if(0=d?(a.g-a.b)/c:a.g>=d?2+(a.b-a.r)/c:4+(a.r-a.g)/c;b.h*=60;0>b.h&&(b.h+=360);return b};
cc.ControlUtils.RGBfromHSV=function(a){var b,c,d,e,f=new cc.RGBA;f.a=1;if(0>=a.s){if(!a.h)return f.r=a.v,f.g=a.v,f.b=a.v,f;f.r=0;f.g=0;f.b=0;return f}b=a.h;360<=b&&(b=0);b/=60;e=0|b;d=b-e;b=a.v*(1-a.s);c=a.v*(1-a.s*d);d=a.v*(1-a.s*(1-d));switch(e){case 0:f.r=a.v;f.g=d;f.b=b;break;case 1:f.r=c;f.g=a.v;f.b=b;break;case 2:f.r=b;f.g=a.v;f.b=d;break;case 3:f.r=b;f.g=c;f.b=a.v;break;case 4:f.r=d;f.g=b;f.b=a.v;break;default:f.r=a.v,f.g=b,f.b=c}return f};
cc.ControlUtils.CCRectUnion=function(a,b){return cc.rectUnion(a,b)};cc.Invocation=cc.Class.extend({_action:null,_target:null,_controlEvent:null,ctor:function(a,b,c){this._target=a;this._action=b;this._controlEvent=c},getAction:function(){return this._action},getTarget:function(){return this._target},getControlEvent:function(){return this._controlEvent},invoke:function(a){if(this._target&&this._action)if(cc.isString(this._action))this._target[this._action](a,this._controlEvent);else this._action.call(this._target,a,this._controlEvent)}});cc.Scale9Sprite=cc.Node.extend({_spriteRect:null,_capInsetsInternal:null,_positionsAreDirty:!1,_scale9Image:null,_topLeft:null,_top:null,_topRight:null,_left:null,_centre:null,_right:null,_bottomLeft:null,_bottom:null,_bottomRight:null,_scale9Dirty:!0,_opacityModifyRGB:!1,_originalSize:null,_preferredSize:null,_opacity:0,_color:null,_capInsets:null,_insetLeft:0,_insetTop:0,_insetRight:0,_insetBottom:0,_spritesGenerated:!1,_spriteFrameRotated:!1,_textureLoaded:!1,_className:"Scale9Sprite",_flippedX:!1,
_flippedY:!1,textureLoaded:function(){return this._textureLoaded},addLoadedEventListener:function(a,b){this.addEventListener("load",a,b)},_updateCapInset:function(){var a;a=this._insetLeft;var b=this._insetTop,c=this._insetRight,d=this._spriteRect,e=this._insetBottom;a=0===a&&0===b&&0===c&&0===e?cc.rect(0,0,0,0):this._spriteFrameRotated?cc.rect(e,a,d.width-c-a,d.height-b-e):cc.rect(a,b,d.width-a-c,d.height-b-e);this.setCapInsets(a)},_updatePositions:function(){if(this._topLeft&&this._topRight&&this._bottomRight&&
this._bottomLeft&&this._centre){var a=this._contentSize,b=this._topLeft,c=this._topRight,d=this._bottomRight,e=this._bottomLeft,f=this._centre,g=this._centre.getContentSize(),h=b.getContentSize(),k=e.getContentSize(),m=a.width-h.width-c.getContentSize().width,a=a.height-h.height-d.getContentSize().height,m=m/g.width,a=a/g.height,h=g.width*m,n=g.height*a,p=k.width,k=k.height;if(cc._renderType===cc._RENDER_TYPE_WEBGL){var t=Math.round(h);h!==t&&(h=t,m=h/g.width);t=Math.round(n);n!==t&&(n=t,a=n/g.height)}f.setScaleX(m);
f.setScaleY(a);var g=this._left,t=this._right,r=this._top,v=this._bottom,s=cc.p(0,0);e.setAnchorPoint(s);d.setAnchorPoint(s);b.setAnchorPoint(s);c.setAnchorPoint(s);g.setAnchorPoint(s);t.setAnchorPoint(s);r.setAnchorPoint(s);v.setAnchorPoint(s);f.setAnchorPoint(s);e.setPosition(0,0);d.setPosition(p+h,0);b.setPosition(0,k+n);c.setPosition(p+h,k+n);g.setPosition(0,k);g.setScaleY(a);t.setPosition(p+h,k);t.setScaleY(a);v.setPosition(p,0);v.setScaleX(m);r.setPosition(p,k+n);r.setScaleX(m);f.setPosition(p,
k)}},ctor:function(a,b,c){cc.Node.prototype.ctor.call(this);this._spriteRect=cc.rect(0,0,0,0);this._capInsetsInternal=cc.rect(0,0,0,0);this._originalSize=cc.size(0,0);this._preferredSize=cc.size(0,0);this._capInsets=cc.rect(0,0,0,0);if(void 0!=a)if(a instanceof cc.SpriteFrame)this.initWithSpriteFrame(a,b);else{var d=cc.spriteFrameCache.getSpriteFrame(a);null!=d?this.initWithSpriteFrame(d,b):this.initWithFile(a,b,c)}else this.init()},getSprite:function(){return this._scale9Image},getOriginalSize:function(){return cc.size(this._originalSize)},
getPreferredSize:function(){return cc.size(this._preferredSize)},_getPreferredWidth:function(){return this._preferredSize.width},_getPreferredHeight:function(){return this._preferredSize.height},setPreferredSize:function(a){this.setContentSize(a);this._preferredSize=a;this._positionsAreDirty&&(this._updatePositions(),this._positionsAreDirty=!1,this._scale9Dirty=!0)},_setPreferredWidth:function(a){this._setWidth(a);this._preferredSize.width=a},_setPreferredHeight:function(a){this._setHeight(a);this._preferredSize.height=
a},setOpacity:function(a){this._scale9Image&&(cc.Node.prototype.setOpacity.call(this,a),this._scale9Dirty=!0)},setColor:function(a){if(this._scale9Image){cc.Node.prototype.setColor.call(this,a);for(var b=this._scale9Image.getChildren(),c=0;c=b.length?cc.log("cc.MenuPassive.alignItemsInColumns(): invalid row index"):(h=b[e])?(k=this._children[c].getContentSize().height,f=0|(f>=k||null==k?f:k),++g,g>=h&&(d+=f+5,f=g=0,++e)):cc.log("cc.MenuPassive.alignItemsInColumns(): can not have zero columns on a row"));var m=cc.director.getWinSize(),n=h=f=e=0,p=0,d=d/2;if(this._children&&0=k||null==k?f:k),this._children[c].setPosition(p-m.width/2,d-this._children[c].getContentSize().height/2),p+=n,++g,g>=h&&(d-=f+5,f=h=g=0,++e))},alignItemsInRows:function(a){var b=[],c;for(c=1;c=b.length?cc.log("cc.MenuPassive.alignItemsInRows(): invalid row index"):(n=b[h])?(p=this._children[c].getContentSize().width,
k=0|(k>=p||null==p?k:p),g+=0|this._children[c].getContentSize().height+5,++m,m>=n&&(d.push(k),e.push(g),f+=k+10,k=m=0,g=-5,++h)):cc.log("cc.MenuPassive.alignItemsInColumns(): can't have zero rows on a column"));g=cc.director.getWinSize();k=h=0;n=null;var f=-f/2,t=0;if(this._children&&0=p||null==p?k:p),this._children[c].setPosition(f+d[h]/2,t-g.height/
2),t-=this._children[c].getContentSize().height+10,++m,m>=n&&(f+=k+5,k=n=m=0,++h))},setOpacityModifyRGB:function(a){},isOpacityModifyRGB:function(){return!1}});cc.MenuPassive.create=function(a){a||(a=null);for(var b=[],c=1;ce&&(a.x=b+e*Math.cos(d),a.y=c+e*Math.sin(d));this._slider.setPosition(a);a.xthis._startPos.x+this._boxPos+this._boxSize-1&&(a.x=this._startPos.x+this._boxPos+this._boxSize-1);a.ythis._startPos.y+this._boxPos+this._boxSize&&(a.y=this._startPos.y+this._boxPos+this._boxSize);this._saturation=1-Math.abs((this._startPos.x+this._boxPos-a.x)/this._boxSize);this._brightness=Math.abs((this._startPos.y+this._boxPos-a.y)/this._boxSize)},_checkSliderPosition:function(a){var b=this._startPos.x+
0.5*this._background.getBoundingBox().width,c=this._startPos.y+0.5*this._background.getBoundingBox().height,b=a.x-b,c=a.y-c;return Math.sqrt(b*b+c*c)<=0.5*this._background.getBoundingBox().width?(this._updateSliderPosition(a),this.sendActionsForControlEvents(cc.CONTROL_EVENT_VALUECHANGED),!0):!1},onTouchBegan:function(a,b){if(!this.isEnabled()||!this.isVisible())return!1;var c=this.getTouchLocation(a);return this._checkSliderPosition(c)},onTouchMoved:function(a,b){var c=this.getTouchLocation(a);this._checkSliderPosition(c)}});
_p=cc.ControlSaturationBrightnessPicker.prototype;cc.defineGetterSetter(_p,"saturation",_p.getSaturation);cc.defineGetterSetter(_p,"brightness",_p.getBrightness);cc.defineGetterSetter(_p,"background",_p.getBackground);cc.defineGetterSetter(_p,"overlay",_p.getOverlay);cc.defineGetterSetter(_p,"shadow",_p.getShadow);cc.defineGetterSetter(_p,"slider",_p.getSlider);cc.defineGetterSetter(_p,"startPos",_p.getStartPos);_p=null;
cc.ControlSaturationBrightnessPicker.create=function(a,b){return new cc.ControlSaturationBrightnessPicker(a,b)};cc.ControlHuePicker=cc.Control.extend({_hue:0,_huePercentage:0,_background:null,_slider:null,_startPos:null,_className:"ControlHuePicker",ctor:function(a,b){cc.Control.prototype.ctor.call(this);b&&this.initWithTargetAndPos(a,b)},getHue:function(){return this._hue},setHue:function(a){this._hue=a;this.setHuePercentage(this._hue/360)},getHuePercentage:function(){return this._huePercentage},setHuePercentage:function(a){this._huePercentage=a;this._hue=360*this._huePercentage;var b=this._background.getBoundingBox(),
c=this._startPos.x+0.5*b.width;a=this._startPos.y+0.5*b.height;var b=0.5*b.width-15,d=cc.degreesToRadians(360*this._huePercentage-180),c=c+b*Math.cos(d);a+=b*Math.sin(d);this._slider.setPosition(c,a)},setEnabled:function(a){cc.Control.prototype.setEnabled.call(this,a);this._slider&&this._slider.setOpacity(a?255:128)},getBackground:function(){return this._background},getSlider:function(){return this._slider},getStartPos:function(){return this._startPos},initWithTargetAndPos:function(a,b){return cc.Control.prototype.init.call(this)?
(this._background=cc.ControlUtils.addSpriteToTargetWithPosAndAnchor("huePickerBackground.png",a,b,cc.p(0,0)),this._slider=cc.ControlUtils.addSpriteToTargetWithPosAndAnchor("colourPicker.png",a,b,cc.p(0.5,0.5)),this._slider.setPosition(b.x,b.y+0.5*this._background.getBoundingBox().height),this._startPos=b,this._huePercentage=this._hue=0,!0):!1},_updateSliderPosition:function(a){var b=this._background.getBoundingBox();a=Math.atan2(a.y-(this._startPos.y+0.5*b.height),a.x-(this._startPos.x+0.5*b.width));
a=cc.radiansToDegrees(a)+180;this.setHue(a);this.sendActionsForControlEvents(cc.CONTROL_EVENT_VALUECHANGED)},_checkSliderPosition:function(a){var b=Math.sqrt(Math.pow(a.x+10,2)+Math.pow(a.y,2));return 80>b&&59=this._maximumValue&&(this._maximumValue=this._minimumValue+1);this.setValue(this._value)},getMaximumValue:function(){return this._maximumValue},setMaximumValue:function(a){this._maximumAllowedValue=this._maximumValue=a;this._maximumValue<=this._minimumValue&&(this._minimumValue=
this._maximumValue-1);this.setValue(this._value)},isTouchInside:function(a){a=a.getLocation();a=this.getParent().convertToNodeSpace(a);var b=this.getBoundingBox();b.width+=this._thumbSprite.getContentSize().width;b.x-=this._thumbSprite.getContentSize().width/2;return cc.rectContainsPoint(b,a)},locationFromTouch:function(a){a=a.getLocation();a=this.convertToNodeSpace(a);0>a.x?a.x=0:a.x>this._backgroundSprite.getContentSize().width&&(a.x=this._backgroundSprite.getContentSize().width);return a},getMinimumAllowedValue:function(){return this._minimumAllowedValue},
setMinimumAllowedValue:function(a){this._minimumAllowedValue=a},getMaximumAllowedValue:function(){return this._maximumAllowedValue},setMaximumAllowedValue:function(a){this._maximumAllowedValue=a},getThumbSprite:function(){return this._thumbSprite},getProgressSprite:function(){return this._progressSprite},getBackgroundSprite:function(){return this._backgroundSprite},initWithSprites:function(a,b,c){return cc.Control.prototype.init.call(this)?(this.ignoreAnchorPointForPosition(!1),this._backgroundSprite=
a,this._progressSprite=b,this._thumbSprite=c,a=cc.ControlUtils.CCRectUnion(a.getBoundingBox(),c.getBoundingBox()),this.setContentSize(a.width,a.height),this._backgroundSprite.setAnchorPoint(0.5,0.5),this._backgroundSprite.setPosition(a.width/2,a.height/2),this.addChild(this._backgroundSprite),this._progressSprite.setAnchorPoint(0,0.5),this._progressSprite.setPosition(0,a.height/2),this.addChild(this._progressSprite),this._thumbSprite.setPosition(0,a.height/2),this.addChild(this._thumbSprite),this._minimumValue=
0,this._maximumValue=1,this.setValue(this._minimumValue),!0):!1},setEnabled:function(a){cc.Control.prototype.setEnabled.call(this,a);this._thumbSprite&&this._thumbSprite.setOpacity(a?255:128)},sliderBegan:function(a){this.setSelected(!0);this._thumbSprite.setColor(cc.color.GRAY);this.setValue(this.valueForLocation(a))},sliderMoved:function(a){this.setValue(this.valueForLocation(a))},sliderEnded:function(a){this.isSelected()&&this.setValue(this.valueForLocation(this._thumbSprite.getPosition()));this._thumbSprite.setColor(cc.color.WHITE);
this.setSelected(!1)},getTouchLocationInControl:function(a){a=a.getLocation();a=this.convertToNodeSpace(a);0>a.x?a.x=0:a.x>this._backgroundSprite.getContentSize().width+cc.SLIDER_MARGIN_H&&(a.x=this._backgroundSprite.getContentSize().width+cc.SLIDER_MARGIN_H);return a},onTouchBegan:function(a,b){if(!this.isTouchInside(a)||!this.isEnabled()||!this.isVisible())return!1;var c=this.locationFromTouch(a);this.sliderBegan(c);return!0},onTouchMoved:function(a,b){var c=this.locationFromTouch(a);this.sliderMoved(c)},
onTouchEnded:function(a,b){this.sliderEnded(cc.p(0,0))},needsLayout:function(){this._thumbSprite.setPositionX((this._value-this._minimumValue)/(this._maximumValue-this._minimumValue)*this._backgroundSprite.getContentSize().width);var a=this._progressSprite.getTextureRect(),a=cc.rect(a.x,a.y,this._thumbSprite.getPositionX(),a.height);this._progressSprite.setTextureRect(a,this._progressSprite.isTextureRectRotated());this._thumbSprite._renderCmd.transform(this._renderCmd)},valueForLocation:function(a){a=
a.x/this._backgroundSprite.getContentSize().width;return Math.max(Math.min(this._minimumValue+a*(this._maximumValue-this._minimumValue),this._maximumAllowedValue),this._minimumAllowedValue)}});_p=cc.ControlSlider.prototype;cc.defineGetterSetter(_p,"value",_p.getValue,_p.setValue);cc.defineGetterSetter(_p,"minValue",_p.getMinimumValue,_p.setMinimumValue);cc.defineGetterSetter(_p,"maxValue",_p.getMaximumValue,_p.setMaximumValue);cc.defineGetterSetter(_p,"minAllowedValue",_p.getMinimumAllowedValue,_p.setMinimumAllowedValue);
cc.defineGetterSetter(_p,"maxAllowedValue",_p.getMaximumAllowedValue,_p.setMaximumAllowedValue);cc.defineGetterSetter(_p,"thumbSprite",_p.getThumbSprite);cc.defineGetterSetter(_p,"progressSprite",_p.getProgressSprite);cc.defineGetterSetter(_p,"backgroundSprite",_p.getBackgroundSprite);_p=null;cc.ControlSlider.create=function(a,b,c){return new cc.ControlSlider(a,b,c)};cc.ControlSwitch=cc.Control.extend({_switchSprite:null,_initialTouchXPosition:0,_moved:!1,_on:!1,_className:"ControlSwitch",ctor:function(a,b,c,d,e,f){cc.Control.prototype.ctor.call(this);f&&this.initWithMaskSprite(a,b,c,d,e,f)},initWithMaskSprite:function(a,b,c,d,e,f){if(!a)throw Error("cc.ControlSwitch.initWithMaskSprite(): maskSprite should be non-null.");if(!b)throw Error("cc.ControlSwitch.initWithMaskSprite(): onSprite should be non-null.");if(!c)throw Error("cc.ControlSwitch.initWithMaskSprite(): offSprite should be non-null.");
if(!d)throw Error("cc.ControlSwitch.initWithMaskSprite(): thumbSprite should be non-null.");return this.init()?(this._on=!0,this._switchSprite=new cc.ControlSwitchSprite,this._switchSprite.initWithMaskSprite(a,b,c,d,e,f),this._switchSprite.setPosition(this._switchSprite.getContentSize().width/2,this._switchSprite.getContentSize().height/2),this.addChild(this._switchSprite),this.ignoreAnchorPointForPosition(!1),this.setAnchorPoint(0.5,0.5),this.setContentSize(this._switchSprite.getContentSize()),!0):
!1},setOn:function(a,b){b=b||!1;var c=(this._on=a)?this._switchSprite.getOnPosition():this._switchSprite.getOffPosition();b?this._switchSprite.runAction(new cc.ActionTween(0.2,"sliderXPosition",this._switchSprite.getSliderXPosition(),c)):this._switchSprite.setSliderXPosition(c);this.sendActionsForControlEvents(cc.CONTROL_EVENT_VALUECHANGED)},isOn:function(){return this._on},hasMoved:function(){return this._moved},setEnabled:function(a){this._enabled=a;this._switchSprite.setOpacity(a?255:128)},locationFromTouch:function(a){a=
a.getLocation();return a=this.convertToNodeSpace(a)},onTouchBegan:function(a,b){if(!this.isTouchInside(a)||!this.isEnabled()||!this.isVisible())return!1;this._moved=!1;this._initialTouchXPosition=this.locationFromTouch(a).x-this._switchSprite.getSliderXPosition();this._switchSprite.getThumbSprite().setColor(cc.color.GRAY);this._switchSprite.needsLayout();return!0},onTouchMoved:function(a,b){var c=this.locationFromTouch(a),c=cc.p(c.x-this._initialTouchXPosition,0);this._moved=!0;this._switchSprite.setSliderXPosition(c.x)},
onTouchEnded:function(a,b){var c=this.locationFromTouch(a);this._switchSprite.getThumbSprite().setColor(cc.color.WHITE);this.hasMoved()?this.setOn(!(c.x=this._onPosition&&(a=this._onPosition);this._sliderXPosition=a;this.needsLayout()},getSliderXPosition:function(){return this._sliderXPosition},_getOnSideWidth:function(){return this._onSprite.getContentSize().width},_getOffSideWidth:function(){return this._offSprite.getContentSize().height},updateTweenAction:function(a,b){"sliderXPosition"===b&&this.setSliderXPosition(a)},setOnPosition:function(a){this._onPosition=
a},getOnPosition:function(){return this._onPosition},setOffPosition:function(a){this._offPosition=a},getOffPosition:function(){return this._offPosition},setMaskTexture:function(a){this._stencil.setTexture(a)},getMaskTexture:function(){return this._stencil.getTexture()},setTextureLocation:function(a){this._textureLocation=a},getTextureLocation:function(){return this._textureLocation},setMaskLocation:function(a){this._maskLocation=a},getMaskLocation:function(){return this._maskLocation},setOnSprite:function(a){this._onSprite=
a},getOnSprite:function(){return this._onSprite},setOffSprite:function(a){this._offSprite=a},getOffSprite:function(){return this._offSprite},setThumbSprite:function(a){this._thumbSprite=a},getThumbSprite:function(){return this._thumbSprite},setOnLabel:function(a){this._onLabel=a},getOnLabel:function(){return this._onLabel},setOffLabel:function(a){this._offLabel=a},getOffLabel:function(){return this._offLabel}});_p=cc.ControlSwitchSprite.prototype;
cc.defineGetterSetter(_p,"sliderX",_p.getSliderXPosition,_p.setSliderXPosition);cc.defineGetterSetter(_p,"onPos",_p.getOnPosition,_p.setOnPosition);cc.defineGetterSetter(_p,"offPos",_p.getOffPosition,_p.setOffPosition);cc.defineGetterSetter(_p,"maskTexture",_p.getMaskTexture,_p.setMaskTexture);cc.defineGetterSetter(_p,"maskPos",_p.getMaskLocation,_p.setMaskLocation);cc.defineGetterSetter(_p,"onSprite",_p.getOnSprite,_p.setOnSprite);cc.defineGetterSetter(_p,"offSprite",_p.getOffSprite,_p.setOffSprite);
cc.defineGetterSetter(_p,"thumbSprite",_p.getThumbSprite,_p.setThumbSprite);cc.defineGetterSetter(_p,"onLabel",_p.getOnLabel,_p.setOnLabel);cc.defineGetterSetter(_p,"offLabel",_p.getOffLabel,_p.setOffLabel);cc.defineGetterSetter(_p,"onSideWidth",_p._getOnSideWidth);cc.defineGetterSetter(_p,"offSideWidth",_p._getOffSideWidth);_p=null;cc.CONTROL_STEPPER_PARTMINUS=0;cc.CONTROL_STEPPER_PARTPLUS=1;cc.CONTROL_STEPPER_PARTNONE=2;cc.CONTROL_STEPPER_LABELCOLOR_ENABLED=cc.color(55,55,55);cc.CONTROL_STEPPER_LABELCOLOR_DISABLED=cc.color(147,147,147);cc.CONTROL_STEPPER_LABELFONT="CourierNewPSMT";cc.AUTOREPEAT_DELTATIME=0.15;cc.AUTOREPEAT_INCREASETIME_INCREMENT=12;
cc.ControlStepper=cc.Control.extend({_minusSprite:null,_plusSprite:null,_minusLabel:null,_plusLabel:null,_value:0,_continuous:!1,_autorepeat:!1,_wraps:!1,_minimumValue:0,_maximumValue:0,_stepValue:0,_touchInsideFlag:!1,_touchedPart:cc.CONTROL_STEPPER_PARTNONE,_autorepeatCount:0,_className:"ControlStepper",ctor:function(a,b){cc.Control.prototype.ctor.call(this);this._plusLabel=this._minusLabel=this._plusSprite=this._minusSprite=null;this._value=0;this._wraps=this._autorepeat=this._continuous=!1;this._stepValue=
this._maximumValue=this._minimumValue=0;this._touchInsideFlag=!1;this._touchedPart=cc.CONTROL_STEPPER_PARTNONE;this._autorepeatCount=0;b&&this.initWithMinusSpriteAndPlusSprite(a,b)},initWithMinusSpriteAndPlusSprite:function(a,b){if(!a)throw Error("cc.ControlStepper.initWithMinusSpriteAndPlusSprite(): Minus sprite should be non-null.");if(!b)throw Error("cc.ControlStepper.initWithMinusSpriteAndPlusSprite(): Plus sprite should be non-null.");if(this.init()){this._continuous=this._autorepeat=!0;this._minimumValue=
0;this._maximumValue=100;this._value=0;this._stepValue=1;this._wraps=!1;this.ignoreAnchorPointForPosition(!1);this.setMinusSprite(a);this._minusSprite.setPosition(a.getContentSize().width/2,a.getContentSize().height/2);this.addChild(this._minusSprite);this.setMinusLabel(new cc.LabelTTF("-",cc.CONTROL_STEPPER_LABELFONT,40,cc.size(40,40),cc.TEXT_ALIGNMENT_CENTER,cc.VERTICAL_TEXT_ALIGNMENT_CENTER));this._minusLabel.setColor(cc.CONTROL_STEPPER_LABELCOLOR_DISABLED);this._minusLabel.setPosition(this._minusSprite.getContentSize().width/
2,this._minusSprite.getContentSize().height/2);this._minusSprite.addChild(this._minusLabel);this.setPlusSprite(b);this._plusSprite.setPosition(a.getContentSize().width+b.getContentSize().width/2,a.getContentSize().height/2);this.addChild(this._plusSprite);this.setPlusLabel(new cc.LabelTTF("+",cc.CONTROL_STEPPER_LABELFONT,40,cc.size(40,40),cc.TEXT_ALIGNMENT_CENTER,cc.VERTICAL_TEXT_ALIGNMENT_CENTER));this._plusLabel.setColor(cc.CONTROL_STEPPER_LABELCOLOR_ENABLED);this._plusLabel.setPosition(this._plusSprite.getContentSize().width/
2,this._plusSprite.getContentSize().height/2);this._plusSprite.addChild(this._plusLabel);var c=cc.ControlUtils.CCRectUnion(this._minusSprite.getBoundingBox(),this._plusSprite.getBoundingBox());this.setContentSize(this._minusSprite.getContentSize().width+this._plusSprite.getContentSize().height,c.height);return!0}return!1},setWraps:function(a){if(this._wraps=a)this._minusLabel.setColor(cc.CONTROL_STEPPER_LABELCOLOR_ENABLED),this._plusLabel.setColor(cc.CONTROL_STEPPER_LABELCOLOR_ENABLED);this.setValue(this._value)},
getWraps:function(){return this._wraps},setMinimumValue:function(a){if(a>=this._maximumValue)throw Error("cc.ControlStepper.setMinimumValue(): minimumValue should be numerically less than maximumValue.");this._minimumValue=a;this.setValue(this._value)},getMinimumValue:function(){return this._minimumValue},setMaximumValue:function(a){if(a<=this._minimumValue)throw Error("cc.ControlStepper.setMaximumValue(): maximumValue should be numerically less than maximumValue.");this._maximumValue=a;this.setValue(this._value)},
getMaximumValue:function(){return this._maximumValue},setValue:function(a){this.setValueWithSendingEvent(a,!0)},getValue:function(){return this._value},setStepValue:function(a){if(0>=a)throw Error("cc.ControlStepper.setMaximumValue(): stepValue should be numerically greater than 0.");this._stepValue=a},getStepValue:function(){return this._stepValue},isContinuous:function(){return this._continuous},setValueWithSendingEvent:function(a,b){athis._maximumValue&&(a=this._wraps?this._minimumValue:this._maximumValue);this._value=a;this._wraps||(this._minusLabel.setColor(a===this._minimumValue?cc.CONTROL_STEPPER_LABELCOLOR_DISABLED:cc.CONTROL_STEPPER_LABELCOLOR_ENABLED),this._plusLabel.setColor(a===this._maximumValue?cc.CONTROL_STEPPER_LABELCOLOR_DISABLED:cc.CONTROL_STEPPER_LABELCOLOR_ENABLED));b&&this.sendActionsForControlEvents(cc.CONTROL_EVENT_VALUECHANGED)},startAutorepeat:function(){this._autorepeatCount=-1;this.schedule(this.update,
cc.AUTOREPEAT_DELTATIME,cc.REPEAT_FOREVER,3*cc.AUTOREPEAT_DELTATIME)},stopAutorepeat:function(){this.unschedule(this.update)},update:function(a){this._autorepeatCount++;this._autorepeatCountthis._minimumValue?(this._touchedPart=cc.CONTROL_STEPPER_PARTMINUS,this._minusSprite.setColor(cc.color.GRAY),this._plusSprite.setColor(cc.color.WHITE)):a.x>=this._minusSprite.getContentSize().width&&this._valuethis._maximumValue&&(a=this._maximumValue);this._value=a;a=(a-this._minimumValue)/(this._maximumValue-
this._minimumValue);this._progressTimer.setPercentage(100*a);this._thumbSprite.setRotation(360*a);this.sendActionsForControlEvents(cc.CONTROL_EVENT_VALUECHANGED)},getValue:function(){return this._value},setMinimumValue:function(a){this._minimumValue=a;this._minimumValue>=this._maximumValue&&(this._maximumValue=this._minimumValue+1);this.setValue(this._maximumValue)},getMinimumValue:function(){return this._minimumValue},setMaximumValue:function(a){this._maximumValue=a;this._maximumValue<=this._minimumValue&&
(this._minimumValue=this._maximumValue-1);this.setValue(this._minimumValue)},getMaximumValue:function(){return this._maximumValue},isTouchInside:function(a){a=this.getTouchLocation(a);return this.distanceBetweenPointAndPoint(this._progressTimer.getPosition(),a)b&&(b+=360);this.setValue(this._value+b/360*(this._maximumValue-this._minimumValue));this._previousLocation=a},potentiometerEnded:function(a){this.getThumbSprite().setColor(cc.color.WHITE);this.setSelected(!1)},setThumbSprite:function(a){this._thumbSprite=a},getThumbSprite:function(){return this._thumbSprite},
setProgressTimer:function(a){this._progressTimer=a},getProgressTimer:function(){return this._progressTimer},setPreviousLocation:function(a){this._previousLocation=a},getPreviousLocation:function(){return this._previousLocation}});_p=cc.ControlPotentiometer.prototype;cc.defineGetterSetter(_p,"value",_p.getValue,_p.setValue);cc.defineGetterSetter(_p,"minValue",_p.getMinimumValue,_p.setMinimumValue);cc.defineGetterSetter(_p,"maxValue",_p.getMaximumValue,_p.setMaximumValue);
cc.defineGetterSetter(_p,"progressTimer",_p.getProgressTimer,_p.setProgressTimer);cc.defineGetterSetter(_p,"thumbSprite",_p.getThumbSprite,_p.setThumbSprite);cc.defineGetterSetter(_p,"prevLocation",_p.getPreviousLocation,_p.setPreviousLocation);_p=null;cc.ControlPotentiometer.create=function(a,b,c){return new cc.ControlPotentiometer(a,b,c)};cc.SCROLLVIEW_DIRECTION_NONE=-1;cc.SCROLLVIEW_DIRECTION_HORIZONTAL=0;cc.SCROLLVIEW_DIRECTION_VERTICAL=1;cc.SCROLLVIEW_DIRECTION_BOTH=2;var SCROLL_DEACCEL_RATE=0.95,SCROLL_DEACCEL_DIST=1,BOUNCE_DURATION=0.15,INSET_RATIO=0.2,MOVE_INCH=0.04375,BOUNCE_BACK_FACTOR=0.35;cc.convertDistanceFromPointToInch=function(a){var b=cc.view,b=(b.getScaleX()+b.getScaleY())/2;return a*b/160};cc.ScrollViewDelegate=cc.Class.extend({scrollViewDidScroll:function(a){},scrollViewDidZoom:function(a){}});
cc.ScrollView=cc.Layer.extend({_zoomScale:0,_minZoomScale:0,_maxZoomScale:0,_delegate:null,_direction:cc.SCROLLVIEW_DIRECTION_BOTH,_dragging:!1,_contentOffset:null,_container:null,_touchMoved:!1,_maxInset:null,_minInset:null,_bounceable:!1,_clippingToBounds:!1,_scrollDistance:null,_touchPoint:null,_touchLength:0,_touches:null,_viewSize:null,_minScale:0,_maxScale:0,_parentScissorRect:null,_scissorRestored:!1,_tmpViewRect:null,_touchListener:null,_className:"ScrollView",ctor:function(a,b){cc.Layer.prototype.ctor.call(this);
this._contentOffset=cc.p(0,0);this._maxInset=cc.p(0,0);this._minInset=cc.p(0,0);this._scrollDistance=cc.p(0,0);this._touchPoint=cc.p(0,0);this._touches=[];this._viewSize=cc.size(0,0);this._parentScissorRect=new cc.Rect(0,0,0,0);this._tmpViewRect=new cc.Rect(0,0,0,0);void 0!=b?this.initWithViewSize(a,b):this.initWithViewSize(cc.size(200,200),null)},init:function(){return this.initWithViewSize(cc.size(200,200),null)},initWithViewSize:function(a,b){var c=cc.p(0,0);return cc.Layer.prototype.init.call(this)?
(b||this._container||(b=new cc.Layer),b&&this.setContainer(b),this.setViewSize(a),this.setTouchEnabled(!0),this._touches.length=0,this._delegate=null,this._clippingToBounds=this._bounceable=!0,this._direction=cc.SCROLLVIEW_DIRECTION_BOTH,this._container.setPosition(c),this._touchLength=0,this._minScale=this._maxScale=1,!0):!1},setContentOffset:function(a,b){if(b)this.setContentOffsetInDuration(a,BOUNCE_DURATION);else{if(!this._bounceable){var c=this.minContainerOffset(),d=this.maxContainerOffset();
a.x=Math.max(c.x,Math.min(d.x,a.x));a.y=Math.max(c.y,Math.min(d.y,a.y))}this._container.setPosition(a);c=this._delegate;null!=c&&c.scrollViewDidScroll&&c.scrollViewDidScroll(this)}},getContentOffset:function(){var a=this._container.getPosition();return cc.p(a.x,a.y)},setContentOffsetInDuration:function(a,b){var c=cc.moveTo(b,a),d=cc.callFunc(this._stoppedAnimatedScroll,this);this._container.runAction(cc.sequence(c,d));this.schedule(this._performedAnimatedScroll)},setZoomScale:function(a,b){if(b)this.setZoomScaleInDuration(a,
BOUNCE_DURATION);else{var c=this._container;if(c.getScale()!==a){var d,e;0===this._touchLength?(e=this._viewSize,e=cc.p(0.5*e.width,0.5*e.height),e=this.convertToWorldSpace(e)):e=this._touchPoint;d=c.convertToNodeSpace(e);c.setScale(Math.max(this._minScale,Math.min(this._maxScale,a)));d=c.convertToWorldSpace(d);e=cc.pSub(e,d);this._delegate&&this._delegate.scrollViewDidZoom&&this._delegate.scrollViewDidZoom(this);this.setContentOffset(cc.pAdd(c.getPosition(),e))}}},getZoomScale:function(){return this._container.getScale()},
setZoomScaleInDuration:function(a,b){if(0b.y||eb.x||dc&&(a.x+=b.width*c,c=-c);0>d&&(a.y+=b.height*d,d=-d);e=this._tmpViewRect;e.x=a.x;e.y=a.y;e.width=b.width*c;e.height=b.height*d;return e},_createRenderCmd:function(){return cc._renderType===
cc._RENDER_TYPE_CANVAS?new cc.ScrollView.CanvasRenderCmd(this):new cc.ScrollView.WebGLRenderCmd(this)}});_p=cc.ScrollView.prototype;cc.defineGetterSetter(_p,"minOffset",_p.minContainerOffset);cc.defineGetterSetter(_p,"maxOffset",_p.maxContainerOffset);cc.defineGetterSetter(_p,"bounceable",_p.isBounceable,_p.setBounceable);cc.defineGetterSetter(_p,"viewSize",_p.getViewSize,_p.setViewSize);cc.defineGetterSetter(_p,"container",_p.getContainer,_p.setContainer);
cc.defineGetterSetter(_p,"direction",_p.getDirection,_p.setDirection);cc.defineGetterSetter(_p,"delegate",_p.getDelegate,_p.setDelegate);cc.defineGetterSetter(_p,"clippingToBounds",_p.isClippingToBounds,_p.setClippingToBounds);_p=null;cc.ScrollView.create=function(a,b){return new cc.ScrollView(a,b)};(function(){cc.ScrollView.CanvasRenderCmd=function(a){cc.Layer.CanvasRenderCmd.call(this,a);this._needDraw=!1;this.startCmd=new cc.CustomRenderCmd(this,this._startCmd);this.endCmd=new cc.CustomRenderCmd(this,this._endCmd)};var a=cc.ScrollView.CanvasRenderCmd.prototype=Object.create(cc.Layer.CanvasRenderCmd.prototype);a.constructor=cc.ScrollView.CanvasRenderCmd;a._startCmd=function(a,c,d){var e=this._node,f=a||cc._renderContext;a=f.getContext();f.save();if(e._clippingToBounds){this._scissorRestored=
!1;f.setTransform(this._worldTransform,c,d);var g=e.getScaleX(),f=e.getScaleY();c*=e._viewSize.width*g;d*=e._viewSize.height*f;a.beginPath();a.rect(0,0,c,-d);a.closePath();a.clip()}};a._endCmd=function(a){a=a||cc._renderContext;a.restore()};a.visit=function(a){var c=this._node,d=c._children;this.transform(a);cc.renderer.pushRenderCommand(this.startCmd);if(d&&0e._localZOrder)e._renderCmd.visit();else break;for(;a=c&&a=b;){var e=0|b+(c-b)/2,f=d[e],g=d[e+1];if(a>=f&&a<=g)return e;a=b?0:-1},_indexFromOffset:function(a){var b={x:a.x,y:a.y};a=this._dataSource.numberOfCellsInTableView(this)-1;this._vOrdering===cc.TABLEVIEW_FILL_TOPDOWN&&(b.y=this.getContainer().getContentSize().height-b.y);b=this.__indexFromOffset(b);-1!==b&&(b=Math.max(0,b),b>a&&(b=cc.INVALID_INDEX));
return b},__offsetFromIndex:function(a){switch(this.getDirection()){case cc.SCROLLVIEW_DIRECTION_HORIZONTAL:a=cc.p(this._cellsPositions[a],0);break;default:a=cc.p(0,this._cellsPositions[a])}return a},_offsetFromIndex:function(a){var b=this.__offsetFromIndex(a);a=this._dataSource.tableCellSizeForIndex(this,a);this._vOrdering===cc.TABLEVIEW_FILL_TOPDOWN&&(b.y=this.getContainer().getContentSize().height-b.y-a.height);return b},_updateCellPositions:function(){var a=this._dataSource.numberOfCellsInTableView(this),
b=this._cellsPositions;if(0this._dataSource.numberOfCellsInTableView(this)-1)){var b=this.cellAtIndex(a);b&&this._moveCellOutOfSight(b);b=this._dataSource.tableCellAtIndex(this,a);this._setIndexForCell(a,b);this._addCellIfNecessary(b)}},insertCellAtIndex:function(a){if(!(a===cc.INVALID_INDEX||a>this._dataSource.numberOfCellsInTableView(this)-
1)){var b,c=this._cellsUsed;if(b=c.objectWithObjectID(a))for(var d=b=c.indexOfSortedObject(b);dthis._dataSource.numberOfCellsInTableView(this)-1)){var b=this.cellAtIndex(a);if(b){var c=this._cellsUsed,d=c.indexOfSortedObject(b);
this._moveCellOutOfSight(b);cc.arrayRemoveObject(this._indices,a);this._updateCellPositions();for(a=c.count()-1;a>d;a--)b=c.objectAtIndex(a),this._setIndexForCell(b.getIdx()-1,b)}}},reloadData:function(){this._oldDirection=cc.SCROLLVIEW_DIRECTION_NONE;for(var a=this._cellsUsed,b=this._cellsFreed,c=this.getContainer(),d=0,e=a.count();dd;)if(this._moveCellOutOfSight(b),0=d,h=c.readInt(!1),k=c.readCachedString(),m=!1,n=c.readByte();if(n===CCB_PLATFORM_ALL||n===CCB_PLATFORM_IOS||n===CCB_PLATFORM_MAC)m=!0;a instanceof cc.BuilderFile?a.getCCBFileNode()&&g&&(a=a.getCCBFileNode(),m=-1!==a.userObject.indexOf(k)):
g&&a===c.getAnimationManager().getRootNode()&&(g=a.userObject,g||(g=[],a.userObject=g),g.push(k));switch(h){case CCB_PROPTYPE_POSITION:h=this.parsePropTypePosition(a,b,c,k);if(m)this.onHandlePropTypePosition(a,b,k,h,c);break;case CCB_PROPTYPE_POINT:h=this.parsePropTypePoint(a,b,c);if(m)this.onHandlePropTypePoint(a,b,k,h,c);break;case CCB_PROPTYPE_POINTLOCK:h=this.parsePropTypePointLock(a,b,c);if(m)this.onHandlePropTypePointLock(a,b,k,h,c);break;case CCB_PROPTYPE_SIZE:h=this.parsePropTypeSize(a,b,
c);if(m)this.onHandlePropTypeSize(a,b,k,h,c);break;case CCB_PROPTYPE_SCALELOCK:h=this.parsePropTypeScaleLock(a,b,c,k);if(m)this.onHandlePropTypeScaleLock(a,b,k,h,c);break;case CCB_PROPTYPE_FLOATXY:h=this.parsePropTypeFloatXY(a,b,c);if(m)this.onHandlePropTypeFloatXY(a,b,k,h,c);break;case CCB_PROPTYPE_FLOAT:h=this.parsePropTypeFloat(a,b,c);if(m)this.onHandlePropTypeFloat(a,b,k,h,c);break;case CCB_PROPTYPE_DEGREES:h=this.parsePropTypeDegrees(a,b,c,k);if(m)this.onHandlePropTypeDegrees(a,b,k,h,c);break;
case CCB_PROPTYPE_FLOATSCALE:h=this.parsePropTypeFloatScale(a,b,c);if(m)this.onHandlePropTypeFloatScale(a,b,k,h,c);break;case CCB_PROPTYPE_INTEGER:h=this.parsePropTypeInteger(a,b,c);if(m)this.onHandlePropTypeInteger(a,b,k,h,c);break;case CCB_PROPTYPE_INTEGERLABELED:h=this.parsePropTypeIntegerLabeled(a,b,c);if(m)this.onHandlePropTypeIntegerLabeled(a,b,k,h,c);break;case CCB_PROPTYPE_FLOATVAR:h=this.parsePropTypeFloatVar(a,b,c);if(m)this.onHandlePropTypeFloatVar(a,b,k,h,c);break;case CCB_PROPTYPE_CHECK:h=
this.parsePropTypeCheck(a,b,c,k);if(m)this.onHandlePropTypeCheck(a,b,k,h,c);break;case CCB_PROPTYPE_SPRITEFRAME:h=this.parsePropTypeSpriteFrame(a,b,c,k);if(m)this.onHandlePropTypeSpriteFrame(a,b,k,h,c);break;case CCB_PROPTYPE_ANIMATION:h=this.parsePropTypeAnimation(a,b,c);if(m)this.onHandlePropTypeAnimation(a,b,k,h,c);break;case CCB_PROPTYPE_TEXTURE:h=this.parsePropTypeTexture(a,b,c);if(m)this.onHandlePropTypeTexture(a,b,k,h,c);break;case CCB_PROPTYPE_BYTE:h=this.parsePropTypeByte(a,b,c,k);if(m)this.onHandlePropTypeByte(a,
b,k,h,c);break;case CCB_PROPTYPE_COLOR3:h=this.parsePropTypeColor3(a,b,c,k);if(m)this.onHandlePropTypeColor3(a,b,k,h,c);break;case CCB_PROPTYPE_COLOR4VAR:h=this.parsePropTypeColor4FVar(a,b,c);if(m)this.onHandlePropTypeColor4FVar(a,b,k,h,c);break;case CCB_PROPTYPE_FLIP:h=this.parsePropTypeFlip(a,b,c);if(m)this.onHandlePropTypeFlip(a,b,k,h,c);break;case CCB_PROPTYPE_BLENDMODE:h=this.parsePropTypeBlendFunc(a,b,c);if(m)this.onHandlePropTypeBlendFunc(a,b,k,h,c);break;case CCB_PROPTYPE_FNTFILE:h=c.getCCBRootPath()+
this.parsePropTypeFntFile(a,b,c);if(m)this.onHandlePropTypeFntFile(a,b,k,h,c);break;case CCB_PROPTYPE_FONTTTF:h=this.parsePropTypeFontTTF(a,b,c);if(m)this.onHandlePropTypeFontTTF(a,b,k,h,c);break;case CCB_PROPTYPE_STRING:h=this.parsePropTypeString(a,b,c);if(m)this.onHandlePropTypeString(a,b,k,h,c);break;case CCB_PROPTYPE_TEXT:h=this.parsePropTypeText(a,b,c);if(m)this.onHandlePropTypeText(a,b,k,h,c);break;case CCB_PROPTYPE_BLOCK:h=this.parsePropTypeBlock(a,b,c);if(m)this.onHandlePropTypeBlock(a,b,
k,h,c);break;case CCB_PROPTYPE_BLOCKCCCONTROL:h=this.parsePropTypeBlockCCControl(a,b,c);if(m&&null!=h)this.onHandlePropTypeBlockCCControl(a,b,k,h,c);break;case CCB_PROPTYPE_CCBFILE:h=this.parsePropTypeCCBFile(a,b,c);if(m)this.onHandlePropTypeCCBFile(a,b,k,h,c);break;default:ASSERT_FAIL_UNEXPECTED_PROPERTYTYPE(h)}}},getCustomProperties:function(){return this._customProperties},_createCCNode:function(a,b){return new cc.Node},parsePropTypePosition:function(a,b,c,d){var e=c.readFloat(),f=c.readFloat(),
g=c.readInt(!1),h=c.getAnimationManager().getContainerSize(b);b=cc._getAbsolutePosition(e,f,g,h,d);a.setPosition(cc.getAbsolutePosition(b,g,h,d));-1=e?0|255*e:e,f=0|255*c.readFloat(),g=0|255*c.readFloat(),h=0|255*c.readFloat();c=c.readFloat();
var k=[];k[0]={r:a,g:b,b:d,a:e};k[1]={r:f,g:g,b:h,a:1>=c?0|255*c:c};return k},parsePropTypeFlip:function(a,b,c){a=c.readBool();c=c.readBool();return[a,c]},parsePropTypeBlendFunc:function(a,b,c){a=c.readInt(!1);c=c.readInt(!1);return new cc.BlendFunc(a,c)},parsePropTypeFntFile:function(a,b,c){return c.readCachedString()},parsePropTypeString:function(a,b,c){return c.readCachedString()},parsePropTypeText:function(a,b,c){return c.readCachedString()},parsePropTypeFontTTF:function(a,b,c){return c.readCachedString()},
parsePropTypeBlock:function(a,b,c){b=c.readCachedString();var d=c.readInt(!1);if(d!==CCB_TARGETTYPE_NONE){var e=null;if(c.isJSControlled())d===CCB_TARGETTYPE_DOCUMENTROOT?(c.addDocumentCallbackNode(a),c.addDocumentCallbackName(b),c.addDocumentCallbackControlEvents(0)):(c.addOwnerCallbackNode(a),c.addOwnerCallbackName(b),c.addOwnerCallbackControlEvents(0));else if(d===CCB_TARGETTYPE_DOCUMENTROOT?e=c.getAnimationManager().getRootNode():d===CCB_TARGETTYPE_OWNER&&(e=c.getOwner()),null!==e)if(0>3;this._checkSize(c);var c=Math.pow(2,b-1)-1,e=this._readBitsOnly(a+b,1,d),f=this._readBitsOnly(a,b,d),g=0,h=2,k=0;do for(var m=this._readByteOnly(++k,d),n=a%8||8,p=1<>=1;)m&p&&(g+=1/h),h*=2;while(a-=
n);this._currentByte+=d;return f===(c<<1)+1?g?NaN:e?-Infinity:Infinity:(1+-2*e)*(f||g?f?Math.pow(2,f-c)*(1+g):Math.pow(2,-c+1)*g:0)},_readBitsOnly:function(a,b,c){var d=(a+b)%8,e=a%8,f=c-(a>>3)-1;a=c+(-(a+b)>>3);var g=f-a;b=this._readByteOnly(f,c)>>e&(1<<(g?8-e:b))-1;for(g&&d&&(b+=(this._readByteOnly(a++,c)&(1<this._data.length))throw Error("out of the data bound");return a},_alignBits:function(){this._currentBit&&(this._currentBit=0,this._currentByte++)},_readUTF8:function(){}});cc.BuilderReader._ccbResolutionScale=1;cc.BuilderReader.setResolutionScale=function(a){cc.BuilderReader._ccbResolutionScale=a};cc.BuilderReader.getResolutionScale=function(){return cc.BuilderReader._ccbResolutionScale};
cc.BuilderReader.loadAsScene=function(a,b,c,d){d=d||cc.BuilderReader.getResourcePath();a=cc.BuilderReader.load(a,b,c,d);b=new cc.Scene;b.addChild(a);return b};cc.BuilderReader._controllerClassCache={};cc.BuilderReader.registerController=function(a,b){cc.BuilderReader._controllerClassCache[a]=cc.Class.extend(b)};
cc.BuilderReader.load=function(a,b,c,d){d=d||cc.BuilderReader.getResourcePath();var e=new cc.BuilderReader(cc.NodeLoaderLibrary.newDefaultCCNodeLoaderLibrary());e.setCCBRootPath(d);if(5>a.length||a.toLowerCase().lastIndexOf(".ccbi")!==a.length-5)a+=".ccbi";a=e.readNodeGraphFromFile(a,b,c);var f,g,h;if(b){d=e.getOwnerCallbackNames();var k=e.getOwnerCallbackNodes(),m=e.getOwnerCallbackControlEvents();for(c=0;c=b.length?0===a.lastIndexOf(b):!1};cc.BuilderReader.concat=function(a,b){return a+b};cc.loader.register(["ccbi"],cc._binaryLoader);cc.INT_VALUE=0;cc.FLOAT_VALUE=1;cc.POINTER_VALUE=2;cc.BOOL_VALUE=3;cc.UNSIGNEDCHAR_VALUE=4;cc.Color3BWapper=cc.Class.extend({_color:null,ctor:function(){this._color=cc.color(0,0,0)},getColor:function(){return this._color}});cc.Color3BWapper.create=function(a){var b=new cc.Color3BWapper;b&&(b._color.r=a.r,b._color.g=a.g,b._color.b=a.b);return b};
cc.BuilderValue=cc.Class.extend({_value:null,_type:0,getIntValue:function(){},getFloatValue:function(){},getBoolValue:function(){},getByteValue:function(){},getPointer:function(){},getValue:function(){return this._value}});cc.BuilderValue.create=function(a){return new cc.BuilderValue};cc.BuilderKeyframe=cc.Class.extend({_value:null,_time:0,_easingType:0,_easingOpt:0,getValue:function(){return this._value},setValue:function(a){this._value=a},getTime:function(){return this._time},setTime:function(a){this._time=a},getEasingType:function(){return this._easingType},setEasingType:function(a){this._easingType=a},getEasingOpt:function(){return this._easingOpt},setEasingOpt:function(a){this._easingOpt=a}});cc.BuilderSequence=cc.Class.extend({_duration:0,_name:"",_sequenceId:0,_chainedSequenceId:0,_callbackChannel:null,_soundChannel:null,ctor:function(){this._name=""},getDuration:function(){return this._duration},setDuration:function(a){this._duration=a},getName:function(){return this._name},setName:function(a){this._name=a},getSequenceId:function(){return this._sequenceId},setSequenceId:function(a){this._sequenceId=a},getChainedSequenceId:function(){return this._chainedSequenceId},setChainedSequenceId:function(a){this._chainedSequenceId=
a},getCallbackChannel:function(){return this._callbackChannel},setCallbackChannel:function(a){this._callbackChannel=a},getSoundChannel:function(){return this._soundChannel},setSoundChannel:function(a){this._soundChannel=a}});
cc.BuilderSequenceProperty=cc.Class.extend({_name:null,_type:0,_keyFrames:null,ctor:function(){this.init()},init:function(){this._keyFrames=[];this._name=""},getName:function(){return this._name},setName:function(a){this._name=a},getType:function(){return this._type},setType:function(a){this._type=a},getKeyframes:function(){return this._keyFrames}});cc.getAbsolutePosition=function(a,b,c,d){d=cc.p(0,0);b===CCB_POSITIONTYPE_RELATIVE_BOTTOM_LEFT?d=a:b===CCB_POSITIONTYPE_RELATIVE_TOP_LEFT?(d.x=a.x,d.y=c.height-a.y):b===CCB_POSITIONTYPE_RELATIVE_TOP_RIGHT?(d.x=c.width-a.x,d.y=c.height-a.y):b===CCB_POSITIONTYPE_RELATIVE_BOTTOM_RIGHT?(d.x=c.width-a.x,d.y=a.y):b===CCB_POSITIONTYPE_PERCENT?(d.x=c.width*a.x/100,d.y=c.height*a.y/100):b===CCB_POSITIONTYPE_MULTIPLY_RESOLUTION&&(b=cc.BuilderReader.getResolutionScale(),d.x=a.x*b,d.y=a.y*b);return d};
cc._getAbsolutePosition=function(a,b,c,d,e){e=cc.p(0,0);c===CCB_POSITIONTYPE_RELATIVE_BOTTOM_LEFT?(e.x=a,e.y=b):c===CCB_POSITIONTYPE_RELATIVE_TOP_LEFT?(e.x=a,e.y=d.height-b):c===CCB_POSITIONTYPE_RELATIVE_TOP_RIGHT?(e.x=d.width-a,e.y=d.height-b):c===CCB_POSITIONTYPE_RELATIVE_BOTTOM_RIGHT?(e.x=d.width-a,e.y=b):c===CCB_POSITIONTYPE_PERCENT?(e.x=d.width*a/100,e.y=d.height*b/100):c===CCB_POSITIONTYPE_MULTIPLY_RESOLUTION&&(c=cc.BuilderReader.getResolutionScale(),e.x=a*c,e.y=b*c);return e};
cc.setRelativeScale=function(a,b,c,d,e){if(!a)throw Error("cc.setRelativeScale(): node should be non-null");d===CCB_POSITIONTYPE_MULTIPLY_RESOLUTION&&(d=cc.BuilderReader.getResolutionScale(),b*=d,c*=d);a.setScaleX(b);a.setScaleY(c)};cc.BuilderAnimationManagerDelegate=cc.Class.extend({completedAnimationSequenceNamed:function(a){}});
cc.BuilderAnimationManager=cc.Class.extend({_sequences:null,_nodeSequences:null,_baseValues:null,_autoPlaySequenceId:0,_rootNode:null,_owner:null,_rootContainerSize:null,_delegate:null,_runningSequence:null,_documentOutletNames:null,_documentOutletNodes:null,_documentCallbackNames:null,_documentCallbackNodes:null,_documentCallbackControlEvents:null,_documentControllerName:"",_lastCompletedSequenceName:"",_keyframeCallbacks:null,_keyframeCallFuncs:null,_animationCompleteCallbackFunc:null,_target:null,
_jsControlled:!1,ctor:function(){this._rootContainerSize=cc.size(0,0);this.init()},init:function(){this._sequences=[];this._nodeSequences=new cc._Dictionary;this._baseValues=new cc._Dictionary;this._documentOutletNames=[];this._documentOutletNodes=[];this._documentCallbackNames=[];this._documentCallbackNodes=[];this._documentCallbackControlEvents=[];this._keyframeCallbacks=[];this._keyframeCallFuncs={};return!0},getSequences:function(){return this._sequences},setSequences:function(a){this._sequences=
a},getAutoPlaySequenceId:function(){return this._autoPlaySequenceId},setAutoPlaySequenceId:function(a){this._autoPlaySequenceId=a},getRootNode:function(){return this._rootNode},setRootNode:function(a){this._rootNode=a},getOwner:function(){return this._owner},setOwner:function(a){this._owner=a},addDocumentCallbackNode:function(a){this._documentCallbackNodes.push(a)},addDocumentCallbackName:function(a){this._documentCallbackNames.push(a)},addDocumentCallbackControlEvents:function(a){this._documentCallbackControlEvents.push(a)},
addDocumentOutletNode:function(a){this._documentOutletNodes.push(a)},addDocumentOutletName:function(a){this._documentOutletNames.push(a)},setDocumentControllerName:function(a){this._documentControllerName=a},getDocumentControllerName:function(){return this._documentControllerName},getDocumentCallbackNames:function(){return this._documentCallbackNames},getDocumentCallbackNodes:function(){return this._documentCallbackNodes},getDocumentCallbackControlEvents:function(){return this._documentCallbackControlEvents},
getDocumentOutletNames:function(){return this._documentOutletNames},getDocumentOutletNodes:function(){return this._documentOutletNodes},getLastCompletedSequenceName:function(){return this._lastCompletedSequenceName},getKeyframeCallbacks:function(){return this._keyframeCallbacks},getRootContainerSize:function(){return this._rootContainerSize},setRootContainerSize:function(a){this._rootContainerSize=cc.size(a.width,a.height)},getDelegate:function(){return this._delegate},setDelegate:function(a){this._delegate=
a},getRunningSequenceName:function(){return this._runningSequence?this._runningSequence.getName():null},getContainerSize:function(a){return a?a.getContentSize():this._rootContainerSize},addNode:function(a,b){this._nodeSequences.setObject(b,a)},setBaseValue:function(a,b,c){var d=this._baseValues.objectForKey(b);d||(d=new cc._Dictionary,this._baseValues.setObject(d,b));d.setObject(a,c)},moveAnimationsFromNode:function(a,b){var c=this._baseValues,d=c.objectForKey(a);null!==d&&(c.setObject(d,b),c.removeObjectForKey(a));
c=this._nodeSequences;d=c.objectForKey(a);null!=d&&(c.setObject(d,b),c.removeObjectForKey(a))},getActionForCallbackChannel:function(a){var b=0,c=[];a=a.getKeyframes();for(var d=a.length,e=0;ec.length?null:cc.sequence(c)},getActionForSoundChannel:function(a){var b=0,c=[];a=a.getKeyframes();for(var d=a.length,e=0;ec.length?null:cc.sequence(c)},runAnimationsForSequenceNamed:function(a){this.runAnimationsForSequenceIdTweenDuration(this._getSequenceId(a),0)},runAnimationsForSequenceNamedTweenDuration:function(a,b){this.runAnimationsForSequenceIdTweenDuration(this._getSequenceId(a),b)},runAnimationsForSequenceIdTweenDuration:function(a,b){if(-1===a)throw Error("cc.BuilderAnimationManager.runAnimationsForSequenceIdTweenDuration(): Sequence id should not be -1");
b=b||0;this._rootNode.stopAllActions();for(var c=this._nodeSequences.allKeys(),d=0,e=c.length;dc._localZOrder)c.visit(this);else break;for(c=0;ch._localZOrder)this._changeProtectedChild(h),h.visit(this);else break;for(cc.renderer.pushRenderCommand(this);ag[a]._localZOrder)g[a].visit(this);else break;for(d=0;dn._localZOrder)this._changeProtectedChild(n),n.visit(this);else break;for(cc.renderer.pushRenderCommand(this);a=a.width||0>=a.height?this._positionPercent.x=this._positionPercent.y=0:(this._positionPercent.x=b.x/a.width,this._positionPercent.y=b.y/a.height);break;case ccui.Widget.POSITION_PERCENT:b=cc.p(a.width*this._positionPercent.x,a.height*this._positionPercent.y)}if(this._parent instanceof ccui.ImageView&&(a=this._parent._imageRenderer)&&
!a._textureLoaded)return;this.setPosition(b)},setSizeType:function(a){this._sizeType=a;this._usingLayoutComponent&&this._getOrCreateLayoutComponent().setUsingPercentContentSize(this._sizeType===ccui.SIZE_PERCENT)},getSizeType:function(){return this._sizeType},ignoreContentAdaptWithSize:function(a){this._unifySize?this.setContentSize(this._customSize):this._ignoreSize!==a&&(this._ignoreSize=a,this.setContentSize(a?this.getVirtualRendererSize():this._customSize))},isIgnoreContentAdaptWithSize:function(){return this._ignoreSize},
getCustomSize:function(){return cc.size(this._customSize)},getLayoutSize:function(){return cc.size(this._contentSize)},getSizePercent:function(){this._usingLayoutComponent&&(this._sizePercent=this._getOrCreateLayoutComponent().getPercentContentSize());return this._sizePercent},_getWidthPercent:function(){return this._sizePercent.x},_getHeightPercent:function(){return this._sizePercent.y},getWorldPosition:function(){return this.convertToWorldSpace(cc.p(this._anchorPoint.x*this._contentSize.width,this._anchorPoint.y*
this._contentSize.height))},getVirtualRenderer:function(){return this},getVirtualRendererSize:function(){return cc.size(this._contentSize)},_onSizeChanged:function(){if(!this._usingLayoutComponent)for(var a=this.getChildren(),b=0,c=a.length;b=c.width||0>=c.height?(this._positionPercent.x=0,this._positionPercent.y=0):void 0===b?(this._positionPercent.x=a.x/c.width,this._positionPercent.y=a.y/c.height):(this._positionPercent.x=a/c.width,this._positionPercent.y=b/c.height))}cc.Node.prototype.setPosition.call(this,a,b)},setPositionX:function(a){if(this._running){var b=this.getWidgetParent();
b&&(b=b.width,this._positionPercent.x=0>=b?0:a/b)}cc.Node.prototype.setPositionX.call(this,a)},setPositionY:function(a){if(this._running){var b=this.getWidgetParent();b&&(b=b.height,this._positionPercent.y=0>=b?0:a/b)}cc.Node.prototype.setPositionY.call(this,a)},setPositionPercent:function(a){if(this._usingLayoutComponent){var b=this._getOrCreateLayoutComponent();b.setPositionPercentX(a.x);b.setPositionPercentY(a.y);b.refreshLayout()}else this._setXPercent(a.x),this._setYPercent(a.y),this._renderCmd.setDirtyFlag(cc.Node._dirtyFlags.transformDirty)},
_setXPercent:function(a){if(this._usingLayoutComponent){var b=this._getOrCreateLayoutComponent();b.setPositionPercentX(a.x);b.refreshLayout()}else this._positionPercent.x=a},_setYPercent:function(a){if(this._usingLayoutComponent){var b=this._getOrCreateLayoutComponent();b.setPositionPercentY(a.x);b.refreshLayout()}else this._positionPercent.y=a},getPositionPercent:function(){if(this._usingLayoutComponent){var a=this._getOrCreateLayoutComponent();this._positionPercent.x=a.getPositionPercentX();this._positionPercent.y=
a.getPositionPercentY()}return cc.p(this._positionPercent)},_getXPercent:function(){if(this._usingLayoutComponent){var a=this._getOrCreateLayoutComponent();this._positionPercent.x=a.getPositionPercentX();this._positionPercent.y=a.getPositionPercentY()}return this._positionPercent.x},_getYPercent:function(){if(this._usingLayoutComponent){var a=this._getOrCreateLayoutComponent();this._positionPercent.x=a.getPositionPercentX();this._positionPercent.y=a.getPositionPercentY()}return this._positionPercent.y},
setPositionType:function(a){this._positionType=a;if(this._usingLayoutComponent){var b=this._getOrCreateLayoutComponent();a===ccui.POSITION_ABSOLUTE?(b.setPositionPercentXEnabled(!1),b.setPositionPercentYEnabled(!1)):(b.setPositionPercentXEnabled(!0),b.setPositionPercentYEnabled(!0))}this._renderCmd.setDirtyFlag(cc.Node._dirtyFlags.transformDirty)},getPositionType:function(){return this._positionType},setFlippedX:function(a){var b=this.getScaleX();this._flippedX=a;this.setScaleX(b)},isFlippedX:function(){return this._flippedX},
setFlippedY:function(a){var b=this.getScaleY();this._flippedY=a;this.setScaleY(b)},isFlippedY:function(){return this._flippedY},_adaptRenderers:function(){},isBright:function(){return this._bright},isEnabled:function(){return this._enabled},getLeftBoundary:function(){return this.getPositionX()-this._getAnchorX()*this._contentSize.width},getBottomBoundary:function(){return this.getPositionY()-this._getAnchorY()*this._contentSize.height},getRightBoundary:function(){return this.getLeftBoundary()+this._contentSize.width},
getTopBoundary:function(){return this.getBottomBoundary()+this._contentSize.height},getTouchBeganPosition:function(){return cc.p(this._touchBeganPosition)},getTouchMovePosition:function(){return cc.p(this._touchMovePosition)},getTouchEndPosition:function(){return cc.p(this._touchEndPosition)},getWidgetType:function(){return this._widgetType},setLayoutParameter:function(a){a&&(this._layoutParameterDictionary[a.getLayoutType()]=a,this._layoutParameterType=a.getLayoutType())},getLayoutParameter:function(a){a=
a||this._layoutParameterType;return this._layoutParameterDictionary[a]},getDescription:function(){return"Widget"},clone:function(){var a=this._createCloneInstance();a._copyProperties(this);a._copyClonedWidgetChildren(this);return a},_createCloneInstance:function(){return new ccui.Widget},_copyClonedWidgetChildren:function(a){a=a.getChildren();for(var b=0;bk&&(e=b.x,g+=k);c=a.x+c-(b.x+b.width);0a&&(f=b.x,h+=a);0>g&&(g=0);0>h&&(h=0);this._clippingRect.x=
e;this._clippingRect.y=f;this._clippingRect.width=g;this._clippingRect.height=h}else this._clippingRect.x=a.x-c*this._anchorPoint.x,this._clippingRect.y=a.y-d*this._anchorPoint.y,this._clippingRect.width=c,this._clippingRect.height=d;this._clippingRectDirty=!1}return this._clippingRect},_onSizeChanged:function(){ccui.Widget.prototype._onSizeChanged.call(this);var a=this._contentSize;this._setStencilClippingSize(a);this._clippingRectDirty=this._doLayoutDirty=!0;this._backGroundImage&&(this._backGroundImage.setPosition(0.5*
a.width,0.5*a.height),this._backGroundScale9Enabled&&this._backGroundImage instanceof ccui.Scale9Sprite&&this._backGroundImage.setPreferredSize(a));this._colorRender&&this._colorRender.setContentSize(a);this._gradientRender&&this._gradientRender.setContentSize(a)},setBackGroundImageScale9Enabled:function(a){this._backGroundScale9Enabled!==a&&(this.removeProtectedChild(this._backGroundImage),this._backGroundImage=null,this._backGroundScale9Enabled=a,this._addBackGroundImage(),this.setBackGroundImage(this._backGroundImageFileName,
this._bgImageTexType),this.setBackGroundImageCapInsets(this._backGroundImageCapInsets))},isBackGroundImageScale9Enabled:function(){return this._backGroundScale9Enabled},setBackGroundImage:function(a,b){if(a){b=b||ccui.Widget.LOCAL_TEXTURE;null===this._backGroundImage&&(this._addBackGroundImage(),this.setBackGroundImageScale9Enabled(this._backGroundScale9Enabled));this._backGroundImageFileName=a;this._bgImageTexType=b;var c=this._backGroundImage;switch(this._bgImageTexType){case ccui.Widget.LOCAL_TEXTURE:c.initWithFile(a);
break;case ccui.Widget.PLIST_TEXTURE:c.initWithSpriteFrameName(a)}this._backGroundScale9Enabled&&c.setPreferredSize(this._contentSize);this._backGroundImageTextureSize=c.getContentSize();c.setPosition(0.5*this._contentSize.width,0.5*this._contentSize.height);this._updateBackGroundImageColor()}},setBackGroundImageCapInsets:function(a){if(a){var b=this._backGroundImageCapInsets;b.x=a.x;b.y=a.y;b.width=a.width;b.height=a.height;this._backGroundScale9Enabled&&this._backGroundImage.setCapInsets(a)}},getBackGroundImageCapInsets:function(){return cc.rect(this._backGroundImageCapInsets)},
_supplyTheLayoutParameterLackToChild:function(a){if(a)switch(this._layoutType){case ccui.Layout.LINEAR_HORIZONTAL:case ccui.Layout.LINEAR_VERTICAL:var b=a.getLayoutParameter(ccui.LayoutParameter.LINEAR);b||a.setLayoutParameter(new ccui.LinearLayoutParameter);break;case ccui.Layout.RELATIVE:(b=a.getLayoutParameter(ccui.LayoutParameter.RELATIVE))||a.setLayoutParameter(new ccui.RelativeLayoutParameter)}},_addBackGroundImage:function(){var a=this._contentSize;this._backGroundScale9Enabled?(this._backGroundImage=
new ccui.Scale9Sprite,this._backGroundImage.setPreferredSize(a)):this._backGroundImage=new cc.Sprite;this.addProtectedChild(this._backGroundImage,ccui.Layout.BACKGROUND_IMAGE_ZORDER,-1);this._backGroundImage.setPosition(0.5*a.width,0.5*a.height)},removeBackGroundImage:function(){this._backGroundImage&&(this.removeProtectedChild(this._backGroundImage),this._backGroundImage=null,this._backGroundImageFileName="",this._backGroundImageTextureSize.width=0,this._backGroundImageTextureSize.height=0)},setBackGroundColorType:function(a){if(this._colorType!==
a){switch(this._colorType){case ccui.Layout.BG_COLOR_NONE:this._colorRender&&(this.removeProtectedChild(this._colorRender),this._colorRender=null);this._gradientRender&&(this.removeProtectedChild(this._gradientRender),this._gradientRender=null);break;case ccui.Layout.BG_COLOR_SOLID:this._colorRender&&(this.removeProtectedChild(this._colorRender),this._colorRender=null);break;case ccui.Layout.BG_COLOR_GRADIENT:this._gradientRender&&(this.removeProtectedChild(this._gradientRender),this._gradientRender=
null)}this._colorType=a;switch(this._colorType){case ccui.Layout.BG_COLOR_SOLID:this._colorRender=new cc.LayerColor;this._colorRender.setContentSize(this._contentSize);this._colorRender.setOpacity(this._opacity);this._colorRender.setColor(this._color);this.addProtectedChild(this._colorRender,ccui.Layout.BACKGROUND_RENDERER_ZORDER,-1);break;case ccui.Layout.BG_COLOR_GRADIENT:this._gradientRender=new cc.LayerGradient(cc.color(255,0,0,255),cc.color(0,255,0,255)),this._gradientRender.setContentSize(this._contentSize),
this._gradientRender.setOpacity(this._opacity),this._gradientRender.setStartColor(this._startColor),this._gradientRender.setEndColor(this._endColor),this._gradientRender.setVector(this._alongVector),this.addProtectedChild(this._gradientRender,ccui.Layout.BACKGROUND_RENDERER_ZORDER,-1)}}},getBackGroundColorType:function(){return this._colorType},setBackGroundColor:function(a,b){b?(this._startColor.r=a.r,this._startColor.g=a.g,this._startColor.b=a.b,this._gradientRender&&this._gradientRender.setStartColor(a),
this._endColor.r=b.r,this._endColor.g=b.g,this._endColor.b=b.b,this._gradientRender&&this._gradientRender.setEndColor(b)):(this._color.r=a.r,this._color.g=a.g,this._color.b=a.b,this._colorRender&&this._colorRender.setColor(a))},getBackGroundColor:function(){var a=this._color;return cc.color(a.r,a.g,a.b,a.a)},getBackGroundStartColor:function(){var a=this._startColor;return cc.color(a.r,a.g,a.b,a.a)},getBackGroundEndColor:function(){var a=this._endColor;return cc.color(a.r,a.g,a.b,a.a)},setBackGroundColorOpacity:function(a){this._opacity=
a;switch(this._colorType){case ccui.Layout.BG_COLOR_SOLID:this._colorRender.setOpacity(a);break;case ccui.Layout.BG_COLOR_GRADIENT:this._gradientRender.setOpacity(a)}},getBackGroundColorOpacity:function(){return this._opacity},setBackGroundColorVector:function(a){this._alongVector.x=a.x;this._alongVector.y=a.y;this._gradientRender&&this._gradientRender.setVector(a)},getBackGroundColorVector:function(){return this._alongVector},setBackGroundImageColor:function(a){this._backGroundImageColor.r=a.r;this._backGroundImageColor.g=
a.g;this._backGroundImageColor.b=a.b;this._updateBackGroundImageColor()},setBackGroundImageOpacity:function(a){this._backGroundImageColor.a=a;this.getBackGroundImageColor()},getBackGroundImageColor:function(){var a=this._backGroundImageColor;return cc.color(a.r,a.g,a.b,a.a)},getBackGroundImageOpacity:function(){return this._backGroundImageColor.a},_updateBackGroundImageColor:function(){this._backGroundImage&&this._backGroundImage.setColor(this._backGroundImageColor)},getBackGroundImageTextureSize:function(){return this._backGroundImageTextureSize},
setLayoutType:function(a){this._layoutType=a;a=this._children;for(var b=null,c=0;cf&&(g=c,f=k));c++}return g}cc.log("invalid focus direction!!!");return 0},_calculateNearestDistance:function(a){for(var b=cc.FLT_MAX,c=
this._getWorldCenterPoint(a),d=this._children,e=0,f=d.length;eb&&(b=g)}return b},_findProperSearchingFunctor:function(a,b){if(null!=b){var c=this._getWorldCenterPoint(b),d=this._getWorldCenterPoint(this._findFirstNonLayoutWidget());a===ccui.Widget.LEFT?this.onPassFocusToChild=c.x>d.x?this._findNearestChildWidgetIndex.bind(this):this._findFarthestChildWidgetIndex.bind(this):a===ccui.Widget.RIGHT?this.onPassFocusToChild=c.x>d.x?this._findFarthestChildWidgetIndex.bind(this):
this._findNearestChildWidgetIndex.bind(this):a===ccui.Widget.DOWN?this.onPassFocusToChild=c.y>d.y?this._findNearestChildWidgetIndex.bind(this):this._findFarthestChildWidgetIndex.bind(this):a===ccui.Widget.UP?this.onPassFocusToChild=c.yf.getLocalZOrder())f.visit(this);else break;for(;df.getLocalZOrder())f.visit(this);else break;for(;ek.getLocalZOrder())k.visit(this);
else break;for(;ek.getLocalZOrder())k.visit(this);else break;for(;a=a.width||0>=a.height){this._buttonNormalRenderer.setScale(1);return}var b=this._contentSize.width/a.width,a=this._contentSize.height/a.height;this._buttonNormalRenderer.setScaleX(b);this._buttonNormalRenderer.setScaleY(a);this._normalTextureScaleXInSize=b;this._normalTextureScaleYInSize=a}this._buttonNormalRenderer.setPosition(this._contentSize.width/2,this._contentSize.height/
2)},_pressedTextureScaleChangedWithSize:function(){if(this._ignoreSize&&!this._unifySize)this._scale9Enabled||(this._buttonClickedRenderer.setScale(1),this._pressedTextureScaleXInSize=this._pressedTextureScaleYInSize=1);else if(this._scale9Enabled)this._buttonClickedRenderer.setPreferredSize(this._contentSize),this._pressedTextureScaleXInSize=this._pressedTextureScaleYInSize=1,this._buttonClickedRenderer.setScale(this._pressedTextureScaleXInSize,this._pressedTextureScaleYInSize);else{var a=this._pressedTextureSize;
if(0>=a.width||0>=a.height){this._buttonClickedRenderer.setScale(1);return}var b=this._contentSize.width/a.width,a=this._contentSize.height/a.height;this._buttonClickedRenderer.setScaleX(b);this._buttonClickedRenderer.setScaleY(a);this._pressedTextureScaleXInSize=b;this._pressedTextureScaleYInSize=a}this._buttonClickedRenderer.setPosition(this._contentSize.width/2,this._contentSize.height/2)},_disabledTextureScaleChangedWithSize:function(){if(this._ignoreSize&&!this._unifySize)this._scale9Enabled&&
this._buttonDisableRenderer.setScale(1);else if(this._scale9Enabled)this._buttonDisableRenderer.setScale(1),this._buttonDisableRenderer.setPreferredSize(this._contentSize);else{var a=this._disabledTextureSize;if(0>=a.width||0>=a.height){this._buttonDisableRenderer.setScale(1);return}var b=this._contentSize.height/a.height;this._buttonDisableRenderer.setScaleX(this._contentSize.width/a.width);this._buttonDisableRenderer.setScaleY(b)}this._buttonDisableRenderer.setPosition(this._contentSize.width/2,
this._contentSize.height/2)},_adaptRenderers:function(){this._normalTextureAdaptDirty&&(this._normalTextureScaleChangedWithSize(),this._normalTextureAdaptDirty=!1);this._pressedTextureAdaptDirty&&(this._pressedTextureScaleChangedWithSize(),this._pressedTextureAdaptDirty=!1);this._disabledTextureAdaptDirty&&(this._disabledTextureScaleChangedWithSize(),this._disabledTextureAdaptDirty=!1)},_updateTitleLocation:function(){this._titleRenderer.setPosition(0.5*this._contentSize.width,0.5*this._contentSize.height)},
setPressedActionEnabled:function(a){this.pressedActionEnabled=a},setTitleText:function(a){a!==this.getTitleText()&&(this._titleRenderer.setString(a),this._ignoreSize?(a=this.getVirtualRendererSize(),this.setContentSize(a)):this._titleRenderer._renderCmd._updateTTF())},getTitleText:function(){return this._titleRenderer.getString()},setTitleColor:function(a){this._titleRenderer.setFontFillColor(a)},getTitleColor:function(){return this._titleRenderer._getFillStyle()},setTitleFontSize:function(a){this._titleRenderer.setFontSize(a);
this._fontSize=a},getTitleFontSize:function(){return this._titleRenderer.getFontSize()},setZoomScale:function(a){this._zoomScale=a},getZoomScale:function(){return this._zoomScale},getNormalTextureSize:function(){return this._normalTextureSize},setTitleFontName:function(a){this._titleRenderer.setFontName(a);this._fontName=a},getTitleRenderer:function(){return this._titleRenderer},getTitleFontName:function(){return this._titleRenderer.getFontName()},_setTitleFont:function(a){this._titleRenderer.font=
a},_getTitleFont:function(){return this._titleRenderer.font},getDescription:function(){return"Button"},_createCloneInstance:function(){return new ccui.Button},_copySpecialProperties:function(a){this._prevIgnoreSize=a._prevIgnoreSize;this.setScale9Enabled(a._scale9Enabled);this.loadTextureNormal(a._normalFileName,a._normalTexType);this.loadTexturePressed(a._clickedFileName,a._pressedTexType);this.loadTextureDisabled(a._disabledFileName,a._disabledTexType);this.setCapInsetsNormalRenderer(a._capInsetsNormal);
this.setCapInsetsPressedRenderer(a._capInsetsPressed);this.setCapInsetsDisabledRenderer(a._capInsetsDisabled);this.setTitleText(a.getTitleText());this.setTitleFontName(a.getTitleFontName());this.setTitleFontSize(a.getTitleFontSize());this.setTitleColor(a.getTitleColor());this.setPressedActionEnabled(a.pressedActionEnabled);this.setZoomScale(a._zoomScale)},setColor:function(a){cc.ProtectedNode.prototype.setColor.call(this,a);this._updateTexturesRGBA()},_getNormalSize:function(){var a;null!==this._titleRenderer&&
(a=this._titleRenderer.getContentSize());var b;null!==this._buttonNormalRenderer&&(b=this._buttonNormalRenderer.getContentSize());return cc.size(a.width>b.width?a.width:b.width,a.height>b.height?a.height:b.height)}});_p=ccui.Button.prototype;cc.defineGetterSetter(_p,"titleText",_p.getTitleText,_p.setTitleText);cc.defineGetterSetter(_p,"titleFont",_p._getTitleFont,_p._setTitleFont);cc.defineGetterSetter(_p,"titleFontSize",_p.getTitleFontSize,_p.setTitleFontSize);
cc.defineGetterSetter(_p,"titleFontName",_p.getTitleFontName,_p.setTitleFontName);cc.defineGetterSetter(_p,"titleColor",_p.getTitleColor,_p.setTitleColor);_p=null;ccui.Button.create=function(a,b,c,d){return new ccui.Button(a,b,c,d)};ccui.Button.NORMAL_RENDERER_ZORDER=-2;ccui.Button.PRESSED_RENDERER_ZORDER=-2;ccui.Button.DISABLED_RENDERER_ZORDER=-2;ccui.Button.TITLE_RENDERER_ZORDER=-1;ccui.Button.ZOOM_ACTION_TIME_STEP=0.05;ccui.Button.SYSTEM=0;ccui.Button.TTF=1;ccui.CheckBox=ccui.Widget.extend({_backGroundBoxRenderer:null,_backGroundSelectedBoxRenderer:null,_frontCrossRenderer:null,_backGroundBoxDisabledRenderer:null,_frontCrossDisabledRenderer:null,_isSelected:!0,_checkBoxEventListener:null,_checkBoxEventSelector:null,_backGroundTexType:ccui.Widget.LOCAL_TEXTURE,_backGroundSelectedTexType:ccui.Widget.LOCAL_TEXTURE,_frontCrossTexType:ccui.Widget.LOCAL_TEXTURE,_backGroundDisabledTexType:ccui.Widget.LOCAL_TEXTURE,_frontCrossDisabledTexType:ccui.Widget.LOCAL_TEXTURE,
_backGroundFileName:"",_backGroundSelectedFileName:"",_frontCrossFileName:"",_backGroundDisabledFileName:"",_frontCrossDisabledFileName:"",_className:"CheckBox",_zoomScale:0.1,_backgroundTextureScaleX:0.1,_backgroundTextureScaleY:0.1,_backGroundBoxRendererAdaptDirty:!0,_backGroundSelectedBoxRendererAdaptDirty:!0,_frontCrossRendererAdaptDirty:!0,_backGroundBoxDisabledRendererAdaptDirty:!0,_frontCrossDisabledRendererAdaptDirty:!0,ctor:function(a,b,c,d,e,f){ccui.Widget.prototype.ctor.call(this);this.setTouchEnabled(!0);
for(var g=0,h=0;h=c.width||0>=c.height){a.setScale(1);this._backgroundTextureScaleX=this._backgroundTextureScaleY=1;return}var d=b.width/c.width,c=b.height/c.height;this._backgroundTextureScaleX=d;this._backgroundTextureScaleY=c;a.setScaleX(d);a.setScaleY(c)}a.setPosition(0.5*b.width,0.5*b.height)},_backGroundSelectedTextureScaleChangedWithSize:function(){var a=
this._backGroundSelectedBoxRenderer,b=this._contentSize;if(this._ignoreSize)a.setScale(1);else{var c=a.getContentSize();if(0>=c.width||0>=c.height){a.setScale(1);return}var d=b.height/c.height;a.setScaleX(b.width/c.width);a.setScaleY(d)}a.setPosition(0.5*b.width,0.5*b.height)},_frontCrossTextureScaleChangedWithSize:function(){var a=this._frontCrossRenderer,b=this._contentSize;if(this._ignoreSize)a.setScale(1);else{var c=a.getContentSize();if(0>=c.width||0>=c.height){a.setScale(1);return}var d=b.height/
c.height;a.setScaleX(b.width/c.width);a.setScaleY(d)}a.setPosition(0.5*b.width,0.5*b.height)},_backGroundDisabledTextureScaleChangedWithSize:function(){var a=this._backGroundBoxDisabledRenderer,b=this._contentSize;if(this._ignoreSize)a.setScale(1);else{var c=a.getContentSize();if(0>=c.width||0>=c.height){a.setScale(1);return}var d=b.height/c.height;a.setScaleX(b.width/c.width);a.setScaleY(d)}a.setPosition(0.5*b.width,0.5*b.height)},_frontCrossDisabledTextureScaleChangedWithSize:function(){var a=this._frontCrossDisabledRenderer,
b=this._contentSize;if(this._ignoreSize)a.setScale(1);else{var c=a.getContentSize();if(0>=c.width||0>=c.height){a.setScale(1);return}var d=b.height/c.height;a.setScaleX(b.width/c.width);a.setScaleY(d)}a.setPosition(0.5*b.width,0.5*b.height)},getDescription:function(){return"CheckBox"},_createCloneInstance:function(){return new ccui.CheckBox},_copySpecialProperties:function(a){a instanceof ccui.CheckBox&&(this.loadTextureBackGround(a._backGroundFileName,a._backGroundTexType),this.loadTextureBackGroundSelected(a._backGroundSelectedFileName,
a._backGroundSelectedTexType),this.loadTextureFrontCross(a._frontCrossFileName,a._frontCrossTexType),this.loadTextureBackGroundDisabled(a._backGroundDisabledFileName,a._backGroundDisabledTexType),this.loadTextureFrontCrossDisabled(a._frontCrossDisabledFileName,a._frontCrossDisabledTexType),this.setSelected(a._isSelected),this._checkBoxEventListener=a._checkBoxEventListener,this._checkBoxEventSelector=a._checkBoxEventSelector,this._ccEventCallback=a._ccEventCallback,this._zoomScale=a._zoomScale,this._backgroundTextureScaleX=
a._backgroundTextureScaleX,this._backgroundTextureScaleY=a._backgroundTextureScaleY)},_adaptRenderers:function(){this._backGroundBoxRendererAdaptDirty&&(this._backGroundTextureScaleChangedWithSize(),this._backGroundBoxRendererAdaptDirty=!1);this._backGroundSelectedBoxRendererAdaptDirty&&(this._backGroundSelectedTextureScaleChangedWithSize(),this._backGroundSelectedBoxRendererAdaptDirty=!1);this._frontCrossRendererAdaptDirty&&(this._frontCrossTextureScaleChangedWithSize(),this._frontCrossRendererAdaptDirty=
!1);this._backGroundBoxDisabledRendererAdaptDirty&&(this._backGroundDisabledTextureScaleChangedWithSize(),this._backGroundBoxDisabledRendererAdaptDirty=!1);this._frontCrossDisabledRendererAdaptDirty&&(this._frontCrossDisabledTextureScaleChangedWithSize(),this._frontCrossDisabledRendererAdaptDirty=!1)}});_p=ccui.CheckBox.prototype;cc.defineGetterSetter(_p,"selected",_p.isSelected,_p.setSelected);_p=null;ccui.CheckBox.create=function(a,b,c,d,e,f){return new ccui.CheckBox(a,b,c,d,e,f)};
ccui.CheckBox.EVENT_SELECTED=0;ccui.CheckBox.EVENT_UNSELECTED=1;ccui.CheckBox.BOX_RENDERER_ZORDER=-1;ccui.CheckBox.BOX_SELECTED_RENDERER_ZORDER=-1;ccui.CheckBox.BOX_DISABLED_RENDERER_ZORDER=-1;ccui.CheckBox.FRONT_CROSS_RENDERER_ZORDER=-1;ccui.CheckBox.FRONT_CROSS_DISABLED_RENDERER_ZORDER=-1;ccui.ImageView=ccui.Widget.extend({_scale9Enabled:!1,_prevIgnoreSize:!0,_capInsets:null,_imageRenderer:null,_textureFile:"",_imageTexType:ccui.Widget.LOCAL_TEXTURE,_imageTextureSize:null,_className:"ImageView",_imageRendererAdaptDirty:!0,ctor:function(a,b){this._capInsets=cc.rect(0,0,0,0);this._imageTextureSize=cc.size(this._capInsets.width,this._capInsets.height);ccui.Widget.prototype.ctor.call(this);this.init(a,void 0===b?0:b)},init:function(a,b){return ccui.Widget.prototype.init.call(this)?(void 0===
a?this._imageTexType=ccui.Widget.LOCAL_TEXTURE:this.loadTexture(a,b),!0):!1},_initRenderer:function(){this._imageRenderer=new cc.Sprite;this.addProtectedChild(this._imageRenderer,ccui.ImageView.RENDERER_ZORDER,-1)},setRotation:function(a){this._imageRenderer.setRotation(a)},loadTexture:function(a,b){if(a){var c=this;b=b||ccui.Widget.LOCAL_TEXTURE;this._textureFile=a;this._imageTexType=b;var d=c._imageRenderer;d._textureLoaded||d.addEventListener("load",function(){c.loadTexture(c._textureFile,c._imageTexType)});
switch(c._imageTexType){case ccui.Widget.LOCAL_TEXTURE:c._scale9Enabled?(d.initWithFile(a),d.setCapInsets(c._capInsets)):d.initWithFile(a);break;case ccui.Widget.PLIST_TEXTURE:c._scale9Enabled?(d.initWithSpriteFrameName(a),d.setCapInsets(c._capInsets)):d.initWithSpriteFrameName(a)}c._imageTextureSize=d.getContentSize();this._updateChildrenDisplayedRGBA();c._updateContentSizeWithTextureSize(c._imageTextureSize);c._imageRendererAdaptDirty=!0;c._findLayout()}},setTextureRect:function(a){this._scale9Enabled||
this._imageRenderer.setTextureRect(a)},setScale9Enabled:function(a){this._scale9Enabled!==a&&(this._scale9Enabled=a,this.removeProtectedChild(this._imageRenderer),this._imageRenderer=null,this._imageRenderer=this._scale9Enabled?new ccui.Scale9Sprite:new cc.Sprite,this.loadTexture(this._textureFile,this._imageTexType),this.addProtectedChild(this._imageRenderer,ccui.ImageView.RENDERER_ZORDER,-1),this._scale9Enabled?(a=this._ignoreSize,this.ignoreContentAdaptWithSize(!1),this._prevIgnoreSize=a):this.ignoreContentAdaptWithSize(this._prevIgnoreSize),
this.setCapInsets(this._capInsets),this._imageRendererAdaptDirty=!0)},isScale9Enabled:function(){return this._scale9Enabled},ignoreContentAdaptWithSize:function(a){if(!this._scale9Enabled||this._scale9Enabled&&!a)ccui.Widget.prototype.ignoreContentAdaptWithSize.call(this,a),this._prevIgnoreSize=a},setCapInsets:function(a){if(a){var b=this._capInsets;b.x=a.x;b.y=a.y;b.width=a.width;b.height=a.height;this._scale9Enabled&&this._imageRenderer.setCapInsets(a)}},getCapInsets:function(){return cc.rect(this._capInsets)},
_onSizeChanged:function(){ccui.Widget.prototype._onSizeChanged.call(this);this._imageRendererAdaptDirty=!0},_adaptRenderers:function(){this._imageRendererAdaptDirty&&(this._imageTextureScaleChangedWithSize(),this._imageRendererAdaptDirty=!1)},getVirtualRendererSize:function(){return cc.size(this._imageTextureSize)},getVirtualRenderer:function(){return this._imageRenderer},_imageTextureScaleChangedWithSize:function(){if(this._ignoreSize)this._scale9Enabled||this._imageRenderer.setScale(1);else if(this._scale9Enabled)this._imageRenderer.setPreferredSize(this._contentSize),
this._imageRenderer.setScale(1);else{var a=this._imageTextureSize;if(0>=a.width||0>=a.height){this._imageRenderer.setScale(1);return}this._imageRenderer.setScaleX(this._contentSize.width/a.width);this._imageRenderer.setScaleY(this._contentSize.height/a.height)}this._imageRenderer.setPosition(this._contentSize.width/2,this._contentSize.height/2)},getDescription:function(){return"ImageView"},_createCloneInstance:function(){return new ccui.ImageView},_copySpecialProperties:function(a){a instanceof ccui.ImageView&&
(this._prevIgnoreSize=a._prevIgnoreSize,this.setScale9Enabled(a._scale9Enabled),this.loadTexture(a._textureFile,a._imageTexType),this.setCapInsets(a._capInsets))},setContentSize:function(a,b){null!=b&&(a=cc.size(a,b));ccui.Widget.prototype.setContentSize.call(this,a);if(this._scale9Enabled)this._imageRenderer.setContentSize(a);else{var c=this._imageRenderer.getContentSize();this._imageRenderer.setScaleX(a.width/c.width);this._imageRenderer.setScaleY(a.height/c.height)}}});
ccui.ImageView.create=function(a,b){return new ccui.ImageView(a,b)};ccui.ImageView.RENDERER_ZORDER=-1;ccui.LoadingBar=ccui.Widget.extend({_direction:null,_percent:100,_totalLength:0,_barRenderer:null,_renderBarTexType:ccui.Widget.LOCAL_TEXTURE,_barRendererTextureSize:null,_scale9Enabled:!1,_prevIgnoreSize:!0,_capInsets:null,_textureFile:"",_isTextureLoaded:!1,_className:"LoadingBar",_barRendererAdaptDirty:!0,ctor:function(a,b){this._direction=ccui.LoadingBar.TYPE_LEFT;this._barRendererTextureSize=cc.size(0,0);this._capInsets=cc.rect(0,0,0,0);ccui.Widget.prototype.ctor.call(this);void 0!==a&&this.loadTexture(a);
void 0!==b&&this.setPercent(b)},_initRenderer:function(){this._barRenderer=new cc.Sprite;this.addProtectedChild(this._barRenderer,ccui.LoadingBar.RENDERER_ZORDER,-1);this._barRenderer.setAnchorPoint(0,0.5)},setDirection:function(a){if(this._direction!==a)switch(this._direction=a,this._direction){case ccui.LoadingBar.TYPE_LEFT:this._barRenderer.setAnchorPoint(0,0.5);this._barRenderer.setPosition(0,0.5*this._contentSize.height);this._scale9Enabled||this._barRenderer.setFlippedX(!1);break;case ccui.LoadingBar.TYPE_RIGHT:this._barRenderer.setAnchorPoint(1,
0.5),this._barRenderer.setPosition(this._totalLength,0.5*this._contentSize.height),this._scale9Enabled||this._barRenderer.setFlippedX(!0)}},getDirection:function(){return this._direction},loadTexture:function(a,b){if(a){this._renderBarTexType=b=b||ccui.Widget.LOCAL_TEXTURE;this._textureFile=a;var c=this._barRenderer,d=this;c._textureLoaded||c.addEventListener("load",function(){d.loadTexture(d._textureFile,d._renderBarTexType);d._setPercent(d._percent)});switch(this._renderBarTexType){case ccui.Widget.LOCAL_TEXTURE:c.initWithFile(a);
break;case ccui.Widget.PLIST_TEXTURE:c.initWithSpriteFrameName(a)}var e=c.getContentSize();this._barRendererTextureSize.width=e.width;this._barRendererTextureSize.height=e.height;switch(this._direction){case ccui.LoadingBar.TYPE_LEFT:c.setAnchorPoint(0,0.5);this._scale9Enabled||c.setFlippedX(!1);break;case ccui.LoadingBar.TYPE_RIGHT:c.setAnchorPoint(1,0.5),this._scale9Enabled||c.setFlippedX(!0)}this._scale9Enabled&&c.setCapInsets(this._capInsets);this._updateChildrenDisplayedRGBA();this._barRendererScaleChangedWithSize();
this._updateContentSizeWithTextureSize(this._barRendererTextureSize);this._barRendererAdaptDirty=!0;this._findLayout()}},setScale9Enabled:function(a){this._scale9Enabled!==a&&(this._scale9Enabled=a,this.removeProtectedChild(this._barRenderer),this._barRenderer=this._scale9Enabled?new ccui.Scale9Sprite:new cc.Sprite,this.loadTexture(this._textureFile,this._renderBarTexType),this.addProtectedChild(this._barRenderer,ccui.LoadingBar.RENDERER_ZORDER,-1),this._scale9Enabled?(a=this._ignoreSize,this.ignoreContentAdaptWithSize(!1),
this._prevIgnoreSize=a):this.ignoreContentAdaptWithSize(this._prevIgnoreSize),this.setCapInsets(this._capInsets),this.setPercent(this._percent),this._barRendererAdaptDirty=!0)},isScale9Enabled:function(){return this._scale9Enabled},setCapInsets:function(a){if(a){var b=this._capInsets;b.x=a.x;b.y=a.y;b.width=a.width;b.height=a.height;this._scale9Enabled&&this._barRenderer.setCapInsets(a)}},getCapInsets:function(){return cc.rect(this._capInsets)},setPercent:function(a){100