1 |
- var egret;!function(a){var b=function(){function c(){this._hashCode=c.hashCount++}return Object.defineProperty(c.prototype,"hashCode",{get:function(){return this._hashCode},enumerable:!0,configurable:!0}),c.hashCount=1,c}();a.HashObject=b,b.prototype.__class__="egret.HashObject"}(egret||(egret={}));var __extends=this.__extends||function(b,c){function a(){this.constructor=b}for(var d in c){c.hasOwnProperty(d)&&(b[d]=c[d])}a.prototype=c.prototype,b.prototype=new a};!function(a){var b=function(c){function d(f){"undefined"==typeof f&&(f=300),c.call(this),this.objectPool=[],this._length=0,1>f&&(f=1),this.autoDisposeTime=f,this.frameCount=0}return __extends(d,c),d.prototype._checkFrame=function(){this.frameCount--,0>=this.frameCount&&this.dispose()},Object.defineProperty(d.prototype,"length",{get:function(){return this._length},enumerable:!0,configurable:!0}),d.prototype.push=function(f){var e=this.objectPool;-1==e.indexOf(f)&&(e.push(f),this._length++,0==this.frameCount&&(this.frameCount=this.autoDisposeTime,d._callBackList.push(this)))},d.prototype.pop=function(){return 0==this._length?null:(this._length--,this.objectPool.pop())},d.prototype.dispose=function(){0<this._length&&(this.objectPool=[],this._length=0),this.frameCount=0;var f=d._callBackList,e=f.indexOf(this);-1!=e&&f.splice(e,1)},d._callBackList=[],d}(a.HashObject);a.Recycler=b,b.prototype.__class__="egret.Recycler"}(egret||(egret={})),function(a){a.__START_TIME,a.getTimer=function(){return Date.now()-a.__START_TIME}}(egret||(egret={})),function(a){a.__callLaterFunctionList=[],a.__callLaterThisList=[],a.__callLaterArgsList=[],a.callLater=function(d,b){for(var f=[],c=0;c<arguments.length-2;c++){f[c]=arguments[c+2]}a.__callLaterFunctionList.push(d),a.__callLaterThisList.push(b),a.__callLaterArgsList.push(f)}}(egret||(egret={}));var egret_dom;!function(a){function b(){for(var d=document.createElement("div").style,f=["t","webkitT","msT","MozT","OT"],c=0;c<f.length;c++){if(f[c]+"ransform" in d){return f[c]}}return f[0]}a.header="",a.getHeader=b,a.getTrans=function(c){return""==a.header&&(a.header=b()),a.header+c.substring(1,c.length)}}(egret_dom||(egret_dom={})),__extends=this.__extends||function(b,c){function a(){this.constructor=b}for(var d in c){c.hasOwnProperty(d)&&(b[d]=c[d])}a.prototype=c.prototype,b.prototype=new a},function(a){var b=function(d){function c(f,e,g){"undefined"==typeof e&&(e=!1),"undefined"==typeof g&&(g=!1),d.call(this),this._eventPhase=2,this._isPropagationImmediateStopped=this._isPropagationStopped=this._isDefaultPrevented=!1,this.isNew=!0,this._type=f,this._bubbles=e,this._cancelable=g}return __extends(c,d),Object.defineProperty(c.prototype,"type",{get:function(){return this._type},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"bubbles",{get:function(){return this._bubbles},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"cancelable",{get:function(){return this._cancelable},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"eventPhase",{get:function(){return this._eventPhase},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"currentTarget",{get:function(){return this._currentTarget},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"target",{get:function(){return this._target},enumerable:!0,configurable:!0}),c.prototype.isDefaultPrevented=function(){return this._isDefaultPrevented},c.prototype.preventDefault=function(){this._cancelable&&(this._isDefaultPrevented=!0)},c.prototype.stopPropagation=function(){this._bubbles&&(this._isPropagationStopped=!0)},c.prototype.stopImmediatePropagation=function(){this._bubbles&&(this._isPropagationImmediateStopped=!0)},c.prototype._reset=function(){this.isNew?this.isNew=!1:(this._isPropagationImmediateStopped=this._isPropagationStopped=this._isDefaultPrevented=!1,this._currentTarget=this._target=null,this._eventPhase=2)},c._dispatchByTarget=function(m,k,j,f,g,t){"undefined"==typeof g&&(g=!1),"undefined"==typeof t&&(t=!1);var q=m.eventRecycler;q||(q=m.eventRecycler=new a.Recycler);var l=q.pop();if(l?l._type=j:l=new m(j),l._bubbles=g,l._cancelable=t,f){for(var p in f){l[p]=f[p],null!==l[p]&&(f[p]=null)}}return m=k.dispatchEvent(l),q.push(l),m},c._getPropertyData=function(f){var g=f._props;return g||(g=f._props={}),g},c.dispatchEvent=function(f,h,j,g){"undefined"==typeof j&&(j=!1);var i=c._getPropertyData(c);g&&(i.data=g),c._dispatchByTarget(c,f,h,i,j)},c.ADDED_TO_STAGE="addedToStage",c.REMOVED_FROM_STAGE="removedFromStage",c.ADDED="added",c.REMOVED="removed",c.COMPLETE="complete",c.ENTER_FRAME="enterFrame",c.RENDER="render",c.FINISH_RENDER="finishRender",c.FINISH_UPDATE_TRANSFORM="finishUpdateTransform",c.LEAVE_STAGE="leaveStage",c.RESIZE="resize",c.CHANGE="change",c}(a.HashObject);a.Event=b,b.prototype.__class__="egret.Event"}(egret||(egret={})),__extends=this.__extends||function(b,c){function a(){this.constructor=b}for(var d in c){c.hasOwnProperty(d)&&(b[d]=c[d])}a.prototype=c.prototype,b.prototype=new a},function(a){var b=function(d){function c(f,e,g){"undefined"==typeof e&&(e=!1),"undefined"==typeof g&&(g=!1),d.call(this,f,e,g)}return __extends(c,d),c.dispatchIOErrorEvent=function(f){a.Event._dispatchByTarget(c,f,c.IO_ERROR)},c.IO_ERROR="ioError",c}(a.Event);a.IOErrorEvent=b,b.prototype.__class__="egret.IOErrorEvent"}(egret||(egret={})),__extends=this.__extends||function(b,c){function a(){this.constructor=b}for(var d in c){c.hasOwnProperty(d)&&(b[d]=c[d])}a.prototype=c.prototype,b.prototype=new a},function(a){var b=function(d){function c(q,j,g,e,f,v,m,k,l,p){"undefined"==typeof j&&(j=!0),"undefined"==typeof g&&(g=!0),"undefined"==typeof e&&(e=0),"undefined"==typeof f&&(f=0),"undefined"==typeof v&&(v=0),"undefined"==typeof m&&(m=!1),"undefined"==typeof k&&(k=!1),"undefined"==typeof p&&(p=!1),d.call(this,q,j,g),this._stageY=this._stageX=0,this.touchPointID=e,this._stageX=f,this._stageY=v,this.ctrlKey=m,this.altKey=k,this.touchDown=p}return __extends(c,d),Object.defineProperty(c.prototype,"stageX",{get:function(){return this._stageX},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"stageY",{get:function(){return this._stageY},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"localX",{get:function(){return this._currentTarget.globalToLocal(this._stageX,this._stageY,a.Point.identity).x},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"localY",{get:function(){return this._currentTarget.globalToLocal(this._stageX,this._stageY,a.Point.identity).y},enumerable:!0,configurable:!0}),c.dispatchTouchEvent=function(l,j,f,i,v,q,k,m,t){"undefined"==typeof f&&(f=0),"undefined"==typeof i&&(i=0),"undefined"==typeof v&&(v=0),"undefined"==typeof q&&(q=!1),"undefined"==typeof k&&(k=!1),"undefined"==typeof m&&(m=!1),"undefined"==typeof t&&(t=!1);var g=a.Event._getPropertyData(c);g.touchPointID=f,g._stageX=i,g._stageY=v,g.ctrlKey=q,g.altKey=k,g.shiftKey=m,g.touchDown=t,a.Event._dispatchByTarget(c,l,j,g,!0,!0)},c.TOUCH_TAP="touchTap",c.TOUCH_MOVE="touchMove",c.TOUCH_BEGIN="touchBegin",c.TOUCH_END="touchEnd",c.TOUCH_RELEASE_OUTSIDE="touchReleaseOutside",c.TOUCH_ROLL_OUT="touchRollOut",c.TOUCH_ROLL_OVER="touchRollOver",c.TOUCH_OUT="touchOut",c.TOUCH_OVER="touchOver",c}(a.Event);a.TouchEvent=b,b.prototype.__class__="egret.TouchEvent"}(egret||(egret={})),__extends=this.__extends||function(b,c){function a(){this.constructor=b}for(var d in c){c.hasOwnProperty(d)&&(b[d]=c[d])}a.prototype=c.prototype,b.prototype=new a},function(a){var b=function(d){function c(f,e,g){"undefined"==typeof e&&(e=!1),"undefined"==typeof g&&(g=!1),d.call(this,f,e,g)}return __extends(c,d),c.dispatchTimerEvent=function(f,g){a.Event._dispatchByTarget(c,f,g)},c.TIMER="timer",c.TIMER_COMPLETE="timerComplete",c}(a.Event);a.TimerEvent=b,b.prototype.__class__="egret.TimerEvent"}(egret||(egret={})),function(a){var b=function(){function c(){}return c.CAPTURING_PHASE=1,c.AT_TARGET=2,c.BUBBLING_PHASE=3,c}();a.EventPhase=b,b.prototype.__class__="egret.EventPhase"}(egret||(egret={})),__extends=this.__extends||function(b,c){function a(){this.constructor=b}for(var d in c){c.hasOwnProperty(d)&&(b[d]=c[d])}a.prototype=c.prototype,b.prototype=new a},function(a){var b=function(d){function c(e){"undefined"==typeof e&&(e=null),d.call(this),this._eventTarget=e?e:this}return __extends(c,d),c.prototype.addEventListener=function(j,f,l,h,k){"undefined"==typeof h&&(h=!1),"undefined"==typeof k&&(k=0),"undefined"==typeof h&&(h=!1),"undefined"==typeof k&&(k=0),f||a.Logger.fatal("addEventListener侦听函数不能为空"),h?(this._captureEventsMap||(this._captureEventsMap={}),h=this._captureEventsMap):(this._eventsMap||(this._eventsMap={}),h=this._eventsMap);var g=h[j];g||(g=h[j]=[]),this._insertEventBin(g,f,l,k)},c.prototype._insertEventBin=function(h,l,g,p){for(var k=-1,m=h.length,j=0;m>j;j++){var f=h[j];if(f.listener===l&&f.thisObject===g){return !1}-1==k&&f.priority<p&&(k=j)}return l={listener:l,thisObject:g,priority:p},-1!=k?h.splice(k,0,l):h.push(l),!0},c.prototype.removeEventListener=function(g,j,f,k){if("undefined"==typeof k&&(k=!1),k=k?this._captureEventsMap:this._eventsMap){var h=k[g];h&&(this._removeEventBin(h,j,f),0==h.length&&delete k[g])}},c.prototype._removeEventBin=function(g,j,f){for(var l=g.length,h=0;l>h;h++){var k=g[h];if(k.listener===j&&k.thisObject===f){return g.splice(h,1),!0}}return !1},c.prototype.hasEventListener=function(e){return this._eventsMap&&this._eventsMap[e]||this._captureEventsMap&&this._captureEventsMap[e]},c.prototype.willTrigger=function(e){return this.hasEventListener(e)},c.prototype.dispatchEvent=function(e){return e._reset(),e._target=this._eventTarget,e._currentTarget=this._eventTarget,this._notifyListener(e)},c.prototype._notifyListener=function(g){var j=1==g._eventPhase?this._captureEventsMap:this._eventsMap;if(!j){return !0}if(j=j[g._type],!j){return !0}var f=j.length;if(0==f){return !0}for(var j=j.concat(),k=0;f>k;k++){var h=j[k];if(h.listener.call(h.thisObject,g),g._isPropagationImmediateStopped){break}}return !g._isDefaultPrevented},c.prototype.dispatchEventWith=function(g,f,h){"undefined"==typeof f&&(f=!1),a.Event.dispatchEvent(this,g,f,h)},c}(a.HashObject);a.EventDispatcher=b,b.prototype.__class__="egret.EventDispatcher"}(egret||(egret={})),__extends=this.__extends||function(b,c){function a(){this.constructor=b}for(var d in c){c.hasOwnProperty(d)&&(b[d]=c[d])}a.prototype=c.prototype,b.prototype=new a},function(a){var b=function(d){function c(){d.call(this),this.reuseEvent=new a.Event("")}return __extends(c,d),c.prototype.run=function(){a.Ticker.getInstance().run(),a.Ticker.getInstance().register(this.renderLoop,this,Number.NEGATIVE_INFINITY),a.Ticker.getInstance().register(this.broadcastEnterFrame,this,Number.POSITIVE_INFINITY),this.touchContext.run()},c.prototype.renderLoop=function(h){if(0<a.__callLaterFunctionList.length){var j=a.__callLaterFunctionList;a.__callLaterFunctionList=[];var g=a.__callLaterThisList;a.__callLaterThisList=[];var i=a.__callLaterArgsList;a.__callLaterArgsList=[]}h=this.stage;var f=c.cachedEvent;f._type=a.Event.RENDER,this.dispatchEvent(f),a.Stage._invalidateRenderFlag&&(this.broadcastRender(),a.Stage._invalidateRenderFlag=!1),j&&this.doCallLaterList(j,g,i),j=this.rendererContext,j.onRenderStart(),j.clearScreen(),h._updateTransform(),f._type=a.Event.FINISH_UPDATE_TRANSFORM,this.dispatchEvent(f),h._draw(j),f._type=a.Event.FINISH_RENDER,this.dispatchEvent(f),j.onRenderFinish()},c.prototype.broadcastEnterFrame=function(h){h=this.reuseEvent,h._type=a.Event.ENTER_FRAME,this.dispatchEvent(h);for(var f=a.DisplayObject._enterFrameCallBackList.concat(),k=f.length,g=0;k>g;g++){var j=f[g];h._target=j.display,h._currentTarget=j.display,j.listener.call(j.thisObject,h)}for(f=a.Recycler._callBackList,g=f.length-1;g>=0;g--){f[g]._checkFrame()}},c.prototype.broadcastRender=function(){var j=this.reuseEvent;j._type=a.Event.RENDER;for(var f=a.DisplayObject._renderCallBackList.concat(),l=f.length,h=0;l>h;h++){var k=f[h],g=k.display;j._target=g,j._currentTarget=g,k.listener.call(k.thisObject,j)}},c.prototype.doCallLaterList=function(g,j,f){for(var l=g.length,h=0;l>h;h++){var k=g[h];null!=k&&k.apply(j[h],f[h])}},c.DEVICE_PC="web",c.DEVICE_MOBILE="native",c.RUNTIME_HTML5="runtime_html5",c.RUNTIME_NATIVE="runtime_native",c.cachedEvent=new a.Event(""),c}(a.EventDispatcher);a.MainContext=b,b.prototype.__class__="egret.MainContext"}(egret||(egret={}));var testDeviceType=function(){if(!this.navigator){return !0}var a=navigator.userAgent.toLowerCase();return -1!=a.indexOf("mobile")||-1!=a.indexOf("android")},testRuntimeType=function(){return this.navigator?!0:!1};egret.MainContext.instance=new egret.MainContext,egret.MainContext.deviceType=testDeviceType()?egret.MainContext.DEVICE_MOBILE:egret.MainContext.DEVICE_PC,egret.MainContext.runtimeType=testRuntimeType()?egret.MainContext.RUNTIME_HTML5:egret.MainContext.RUNTIME_NATIVE,function(a){var b=function(){function c(){this._tick=this._preDrawCount=this._updateTransformPerformanceCost=this._renderPerformanceCost=this._logicPerformanceCost=this._lastTime=0,this._maxDeltaTime=500,this._totalDeltaTime=0}return c.getInstance=function(){return null==c.instance&&(c.instance=new c),c.instance},c.prototype.run=function(){a.Ticker.getInstance().register(this.update,this),null==this._txt&&(this._txt=new a.TextField,this._txt.size=28,a.MainContext.instance.stage.addChild(this._txt));var d=a.MainContext.instance;d.addEventListener(a.Event.ENTER_FRAME,this.onEnterFrame,this),d.addEventListener(a.Event.RENDER,this.onStartRender,this),d.addEventListener(a.Event.FINISH_RENDER,this.onFinishRender,this),d.addEventListener(a.Event.FINISH_UPDATE_TRANSFORM,this.onFinishUpdateTransform,this)},c.prototype.onEnterFrame=function(){this._lastTime=a.getTimer()},c.prototype.onStartRender=function(d){d=a.getTimer(),this._logicPerformanceCost=d-this._lastTime,this._lastTime=d},c.prototype.onFinishUpdateTransform=function(d){d=a.getTimer(),this._updateTransformPerformanceCost=d-this._lastTime,this._lastTime=d},c.prototype.onFinishRender=function(d){d=a.getTimer(),this._renderPerformanceCost=d-this._lastTime,this._lastTime=d},c.prototype.update=function(f){if(this._tick++,this._totalDeltaTime+=f,this._totalDeltaTime>=this._maxDeltaTime){f=(this._preDrawCount-1).toString();var d=Math.ceil(this._logicPerformanceCost).toString()+","+Math.ceil(this._updateTransformPerformanceCost).toString()+","+Math.ceil(this._renderPerformanceCost).toString()+","+Math.ceil(a.MainContext.instance.rendererContext.renderCost).toString();this._txt.text="draw:"+f+"\ncost:"+d+"\nFPS:"+Math.floor(1000*this._tick/this._totalDeltaTime).toString(),this._tick=this._totalDeltaTime=0}this._preDrawCount=0},c.prototype.onDrawImage=function(){this._preDrawCount++},c}();a.Profiler=b,b.prototype.__class__="egret.Profiler"}(egret||(egret={})),__extends=this.__extends||function(b,c){function a(){this.constructor=b}for(var d in c){c.hasOwnProperty(d)&&(b[d]=c[d])}a.prototype=c.prototype,b.prototype=new a},function(a){var b=function(d){function c(){d.apply(this,arguments),this._timeScale=1,this._paused=!1,this.callBackList=[]}return __extends(c,d),c.prototype.run=function(){a.__START_TIME=(new Date).getTime(),a.MainContext.instance.deviceContext.executeMainLoop(this.update,this)},c.prototype.update=function(g){var j=this.callBackList.concat(),f=j.length;g*=this._timeScale,g*=this._timeScale;for(var k=0;f>k;k++){var h=j[k];h.listener.call(h.thisObject,g)}},c.prototype.register=function(g,h,f){"undefined"==typeof f&&(f=0),this._insertEventBin(this.callBackList,g,h,f)},c.prototype.unregister=function(f,g){this._removeEventBin(this.callBackList,f,g)},c.prototype.setTimeout=function(h,f,k){for(var g=[],j=0;j<arguments.length-3;j++){g[j]=arguments[j+3]}a.Logger.warning("Ticker#setTimeout方法即将废弃,请使用egret.setTimeout"),a.setTimeout.apply(null,[h,f,k].concat(g))},c.prototype.setTimeScale=function(e){this._timeScale=e},c.prototype.getTimeScale=function(){return this._timeScale},c.prototype.pause=function(){this._paused=!0},c.prototype.resume=function(){this._paused=!1},c.getInstance=function(){return null==c.instance&&(c.instance=new c),c.instance},c}(a.EventDispatcher);a.Ticker=b,b.prototype.__class__="egret.Ticker"}(egret||(egret={})),function(a){var b=function(){function c(){}return c.LEFT="left",c.RIGHT="right",c.CENTER="center",c.JUSTIFY="justify",c.CONTENT_JUSTIFY="contentJustify",c}();a.HorizontalAlign=b,b.prototype.__class__="egret.HorizontalAlign"}(egret||(egret={})),function(a){var b=function(){function c(){}return c.TOP="top",c.BOTTOM="bottom",c.MIDDLE="middle",c.JUSTIFY="justify",c.CONTENT_JUSTIFY="contentJustify",c}();a.VerticalAlign=b,b.prototype.__class__="egret.VerticalAlign"}(egret||(egret={})),__extends=this.__extends||function(b,c){function a(){this.constructor=b}for(var d in c){c.hasOwnProperty(d)&&(b[d]=c[d])}a.prototype=c.prototype,b.prototype=new a},function(a){var b=function(d){function c(f,e){"undefined"==typeof e&&(e=0),d.call(this),this._currentCount=0,this.delay=f,this.repeatCount=e}return __extends(c,d),c.prototype.currentCount=function(){return this._currentCount},Object.defineProperty(c.prototype,"running",{get:function(){return this._running},enumerable:!0,configurable:!0}),c.prototype.reset=function(){this.stop(),this._currentCount=0},c.prototype.start=function(){this._running||(this.lastTime=a.getTimer(),0!=this._currentCount&&(this._currentCount=0),a.Ticker.getInstance().register(this.onEnterFrame,this),this._running=!0)},c.prototype.stop=function(){this._running&&(a.Ticker.getInstance().unregister(this.onEnterFrame,this),this._running=!1)},c.prototype.onEnterFrame=function(f){f=a.getTimer(),f-this.lastTime>this.delay&&(this.lastTime=f,this._currentCount++,a.TimerEvent.dispatchTimerEvent(this,a.TimerEvent.TIMER),0<this.repeatCount&&this._currentCount>=this.repeatCount&&(this.stop(),a.TimerEvent.dispatchTimerEvent(this,a.TimerEvent.TIMER_COMPLETE)))},c}(a.EventDispatcher);a.Timer=b,b.prototype.__class__="egret.Timer"}(egret||(egret={})),function(a){a.getQualifiedClassName=function(c){if(c=c.prototype?c.prototype:c.__proto__,c.hasOwnProperty("__class__")){return c.__class__}var d=c.constructor.toString(),b=d.indexOf("("),d=d.substring(9,b);return c.__class__=d}}(egret||(egret={})),function(a){var b={};a.getDefinitionByName=function(d){if(!d){return null}var c=b[d];if(c){return c}for(var g=d.split("."),e=g.length,c=__global,f=0;e>f;f++){if(c=c[g[f]],!c){return null}}return b[d]=c}}(egret||(egret={}));var __global=__global||this;!function(b){function c(f){for(var g in a){var h=a[g];h.delay-=f,0>=h.delay&&(h.listener.apply(h.thisObject,h.params),delete a[g])}}var a={},d=0;b.setTimeout=function(i,j,g){for(var e=[],f=0;f<arguments.length-3;f++){e[f]=arguments[f+3]}return e={listener:i,thisObject:j,delay:g,params:e},0==d&&b.Ticker.getInstance().register(c,null),d++,a[d]=e,d},b.clearTimeout=function(e){delete a[e]}}(egret||(egret={})),function(a){a.hasDefinition=function(b){return a.getDefinitionByName(b)?!0:!1}}(egret||(egret={})),function(a){a.toColorString=function(b){for((isNaN(b)||0>b)&&(b=0),b>16777215&&(b=16777215),b=b.toString(16).toUpperCase();6>b.length;){b="0"+b}return"#"+b}}(egret||(egret={})),__extends=this.__extends||function(b,c){function a(){this.constructor=b}for(var d in c){c.hasOwnProperty(d)&&(b[d]=c[d])}a.prototype=c.prototype,b.prototype=new a},function(a){var b=function(d){function c(f,e,k,h,j,g){"undefined"==typeof f&&(f=1),"undefined"==typeof e&&(e=0),"undefined"==typeof k&&(k=0),"undefined"==typeof h&&(h=1),"undefined"==typeof j&&(j=0),"undefined"==typeof g&&(g=0),d.call(this),this.a=f,this.b=e,this.c=k,this.d=h,this.tx=j,this.ty=g}return __extends(c,d),c.prototype.prepend=function(q,m,k,j,f,g){var u=this.tx;if(1!=q||0!=m||0!=k||1!=j){var p=this.a,l=this.c;this.a=p*q+this.b*k,this.b=p*m+this.b*j,this.c=l*q+this.d*k,this.d=l*m+this.d*j}return this.tx=u*q+this.ty*k+f,this.ty=u*m+this.ty*j+g,this},c.prototype.append=function(u,m,k,j,f,g){var v=this.a,q=this.b,l=this.c,p=this.d;return(1!=u||0!=m||0!=k||1!=j)&&(this.a=u*v+m*l,this.b=u*q+m*p,this.c=k*v+j*l,this.d=k*q+j*p),this.tx=f*v+g*l+this.tx,this.ty=f*q+g*p+this.ty,this},c.prototype.prependMatrix=function(e){return this.prepend(e.a,e.b,e.c,e.d,e.tx,e.ty),this},c.prototype.appendMatrix=function(e){return this.append(e.a,e.b,e.c,e.d,e.tx,e.ty),this},c.prototype.prependTransform=function(q,k,i,f,g,v,m,j,l){if(g%360){var p=g*c.DEG_TO_RAD;g=Math.cos(p),p=Math.sin(p)}else{g=1,p=0}return(j||l)&&(this.tx-=j,this.ty-=l),v||m?(v*=c.DEG_TO_RAD,m*=c.DEG_TO_RAD,this.prepend(g*i,p*i,-p*f,g*f,0,0),this.prepend(Math.cos(m),Math.sin(m),-Math.sin(v),Math.cos(v),q,k)):this.prepend(g*i,p*i,-p*f,g*f,q,k),this},c.prototype.appendTransform=function(q,k,i,f,g,v,m,j,l){if(g%360){var p=g*c.DEG_TO_RAD;g=Math.cos(p),p=Math.sin(p)}else{g=1,p=0}return v||m?(v*=c.DEG_TO_RAD,m*=c.DEG_TO_RAD,this.append(Math.cos(m),Math.sin(m),-Math.sin(v),Math.cos(v),q,k),this.append(g*i,p*i,-p*f,g*f,0,0)):this.append(g*i,p*i,-p*f,g*f,q,k),(j||l)&&(this.tx-=j*this.a+l*this.c,this.ty-=j*this.b+l*this.d),this},c.prototype.rotate=function(g){var j=Math.cos(g);g=Math.sin(g);var f=this.a,k=this.c,h=this.tx;return this.a=f*j-this.b*g,this.b=f*g+this.b*j,this.c=k*j-this.d*g,this.d=k*g+this.d*j,this.tx=h*j-this.ty*g,this.ty=h*g+this.ty*j,this},c.prototype.skew=function(f,g){return f*=c.DEG_TO_RAD,g*=c.DEG_TO_RAD,this.append(Math.cos(g),Math.sin(g),-Math.sin(f),Math.cos(f),0,0),this},c.prototype.scale=function(f,g){return this.a*=f,this.d*=g,this.c*=f,this.b*=g,this.tx*=f,this.ty*=g,this},c.prototype.translate=function(f,g){return this.tx+=f,this.ty+=g,this},c.prototype.identity=function(){return this.a=this.d=1,this.b=this.c=this.tx=this.ty=0,this},c.prototype.identityMatrix=function(e){return this.a=e.a,this.b=e.b,this.c=e.c,this.d=e.d,this.tx=e.tx,this.ty=e.ty,this},c.prototype.invert=function(){var g=this.a,j=this.b,f=this.c,l=this.d,h=this.tx,k=g*l-j*f;return this.a=l/k,this.b=-j/k,this.c=-f/k,this.d=g/k,this.tx=(f*this.ty-l*h)/k,this.ty=-(g*this.ty-j*h)/k,this},c.transformCoords=function(h,f,j){var g=a.Point.identity;return g.x=h.a*f+h.c*j+h.tx,g.y=h.d*j+h.b*f+h.ty,g},c.prototype.toArray=function(e){return this.array||(this.array=new Float32Array(9)),e?(this.array[0]=this.a,this.array[1]=this.b,this.array[2]=0,this.array[3]=this.c,this.array[4]=this.d,this.array[5]=0,this.array[6]=this.tx,this.array[7]=this.ty):(this.array[0]=this.a,this.array[1]=this.b,this.array[2]=this.tx,this.array[3]=this.c,this.array[4]=this.d,this.array[5]=this.ty,this.array[6]=0,this.array[7]=0),this.array[8]=1,this.array},c.identity=new c,c.DEG_TO_RAD=Math.PI/180,c}(a.HashObject);a.Matrix=b,b.prototype.__class__="egret.Matrix"}(egret||(egret={})),__extends=this.__extends||function(b,c){function a(){this.constructor=b}for(var d in c){c.hasOwnProperty(d)&&(b[d]=c[d])}a.prototype=c.prototype,b.prototype=new a},function(a){var b=function(c){function d(g,f){"undefined"==typeof g&&(g=0),"undefined"==typeof f&&(f=0),c.call(this),this.x=g,this.y=f}return __extends(d,c),d.prototype.clone=function(){return new d(this.x,this.y)},d.prototype.equals=function(e){return this.x==e.x&&this.y==e.y},d.distance=function(f,g){return Math.sqrt((f.x-g.x)*(f.x-g.x)+(f.y-g.y)*(f.y-g.y))},d.identity=new d(0,0),d}(a.HashObject);a.Point=b,b.prototype.__class__="egret.Point"}(egret||(egret={})),__extends=this.__extends||function(b,c){function a(){this.constructor=b}for(var d in c){c.hasOwnProperty(d)&&(b[d]=c[d])}a.prototype=c.prototype,b.prototype=new a},function(a){var b=function(c){function d(h,f,j,g){"undefined"==typeof h&&(h=0),"undefined"==typeof f&&(f=0),"undefined"==typeof j&&(j=0),"undefined"==typeof g&&(g=0),c.call(this),this.x=h,this.y=f,this.width=j,this.height=g}return __extends(d,c),Object.defineProperty(d.prototype,"right",{get:function(){return this.x+this.width},set:function(e){this.width=e-this.x},enumerable:!0,configurable:!0}),Object.defineProperty(d.prototype,"bottom",{get:function(){return this.y+this.height},set:function(e){this.height=e-this.y},enumerable:!0,configurable:!0}),d.prototype.initialize=function(g,h,f,j){return this.x=g,this.y=h,this.width=f,this.height=j,this},d.prototype.contains=function(f,g){return this.x<=f&&this.x+this.width>=f&&this.y<=g&&this.y+this.height>=g},d.prototype.intersects=function(g){var j=g.right,f=g.bottom,k=this.right,h=this.bottom;return this.contains(g.x,g.y)||this.contains(g.x,f)||this.contains(j,g.y)||this.contains(j,f)||g.contains(this.x,this.y)||g.contains(this.x,h)||g.contains(k,this.y)||g.contains(k,h)?!0:!1},d.prototype.clone=function(){return new d(this.x,this.y,this.width,this.height)},d.prototype.containsPoint=function(e){return this.x<e.x&&this.x+this.width>e.x&&this.y<e.y&&this.y+this.height>e.y?!0:!1},d.identity=new d(0,0,0,0),d}(a.HashObject);a.Rectangle=b,b.prototype.__class__="egret.Rectangle"}(egret||(egret={})),function(a){var b=function(){function c(){}return c.fatal=function(f,d){throw"undefined"==typeof d&&(d=null),a.Logger.traceToConsole("Fatal",f,d),Error(a.Logger.getTraceCode("Fatal",f,d))},c.info=function(f,d){"undefined"==typeof d&&(d=null),a.Logger.traceToConsole("Info",f,d)},c.warning=function(f,d){"undefined"==typeof d&&(d=null),a.Logger.traceToConsole("Warning",f,d)},c.traceToConsole=function(f,d,g){console.log(a.Logger.getTraceCode(f,d,g))},c.getTraceCode=function(f,g,d){return"["+f+"]"+g+":"+(null==d?"":d)},c}();a.Logger=b,b.prototype.__class__="egret.Logger"}(egret||(egret={})),__extends=this.__extends||function(b,c){function a(){this.constructor=b}for(var d in c){c.hasOwnProperty(d)&&(b[d]=c[d])}a.prototype=c.prototype,b.prototype=new a},function(a){var b=function(d){function c(){d.call(this),this._isSupportDOMParser=this._xmlDict=this._parser=null,this._xmlDict={},window.DOMParser?(this._isSupportDOMParser=!0,this._parser=new DOMParser):this._isSupportDOMParser=!1}return __extends(c,d),c.getInstance=function(){return c._instance||(c._instance=new c),c._instance},c.prototype.parserXML=function(g){for(var f=0;"\n"==g.charAt(f)||" "==g.charAt(f)||"\r"==g.charAt(f)||" "==g.charAt(f);){f++}return 0!=f&&(g=g.substring(f,g.length)),this._isSupportDOMParser?f=this._parser.parseFromString(g,"text/xml"):(f=new ActiveXObject("Microsoft.XMLDOM"),f.async="false",f.loadXML(g)),null==f&&a.Logger.info("xml not found!"),f},c._instance=null,c}(a.HashObject);a.SAXParser=b,b.prototype.__class__="egret.SAXParser"}(egret||(egret={})),__extends=this.__extends||function(b,c){function a(){this.constructor=b}for(var d in c){c.hasOwnProperty(d)&&(b[d]=c[d])}a.prototype=c.prototype,b.prototype=new a},function(b){var d=function(j){function h(){j.call(this),this._designHeight=this._designWidth=0,this._scaleY=this._scaleX=1,this._offSetY=0;var e=document.getElementById(h.canvas_name),i=e.height;this._designWidth=e.width,this._designHeight=i}return __extends(h,j),h.getInstance=function(){return null==h.instance&&(g.initialize(),h.instance=new h),h.instance},h.prototype.setDesignSize=function(l,k,m){this._designWidth=l,this._designHeight=k,m&&(b.Logger.warning("该方法目前不应传入 resolutionPolicy 参数,请在 docs/1.0_Final_ReleaseNote中查看如何升级"),this._setResolutionPolicy(m))},h.prototype._setResolutionPolicy=function(e){this._resolutionPolicy=e,e.init(this),e._apply(this,this._designWidth,this._designHeight)},h.prototype.getScaleX=function(){return this._scaleX},h.prototype.getScaleY=function(){return this._scaleY},h.prototype.getOffSetY=function(){return this._offSetY},h.canvas_name="gameCanvas",h.canvas_div_name="gameDiv",h}(b.HashObject);b.StageDelegate=d,d.prototype.__class__="egret.StageDelegate";var a=function(){function e(h,i){this._containerStrategy=h,this._contentStrategy=i}return e.prototype.init=function(h){this._containerStrategy.init(h),this._contentStrategy.init(h)},e.prototype._apply=function(j,k,h){this._containerStrategy._apply(j,k,h),this._contentStrategy._apply(j,k,h)},e}();b.ResolutionPolicy=a,a.prototype.__class__="egret.ResolutionPolicy";var g=function(){function e(){}return e.initialize=function(){e.EQUAL_TO_FRAME=new c},e.prototype.init=function(){},e.prototype._apply=function(){},e.prototype._setupContainer=function(){var h,i=document.body;i&&(h=i.style)&&(h.paddingTop=h.paddingTop||"0px",h.paddingRight=h.paddingRight||"0px",h.paddingBottom=h.paddingBottom||"0px",h.paddingLeft=h.paddingLeft||"0px",h.borderTop=h.borderTop||"0px",h.borderRight=h.borderRight||"0px",h.borderBottom=h.borderBottom||"0px",h.borderLeft=h.borderLeft||"0px",h.marginTop=h.marginTop||"0px",h.marginRight=h.marginRight||"0px",h.marginBottom=h.marginBottom||"0px",h.marginLeft=h.marginLeft||"0px")},e}();b.ContainerStrategy=g,g.prototype.__class__="egret.ContainerStrategy";var c=function(h){function i(){h.apply(this,arguments)}return __extends(i,h),i.prototype._apply=function(){this._setupContainer()},i}(g);b.EqualToFrame=c,c.prototype.__class__="egret.EqualToFrame",a=function(){function e(){}return e.prototype.init=function(){},e.prototype._apply=function(){},e}(),b.ContentStrategy=a,a.prototype.__class__="egret.ContentStrategy";var f=function(h){function e(i){"undefined"==typeof i&&(i=0),h.call(this),this.minWidth=i}return __extends(e,h),e.prototype._apply=function(v,m,l){m=document.getElementById(d.canvas_name);var j=document.getElementById(d.canvas_div_name),k=document.documentElement.clientWidth,w=document.documentElement.clientHeight,u=w/l,p=k/u,q=1;0!=this.minWidth&&(q=Math.min(1,p/this.minWidth)),m.width=p/q,m.height=l,m.style.width=k+"px",m.style.height=w*q+"px",j.style.width=k+"px",j.style.height=w*q+"px",v._scaleX=u*q,v._scaleY=u*q},e}(a);b.FixedHeight=f,f.prototype.__class__="egret.FixedHeight",f=function(h){function e(i){"undefined"==typeof i&&(i=0),h.call(this),this.minHeight=i}return __extends(e,h),e.prototype._apply=function(v,m,l){l=document.getElementById(d.canvas_name);var j=document.getElementById(d.canvas_div_name),k=document.documentElement.clientWidth,w=document.documentElement.clientHeight,u=k/m,p=w/u,q=1;0!=this.minHeight&&(q=Math.min(1,p/this.minHeight)),l.width=m,l.height=p/q,l.style.width=k*q+"px",l.style.height=w+"px",j.style.width=k*q+"px",j.style.height=w+"px",v._scaleX=u*q,v._scaleY=u*q},e}(a),b.FixedWidth=f,f.prototype.__class__="egret.FixedWidth",f=function(h){function e(k,j){h.call(this),this.width=k,this.height=j}return __extends(e,h),e.prototype._apply=function(l,k,u){u=document.getElementById(d.canvas_name);var p=document.getElementById(d.canvas_div_name),q=this.width,m=this.height,j=q/k;u.width=k,u.height=m/j,u.style.width=q+"px",u.style.height=m+"px",p.style.width=q+"px",p.style.height=m+"px",l._scaleX=j,l._scaleY=j},e}(a),b.FixedSize=f,f.prototype.__class__="egret.FixedSize",f=function(h){function e(){h.call(this)}return __extends(e,h),e.prototype._apply=function(k,j,m){var l=document.getElementById(d.canvas_name);l.width=j,l.height=m,l.style.width=j+"px",l.style.height=m+"px",k._scaleX=1,k._scaleY=1},e}(a),b.NoScale=f,f.prototype.__class__="egret.NoScale",f=function(h){function e(){h.call(this)}return __extends(e,h),e.prototype._apply=function(l,k,v){var q=document.getElementById(d.canvas_name),u=document.getElementById(d.canvas_div_name),p=document.documentElement.clientWidth,j=document.documentElement.clientHeight,m=j/v>p/k?p/k:j/v,p=k*m,j=v*m;q.width=k,q.height=v/1,q.style.width=1*p+"px",q.style.height=j+"px",l._offSetY=Math.floor((document.documentElement.clientHeight-j)/2),q.style.top=l._offSetY+"px",u.style.width=1*p+"px",u.style.height=j+"px",l._scaleX=1*m,l._scaleY=1*m},e}(a),b.ShowAll=f,f.prototype.__class__="egret.ShowAll",a=function(h){function e(){h.call(this)}return __extends(e,h),e.prototype._apply=function(v,m,l){var j=document.getElementById(d.canvas_name),k=document.getElementById(d.canvas_div_name),w=document.documentElement.clientWidth,u=document.documentElement.clientHeight,p=w/m,q=u/l,w=m*p,u=l*q;j.width=m,j.height=l,j.style.width=w+"px",j.style.height=u+"px",k.style.width=w+"px",k.style.height=u+"px",v._scaleX=p,v._scaleY=q},e}(a),b.FullScreen=a,a.prototype.__class__="egret.FullScreen"}(egret||(egret={})),__extends=this.__extends||function(b,c){function a(){this.constructor=b}for(var d in c){c.hasOwnProperty(d)&&(b[d]=c[d])}a.prototype=c.prototype,b.prototype=new a},function(a){var b=function(d){function c(){d.call(this),this._originalData={},this._drawAreaList=[]}return __extends(c,d),c.getInstance=function(){return null==c.instance&&(c.instance=new c),c.instance},c.prototype.addDrawArea=function(e){this._drawAreaList.push(e)},c.prototype.clearDrawArea=function(){this._drawAreaList=[]},c.prototype.drawImage=function(F,B,x,t,w,q,I,C,H,k){I=I||0,C=C||0;var v=B._texture_to_render;if(null!=v&&0!=q&&0!=w&&0!=H&&0!=k){if(B._worldBounds){var A=this._originalData;A.sourceX=x,A.sourceY=t,A.sourceWidth=w,A.sourceHeight=q,A.destX=I,A.destY=C,A.destWidth=H,A.destHeight=k;for(var G=this.getDrawAreaList(),E=0;E<G.length;E++){var J=G[E];if(!this.ignoreRender(B,J,A.destX,A.destY)){if(0!=this._drawAreaList.length){if(0!=B._worldTransform.b||0!=B._worldTransform.c){if(B._worldBounds.x+A.destX<J.x||B._worldBounds.y+A.destY<J.y||B._worldBounds.x+B._worldBounds.width+A.destX>J.x+J.width||B._worldBounds.y+B._worldBounds.height+A.destY>J.y+J.height){a.Logger.fatal("请不要让带有旋转和斜切的显示对象跨过重绘区域");break}}else{var D,j=B._worldTransform.a,z=B._worldTransform.d;B._worldBounds.x+A.destX<J.x&&(D=(J.x-B._worldBounds.x)/j-A.destX,x+=D/(H/w),w-=D/(H/w),H-=D,I+=D),B._worldBounds.y+A.destY<J.y&&(D=(J.y-B._worldBounds.y)/z-A.destY,t+=D/(k/q),q-=D/(k/q),k-=D,C+=D),B._worldBounds.x+B._worldBounds.width+A.destX>J.x+J.width&&(D=(B._worldBounds.x+B._worldBounds.width-J.x-J.width)/j+A.destX,w-=D/(H/w),H-=D),B._worldBounds.y+B._worldBounds.height+A.destY>J.y+J.height&&(D=(B._worldBounds.y+B._worldBounds.height-J.y-J.height)/z+A.destY,q-=D/(k/q),k-=D)}}F.drawImage(v,x,t,w,q,I,C,H,k)}}}else{F.drawImage(v,x,t,w,q,I,C,H,k)}}},c.prototype.ignoreRender=function(g,j,f,k){var h=g._worldBounds;return f*=g._worldTransform.a,k*=g._worldTransform.d,h.x+h.width+f<=j.x||h.x+f>=j.x+j.width||h.y+h.height+k<=j.y||h.y+k>=j.y+j.height?!0:!1},c.prototype.getDrawAreaList=function(){var f;return 0==this._drawAreaList.length?(this._defaultDrawAreaList||(this._defaultDrawAreaList=[new a.Rectangle(0,0,a.MainContext.instance.stage.stageWidth,a.MainContext.instance.stage.stageHeight)]),f=this._defaultDrawAreaList):f=this._drawAreaList,f},c}(a.HashObject);a.RenderFilter=b,b.prototype.__class__="egret.RenderFilter"}(egret||(egret={})),function(a){var b=function(){function c(){}return c.mapClass=function(f,g,d){"undefined"==typeof d&&(d=""),f=this.getKey(f)+"#"+d,this.mapClassDic[f]=g},c.getKey=function(d){return"string"==typeof d?d:a.getQualifiedClassName(d)},c.mapValue=function(f,g,d){"undefined"==typeof d&&(d=""),f=this.getKey(f)+"#"+d,this.mapValueDic[f]=g},c.hasMapRule=function(f,g){"undefined"==typeof g&&(g="");var d=this.getKey(f)+"#"+g;return this.mapValueDic[d]||this.mapClassDic[d]?!0:!1},c.getInstance=function(f,g){"undefined"==typeof g&&(g="");var d=this.getKey(f)+"#"+g;if(this.mapValueDic[d]){return this.mapValueDic[d]}var h=this.mapClassDic[d];if(h){return h=new h,this.mapValueDic[d]=h,delete this.mapClassDic[d],h}throw Error("调用了未配置的注入规则:"+d+"。 请先在项目初始化里配置指定的注入规则,再调用对应单例。")},c.mapClassDic={},c.mapValueDic={},c}();a.Injector=b,b.prototype.__class__="egret.Injector"}(egret||(egret={})),function(a){var b=function(){function c(){}return c.NORMAL="normal",c.ADD="add",c.LAYER="layer",c}();a.BlendMode=b,b.prototype.__class__="egret.BlendMode"}(egret||(egret={})),__extends=this.__extends||function(b,c){function a(){this.constructor=b}for(var d in c){c.hasOwnProperty(d)&&(b[d]=c[d])}a.prototype=c.prototype,b.prototype=new a},function(a){var b=function(d){function c(){d.call(this),this._sizeDirty=this._normalDirty=!0,this._parent=null,this._cacheAsBitmap=!1,this._y=this._x=0,this._scaleY=this._scaleX=1,this._anchorY=this._anchorX=this._anchorOffsetY=this._anchorOffsetX=0,this._visible=!0,this._rotation=0,this._alpha=1,this._skewY=this._skewX=0,this._hasHeightSet=this._hasWidthSet=!1,this.worldAlpha=1,this._rectH=this._rectW=0,this._stage=null,this._worldTransform=new a.Matrix,this._cacheBounds=new a.Rectangle(0,0,0,0)}return __extends(c,d),c.prototype._setDirty=function(){this._normalDirty=!0},c.prototype.getDirty=function(){return this._normalDirty||this._sizeDirty},c.prototype._setParentSizeDirty=function(){var e=this._parent;!e||e._hasWidthSet||e._hasHeightSet||e._setSizeDirty()},c.prototype._setSizeDirty=function(){this._sizeDirty||(this._sizeDirty=!0,this._setDirty(),this._setParentSizeDirty())},c.prototype._clearDirty=function(){this._normalDirty=!1},c.prototype._clearSizeDirty=function(){this._sizeDirty=!1},Object.defineProperty(c.prototype,"parent",{get:function(){return this._parent},enumerable:!0,configurable:!0}),c.prototype._parentChanged=function(e){this._parent=e},Object.defineProperty(c.prototype,"x",{get:function(){return this._x},set:function(e){this._setX(e)},enumerable:!0,configurable:!0}),c.prototype._setX=function(f){a.NumberUtils.isNumber(f)&&this._x!=f&&(this._x=f,this._setDirty(),this._setParentSizeDirty())},Object.defineProperty(c.prototype,"y",{get:function(){return this._y},set:function(e){this._setY(e)},enumerable:!0,configurable:!0}),c.prototype._setY=function(f){a.NumberUtils.isNumber(f)&&this._y!=f&&(this._y=f,this._setDirty(),this._setParentSizeDirty())},Object.defineProperty(c.prototype,"scaleX",{get:function(){return this._scaleX},set:function(f){a.NumberUtils.isNumber(f)&&this._scaleX!=f&&(this._scaleX=f,this._setDirty(),this._setParentSizeDirty())},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"scaleY",{get:function(){return this._scaleY},set:function(f){a.NumberUtils.isNumber(f)&&this._scaleY!=f&&(this._scaleY=f,this._setDirty(),this._setParentSizeDirty())},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"anchorOffsetX",{get:function(){return this._anchorOffsetX},set:function(f){a.NumberUtils.isNumber(f)&&this._anchorOffsetX!=f&&(this._anchorOffsetX=f,this._setDirty(),this._setParentSizeDirty())},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"anchorOffsetY",{get:function(){return this._anchorOffsetY},set:function(f){a.NumberUtils.isNumber(f)&&this._anchorOffsetY!=f&&(this._anchorOffsetY=f,this._setDirty(),this._setParentSizeDirty())},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"anchorX",{get:function(){return this._anchorX},set:function(f){a.NumberUtils.isNumber(f)&&this._anchorX!=f&&(this._anchorX=f,this._setDirty(),this._setParentSizeDirty())},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"anchorY",{get:function(){return this._anchorY},set:function(f){a.NumberUtils.isNumber(f)&&this._anchorY!=f&&(this._anchorY=f,this._setDirty(),this._setParentSizeDirty())},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"visible",{get:function(){return this._visible},set:function(e){this._setVisible(e)},enumerable:!0,configurable:!0}),c.prototype._setVisible=function(e){this._visible!=e&&(this._visible=e,this._setSizeDirty())},Object.defineProperty(c.prototype,"rotation",{get:function(){return this._rotation},set:function(f){a.NumberUtils.isNumber(f)&&this._rotation!=f&&(this._rotation=f,this._setSizeDirty())},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"alpha",{get:function(){return this._alpha},set:function(f){a.NumberUtils.isNumber(f)&&this._alpha!=f&&(this._alpha=f,this._setDirty())},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"skewX",{get:function(){return this._skewX},set:function(f){a.NumberUtils.isNumber(f)&&this._skewX!=f&&(this._skewX=f,this._setSizeDirty())},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"skewY",{get:function(){return this._skewY},set:function(f){a.NumberUtils.isNumber(f)&&this._skewY!=f&&(this._skewY=f,this._setSizeDirty())},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"touchEnabled",{get:function(){return this._touchEnabled},set:function(e){this._touchEnabled=e},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"scrollRect",{get:function(){return this._scrollRect},set:function(e){this._scrollRect=e,this._setSizeDirty()},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"measuredWidth",{get:function(){return this._measureBounds().width},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"measuredHeight",{get:function(){return this._measureBounds().height},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"explicitWidth",{get:function(){return this._explicitWidth},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"explicitHeight",{get:function(){return this._explicitHeight},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"width",{get:function(){return this._getSize(a.Rectangle.identity).width},set:function(e){this._setWidth(e)},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"height",{get:function(){return this._getSize(a.Rectangle.identity).height},set:function(e){this._setHeight(e)},enumerable:!0,configurable:!0}),c.prototype._setWidth=function(f){this._setSizeDirty(),this._explicitWidth=f,this._hasWidthSet=a.NumberUtils.isNumber(f)},c.prototype._setHeight=function(f){this._setSizeDirty(),this._explicitHeight=f,this._hasHeightSet=a.NumberUtils.isNumber(f)},c.prototype._draw=function(f){if(this._visible&&!this.drawCacheTexture(f)){f.setAlpha(this.worldAlpha,this.blendMode),f.setTransform(this._worldTransform);var g=this.mask||this._scrollRect;g&&f.pushMask(g),this._render(f),g&&f.popMask()}this.destroyCacheBounds()},c.prototype.drawCacheTexture=function(j){if(this._cacheAsBitmap){var f=this._texture_to_render,l=f._offsetX,h=f._offsetY,k=f._textureWidth,f=f._textureHeight;this._updateTransform(),j.setAlpha(this.worldAlpha,this.blendMode),j.setTransform(this._worldTransform);var g=a.MainContext.instance.rendererContext.texture_scale_factor;return a.RenderFilter.getInstance().drawImage(j,this,0,0,k*g,f*g,l,h,k,f),!0}return !1},c.prototype._updateTransform=function(){this._calculateWorldform()},c.prototype._calculateWorldform=function(){this._worldTransform.identityMatrix(this._parent._worldTransform);var e=this._getOffsetPoint();this._worldTransform.appendTransform(this._x,this._y,this._scaleX,this._scaleY,this._rotation,this._skewX,this._skewY,e.x,e.y),this._scrollRect&&this._worldTransform.append(1,0,0,1,-this._scrollRect.x,-this._scrollRect.y),this.worldAlpha=this._parent.worldAlpha*this._alpha},c.prototype._render=function(){},c.prototype.getBounds=function(k){var g,m,j=this._measureBounds(),l=this._hasWidthSet?this._explicitWidth:j.width,h=this._hasHeightSet?this._explicitHeight:j.height,f=j.x,j=j.y;return 0!=this._anchorX||0!=this._anchorY?(g=l*this._anchorX,m=h*this._anchorY):(g=this._anchorOffsetX,m=this._anchorOffsetY),this._cacheBounds.initialize(f-g,j-m,l,h),l=this._cacheBounds,k||(k=new a.Rectangle),k.initialize(l.x,l.y,l.width,l.height)},c.prototype.destroyCacheBounds=function(){this._cacheBounds.x=0,this._cacheBounds.y=0,this._cacheBounds.width=0,this._cacheBounds.height=0},c.prototype._getConcatenatedMatrix=function(){for(var g=c.identityMatrixForGetConcatenated.identity(),h=this;null!=h;){if(0!=h._anchorX||0!=h._anchorY){var f=h._getSize(a.Rectangle.identity);g.prependTransform(h._x,h._y,h._scaleX,h._scaleY,h._rotation,h._skewX,h._skewY,f.width*h._anchorX,f.height*h._anchorY)}else{g.prependTransform(h._x,h._y,h._scaleX,h._scaleY,h._rotation,h._skewX,h._skewY,h._anchorOffsetX,h._anchorOffsetY)}h=h._parent}return g},c.prototype.localToGlobal=function(h,f,j){"undefined"==typeof h&&(h=0),"undefined"==typeof f&&(f=0);var g=this._getConcatenatedMatrix();return g.append(1,0,0,1,h,f),j||(j=new a.Point),j.x=g.tx,j.y=g.ty,j},c.prototype.globalToLocal=function(h,f,j){"undefined"==typeof h&&(h=0),"undefined"==typeof f&&(f=0);var g=this._getConcatenatedMatrix();return g.invert(),g.append(1,0,0,1,h,f),j||(j=new a.Point),j.x=g.tx,j.y=g.ty,j},c.prototype.hitTest=function(g,f,h){return"undefined"==typeof h&&(h=!1),this._visible&&(h||this._touchEnabled)?(h=this._getSize(a.Rectangle.identity),g>=0&&g<h.width&&f>=0&&f<h.height?this.mask||this._scrollRect?this._scrollRect&&g<this._scrollRect.width&&f<this._scrollRect.height||this.mask&&this.mask.x<=g&&g<this.mask.x+this.mask.width&&this.mask.y<=f&&f<this.mask.y+this.mask.height?this:null:this:null):null},c.prototype.hitTestPoint=function(g,f,h){return g=this.globalToLocal(g,f),h?(this._hitTestPointTexture||(this._hitTestPointTexture=new a.RenderTexture),h=this._hitTestPointTexture,h.drawToTexture(this),0!=h.getPixel32(g.x-this._hitTestPointTexture._offsetX,g.y-this._hitTestPointTexture._offsetY)[3]?!0:!1):!!this.hitTest(g.x,g.y,!0)},c.prototype._getMatrix=function(){var g=a.Matrix.identity.identity(),f=this._getOffsetPoint();return g.appendTransform(this._x,this._y,this._scaleX,this._scaleY,this._rotation,this._skewX,this._skewY,f.x,f.y),g},c.prototype._getSize=function(f){return this._hasHeightSet&&this._hasWidthSet?f.initialize(0,0,this._explicitWidth,this._explicitHeight):this._measureSize(a.Rectangle.identity)},c.prototype._measureSize=function(e){return this._sizeDirty?(e=this._measureBounds(),this._rectW=e.width,this._rectH=e.height,this._clearSizeDirty()):(e.width=this._rectW,e.height=this._rectH),e},c.prototype._measureBounds=function(){return a.Rectangle.identity.initialize(0,0,0,0)},c.prototype._getOffsetPoint=function(){var g=this._anchorOffsetX,f=this._anchorOffsetY;(0!=this._anchorX||0!=this._anchorY)&&(f=this._getSize(a.Rectangle.identity),g=this._anchorX*f.width,f=this._anchorY*f.height);var h=a.Point.identity;return h.x=g,h.y=f,h},c.prototype._onAddToStage=function(){this._stage=a.MainContext.instance.stage,a.DisplayObjectContainer.__EVENT__ADD_TO_STAGE_LIST.push(this)},c.prototype._onRemoveFromStage=function(){this._stage=null,a.DisplayObjectContainer.__EVENT__REMOVE_FROM_STAGE_LIST.push(this)},Object.defineProperty(c.prototype,"stage",{get:function(){return this._stage},enumerable:!0,configurable:!0}),c.prototype.addEventListener=function(i,g,h,f,e){"undefined"==typeof f&&(f=!1),"undefined"==typeof e&&(e=0),d.prototype.addEventListener.call(this,i,g,h,f,e),((f=i==a.Event.ENTER_FRAME)||i==a.Event.RENDER)&&this._insertEventBin(f?c._enterFrameCallBackList:c._renderCallBackList,g,h,e)},c.prototype.removeEventListener=function(h,f,g,e){"undefined"==typeof e&&(e=!1),d.prototype.removeEventListener.call(this,h,f,g,e),((e=h==a.Event.ENTER_FRAME)||h==a.Event.RENDER)&&this._removeEventBin(e?c._enterFrameCallBackList:c._renderCallBackList,f,g)},c.prototype.dispatchEvent=function(f){if(!f._bubbles){return d.prototype.dispatchEvent.call(this,f)}for(var e=[],g=this;g;){e.push(g),g=g._parent}return f._reset(),this._dispatchPropagationEvent(f,e),!f._isDefaultPrevented},c.prototype._dispatchPropagationEvent=function(g,j,f){f=j.length;for(var l=1,h=f-1;h>=0;h--){var k=j[h];if(g._currentTarget=k,g._target=this,g._eventPhase=l,k._notifyListener(g),g._isPropagationStopped||g._isPropagationImmediateStopped){return}}if(k=j[0],g._currentTarget=k,g._target=this,g._eventPhase=2,k._notifyListener(g),!g._isPropagationStopped&&!g._isPropagationImmediateStopped){for(l=3,h=1;f>h&&(k=j[h],g._currentTarget=k,g._target=this,g._eventPhase=l,k._notifyListener(g),!g._isPropagationStopped&&!g._isPropagationImmediateStopped);h++){}}},c.prototype.willTrigger=function(f){for(var g=this;g;){if(g.hasEventListener(f)){return !0}g=g._parent}return !1},Object.defineProperty(c.prototype,"cacheAsBitmap",{get:function(){return this._cacheAsBitmap},set:function(f){(this._cacheAsBitmap=f)?(this.renderTexture||(this.renderTexture=new a.RenderTexture),this.renderTexture.drawToTexture(this),this._texture_to_render=this.renderTexture):this._texture_to_render=null},enumerable:!0,configurable:!0}),c.getTransformBounds=function(B,w){var q,k,f=B.width,j=B.height,C=f*w.a,f=f*w.b,z=j*w.c,j=j*w.d,v=w.tx,y=w.ty,A=v,g=v,m=y,x=y;return(q=C+v)<A?A=q:q>g&&(g=q),(q=C+z+v)<A?A=q:q>g&&(g=q),(q=z+v)<A?A=q:q>g&&(g=q),(k=f+y)<m?m=k:k>x&&(x=k),(k=f+j+y)<m?m=k:k>x&&(x=k),(k=j+y)<m?m=k:k>x&&(x=k),B.initialize(A,m,g-A,x-m)},c.identityMatrixForGetConcatenated=new a.Matrix,c._enterFrameCallBackList=[],c._renderCallBackList=[],c}(a.EventDispatcher);a.DisplayObject=b,b.prototype.__class__="egret.DisplayObject"}(egret||(egret={})),__extends=this.__extends||function(b,c){function a(){this.constructor=b}for(var d in c){c.hasOwnProperty(d)&&(b[d]=c[d])}a.prototype=c.prototype,b.prototype=new a},function(a){var b=function(d){function c(){d.call(this),this._touchChildren=!0,this._children=[]}return __extends(c,d),Object.defineProperty(c.prototype,"touchChildren",{get:function(){return this._touchChildren},set:function(e){this._touchChildren=e},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"numChildren",{get:function(){return this._children.length},enumerable:!0,configurable:!0}),c.prototype.setChildIndex=function(f,g){this.doSetChildIndex(f,g)},c.prototype.doSetChildIndex=function(g,f){var h=this._children.indexOf(g);0>h&&a.Logger.fatal("child不在当前容器内"),this._children.splice(h,1),0>f||this._children.length<=f?this._children.push(g):this._children.splice(f,0,g)},c.prototype.addChild=function(f){var g=this._children.length;return f._parent==this&&g--,this._doAddChild(f,g)},c.prototype.addChildAt=function(f,g){return this._doAddChild(f,g)},c.prototype._doAddChild=function(g,i,f){if("undefined"==typeof f&&(f=!0),g==this){return g}if(0>i||i>this._children.length){return a.Logger.fatal("提供的索引超出范围"),g}var h=g._parent;if(h==this){return this.doSetChildIndex(g,i),g}if(h&&h.removeChild(g),this._children.splice(i,0,g),g._parentChanged(this),f&&g.dispatchEventWith(a.Event.ADDED,!0),this._stage){for(g._onAddToStage(),i=c.__EVENT__ADD_TO_STAGE_LIST;0<i.length;){i.shift().dispatchEventWith(a.Event.ADDED_TO_STAGE)}}return g._setDirty(),this._setSizeDirty(),g},c.prototype.removeChild=function(f){return f=this._children.indexOf(f),f>=0?this._doRemoveChild(f):(a.Logger.fatal("child未被addChild到该parent"),null)},c.prototype.removeChildAt=function(f){return f>=0&&f<this._children.length?this._doRemoveChild(f):(a.Logger.fatal("提供的索引超出范围"),null)},c.prototype._doRemoveChild=function(h,j){"undefined"==typeof j&&(j=!0);var g=this._children,i=g[h];if(j&&i.dispatchEventWith(a.Event.REMOVED,!0),this._stage){i._onRemoveFromStage();for(var f=c.__EVENT__REMOVE_FROM_STAGE_LIST;0<f.length;){f.shift().dispatchEventWith(a.Event.REMOVED_FROM_STAGE)}}return i._parentChanged(null),g.splice(h,1),this._setSizeDirty(),i},c.prototype.getChildAt=function(f){return f>=0&&f<this._children.length?this._children[f]:(a.Logger.fatal("提供的索引超出范围"),null)},c.prototype.contains=function(e){for(;e;){if(e==this){return !0}e=e._parent}return !1},c.prototype.swapChildrenAt=function(g,f){g>=0&&g<this._children.length&&f>=0&&f<this._children.length?this._swapChildrenAt(g,f):a.Logger.fatal("提供的索引超出范围")},c.prototype.swapChildren=function(h,f){var j=this._children.indexOf(h),g=this._children.indexOf(f);-1==j||-1==g?a.Logger.fatal("child未被addChild到该parent"):this._swapChildrenAt(j,g)},c.prototype._swapChildrenAt=function(g,h){if(g!=h){var f=this._children,j=f[g];f[g]=f[h],f[h]=j}},c.prototype.getChildIndex=function(e){return this._children.indexOf(e)},c.prototype.removeChildren=function(){for(var e=this._children.length-1;e>=0;e--){this._doRemoveChild(e)}},c.prototype._updateTransform=function(){if(this._visible){d.prototype._updateTransform.call(this);for(var f=0,e=this._children.length;e>f;f++){this._children[f]._updateTransform()}}},c.prototype._render=function(g){for(var h=0,f=this._children.length;f>h;h++){this._children[h]._draw(g)}},c.prototype._measureBounds=function(){for(var q=0,l=0,k=0,f=0,j=this._children.length,x=0;j>x;x++){var v,m=this._children[x];if(m._visible&&(v=a.DisplayObject.getTransformBounds(m._getSize(a.Rectangle.identity),m._getMatrix()))){var m=v.x,t=v.y,w=v.width+v.x,g=v.height+v.y;(q>m||0==x)&&(q=m),(w>l||0==x)&&(l=w),(k>t||0==x)&&(k=t),(g>f||0==x)&&(f=g)}}return a.Rectangle.identity.initialize(q,k,l-q,f-k)},c.prototype.hitTest=function(m,j,e){"undefined"==typeof e&&(e=!1);var g;if(!this._visible){return null}if(this._scrollRect){if(0>m||0>j||m>this._scrollRect.width||j>this._scrollRect.height){return null}}else{if(this.mask&&(this.mask.x>m||m>this.mask.x+this.mask.width||this.mask.y>j||j>this.mask.y+this.mask.height)){return null}}for(var y=this._children,w=this._touchChildren,q=y.length-1;q>=0;q--){var v=y[q],x=v,f=x._getOffsetPoint(),k=x._x,t=x._y;if(this._scrollRect&&(k-=this._scrollRect.x,t-=this._scrollRect.y),x=a.Matrix.identity.identity().prependTransform(k,t,x._scaleX,x._scaleY,x._rotation,0,0,f.x,f.y),x.invert(),x=a.Matrix.transformCoords(x,m,j),v=v.hitTest(x.x,x.y,!0)){if(!w){return this}if(v._touchEnabled&&w){return v}g=this}}return g?g:this._texture_to_render||this.graphics?d.prototype.hitTest.call(this,m,j,e):null},c.prototype._onAddToStage=function(){d.prototype._onAddToStage.call(this);for(var f=this._children.length,e=0;f>e;e++){this._children[e]._onAddToStage()}},c.prototype._onRemoveFromStage=function(){d.prototype._onRemoveFromStage.call(this);for(var f=this._children.length,e=0;f>e;e++){this._children[e]._onRemoveFromStage()}},c.prototype.getChildByName=function(g){for(var j,f=this._children,k=f.length,h=0;k>h;h++){if(j=f[h],j.name==g){return j}}return null},c.__EVENT__ADD_TO_STAGE_LIST=[],c.__EVENT__REMOVE_FROM_STAGE_LIST=[],c}(a.DisplayObject);a.DisplayObjectContainer=b,b.prototype.__class__="egret.DisplayObjectContainer"}(egret||(egret={})),__extends=this.__extends||function(b,c){function a(){this.constructor=b}for(var d in c){c.hasOwnProperty(d)&&(b[d]=c[d])}a.prototype=c.prototype,b.prototype=new a},function(a){var b=function(d){function c(f,e){"undefined"==typeof f&&(f=480),"undefined"==typeof e&&(e=800),d.call(this),this.touchEnabled=!0,this._stage=this,this._stageWidth=f,this._stageHeight=e}return __extends(c,d),c.prototype.invalidate=function(){c._invalidateRenderFlag=!0},Object.defineProperty(c.prototype,"scaleMode",{get:function(){return this._scaleMode},set:function(g){if(this._scaleMode!=g){this._scaleMode=g;var f={};if(f[a.StageScaleMode.NO_SCALE]=new a.NoScale,f[a.StageScaleMode.SHOW_ALL]=new a.ShowAll,f[a.StageScaleMode.NO_BORDER]=new a.FixedWidth,f[a.StageScaleMode.EXACT_FIT]=new a.FullScreen,g=f[g],!g){throw Error("使用了尚未实现的ScaleMode")}f=new a.EqualToFrame,g=new a.ResolutionPolicy(f,g),a.StageDelegate.getInstance()._setResolutionPolicy(g),g=document.getElementById(a.StageDelegate.canvas_name),this._stageWidth=g.width,this._stageHeight=g.height,this.dispatchEventWith(a.Event.RESIZE)}},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"stageWidth",{get:function(){return this._stageWidth},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"stageHeight",{get:function(){return this._stageHeight},enumerable:!0,configurable:!0}),c.prototype.hitTest=function(k,g){if(!this._touchEnabled){return null}var m;if(!this._touchChildren){return this}for(var j=this._children,l=j.length-1;l>=0;l--){var h=m=j[l],f=h._getOffsetPoint(),h=a.Matrix.identity.identity().prependTransform(h._x,h._y,h._scaleX,h._scaleY,h._rotation,0,0,f.x,f.y);if(h.invert(),h=a.Matrix.transformCoords(h,k,g),(m=m.hitTest(h.x,h.y,!0))&&m._touchEnabled){return m}}return this},c.prototype.getBounds=function(f){return f||(f=new a.Rectangle),f.initialize(0,0,this._stageWidth,this._stageHeight)},c.prototype._updateTransform=function(){for(var f=0,g=this._children.length;g>f;f++){this._children[f]._updateTransform()}},c._invalidateRenderFlag=!1,c}(a.DisplayObjectContainer);a.Stage=b,b.prototype.__class__="egret.Stage"}(egret||(egret={})),function(a){var b=function(){function c(){}return c.NO_BORDER="noBorder",c.NO_SCALE="noScale",c.SHOW_ALL="showAll",c.EXACT_FIT="exactFit",c}();a.StageScaleMode=b,b.prototype.__class__="egret.StageScaleMode"}(egret||(egret={})),function(a){var b=function(){function c(){}return c.REPEAT="repeat",c.SCALE="scale",c}();a.BitmapFillMode=b,b.prototype.__class__="egret.BitmapFillMode"}(egret||(egret={})),__extends=this.__extends||function(b,c){function a(){this.constructor=b}for(var d in c){c.hasOwnProperty(d)&&(b[d]=c[d])}a.prototype=c.prototype,b.prototype=new a},function(a){var b=function(d){function c(e){d.call(this),this.debug=!1,this.debugColor=16711680,this.fillMode="scale",e&&(this._texture=e,this._setSizeDirty())}return __extends(c,d),Object.defineProperty(c.prototype,"texture",{get:function(){return this._texture},set:function(e){e!=this._texture&&(this._setSizeDirty(),this._texture=e)},enumerable:!0,configurable:!0}),c.prototype._render=function(f){var g=this._texture;g?(this._texture_to_render=g,c._drawBitmap(f,this._hasWidthSet?this._explicitWidth:g._textureWidth,this._hasHeightSet?this._explicitHeight:g._textureHeight,this)):this._texture_to_render=null},c._drawBitmap=function(q,j,f,i){var x=i._texture_to_render;if(x){var v=x._textureWidth,m=x._textureHeight;if("scale"==i.fillMode){var t=i.scale9Grid||x.scale9Grid;if(t&&v-t.width<j&&m-t.height<f){c.drawScale9GridImage(q,i,t,j,f)}else{var t=x._offsetX,w=x._offsetY,g=x._bitmapWidth||v,k=x._bitmapHeight||m;j/=v,t=Math.round(t*j),j=Math.round(g*j),f/=m,w=Math.round(w*f),f=Math.round(k*f),a.RenderFilter.getInstance().drawImage(q,i,x._bitmapX,x._bitmapY,g,k,t,w,j,f)}}else{c.drawRepeatImage(q,i,j,f)}}},c.drawRepeatImage=function(z,v,q,j){var m=v._texture_to_render;if(m){for(var F=m._textureWidth,C=m._textureHeight,w=m._bitmapX,B=m._bitmapY,E=m._bitmapWidth||F,k=m._bitmapHeight||C,t=m._offsetX,m=m._offsetY,A=a.RenderFilter.getInstance();q>t;t+=F){for(var y=m;j>y;y+=C){var D=Math.min(E,q-t),x=Math.min(k,j-y);A.drawImage(z,v,w,B,D,x,t,y,D,x)}}}},c.drawScale9GridImage=function(J,F,C,z,B){var w=F._texture_to_render;if(w&&C){var M=a.RenderFilter.getInstance(),G=w._textureWidth,L=w._textureHeight,t=w._bitmapX,A=w._bitmapY,E=w._bitmapWidth||G,K=w._bitmapHeight||L,I=w._offsetX,w=w._offsetY;C=a.Rectangle.identity.initialize(C.x-Math.round(I),C.y-Math.round(I),C.width,C.height),I=Math.round(I),w=Math.round(w),z-=G-E,B-=L-K,C.y==C.bottom&&(C.bottom<K?C.bottom++:C.y--),C.x==C.right&&(C.right<E?C.right++:C.x--);var G=t+C.x,L=t+C.right,N=E-C.right,H=A+C.y,j=A+C.bottom,D=K-C.bottom,q=I+C.x,k=w+C.y,K=B-(K-C.bottom),E=z-(E-C.right);M.drawImage(J,F,t,A,C.x,C.y,I,w,C.x,C.y),M.drawImage(J,F,G,A,C.width,C.y,q,w,E-C.x,C.y),M.drawImage(J,F,L,A,N,C.y,I+E,w,z-E,C.y),M.drawImage(J,F,t,H,C.x,C.height,I,k,C.x,K-C.y),M.drawImage(J,F,G,H,C.width,C.height,q,k,E-C.x,K-C.y),M.drawImage(J,F,L,H,N,C.height,I+E,k,z-E,K-C.y),M.drawImage(J,F,t,j,C.x,D,I,w+K,C.x,B-K),M.drawImage(J,F,G,j,C.width,D,q,w+K,E-C.x,B-K),M.drawImage(J,F,L,j,N,D,I+E,w+K,z-E,B-K)}},c.prototype._measureBounds=function(){var e=this._texture;return e?a.Rectangle.identity.initialize(e._offsetX,e._offsetY,e._textureWidth,e._textureHeight):d.prototype._measureBounds.call(this)},c.debug=!1,c}(a.DisplayObject);a.Bitmap=b,b.prototype.__class__="egret.Bitmap"}(egret||(egret={})),__extends=this.__extends||function(b,c){function a(){this.constructor=b}for(var d in c){c.hasOwnProperty(d)&&(b[d]=c[d])}a.prototype=c.prototype,b.prototype=new a},function(a){var b=function(d){function c(){d.call(this),this._text="",this._textChanged=!1,this._bitmapPool=[]}return __extends(c,d),Object.defineProperty(c.prototype,"text",{get:function(){return this._text},set:function(e){this._textChanged=!0,this._text=e},enumerable:!0,configurable:!0}),c.prototype._updateTransform=function(){this.visible&&(this._textChanged&&this._renderText(),d.prototype._updateTransform.call(this))},c.prototype._renderText=function(m){var k=m=0;this._textChanged&&this.removeChildren();for(var j=0,f=this.text.length;f>j;j++){var g=this.text.charAt(j),t=this.spriteSheet.getTexture(g);if(null==t){console.log("当前没有位图文字:"+g)}else{var g=t._offsetX,q=t._offsetY,l=t._textureWidth;if(this._textChanged){var p=this._bitmapPool[j];p||(p=new a.Bitmap,this._bitmapPool.push(p)),p.texture=t,this.addChild(p),p.x=m}m+=l+g,q+t._textureHeight>k&&(k=q+t._textureHeight)}}return this._textChanged=!1,a.Rectangle.identity.initialize(0,0,m,k)},c.prototype._measureBounds=function(){return this._renderText(!0)},c}(a.DisplayObjectContainer);a.BitmapText=b,b.prototype.__class__="egret.BitmapText"}(egret||(egret={})),function(a){var b=function(){function c(){this.commandQueue=[]}return c.prototype.beginFill=function(){},c.prototype._setStyle=function(){},c.prototype.drawRect=function(){},c.prototype.drawCircle=function(){},c.prototype.drawRoundRect=function(){},c.prototype.drawEllipse=function(){},c.prototype.lineStyle=function(){},c.prototype.lineTo=function(){},c.prototype.curveTo=function(){},c.prototype.moveTo=function(){},c.prototype.clear=function(){},c.prototype.endFill=function(){},c.prototype._draw=function(){},c}();a.Graphics=b,b.prototype.__class__="egret.Graphics",(function(){return function(d,f,c){this.method=d,this.thisObject=f,this.args=c}})().prototype.__class__="Command"}(egret||(egret={})),__extends=this.__extends||function(b,c){function a(){this.constructor=b}for(var d in c){c.hasOwnProperty(d)&&(b[d]=c[d])}a.prototype=c.prototype,b.prototype=new a},function(a){var b=function(d){function c(){d.call(this)}return __extends(c,d),Object.defineProperty(c.prototype,"graphics",{get:function(){return this._graphics||(this._graphics=new a.Graphics),this._graphics},enumerable:!0,configurable:!0}),c.prototype._render=function(e){this._graphics&&this._graphics._draw(e)},c}(a.DisplayObject);a.Shape=b,b.prototype.__class__="egret.Shape"}(egret||(egret={})),__extends=this.__extends||function(b,c){function a(){this.constructor=b}for(var d in c){c.hasOwnProperty(d)&&(b[d]=c[d])}a.prototype=c.prototype,b.prototype=new a},function(a){var b=function(d){function c(){d.call(this)}return __extends(c,d),Object.defineProperty(c.prototype,"graphics",{get:function(){return this._graphics||(this._graphics=new a.Graphics),this._graphics},enumerable:!0,configurable:!0}),c.prototype._render=function(e){this._graphics&&this._graphics._draw(e),d.prototype._render.call(this,e)},c}(a.DisplayObjectContainer);a.Sprite=b,b.prototype.__class__="egret.Sprite"}(egret||(egret={})),__extends=this.__extends||function(b,c){function a(){this.constructor=b}for(var d in c){c.hasOwnProperty(d)&&(b[d]=c[d])}a.prototype=c.prototype,b.prototype=new a},function(a){var b=function(d){function c(){d.call(this),this._fontFamily="Arial",this._size=30,this._textColorString="#FFFFFF",this._textColor=16777215,this._strokeColorString="#000000",this._stroke=this._strokeColor=0,this._textAlign="left",this._verticalAlign="top",this._numLines=this._lineSpacing=0,this.measuredWidths=[]}return __extends(c,d),Object.defineProperty(c.prototype,"text",{get:function(){return this._text},set:function(e){this._text!=e&&(this._setTextDirty(),this._text=e)},enumerable:!0,configurable:!0}),c.prototype._setTextDirty=function(){this._setSizeDirty()},Object.defineProperty(c.prototype,"fontFamily",{get:function(){return this._fontFamily},set:function(e){this._fontFamily!=e&&(this._setTextDirty(),this._fontFamily=e)},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"size",{get:function(){return this._size},set:function(e){this._size!=e&&(this._setTextDirty(),this._size=e)},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"italic",{get:function(){return this._italic},set:function(e){this._italic!=e&&(this._setTextDirty(),this._italic=e)},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"bold",{get:function(){return this._bold},set:function(e){this._bold!=e&&(this._setTextDirty(),this._bold=e)},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"textColor",{get:function(){return this._textColor},set:function(f){this._textColor!=f&&(this._setTextDirty(),this._textColor=f,this._textColorString=a.toColorString(f))},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"strokeColor",{get:function(){return this._strokeColor},set:function(f){this._strokeColor!=f&&(this._setTextDirty(),this._strokeColor=f,this._strokeColorString=a.toColorString(f))},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"stroke",{get:function(){return this._stroke},set:function(e){this._stroke!=e&&(this._setTextDirty(),this._stroke=e)},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"textAlign",{get:function(){return this._textAlign},set:function(e){this._textAlign!=e&&(this._setTextDirty(),this._textAlign=e)},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"verticalAlign",{get:function(){return this._verticalAlign},set:function(e){this._verticalAlign!=e&&(this._setTextDirty(),this._verticalAlign=e)},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"lineSpacing",{get:function(){return this._lineSpacing},set:function(e){this._lineSpacing!=e&&(this._setTextDirty(),this._lineSpacing=e)},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"numLines",{get:function(){return this._numLines},enumerable:!0,configurable:!0}),c.prototype._render=function(e){this.drawText(e,!1),this._clearDirty()},c.prototype._measureBounds=function(){return this.drawText(a.MainContext.instance.rendererContext,!0)},c.prototype.drawText=function(z,v){var q=this.getTextLines(z);if(!q){return a.Rectangle.identity.initialize(0,0,0,0)}var j=q.length,m=0.5*this._size,F=this._size+this._lineSpacing,C=j*F-this._lineSpacing;this._textHeight=C;var w=this._hasHeightSet?this._explicitHeight:Number.POSITIVE_INFINITY;if(this._hasHeightSet&&w>C){var B=0;this._verticalAlign==a.VerticalAlign.MIDDLE?B=0.5:this._verticalAlign==a.VerticalAlign.BOTTOM&&(B=1),m+=B*(w-C)}var B=m=Math.round(m),E=0;this._textAlign==a.HorizontalAlign.CENTER?E=0.5:this._textAlign==a.HorizontalAlign.RIGHT&&(E=1);var k,t=this.measuredWidths;k=this._hasWidthSet?this._explicitWidth:this._textWidth;for(var A=Number.POSITIVE_INFINITY,y=0;j>y;y++){var D=q[y],x=Math.round((k-t[y])*E);A>x&&(A=x),!v&&w>m&&z.drawText(this,D,x,m,k),m+=F}return a.Rectangle.identity.initialize(A,B,k,C)},c.prototype.getTextLines=function(B){var w=this.text?this.text.toString():"";if(!w){return null}var q=this.measuredWidths;q.length=0,B.setupFont(this);var w=w.split(/(?:\r\n|\r|\n)/),k=w.length,f=0;if(this._hasWidthSet){for(var j=this._explicitWidth,C=0;k>C;C++){var z=w[C],v=B.measureText(z);if(v>j){for(var y="",A=0,g=z.length,m=0;g>m;m++){var x=z.charAt(m),v=B.measureText(x);A+v>j&&(0==A?(w.splice(C,0,x),q[C]=v,v>f&&(f=v),v=0,x=""):(w.splice(C,0,y),q[C]=A,A>f&&(f=A),y="",A=0),C++,k++),A+=v,y+=x}w[C]=y,q[C]=A}else{q[C]=v,v>f&&(f=v)}}}else{for(C=0;k>C;C++){z=w[C],v=B.measureText(z),q[C]=v,v>f&&(f=v)}}return this._textWidth=f,w},c}(a.DisplayObject);a.TextField=b,b.prototype.__class__="egret.TextField"}(egret||(egret={})),function(a){var b=function(){function c(){}return c.DYNAMIC="dynamic",c.INPUT="input",c}();a.TextFieldType=b,b.prototype.__class__="egret.TextFieldType"}(egret||(egret={})),__extends=this.__extends||function(b,c){function a(){this.constructor=b}for(var d in c){c.hasOwnProperty(d)&&(b[d]=c[d])}a.prototype=c.prototype,b.prototype=new a},function(a){var b=function(d){function c(f){d.call(this);var e=f.bitmapData;this.bitmapData=e,this._textureMap={},this._sourceWidth=e.width,this._sourceHeight=e.height,this._bitmapX=f._bitmapX-f._offsetX,this._bitmapY=f._bitmapY-f._offsetY}return __extends(c,d),c.prototype.getTexture=function(e){return this._textureMap[e]},c.prototype.createTexture=function(m,k,j,f,g,v,q,l,p){"undefined"==typeof v&&(v=0),"undefined"==typeof q&&(q=0),"undefined"==typeof l&&(l=v+f),"undefined"==typeof p&&(p=q+g);var t=new a.Texture;return t._bitmapData=this.bitmapData,t._bitmapX=this._bitmapX+k,t._bitmapY=this._bitmapY+j,t._bitmapWidth=f,t._bitmapHeight=g,t._offsetX=v,t._offsetY=q,t._textureWidth=l,t._textureHeight=p,t._sourceWidth=this._sourceWidth,t._sourceHeight=this._sourceHeight,this._textureMap[m]=t},c}(a.HashObject);a.SpriteSheet=b,b.prototype.__class__="egret.SpriteSheet"}(egret||(egret={})),__extends=this.__extends||function(b,c){function a(){this.constructor=b}for(var d in c){c.hasOwnProperty(d)&&(b[d]=c[d])}a.prototype=c.prototype,b.prototype=new a},function(a){var b=function(d){function c(){d.call(this),this._size=30,this._textColorString="#FFFFFF",this._textColor=16777215,this.stageText=new a.StageText;var e=this.localToGlobal();this.stageText._open(e.x,e.y,this._explicitWidth,this._explicitHeight)}return __extends(c,d),c.prototype._onAddToStage=function(){d.prototype._onAddToStage.call(this),this.stageText._add(),this.addEventListener(a.TouchEvent.TOUCH_BEGIN,this.onMouseDownHandler,this)},c.prototype.setText=function(f){a.Logger.warning("TextInput.setText()已废弃,请使用TextInput.text设置"),this.stageText._setText(f)},c.prototype.getText=function(){return a.Logger.warning("TextInput.getText()已废弃,请使用TextInput.text获取"),this.stageText._getText()},Object.defineProperty(c.prototype,"text",{get:function(){return this.stageText._getText()},set:function(e){this.stageText._setText(e)},enumerable:!0,configurable:!0}),c.prototype.setTextType=function(e){this.stageText._setTextType(e)},c.prototype.getTextType=function(){return this.stageText._getTextType()},c.prototype.onMouseDownHandler=function(){},c.prototype._onRemoveFromStage=function(){this.stageText._remove()},c.prototype._measureBounds=function(){return a.Rectangle.identity},c.prototype.hitTest=function(){return null},c.prototype._updateTransform=function(){var g=this._worldTransform.a,f=this._worldTransform.b,l=this._worldTransform.c,j=this._worldTransform.d,k=this._worldTransform.tx,h=this._worldTransform.ty;d.prototype._updateTransform.call(this);var e=this._worldTransform;(g!=e.a||f!=e.b||l!=e.c||j!=e.d||k!=e.tx||h!=e.ty)&&(g=this.localToGlobal(),this.stageText.changePosition(g.x,g.y),this.stageText.changeSize(this._explicitWidth,this._explicitHeight))},Object.defineProperty(c.prototype,"size",{get:function(){return this._size},set:function(e){this._size!=e&&(this._size=e,this.stageText.setSize(this._size))},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"textColor",{get:function(){return this._textColor},set:function(f){this._textColor!=f&&(this._textColor=f,this._textColorString=a.toColorString(f),this.stageText.setTextColor(this._textColorString))},enumerable:!0,configurable:!0}),c}(a.DisplayObject);a.TextInput=b,b.prototype.__class__="egret.TextInput"}(egret||(egret={})),__extends=this.__extends||function(b,c){function a(){this.constructor=b}for(var d in c){c.hasOwnProperty(d)&&(b[d]=c[d])}a.prototype=c.prototype,b.prototype=new a},function(a){var b=function(c){function d(g,f){c.call(this,g),this.charList=this.parseConfig(f)}return __extends(d,c),d.prototype.getTexture=function(f){var g=this._textureMap[f];if(!g){if(g=this.charList[f],!g){return null}g=this.createTexture(f,g.x,g.y,g.width,g.height,g.offsetX,g.offsetY),this._textureMap[f]=g}return g},d.prototype.parseConfig=function(g){g=g.split("\r\n").join("\n"),g=g.split("\n");for(var k=this.getConfigByKey(g[3],"count"),f={},m=4;4+k>m;m++){var j=g[m],l=String.fromCharCode(this.getConfigByKey(j,"id")),h={};f[l]=h,h.x=this.getConfigByKey(j,"x"),h.y=this.getConfigByKey(j,"y"),h.width=this.getConfigByKey(j,"width"),h.height=this.getConfigByKey(j,"height"),h.offsetX=this.getConfigByKey(j,"xoffset"),h.offsetY=this.getConfigByKey(j,"yoffset")}return f},d.prototype.getConfigByKey=function(g,j){for(var f=g.split(" "),l=0,h=f.length;h>l;l++){var k=f[l];if(j==k.substring(0,j.length)){return f=k.substring(j.length+1),parseInt(f)}}return 0},d}(a.SpriteSheet);a.BitmapTextSpriteSheet=b,b.prototype.__class__="egret.BitmapTextSpriteSheet"}(egret||(egret={})),__extends=this.__extends||function(b,c){function a(){this.constructor=b}for(var d in c){c.hasOwnProperty(d)&&(b[d]=c[d])}a.prototype=c.prototype,b.prototype=new a},function(b){var c=function(d){function f(g,e){d.call(this),this.frameRate=60,g instanceof a?(b.Logger.warning("MovieClip#constructor接口参数已经变更,请尽快调整用法为 new MovieClip(data,texture)"),this.delegate=g):this.delegate=new a(g,e),this.delegate.setMovieClip(this)}return __extends(f,d),f.prototype.gotoAndPlay=function(e){this.delegate.gotoAndPlay(e)},f.prototype.gotoAndStop=function(e){this.delegate.gotoAndStop(e)},f.prototype.stop=function(){this.delegate.stop()},f.prototype.dispose=function(){this.delegate.dispose()},f.prototype.release=function(){b.Logger.warning("MovieClip#release方法即将废弃"),this.dispose()},f.prototype.getCurrentFrameIndex=function(){return b.Logger.warning("MovieClip#getCurrentFrameIndex方法即将废弃"),this.delegate._currentFrameIndex},f.prototype.getTotalFrame=function(){return b.Logger.warning("MovieClip#getTotalFrame方法即将废弃"),this.delegate._totalFrame},f.prototype.setInterval=function(g){b.Logger.warning("MovieClip#setInterval方法即将废弃,请使用MovieClip#frameRate代替"),this.frameRate=60/g},f.prototype.getIsPlaying=function(){return b.Logger.warning("MovieClip#getIsPlaying方法即将废弃"),this.delegate.isPlaying},f}(b.DisplayObjectContainer);b.MovieClip=c,c.prototype.__class__="egret.MovieClip";var a=function(){function d(g,f){this.data=g,this._currentFrameIndex=this._passTime=this._totalFrame=0,this._isPlaying=!1,this._frameData=g,this._spriteSheet=new b.SpriteSheet(f)}return d.prototype.setMovieClip=function(f){this.movieClip=f,this.bitmap=new b.Bitmap,this.movieClip.addChild(this.bitmap)},d.prototype.gotoAndPlay=function(f){this.checkHasFrame(f),this._isPlaying=!0,this._currentFrameIndex=0,this._currentFrameName=f,this._totalFrame=this._frameData.frames[f].totalFrame,this.playNextFrame(),this._passTime=0,b.Ticker.getInstance().register(this.update,this)},d.prototype.gotoAndStop=function(e){this.checkHasFrame(e),this.stop(),this._currentFrameIndex=this._passTime=0,this._currentFrameName=e,this._totalFrame=this._frameData.frames[e].totalFrame,this.playNextFrame()},d.prototype.stop=function(){this._isPlaying=!1,b.Ticker.getInstance().unregister(this.update,this)},d.prototype.dispose=function(){},d.prototype.checkHasFrame=function(f){void 0==this._frameData.frames[f]&&b.Logger.fatal("MovieClip没有对应的frame:",f)},d.prototype.update=function(f){for(var g=1000/this.movieClip.frameRate,g=Math.floor((this._passTime%g+f)/g);g>=1;){1==g?this.playNextFrame():this.playNextFrame(!1),g--}this._passTime+=f},d.prototype.playNextFrame=function(g){"undefined"==typeof g&&(g=!0);var h=this._frameData.frames[this._currentFrameName].childrenFrame[this._currentFrameIndex];if(g){g=this.getTexture(h.res);var f=this.bitmap;f.x=h.x,f.y=h.y,f.texture=g}null!=h.action&&this.movieClip.dispatchEventWith(h.action),this._currentFrameIndex++,this._currentFrameIndex==this._totalFrame&&(this._currentFrameIndex=0)},d.prototype.getTexture=function(g){var h=this._frameData.res[g],f=this._spriteSheet.getTexture(g);return f||(f=this._spriteSheet.createTexture(g,h.x,h.y,h.w,h.h)),f},d}();b.DefaultMovieClipDelegate=a,a.prototype.__class__="egret.DefaultMovieClipDelegate"}(egret||(egret={})),__extends=this.__extends||function(b,c){function a(){this.constructor=b}for(var d in c){c.hasOwnProperty(d)&&(b[d]=c[d])}a.prototype=c.prototype,b.prototype=new a},function(a){var b=function(d){function c(){d.call(this),this._size=30}return __extends(c,d),c.prototype._getText=function(){return this.inputElement.value},c.prototype._setText=function(e){this.inputElement.value=e},c.prototype._setTextType=function(e){this.inputElement.type=e},c.prototype._getTextType=function(){return this.inputElement.type},c.prototype._open=function(k,g,m,j){"undefined"==typeof m&&(m=160),j=a.StageDelegate.getInstance().getScaleX();var l=a.StageDelegate.getInstance().getScaleY(),h=document.createElement("input");h.type="text",h.style.fontSize=this._size+"px",h.style.color="#FFFFFF",h.style.border="none",h.style.background="none",h.style.width=m+"px",h.style.padding="0",h.style.outline="medium";var f=a.Browser.getInstance().$new("div");f.position.x=k*j,f.position.y=g*l,f.style.width=m+"px",f.scale.x=j,f.scale.y=l,f.transforms(),f.style[egret_dom.getTrans("transformOrigin")]="0% 0% 0px",f.appendChild(h),this.div=f,this.inputElement=h},c.prototype._addListeners=function(){this.inputElement.addEventListener("MSPointerDown",this.onHandler),this.inputElement.addEventListener("MSPointerMove",this.onHandler),this.inputElement.addEventListener("MSPointerUp",this.onHandler),this.inputElement.addEventListener("touchstart",this.onHandler),this.inputElement.addEventListener("touchmove",this.onHandler),this.inputElement.addEventListener("touchend",this.onHandler),this.inputElement.addEventListener("touchcancel",this.onHandler)},c.prototype._removeListeners=function(){this.inputElement.removeEventListener("MSPointerDown",this.onHandler),this.inputElement.removeEventListener("MSPointerMove",this.onHandler),this.inputElement.removeEventListener("MSPointerUp",this.onHandler),this.inputElement.removeEventListener("touchstart",this.onHandler),this.inputElement.removeEventListener("touchmove",this.onHandler),this.inputElement.removeEventListener("touchend",this.onHandler),this.inputElement.removeEventListener("touchcancel",this.onHandler)},c.prototype.onHandler=function(e){e.isScroll=!0},c.prototype.getStageDelegateDiv=function(){var f=a.Browser.getInstance().$("#StageDelegateDiv");return f||(f=a.Browser.getInstance().$new("div"),f.id="StageDelegateDiv",f.style.top=a.StageDelegate.getInstance().getOffSetY()+"px",document.getElementById(a.StageDelegate.canvas_div_name).appendChild(f),f.transforms()),f},c.prototype._add=function(){var e=this.div;e&&!e.parentNode&&this.getStageDelegateDiv().appendChild(e),this._addListeners()},c.prototype._remove=function(){var e=this.div;e&&e.parentNode&&e.parentNode.removeChild(e),this._removeListeners()},c.prototype.changePosition=function(h,f){var j=a.StageDelegate.getInstance().getScaleX(),g=a.StageDelegate.getInstance().getScaleY();this.div.position.x=h*j,this.div.position.y=f*g,this.div.transforms()},c.prototype.changeSize=function(e){this.inputElement.style.width=e+"px",this.div.style.width=e+"px",this.div.transforms()},c.prototype.setSize=function(e){this._size=e,this.inputElement.style.fontSize=this._size+"px"},c.prototype.setTextColor=function(e){this.inputElement.style.color=e},c}(a.HashObject);a.StageText=b,b.prototype.__class__="egret.StageText"}(egret||(egret={})),function(a){var b=function(){function c(){}return c.GET="get",c.POST="post",c}();a.URLRequestMethod=b,b.prototype.__class__="egret.URLRequestMethod"}(egret||(egret={})),function(a){var b=function(){function c(){}return c.BINARY="binary",c.TEXT="text",c.VARIABLES="variables",c.TEXTURE="texture",c.SOUND="sound",c}();a.URLLoaderDataFormat=b,b.prototype.__class__="egret.URLLoaderDataFormat"}(egret||(egret={})),__extends=this.__extends||function(b,c){function a(){this.constructor=b}for(var d in c){c.hasOwnProperty(d)&&(b[d]=c[d])}a.prototype=c.prototype,b.prototype=new a},function(a){var b=function(c){function d(f){"undefined"==typeof f&&(f=null),c.call(this),null!==f&&this.decode(f)}return __extends(d,c),d.prototype.decode=function(g){this.variables||(this.variables={}),g=g.split("+").join(" ");for(var h,f=/[?&]?([^=]+)=([^&]*)/g;h=f.exec(g);){this.variables[decodeURIComponent(h[1])]=decodeURIComponent(h[2])}},d.prototype.toString=function(){if(!this.variables){return""}var g,h=this.variables,f="",j=!0;for(g in h){j?j=!1:f+="&",f+=g+"="+h[g]}return f},d}(a.HashObject);a.URLVariables=b,b.prototype.__class__="egret.URLVariables"}(egret||(egret={})),__extends=this.__extends||function(b,c){function a(){this.constructor=b}for(var d in c){c.hasOwnProperty(d)&&(b[d]=c[d])}a.prototype=c.prototype,b.prototype=new a},function(a){var b=function(d){function c(e){"undefined"==typeof e&&(e=null),d.call(this),this.method=a.URLRequestMethod.GET,this.url=e}return __extends(c,d),c}(a.HashObject);a.URLRequest=b,b.prototype.__class__="egret.URLRequest"}(egret||(egret={})),__extends=this.__extends||function(b,c){function a(){this.constructor=b}for(var d in c){c.hasOwnProperty(d)&&(b[d]=c[d])}a.prototype=c.prototype,b.prototype=new a},function(a){var b=function(d){function c(e){"undefined"==typeof e&&(e=null),d.call(this),this.dataFormat=a.URLLoaderDataFormat.TEXT,e&&this.load(e)}return __extends(c,d),c.prototype.load=function(f){this._request=f,this.data=null,a.MainContext.instance.netContext.proceed(this)},c}(a.EventDispatcher);a.URLLoader=b,b.prototype.__class__="egret.URLLoader"}(egret||(egret={})),__extends=this.__extends||function(b,c){function a(){this.constructor=b}for(var d in c){c.hasOwnProperty(d)&&(b[d]=c[d])}a.prototype=c.prototype,b.prototype=new a},function(a){var b=function(d){function c(){d.call(this),this._textureHeight=this._textureWidth=this._offsetY=this._offsetX=this._bitmapHeight=this._bitmapWidth=this._bitmapY=this._bitmapX=0}return __extends(c,d),Object.defineProperty(c.prototype,"textureWidth",{get:function(){return this._textureWidth},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"textureHeight",{get:function(){return this._textureHeight},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"bitmapData",{get:function(){return this._bitmapData},enumerable:!0,configurable:!0}),c.prototype._setBitmapData=function(g){var f=a.MainContext.instance.rendererContext.texture_scale_factor;this._bitmapData=g,this._sourceWidth=g.width,this._sourceHeight=g.height,this._textureWidth=this._sourceWidth*f,this._textureHeight=this._sourceHeight*f,this._bitmapWidth=this._textureWidth,this._bitmapHeight=this._textureHeight,this._offsetX=this._offsetY=this._bitmapX=this._bitmapY=0},c.prototype.getPixel32=function(f,g){return this._bitmapData.getContext("2d").getImageData(f,g,1,1).data},c}(a.HashObject);a.Texture=b,b.prototype.__class__="egret.Texture"}(egret||(egret={})),__extends=this.__extends||function(b,c){function a(){this.constructor=b}for(var d in c){c.hasOwnProperty(d)&&(b[d]=c[d])}a.prototype=c.prototype,b.prototype=new a},function(a){var b=function(d){function c(){d.call(this),this._bitmapData=document.createElement("canvas"),this.renderContext=a.RendererContext.createRendererContext(this._bitmapData)}return __extends(c,d),c.prototype.drawToTexture=function(h){var f=this._bitmapData,j=h.getBounds(a.Rectangle.identity);if(f.width=j.width,f.height=j.height,h._worldTransform.identity(),h.worldAlpha=1,h instanceof a.DisplayObjectContainer){this._offsetX=j.x,this._offsetY=j.y,h._worldTransform.append(1,0,0,1,-j.x,-j.y);for(var f=h._children,j=0,g=f.length;g>j;j++){f[j]._updateTransform()}}f=a.RenderFilter.getInstance(),j=f._drawAreaList.concat(),f._drawAreaList.length=0,this.renderContext.clearScreen(),this.webGLTexture=null,(g=h.mask||h._scrollRect)&&this.renderContext.pushMask(g),h._render(this.renderContext),g&&this.renderContext.popMask(),f._drawAreaList=j,this._textureWidth=this._bitmapData.width,this._textureHeight=this._bitmapData.height,this._sourceWidth=this._textureWidth,this._sourceHeight=this._textureHeight},c}(a.Texture);a.RenderTexture=b,b.prototype.__class__="egret.RenderTexture"}(egret||(egret={})),__extends=this.__extends||function(b,c){function a(){this.constructor=b}for(var d in c){c.hasOwnProperty(d)&&(b[d]=c[d])}a.prototype=c.prototype,b.prototype=new a},function(a){var b=function(d){function c(){d.call(this),this.renderCost=0,this.texture_scale_factor=1}return __extends(c,d),c.prototype.clearScreen=function(){},c.prototype.clearRect=function(){},c.prototype.drawImage=function(){a.Profiler.getInstance().onDrawImage()},c.prototype.setTransform=function(){},c.prototype.setAlpha=function(){},c.prototype.setupFont=function(){},c.prototype.measureText=function(){return 0},c.prototype.drawText=function(){a.Profiler.getInstance().onDrawImage()},c.prototype.strokeRect=function(){},c.prototype.pushMask=function(){},c.prototype.popMask=function(){},c.prototype.onRenderStart=function(){},c.prototype.onRenderFinish=function(){},c.createRendererContext=function(){return null},c}(a.HashObject);a.RendererContext=b,b.prototype.__class__="egret.RendererContext"}(egret||(egret={})),function(a){var b=function(){function c(){}return c.MOUSE="mouse",c.TOUCH="touch",c.mode="touch",c}();a.InteractionMode=b,b.prototype.__class__="egret.InteractionMode"}(egret||(egret={})),__extends=this.__extends||function(b,c){function a(){this.constructor=b}for(var d in c){c.hasOwnProperty(d)&&(b[d]=c[d])}a.prototype=c.prototype,b.prototype=new a},function(a){var b=function(d){function c(){d.call(this),this._currentTouchTarget={},this.maxTouches=2,this.touchDownTarget={},this.touchingIdentifiers=[],this.lastTouchY=this.lastTouchX=-1}return __extends(c,d),c.prototype.run=function(){},c.prototype.getTouchData=function(g,h,f){var j=this._currentTouchTarget[g];return null==j&&(j={},this._currentTouchTarget[g]=j),j.stageX=h,j.stageY=f,j.identifier=g,j},c.prototype.dispatchEvent=function(g,f){a.TouchEvent.dispatchTouchEvent(f.target,g,f.identifier,f.stageX,f.stageY,!1,!1,!1,1==this.touchDownTarget[f.identifier])},c.prototype.onTouchBegan=function(h,f,j){if(this.touchingIdentifiers.length!=this.maxTouches){var g=a.MainContext.instance.stage.hitTest(h,f);g&&(h=this.getTouchData(j,h,f),this.touchDownTarget[j]=!0,h.target=g,h.beginTarget=g,this.dispatchEvent(a.TouchEvent.TOUCH_BEGIN,h)),this.touchingIdentifiers.push(j)}},c.prototype.onTouchMove=function(h,f,j){if(-1!=this.touchingIdentifiers.indexOf(j)&&(h!=this.lastTouchX||f!=this.lastTouchY)){this.lastTouchX=h,this.lastTouchY=f;var g=a.MainContext.instance.stage.hitTest(h,f);g&&(h=this.getTouchData(j,h,f),h.target=g,this.dispatchEvent(a.TouchEvent.TOUCH_MOVE,h))}},c.prototype.onTouchEnd=function(h,f,j){var g=this.touchingIdentifiers.indexOf(j);-1!=g&&(this.touchingIdentifiers.splice(g,1),g=a.MainContext.instance.stage.hitTest(h,f))&&(h=this.getTouchData(j,h,f),delete this.touchDownTarget[j],j=h.beginTarget,h.target=g,this.dispatchEvent(a.TouchEvent.TOUCH_END,h),j==g?this.dispatchEvent(a.TouchEvent.TOUCH_TAP,h):h.beginTarget&&(h.target=h.beginTarget,this.dispatchEvent(a.TouchEvent.TOUCH_RELEASE_OUTSIDE,h)),delete this._currentTouchTarget[h.identifier])},c}(a.HashObject);a.TouchContext=b,b.prototype.__class__="egret.TouchContext"}(egret||(egret={})),__extends=this.__extends||function(b,c){function a(){this.constructor=b}for(var d in c){c.hasOwnProperty(d)&&(b[d]=c[d])}a.prototype=c.prototype,b.prototype=new a},function(a){var b=function(d){function c(){d.call(this)}return __extends(c,d),c.prototype.proceed=function(){},c._getUrl=function(g){var f=g.url;return -1==f.indexOf("?")&&g.method==a.URLRequestMethod.GET&&g.data&&g.data instanceof a.URLVariables&&(f=f+"?"+g.data.toString()),f},c}(a.HashObject);a.NetContext=b,b.prototype.__class__="egret.NetContext"}(egret||(egret={})),__extends=this.__extends||function(b,c){function a(){this.constructor=b}for(var d in c){c.hasOwnProperty(d)&&(b[d]=c[d])}a.prototype=c.prototype,b.prototype=new a},function(a){var b=function(c){function d(){c.call(this),this.frameRate=60}return __extends(d,c),d.prototype.executeMainLoop=function(){},d}(a.HashObject);a.DeviceContext=b,b.prototype.__class__="egret.DeviceContext"}(egret||(egret={})),function(a){var b=function(){function c(){}return c.call=function(){},c.addCallback=function(){},c}();a.ExternalInterface=b,b.prototype.__class__="egret.ExternalInterface"}(egret||(egret={})),__extends=this.__extends||function(b,c){function a(){this.constructor=b}for(var d in c){c.hasOwnProperty(d)&&(b[d]=c[d])}a.prototype=c.prototype,b.prototype=new a},function(a){var b=function(d){function c(){d.call(this),this.translate=this.isHD?function(f){return"translate3d("+f.x+"px, "+(f.y-a.MainContext.instance.stage.stageHeight)+"px, 0) "}:function(f){return"translate("+f.x+"px, "+f.y+"px) "},this.rotate=this.isHD?function(f){return"rotateZ("+f+"deg) "}:function(f){return"rotate("+f+"deg) "},this.ua=navigator.userAgent.toLowerCase();var e=this.ua.match(/micromessenger|qqbrowser|mqqbrowser|ucbrowser|360browser|baidubrowser|maxthon|ie|opera|firefox/)||this.ua.match(/chrome|safari/);switch(e&&0<e.length&&(e=e[0],"micromessenger"==e&&(this.type="wechat"),this.type=e),this.type="unknow",this.type){case"firefox":this.pfx="Moz",this.isHD=!0;break;case"chrome":case"safari":this.pfx="webkit",this.isHD=!0;break;case"opera":this.pfx="O",this.isHD=!1;break;case"ie":this.pfx="ms",this.isHD=!1;break;default:this.pfx="webkit",this.isHD=!0}this.trans=this.pfx+"Transform"}return __extends(c,d),c.getInstance=function(){return null==c.instance&&(c.instance=new c),c.instance},Object.defineProperty(c.prototype,"isMobile",{get:function(){return a.Logger.warning("Browser.isMobile接口参数已经变更,请尽快调整用法为 egret.MainContext.deviceType == egret.MainContext.DEVICE_MOBILE "),a.MainContext.deviceType==a.MainContext.DEVICE_MOBILE},enumerable:!0,configurable:!0}),c.prototype.$new=function(e){return this.$(document.createElement(e))},c.prototype.$=function(f){var g=document;return(f=f instanceof HTMLElement?f:g.querySelector(f))&&(f.find=f.find||this.$,f.hasClass=f.hasClass||function(e){return this.className.match(new RegExp("(\\s|^)"+e+"(\\s|$)"))},f.addClass=f.addClass||function(e){return this.hasClass(e)||(this.className&&(this.className+=" "),this.className+=e),this},f.removeClass=f.removeClass||function(e){return this.hasClass(e)&&(this.className=this.className.replace(e,"")),this},f.remove=f.remove||function(){},f.appendTo=f.appendTo||function(e){return e.appendChild(this),this},f.prependTo=f.prependTo||function(e){return e.childNodes[0]?e.insertBefore(this,e.childNodes[0]):e.appendChild(this),this},f.transforms=f.transforms||function(){return this.style[c.getInstance().trans]=c.getInstance().translate(this.position)+c.getInstance().rotate(this.rotation)+c.getInstance().scale(this.scale)+c.getInstance().skew(this.skew),this},f.position=f.position||{x:0,y:0},f.rotation=f.rotation||0,f.scale=f.scale||{x:1,y:1},f.skew=f.skew||{x:0,y:0},f.translates=function(j,h){return this.position.x=j,this.position.y=h-a.MainContext.instance.stage.stageHeight,this.transforms(),this},f.rotate=function(e){return this.rotation=e,this.transforms(),this},f.resize=function(h,i){return this.scale.x=h,this.scale.y=i,this.transforms(),this},f.setSkew=function(h,i){return this.skew.x=h,this.skew.y=i,this.transforms(),this}),f},c.prototype.scale=function(e){return"scale("+e.x+", "+e.y+") "},c.prototype.skew=function(e){return"skewX("+-e.x+"deg) skewY("+e.y+"deg)"},c}(a.HashObject);a.Browser=b,b.prototype.__class__="egret.Browser"}(egret||(egret={})),function(a){!function(b){b.getItem=function(){return null},b.setItem=function(){},b.removeItem=function(){},b.clear=function(){}}(a.localStorage||(a.localStorage={}))}(egret||(egret={})),function(a){var b=function(){function c(){}return c.parse=function(d){if(d=a.SAXParser.getInstance().parserXML(d),!d||!d.childNodes){return null}for(var h=d.childNodes.length,f=!1,g=0;h>g;g++){var e=d.childNodes[g];if(1==e.nodeType){f=!0;break}}return f?c.parseNode(e):null},c.parseNode=function(f){if(!f||1!=f.nodeType){return null}var e={};e.localName=f.localName,e.name=f.nodeName,f.namespaceURI&&(e.namespace=f.namespaceURI),f.prefix&&(e.prefix=f.prefix);for(var k=f.attributes,h=k.length,j=0;h>j;j++){var g=k[j],d=g.name;0!=d.indexOf("xmlns:")&&(e["$"+d]=g.value)}for(k=f.childNodes,h=k.length,j=0;h>j;j++){(g=c.parseNode(k[j]))&&(e.children||(e.children=[]),g.parent=e,e.children.push(g))}return !e.children&&(f=f.textContent.trim())&&(e.text=f),e},c.findChildren=function(e,d,f){return f?f.length=0:f=[],c.findByPath(e,d,f),f},c.findByPath=function(f,e,m){var k,l=e.indexOf(".");if(-1==l?(k=e,l=!0):(k=e.substring(0,l),e=e.substring(l+1),l=!1),f=f.children){for(var j=f.length,d=0;j>d;d++){var g=f[d];g.localName==k&&(l?m.push(g):c.findByPath(g,e,m))}}},c.getAttributes=function(f,g){g?g.length=0:g=[];for(var d in f){"$"==d.charAt(0)&&g.push(d.substring(1))}return g},c}();a.XML=b,b.prototype.__class__="egret.XML"}(egret||(egret={})),function(b){var c=function(){function d(){}return d.LITTLE_ENDIAN="LITTLE_ENDIAN",d.BIG_ENDIAN="BIG_ENDIAN",d}();b.Endian=c,c.prototype.__class__="egret.Endian";var a=function(){function d(){this.length=this.position=0,this._mode="",this.maxlength=0,this._endian=c.LITTLE_ENDIAN,this.isLittleEndian=!1,this._mode="Typed array",this.maxlength=4,this.arraybytes=new ArrayBuffer(this.maxlength),this.unalignedarraybytestemp=new ArrayBuffer(16),this.endian=d.DEFAULT_ENDIAN}return Object.defineProperty(d.prototype,"endian",{get:function(){return this._endian},set:function(e){this._endian=e,this.isLittleEndian=e==c.LITTLE_ENDIAN},enumerable:!0,configurable:!0}),d.prototype.ensureWriteableSpace=function(e){this.ensureSpace(e+this.position)},d.prototype.setArrayBuffer=function(e){this.ensureSpace(e.byteLength),this.length=e.byteLength,e=new Int8Array(e),new Int8Array(this.arraybytes,0,this.length).set(e),this.position=0},Object.defineProperty(d.prototype,"bytesAvailable",{get:function(){return this.length-this.position},enumerable:!0,configurable:!0}),d.prototype.ensureSpace=function(g){if(g>this.maxlength){g=g+255&-256;var h=new ArrayBuffer(g),f=new Uint8Array(this.arraybytes,0,this.length);new Uint8Array(h,0,this.length).set(f),this.arraybytes=h,this.maxlength=g}},d.prototype.writeByte=function(e){this.ensureWriteableSpace(1),new Int8Array(this.arraybytes)[this.position++]=~~e,this.position>this.length&&(this.length=this.position)},d.prototype.readByte=function(){if(this.position>=this.length){throw"ByteArray out of bounds read. Positon="+this.position+", Length="+this.length}return new Int8Array(this.arraybytes)[this.position++]},d.prototype.readBytes=function(g,j,f){"undefined"==typeof j&&(j=0),"undefined"==typeof f&&(f=0),null==f&&(f=g.length),g.ensureWriteableSpace(j+f);var k=new Int8Array(g.arraybytes),h=new Int8Array(this.arraybytes);k.set(h.subarray(this.position,this.position+f),j),this.position+=f,f+j>g.length&&(g.length+=f+j-g.length)},d.prototype.writeUnsignedByte=function(e){this.ensureWriteableSpace(1),new Uint8Array(this.arraybytes)[this.position++]=255&~~e,this.position>this.length&&(this.length=this.position)},d.prototype.readUnsignedByte=function(){if(this.position>=this.length){throw"ByteArray out of bounds read. Positon="+this.position+", Length="+this.length}return new Uint8Array(this.arraybytes)[this.position++]},d.prototype.writeUnsignedShort=function(f){if(this.ensureWriteableSpace(2),0==(1&this.position)){var g=new Uint16Array(this.arraybytes);g[this.position>>1]=65535&~~f}else{g=new Uint16Array(this.unalignedarraybytestemp,0,1),g[0]=65535&~~f,f=new Uint8Array(this.arraybytes,this.position,2),g=new Uint8Array(this.unalignedarraybytestemp,0,2),f.set(g)}this.position+=2,this.position>this.length&&(this.length=this.position)},d.prototype.readUTFBytes=function(g){var j="";g=this.position+g;for(var f=new DataView(this.arraybytes);this.position<g;){var l=f.getUint8(this.position++);if(128>l){if(0==l){break}j+=String.fromCharCode(l)}else{if(224>l){j+=String.fromCharCode((63&l)<<6|127&f.getUint8(this.position++))}else{if(240>l){var h=f.getUint8(this.position++),j=j+String.fromCharCode((31&l)<<12|(127&h)<<6|127&f.getUint8(this.position++))}else{var h=f.getUint8(this.position++),k=f.getUint8(this.position++),j=j+String.fromCharCode((15&l)<<18|(127&h)<<12|k<<6&127|127&f.getUint8(this.position++))}}}}return j},d.prototype.readInt=function(){var e=new DataView(this.arraybytes).getInt32(this.position,this.isLittleEndian);return this.position+=4,e},d.prototype.readShort=function(){var e=new DataView(this.arraybytes).getInt16(this.position,this.isLittleEndian);return this.position+=2,e},d.prototype.readDouble=function(){var e=new DataView(this.arraybytes).getFloat64(this.position,this.isLittleEndian);return this.position+=8,e},d.prototype.readUnsignedShort=function(){if(this.position>this.length+2){throw"ByteArray out of bounds read. Position="+this.position+", Length="+this.length}if(0==(1&this.position)){var f=new Uint16Array(this.arraybytes),g=this.position>>1;return this.position+=2,f[g]}return f=new Uint16Array(this.unalignedarraybytestemp,0,1),g=new Uint8Array(this.arraybytes,this.position,2),new Uint8Array(this.unalignedarraybytestemp,0,2).set(g),this.position+=2,f[0]},d.prototype.writeUnsignedInt=function(f){if(this.ensureWriteableSpace(4),0==(3&this.position)){var g=new Uint32Array(this.arraybytes);g[this.position>>2]=4294967295&~~f}else{g=new Uint32Array(this.unalignedarraybytestemp,0,1),g[0]=4294967295&~~f,f=new Uint8Array(this.arraybytes,this.position,4),g=new Uint8Array(this.unalignedarraybytestemp,0,4),f.set(g)}this.position+=4,this.position>this.length&&(this.length=this.position)},d.prototype.readUnsignedInt=function(){if(this.position>this.length+4){throw"ByteArray out of bounds read. Position="+this.position+", Length="+this.length}if(0==(3&this.position)){var f=new Uint32Array(this.arraybytes),g=this.position>>2;return this.position+=4,f[g]}return f=new Uint32Array(this.unalignedarraybytestemp,0,1),g=new Uint8Array(this.arraybytes,this.position,4),new Uint8Array(this.unalignedarraybytestemp,0,4).set(g),this.position+=4,f[0]},d.prototype.writeFloat=function(f){if(this.ensureWriteableSpace(4),0==(3&this.position)){var g=new Float32Array(this.arraybytes);g[this.position>>2]=f}else{g=new Float32Array(this.unalignedarraybytestemp,0,1),g[0]=f,f=new Uint8Array(this.arraybytes,this.position,4),g=new Uint8Array(this.unalignedarraybytestemp,0,4),f.set(g)}this.position+=4,this.position>this.length&&(this.length=this.position)},d.prototype.readFloat=function(){if(this.position>this.length+4){throw"ByteArray out of bounds read. Positon="+this.position+", Length="+this.length}if(0==(3&this.position)){var f=new Float32Array(this.arraybytes),g=this.position>>2;return this.position+=4,f[g]}return f=new Float32Array(this.unalignedarraybytestemp,0,1),g=new Uint8Array(this.arraybytes,this.position,4),new Uint8Array(this.unalignedarraybytestemp,0,4).set(g),this.position+=4,f[0]},d.DEFAULT_ENDIAN=c.BIG_ENDIAN,d}();b.ByteArray=a,a.prototype.__class__="egret.ByteArray"}(egret||(egret={})),__extends=this.__extends||function(b,c){function a(){this.constructor=b}for(var d in c){c.hasOwnProperty(d)&&(b[d]=c[d])}a.prototype=c.prototype,b.prototype=new a},function(a){var b=function(d){function c(f,e,g){d.call(this),this._target=null,this.loop=this.ignoreGlobalPause=this._useTicks=!1,this._actions=this._steps=this.pluginData=null,this.paused=!1,this.duration=0,this._prevPos=-1,this.position=null,this._stepPosition=this._prevPosition=0,this.passive=!1,this.initialize(f,e,g)}return __extends(c,d),c.get=function(f,h,i,g){return"undefined"==typeof h&&(h=null),"undefined"==typeof i&&(i=null),"undefined"==typeof g&&(g=!1),g&&c.removeTweens(f),new c(f,h,i)},c.removeTweens=function(f){if(f.tween_count){for(var g=c._tweens,h=g.length-1;h>=0;h--){g[h]._target==f&&(g[h].paused=!0,g.splice(h,1))}f.tween_count=0}},c.pauseTweens=function(g){if(g.tween_count){for(var f=a.Tween._tweens,h=f.length-1;h>=0;h--){f[h]._target==g&&(f[h].paused=!0)}}},c.resumeTweens=function(g){if(g.tween_count){for(var f=a.Tween._tweens,h=f.length-1;h>=0;h--){f[h]._target==g&&(f[h].paused=!1)}}},c.tick=function(f,h){"undefined"==typeof h&&(h=!1);for(var j=c._tweens.concat(),g=j.length-1;g>=0;g--){var i=j[g];h&&!i.ignoreGlobalPause||i.paused||i.tick(i._useTicks?1:f)}},c._register=function(g,i){var f=g._target,h=c._tweens;if(i){f&&(f.tween_count=f.tween_count?f.tween_count+1:1),h.push(g),c._inited||(a.Ticker.getInstance().register(c.tick,null),c._inited=!0)}else{for(f&&f.tween_count--,f=h.length;f--;){if(h[f]==g){h.splice(f,1);break}}}},c.removeAllTweens=function(){for(var f=c._tweens,h=0,i=f.length;i>h;h++){var g=f[h];g.paused=!0,g._target.tweenjs_count=0}f.length=0},c.prototype.initialize=function(f,g,h){this._target=f,g&&(this._useTicks=g.useTicks,this.ignoreGlobalPause=g.ignoreGlobalPause,this.loop=g.loop,g.onChange&&this.addEventListener("change",g.onChange,g.onChangeObj),g.override&&c.removeTweens(f)),this.pluginData=h||{},this._curQueueProps={},this._initQueueProps={},this._steps=[],this._actions=[],g&&g.paused?this.paused=!0:c._register(this,!0),g&&null!=g.position&&this.setPosition(g.position,c.NONE)},c.prototype.setPosition=function(g,k){"undefined"==typeof k&&(k=1),0>g&&(g=0);var f=g,m=!1;if(f>=this.duration&&(this.loop?f%=this.duration:(f=this.duration,m=!0)),f==this._prevPos){return m}var j=this._prevPos;if(this.position=this._prevPos=f,this._prevPosition=g,this._target){if(m){this._updateTargetProps(null,1)}else{if(0<this._steps.length){for(var l=0,h=this._steps.length;h>l&&!(this._steps[l].t>f);l++){}l=this._steps[l-1],this._updateTargetProps(l,(this._stepPosition=f-l.t)/l.d)}}}return 0!=k&&0<this._actions.length&&(this._useTicks?this._runActions(f,f):1==k&&j>f?(j!=this.duration&&this._runActions(j,this.duration),this._runActions(0,f,!0)):this._runActions(j,f)),m&&this.setPaused(!0),this.dispatchEventWith("change"),m},c.prototype._runActions=function(q,m,k){"undefined"==typeof k&&(k=!1);var j=q,f=m,g=-1,u=this._actions.length,p=1;for(q>m&&(j=m,f=q,g=u,u=p=-1);(g+=p)!=u;){m=this._actions[g];var l=m.t;(l==f||l>j&&f>l||k&&l==q)&&m.f.apply(m.o,m.p)}},c.prototype._updateTargetProps=function(w,l){var j,f,i,x;if(w||1!=l){if(this.passive=!!w.v){return}w.e&&(l=w.e(l,0,1,1)),j=w.p0,f=w.p1}else{this.passive=!1,j=f=this._curQueueProps}for(var q in this._initQueueProps){null==(i=j[q])&&(j[q]=i=this._initQueueProps[q]),null==(x=f[q])&&(f[q]=x=i),i=i==x||0==l||1==l||"number"!=typeof i?1==l?x:i:i+(x-i)*l;var k=!1;if(x=c._plugins[q]){for(var m=0,v=x.length;v>m;m++){var g=x[m].tween(this,q,i,j,f,l,!!w&&j==f,!w);g==c.IGNORE?k=!0:i=g}}k||(this._target[q]=i)}},c.prototype.setPaused=function(e){return this.paused=e,c._register(this,!e),this},c.prototype._cloneProps=function(g){var h,f={};for(h in g){f[h]=g[h]}return f},c.prototype._addStep=function(e){return 0<e.d&&(this._steps.push(e),e.t=this.duration,this.duration+=e.d),this},c.prototype._appendQueueProps=function(g){var j,l,i,k,h,f;for(f in g){if(void 0===this._initQueueProps[f]){if(l=this._target[f],j=c._plugins[f]){for(i=0,k=j.length;k>i;i++){l=j[i].init(this,f,l)}}this._initQueueProps[f]=this._curQueueProps[f]=void 0===l?null:l}}for(f in g){if(l=this._curQueueProps[f],j=c._plugins[f]){for(h=h||{},i=0,k=j.length;k>i;i++){j[i].step&&j[i].step(this,f,l,g[f],h)}}this._curQueueProps[f]=g[f]}return h&&this._appendQueueProps(h),this._curQueueProps},c.prototype._addAction=function(e){return e.t=this.duration,this._actions.push(e),this},c.prototype._set=function(g,h){for(var f in g){h[f]=g[f]}},c.prototype.wait=function(g,h){if(null==g||0>=g){return this}var f=this._cloneProps(this._curQueueProps);return this._addStep({d:g,p0:f,p1:f,v:h})},c.prototype.to=function(g,h,f){return"undefined"==typeof f&&(f=void 0),(isNaN(h)||0>h)&&(h=0),this._addStep({d:h||0,p0:this._cloneProps(this._curQueueProps),e:f,p1:this._cloneProps(this._appendQueueProps(g))})},c.prototype.call=function(g,h,f){return"undefined"==typeof h&&(h=void 0),"undefined"==typeof f&&(f=void 0),this._addAction({f:g,p:f?f:[],o:h?h:this._target})},c.prototype.set=function(f,g){return"undefined"==typeof g&&(g=null),this._addAction({f:this._set,o:this,p:[f,g?g:this._target]})},c.prototype.play=function(e){return e||(e=this),this.call(e.setPaused,e,[!1])},c.prototype.pause=function(e){return e||(e=this),this.call(e.setPaused,e,[!0])},c.prototype.tick=function(e){this.paused||this.setPosition(this._prevPosition+e)},c.NONE=0,c.LOOP=1,c.REVERSE=2,c._tweens=[],c.IGNORE={},c._plugins={},c._inited=!1,c}(a.EventDispatcher);a.Tween=b,b.prototype.__class__="egret.Tween"}(egret||(egret={})),function(a){var b=function(){function c(){a.Logger.fatal("Ease不能被实例化")}return c.get=function(d){return -1>d&&(d=-1),d>1&&(d=1),function(f){return 0==d?f:0>d?f*(f*-d+1+d):f*((2-f)*d+(1-d))}},c.getPowIn=function(d){return function(f){return Math.pow(f,d)}},c.getPowOut=function(d){return function(f){return 1-Math.pow(1-f,d)}},c.getPowInOut=function(d){return function(f){return 1>(f*=2)?0.5*Math.pow(f,d):1-0.5*Math.abs(Math.pow(2-f,d))}},c.sineIn=function(d){return 1-Math.cos(d*Math.PI/2)},c.sineOut=function(d){return Math.sin(d*Math.PI/2)},c.sineInOut=function(d){return -0.5*(Math.cos(Math.PI*d)-1)},c.getBackIn=function(d){return function(f){return f*f*((d+1)*f-d)}},c.getBackOut=function(d){return function(f){return f-=1,f*f*((d+1)*f+d)+1}},c.getBackInOut=function(d){return d*=1.525,function(f){return 1>(f*=2)?0.5*f*f*((d+1)*f-d):0.5*((f-=2)*f*((d+1)*f+d)+2)}},c.circIn=function(d){return -(Math.sqrt(1-d*d)-1)},c.circOut=function(d){return Math.sqrt(1-d*d)},c.circInOut=function(d){return 1>(d*=2)?-0.5*(Math.sqrt(1-d*d)-1):0.5*(Math.sqrt(1-(d-=2)*d)+1)},c.bounceIn=function(d){return 1-c.bounceOut(1-d)},c.bounceOut=function(d){return 1/2.75>d?7.5625*d*d:2/2.75>d?7.5625*(d-=1.5/2.75)*d+0.75:2.5/2.75>d?7.5625*(d-=2.25/2.75)*d+0.9375:7.5625*(d-=2.625/2.75)*d+0.984375},c.bounceInOut=function(d){return 0.5>d?0.5*c.bounceIn(2*d):0.5*c.bounceOut(2*d-1)+0.5},c.getElasticIn=function(f,g){var d=2*Math.PI;return function(h){if(0==h||1==h){return h}var e=g/d*Math.asin(1/f);return -(f*Math.pow(2,10*(h-=1))*Math.sin((h-e)*d/g))}},c.getElasticOut=function(f,g){var d=2*Math.PI;return function(h){if(0==h||1==h){return h}var e=g/d*Math.asin(1/f);return f*Math.pow(2,-10*h)*Math.sin((h-e)*d/g)+1}},c.getElasticInOut=function(f,g){var d=2*Math.PI;return function(h){var e=g/d*Math.asin(1/f);return 1>(h*=2)?-0.5*f*Math.pow(2,10*(h-=1))*Math.sin((h-e)*d/g):f*Math.pow(2,-10*(h-=1))*Math.sin((h-e)*d/g)*0.5+1}},c.quadIn=c.getPowIn(2),c.quadOut=c.getPowOut(2),c.quadInOut=c.getPowInOut(2),c.cubicIn=c.getPowIn(3),c.cubicOut=c.getPowOut(3),c.cubicInOut=c.getPowInOut(3),c.quartIn=c.getPowIn(4),c.quartOut=c.getPowOut(4),c.quartInOut=c.getPowInOut(4),c.quintIn=c.getPowIn(5),c.quintOut=c.getPowOut(5),c.quintInOut=c.getPowInOut(5),c.backIn=c.getBackIn(1.7),c.backOut=c.getBackOut(1.7),c.backInOut=c.getBackInOut(1.7),c.elasticIn=c.getElasticIn(1,0.3),c.elasticOut=c.getElasticOut(1,0.3),c.elasticInOut=c.getElasticInOut(1,0.3*1.5),c}();a.Ease=b,b.prototype.__class__="egret.Ease"}(egret||(egret={})),function(a){var b=function(){function c(){this.type=c.EFFECT}return c.prototype.play=function(d){"undefined"==typeof d&&(d=!1);var f=this.audio;f&&(isNaN(f.duration)||(f.currentTime=0),f.loop=d,f.play())},c.prototype.pause=function(){var d=this.audio;d&&d.pause()},c.prototype.load=function(){var d=this.audio;d&&d.load()},c.prototype.addEventListener=function(d,f){this.audio&&this.audio.addEventListener(d,f,!1)},c.prototype.removeEventListener=function(d,f){this.audio&&this.audio.removeEventListener(d,f,!1)},c.prototype.setVolume=function(d){var f=this.audio;f&&(f.volume=d)},c.prototype.getVolume=function(){return this.audio?this.audio.volume:0},c.prototype.preload=function(d){this.type=d},c.prototype._setAudio=function(d){this.audio=d},c.MUSIC="music",c.EFFECT="effect",c}();a.Sound=b,b.prototype.__class__="egret.Sound"}(egret||(egret={})),function(a){var b=function(){function c(){}return c.isNumber=function(d){return"number"==typeof d&&!isNaN(d)},c}();a.NumberUtils=b,b.prototype.__class__="egret.NumberUtils"}(egret||(egret={}));var __extends=this.__extends||function(b,c){function a(){this.constructor=b}for(var d in c){c.hasOwnProperty(d)&&(b[d]=c[d])}a.prototype=c.prototype,b.prototype=new a},RES;!function(a){var b=function(c){function d(g,f,h){"undefined"==typeof f&&(f=!1),"undefined"==typeof h&&(h=!1),c.call(this,g,f,h),this.itemsTotal=this.itemsLoaded=0}return __extends(d,c),d.dispatchResourceEvent=function(g,f,l,j,k,h){"undefined"==typeof l&&(l=""),"undefined"==typeof j&&(j=null),"undefined"==typeof k&&(k=0),"undefined"==typeof h&&(h=0);var e=egret.Event._getPropertyData(d);e.groupName=l,e.resItem=j,e.itemsLoaded=k,e.itemsTotal=h,egret.Event._dispatchByTarget(d,g,f,e)},d.ITEM_LOAD_ERROR="itemLoadError",d.CONFIG_COMPLETE="configComplete",d.GROUP_PROGRESS="groupProgress",d.GROUP_COMPLETE="groupComplete",d}(egret.Event);a.ResourceEvent=b,b.prototype.__class__="RES.ResourceEvent"}(RES||(RES={})),function(a){var b=function(){function c(f,g,d){this._loaded=!1,this.name=f,this.url=g,this.type=d}return Object.defineProperty(c.prototype,"loaded",{get:function(){return this.data?this.data.loaded:this._loaded},set:function(d){this.data&&(this.data.loaded=d),this._loaded=d},enumerable:!0,configurable:!0}),c.prototype.toString=function(){return'[ResourceItem name="'+this.name+'" url="'+this.url+'" type="'+this.type+'"]'},c.TYPE_XML="xml",c.TYPE_IMAGE="image",c.TYPE_BIN="bin",c.TYPE_TEXT="text",c.TYPE_JSON="json",c.TYPE_SHEET="sheet",c.TYPE_FONT="font",c.TYPE_SOUND="sound",c}();a.ResourceItem=b,b.prototype.__class__="RES.ResourceItem"}(RES||(RES={})),function(a){var b=function(){function c(){this.keyMap={},this.groupDic={},a.configInstance=this}return c.prototype.getGroupByName=function(f){var g=[];if(!this.groupDic[f]){return g}f=this.groupDic[f];for(var d=f.length,h=0;d>h;h++){g.push(this.parseResourceItem(f[h]))}return g},c.prototype.getRawGroupByName=function(d){return this.groupDic[d]?this.groupDic[d]:[]},c.prototype.createGroup=function(q,l,j){if("undefined"==typeof j&&(j=!1),!j&&this.groupDic[q]||!l||0==l.length){return !1}j=this.groupDic;for(var g=[],d=l.length,f=0;d>f;f++){var u=l[f],p=j[u];if(p){for(var u=p.length,k=0;u>k;k++){var m=p[k];-1==g.indexOf(m)&&g.push(m)}}else{(m=this.keyMap[u])&&-1==g.indexOf(m)&&g.push(m)}}return 0==g.length?!1:(this.groupDic[q]=g,!0)},c.prototype.parseConfig=function(v,l){if(v){var j=v.resources;if(j){for(var g=j.length,d=0;g>d;d++){var f=j[d],w=f.url;w&&-1==w.indexOf("://")&&(f.url=l+w),this.addItemToKeyMap(f)}}if(j=v.groups){for(g=j.length,d=0;g>d;d++){for(var w=j[d],p=[],k=w.keys.split(","),m=k.length,q=0;m>q;q++){f=k[q].trim(),(f=this.keyMap[f])&&-1==p.indexOf(f)&&p.push(f)}this.groupDic[w.name]=p}}}},c.prototype.addSubkey=function(f,g){var d=this.keyMap[g];d&&!this.keyMap[f]&&(this.keyMap[f]=d)},c.prototype.addItemToKeyMap=function(f){if(this.keyMap[f.name]||(this.keyMap[f.name]=f),f.hasOwnProperty("subkeys")){var h=f.subkeys.split(",");f.subkeys=h;for(var d=h.length,j=0;d>j;j++){var g=h[j];null==this.keyMap[g]&&(this.keyMap[g]=f)}}},c.prototype.getName=function(d){return(d=this.keyMap[d])?d.name:""},c.prototype.getType=function(d){return(d=this.keyMap[d])?d.type:""},c.prototype.getRawResourceItem=function(d){return this.keyMap[d]},c.prototype.getResourceItem=function(d){return(d=this.keyMap[d])?this.parseResourceItem(d):null},c.prototype.parseResourceItem=function(f){var d=new a.ResourceItem(f.name,f.url,f.type);return d.data=f,d},c}();a.ResourceConfig=b,b.prototype.__class__="RES.ResourceConfig"}(RES||(RES={})),__extends=this.__extends||function(b,c){function a(){this.constructor=b}for(var d in c){c.hasOwnProperty(d)&&(b[d]=c[d])}a.prototype=c.prototype,b.prototype=new a},function(a){var b=function(d){function c(){d.call(this),this.thread=2,this.loadingCount=0,this.groupTotalDic={},this.numLoadedDic={},this.itemListDic={},this.priorityQueue={},this.lazyLoadList=[],this.analyzerDic={},this.queueIndex=0}return __extends(c,d),c.prototype.isGroupInLoading=function(e){return void 0!==this.itemListDic[e]},c.prototype.loadGroup=function(h,f,j){if("undefined"==typeof j&&(j=0),!this.itemListDic[f]&&f){if(h&&0!=h.length){this.priorityQueue[j]?this.priorityQueue[j].push(f):this.priorityQueue[j]=[f],this.itemListDic[f]=h,j=h.length;for(var g=0;j>g;g++){h[g].groupName=f}this.groupTotalDic[f]=h.length,this.numLoadedDic[f]=0,this.next()}else{h=new a.ResourceEvent(a.ResourceEvent.GROUP_COMPLETE),h.groupName=f,this.dispatchEvent(h)}}},c.prototype.loadItem=function(e){this.lazyLoadList.push(e),e.groupName="",this.next()},c.prototype.next=function(){for(;this.loadingCount<this.thread;){var g=this.getOneResourceItem();if(!g){break}if(this.loadingCount++,g.loaded){this.onItemComplete(g)}else{var f=this.analyzerDic[g.type];f||(f=this.analyzerDic[g.type]=egret.Injector.getInstance(a.AnalyzerBase,g.type)),f.loadFile(g,this.onItemComplete,this)}}},c.prototype.getOneResourceItem=function(){var g,h=Number.NEGATIVE_INFINITY;for(g in this.priorityQueue){h=Math.max(h,g)}if(h=this.priorityQueue[h],!h||0==h.length){return 0==this.lazyLoadList.length?null:this.lazyLoadList.pop()}g=h.length;for(var f,j=0;g>j&&(this.queueIndex>=g&&(this.queueIndex=0),f=this.itemListDic[h[this.queueIndex]],!(0<f.length));j++){this.queueIndex++}return 0==f.length?null:f.shift()},c.prototype.onItemComplete=function(h){this.loadingCount--;var f=h.groupName;if(h.loaded||a.ResourceEvent.dispatchResourceEvent(this.resInstance,a.ResourceEvent.ITEM_LOAD_ERROR,f,h),f){this.numLoadedDic[f]++;var j=this.numLoadedDic[f],g=this.groupTotalDic[f];a.ResourceEvent.dispatchResourceEvent(this.resInstance,a.ResourceEvent.GROUP_PROGRESS,f,h,j,g),j==g&&(this.removeGroupName(f),delete this.groupTotalDic[f],delete this.numLoadedDic[f],delete this.itemListDic[f],a.ResourceEvent.dispatchResourceEvent(this,a.ResourceEvent.GROUP_COMPLETE,f))}else{this.callBack.call(this.resInstance,h)}this.next()},c.prototype.removeGroupName=function(g){for(var k in this.priorityQueue){for(var f=this.priorityQueue[k],m=f.length,j=0,l=!1,m=f.length,h=0;m>h;h++){if(f[h]==g){f.splice(j,1),l=!0;break}j++}if(l){0==f.length&&delete this.priorityQueue[k];break}}},c}(egret.EventDispatcher);a.ResourceLoader=b,b.prototype.__class__="RES.ResourceLoader"}(RES||(RES={})),__extends=this.__extends||function(b,c){function a(){this.constructor=b}for(var d in c){c.hasOwnProperty(d)&&(b[d]=c[d])}a.prototype=c.prototype,b.prototype=new a},function(a){var b=function(d){function c(){d.call(this),this.resourceConfig=a.configInstance}return __extends(c,d),c.prototype.addSubkey=function(f,g){this.resourceConfig.addSubkey(f,g)},c.prototype.loadFile=function(){},c.prototype.getRes=function(){},c.prototype.destroyRes=function(){return !1},c.getStringPrefix=function(f){if(!f){return""}var g=f.indexOf(".");return -1!=g?f.substring(0,g):""},c.getStringTail=function(f){if(!f){return""}var g=f.indexOf(".");return -1!=g?f.substring(g+1):""},c}(egret.HashObject);a.AnalyzerBase=b,b.prototype.__class__="RES.AnalyzerBase"}(RES||(RES={})),__extends=this.__extends||function(b,c){function a(){this.constructor=b}for(var d in c){c.hasOwnProperty(d)&&(b[d]=c[d])}a.prototype=c.prototype,b.prototype=new a},function(a){var b=function(c){function d(){c.call(this),this.fileDic={},this.resItemDic=[],this._dataFormat=egret.URLLoaderDataFormat.BINARY,this.recycler=new egret.Recycler}return __extends(d,c),d.prototype.loadFile=function(g,h,f){if(this.fileDic[g.name]){h.call(f,g)}else{var j=this.getLoader();this.resItemDic[j.hashCode]={item:g,func:h,thisObject:f},j.load(new egret.URLRequest(g.url))}},d.prototype.getLoader=function(){var e=this.recycler.pop();return e||(e=new egret.URLLoader,e.addEventListener(egret.Event.COMPLETE,this.onLoadFinish,this),e.addEventListener(egret.IOErrorEvent.IO_ERROR,this.onLoadFinish,this)),e.dataFormat=this._dataFormat,e},d.prototype.onLoadFinish=function(g){var j=g.target,f=this.resItemDic[j.hashCode];delete this.resItemDic[j.hashCode],this.recycler.push(j);var k=f.item,h=f.func;k.loaded=g.type==egret.Event.COMPLETE,k.loaded&&this.analyzeData(k,j.data),h.call(f.thisObject,k)},d.prototype.analyzeData=function(g,h){var f=g.name;!this.fileDic[f]&&h&&(this.fileDic[f]=h)},d.prototype.getRes=function(e){return this.fileDic[e]},d.prototype.hasRes=function(e){return null!=this.getRes(e)},d.prototype.destroyRes=function(e){return this.fileDic[e]?(delete this.fileDic[e],!0):!1},d}(a.AnalyzerBase);a.BinAnalyzer=b,b.prototype.__class__="RES.BinAnalyzer"}(RES||(RES={})),__extends=this.__extends||function(b,c){function a(){this.constructor=b}for(var d in c){c.hasOwnProperty(d)&&(b[d]=c[d])}a.prototype=c.prototype,b.prototype=new a},function(a){var b=function(c){function d(){c.call(this),this._dataFormat=egret.URLLoaderDataFormat.TEXTURE}return __extends(d,c),d.prototype.analyzeData=function(g,h){var f=g.name;!this.fileDic[f]&&h&&(this.fileDic[f]=h,(f=g.data)&&f.scale9grid&&(f=f.scale9grid.split(","),h.scale9Grid=new egret.Rectangle(parseInt(f[0]),parseInt(f[1]),parseInt(f[2]),parseInt(f[3]))))},d}(a.BinAnalyzer);a.ImageAnalyzer=b,b.prototype.__class__="RES.ImageAnalyzer"}(RES||(RES={})),__extends=this.__extends||function(b,c){function a(){this.constructor=b}for(var d in c){c.hasOwnProperty(d)&&(b[d]=c[d])}a.prototype=c.prototype,b.prototype=new a},function(a){var b=function(c){function d(){c.call(this),this._dataFormat=egret.URLLoaderDataFormat.TEXT}return __extends(d,c),d.prototype.analyzeData=function(g,h){var f=g.name;if(!this.fileDic[f]&&h){try{this.fileDic[f]=JSON.parse(h)}catch(j){egret.Logger.warning("JSON文件格式不正确: "+g.url+"\ndata:"+h)}}},d}(a.BinAnalyzer);a.JsonAnalyzer=b,b.prototype.__class__="RES.JsonAnalyzer"}(RES||(RES={})),__extends=this.__extends||function(b,c){function a(){this.constructor=b}for(var d in c){c.hasOwnProperty(d)&&(b[d]=c[d])}a.prototype=c.prototype,b.prototype=new a},function(a){var b=function(c){function d(){c.call(this),this._dataFormat=egret.URLLoaderDataFormat.TEXT}return __extends(d,c),d}(a.BinAnalyzer);a.TextAnalyzer=b,b.prototype.__class__="RES.TextAnalyzer"}(RES||(RES={})),__extends=this.__extends||function(b,c){function a(){this.constructor=b}for(var d in c){c.hasOwnProperty(d)&&(b[d]=c[d])}a.prototype=c.prototype,b.prototype=new a},function(a){var b=function(d){function c(){d.call(this),this.sheetMap={},this.textureMap={},this._dataFormat=egret.URLLoaderDataFormat.TEXT}return __extends(c,d),c.prototype.getRes=function(g){var f=this.fileDic[g];return f||(f=this.textureMap[g]),!f&&(f=a.AnalyzerBase.getStringPrefix(g),f=this.fileDic[f])&&(g=a.AnalyzerBase.getStringTail(g),f=f.getTexture(g)),f},c.prototype.onLoadFinish=function(g){var j=g.target,f=this.resItemDic[j.hashCode];delete this.resItemDic[j.hashCode],this.recycler.push(j);var k=f.item,h=f.func;k.loaded=g.type==egret.Event.COMPLETE,k.loaded&&this.analyzeData(k,j.data),"string"==typeof j.data?(this._dataFormat=egret.URLLoaderDataFormat.TEXTURE,this.loadFile(k,h,f.thisObject),this._dataFormat=egret.URLLoaderDataFormat.TEXT):h.call(f.thisObject,k)},c.prototype.analyzeData=function(g,j){var f=g.name;if(!this.fileDic[f]&&j){var k;if("string"==typeof j){try{k=JSON.parse(j)}catch(h){egret.Logger.warning("JSON文件格式不正确: "+g.url)}k&&(this.sheetMap[f]=k,g.loaded=!1,g.url=this.getRelativePath(g.url,k.file))}else{k=this.sheetMap[f],delete this.sheetMap[f],j&&(k=this.parseSpriteSheet(j,k,g.data&&g.data.subkeys?"":f),this.fileDic[f]=k)}}},c.prototype.getRelativePath=function(g,h){g=g.split("\\").join("/");var f=g.lastIndexOf("/");return g=-1!=f?g.substring(0,f+1)+h:h},c.prototype.parseSpriteSheet=function(g,k,f){if(k=k.frames,!k){return null}var m,j=new egret.SpriteSheet(g),l=this.textureMap;for(m in k){var h=k[m];g=j.createTexture(m,h.x,h.y,h.w,h.h,h.offX,h.offY,h.sourceW,h.sourceH),h.scale9grid&&(h=h.scale9grid.split(","),g.scale9Grid=new egret.Rectangle(parseInt(h[0]),parseInt(h[1]),parseInt(h[2]),parseInt(h[3]))),null==l[m]&&(l[m]=g,f&&this.addSubkey(m,f))}return j},c}(a.BinAnalyzer);a.SheetAnalyzer=b,b.prototype.__class__="RES.SheetAnalyzer"}(RES||(RES={})),__extends=this.__extends||function(b,c){function a(){this.constructor=b}for(var d in c){c.hasOwnProperty(d)&&(b[d]=c[d])}a.prototype=c.prototype,b.prototype=new a},function(a){var b=function(c){function d(){c.call(this)}return __extends(d,c),d.prototype.analyzeData=function(g,h){var f=g.name;if(!this.fileDic[f]&&h){var j;"string"==typeof h?(j=h,this.sheetMap[f]=j,g.loaded=!1,g.url=this.getTexturePath(g.url,j)):(j=this.sheetMap[f],delete this.sheetMap[f],h&&(j=new egret.BitmapTextSpriteSheet(h,j),this.fileDic[f]=j))}},d.prototype.getTexturePath=function(g,j){var f="",k=j.split("\n")[2],h=k.indexOf('file="');return -1!=h&&(k=k.substring(h+6),h=k.indexOf('"'),f=k.substring(0,h)),g=g.split("\\").join("/"),h=g.lastIndexOf("/"),g=-1!=h?g.substring(0,h+1)+f:f},d}(a.SheetAnalyzer);a.FontAnalyzer=b,b.prototype.__class__="RES.FontAnalyzer"}(RES||(RES={})),__extends=this.__extends||function(b,c){function a(){this.constructor=b}for(var d in c){c.hasOwnProperty(d)&&(b[d]=c[d])}a.prototype=c.prototype,b.prototype=new a},function(a){var b=function(c){function d(){c.call(this),this._dataFormat=egret.URLLoaderDataFormat.SOUND}return __extends(d,c),d.prototype.analyzeData=function(g,h){var f=g.name;!this.fileDic[f]&&h&&(this.fileDic[f]=h,h.preload((f=g.data)&&f.soundType?f.soundType:egret.Sound.EFFECT))},d}(a.BinAnalyzer);a.SoundAnalyzer=b,b.prototype.__class__="RES.SoundAnalyzer"}(RES||(RES={})),__extends=this.__extends||function(b,c){function a(){this.constructor=b}for(var d in c){c.hasOwnProperty(d)&&(b[d]=c[d])}a.prototype=c.prototype,b.prototype=new a},function(a){var b=function(c){function d(){c.call(this),this._dataFormat=egret.URLLoaderDataFormat.TEXT}return __extends(d,c),d.prototype.analyzeData=function(g,j){var f=g.name;if(!this.fileDic[f]&&j){try{var k=egret.XML.parse(j);this.fileDic[f]=k}catch(h){}}},d}(a.BinAnalyzer);a.XMLAnalyzer=b,b.prototype.__class__="RES.XMLAnalyzer"}(RES||(RES={})),__extends=this.__extends||function(b,c){function a(){this.constructor=b}for(var d in c){c.hasOwnProperty(d)&&(b[d]=c[d])}a.prototype=c.prototype,b.prototype=new a},function(b){b.loadConfig=function(d,f,g){"undefined"==typeof f&&(f=""),"undefined"==typeof g&&(g="json"),a.loadConfig(d,f,g)},b.loadGroup=function(d,f){"undefined"==typeof f&&(f=0),a.loadGroup(d,f)},b.isGroupLoaded=function(d){return a.isGroupLoaded(d)},b.getGroupByName=function(d){return a.getGroupByName(d)},b.createGroup=function(d,f,g){return"undefined"==typeof g&&(g=!1),a.createGroup(d,f,g)},b.hasRes=function(d){return a.hasRes(d)},b.getRes=function(d){return a.getRes(d)},b.getResAsync=function(d,f,g){a.getResAsync(d,f,g)},b.getResByUrl=function(d,g,h,f){"undefined"==typeof f&&(f=""),a.getResByUrl(d,g,h,f)},b.destroyRes=function(d){return a.destroyRes(d)},b.setMaxLoadingThread=function(d){a.setMaxLoadingThread(d)},b.addEventListener=function(d,g,i,f,h){"undefined"==typeof f&&(f=!1),"undefined"==typeof h&&(h=0),a.addEventListener(d,g,i,f,h)},b.removeEventListener=function(d,g,h,f){"undefined"==typeof f&&(f=!1),a.removeEventListener(d,g,h,f)};var c=function(f){function d(){f.call(this),this.analyzerDic={},this.configItemList=[],this.configComplete=this.callLaterFlag=!1,this.loadedGroups=[],this.groupNameList=[],this.asyncDic={},this.init()}return __extends(d,f),d.prototype.getAnalyzerByType=function(h){var g=this.analyzerDic[h];return g||(g=this.analyzerDic[h]=egret.Injector.getInstance(b.AnalyzerBase,h)),g},d.prototype.init=function(){egret.Injector.hasMapRule(b.AnalyzerBase,b.ResourceItem.TYPE_BIN)||egret.Injector.mapClass(b.AnalyzerBase,b.BinAnalyzer,b.ResourceItem.TYPE_BIN),egret.Injector.hasMapRule(b.AnalyzerBase,b.ResourceItem.TYPE_IMAGE)||egret.Injector.mapClass(b.AnalyzerBase,b.ImageAnalyzer,b.ResourceItem.TYPE_IMAGE),egret.Injector.hasMapRule(b.AnalyzerBase,b.ResourceItem.TYPE_TEXT)||egret.Injector.mapClass(b.AnalyzerBase,b.TextAnalyzer,b.ResourceItem.TYPE_TEXT),egret.Injector.hasMapRule(b.AnalyzerBase,b.ResourceItem.TYPE_JSON)||egret.Injector.mapClass(b.AnalyzerBase,b.JsonAnalyzer,b.ResourceItem.TYPE_JSON),egret.Injector.hasMapRule(b.AnalyzerBase,b.ResourceItem.TYPE_SHEET)||egret.Injector.mapClass(b.AnalyzerBase,b.SheetAnalyzer,b.ResourceItem.TYPE_SHEET),egret.Injector.hasMapRule(b.AnalyzerBase,b.ResourceItem.TYPE_FONT)||egret.Injector.mapClass(b.AnalyzerBase,b.FontAnalyzer,b.ResourceItem.TYPE_FONT),egret.Injector.hasMapRule(b.AnalyzerBase,b.ResourceItem.TYPE_SOUND)||egret.Injector.mapClass(b.AnalyzerBase,b.SoundAnalyzer,b.ResourceItem.TYPE_SOUND),egret.Injector.hasMapRule(b.AnalyzerBase,b.ResourceItem.TYPE_XML)||egret.Injector.mapClass(b.AnalyzerBase,b.XMLAnalyzer,b.ResourceItem.TYPE_XML),this.resConfig=new b.ResourceConfig,this.resLoader=new b.ResourceLoader,this.resLoader.callBack=this.onResourceItemComp,this.resLoader.resInstance=this,this.resLoader.addEventListener(b.ResourceEvent.GROUP_COMPLETE,this.onGroupComp,this)},d.prototype.loadConfig=function(h,j,g){"undefined"==typeof g&&(g="json"),this.configItemList.push({url:h,resourceRoot:j,type:g}),this.callLaterFlag||(egret.callLater(this.startLoadConfig,this),this.callLaterFlag=!0)},d.prototype.startLoadConfig=function(){this.callLaterFlag=!1;var i=this.configItemList;this.configItemList=[],this.loadingConfigList=i;for(var k=i.length,h=[],j=0;k>j;j++){var g=i[j],g=new b.ResourceItem(g.url,g.url,g.type);h.push(g)}this.resLoader.loadGroup(h,d.GROUP_CONFIG,Number.MAX_VALUE)},d.prototype.isGroupLoaded=function(e){return -1!=this.loadedGroups.indexOf(e)},d.prototype.getGroupByName=function(e){return this.resConfig.getGroupByName(e)},d.prototype.loadGroup=function(h,j){if("undefined"==typeof j&&(j=0),-1==this.loadedGroups.indexOf(h)&&!this.resLoader.isGroupInLoading(h)){if(this.configComplete){var g=this.resConfig.getGroupByName(h);this.resLoader.loadGroup(g,h,j)}else{this.groupNameList.push({name:h,priority:j})}}},d.prototype.createGroup=function(h,j,g){if("undefined"==typeof g&&(g=!1),g){var k=this.loadedGroups.indexOf(h);-1!=k&&this.loadedGroups.splice(k,1)}return this.resConfig.createGroup(h,j,g)},d.prototype.onGroupComp=function(i){if(i.groupName==d.GROUP_CONFIG){i=this.loadingConfigList.length;for(var k=0;i>k;k++){var h=this.loadingConfigList[k],j=this.getAnalyzerByType(h.type),g=j.getRes(h.url);j.destroyRes(h.url),this.resConfig.parseConfig(g,h.resourceRoot)}for(this.configComplete=!0,this.loadingConfigList=null,b.ResourceEvent.dispatchResourceEvent(this,b.ResourceEvent.CONFIG_COMPLETE),h=this.groupNameList,i=h.length,k=0;i>k;k++){j=h[k],this.loadGroup(j.name,j.priority)}this.groupNameList=[]}else{this.loadedGroups.push(i.groupName),this.dispatchEvent(i)}},d.prototype.hasRes=function(h){var g=this.resConfig.getType(h);return""==g&&(h=b.AnalyzerBase.getStringPrefix(h),g=this.resConfig.getType(h),""==g)?!1:!0},d.prototype.getRes=function(h){var g=this.resConfig.getType(h);return""==g&&(g=b.AnalyzerBase.getStringPrefix(h),g=this.resConfig.getType(g),""==g)?null:this.getAnalyzerByType(g).getRes(h)},d.prototype.getResAsync=function(j,g,l){var h=this.resConfig.getType(j),k=this.resConfig.getName(j);return""==h&&(k=b.AnalyzerBase.getStringPrefix(j),h=this.resConfig.getType(k),""==h)?void g.call(l,null):void ((h=this.getAnalyzerByType(h).getRes(j))?g.call(l,h):(j={key:j,compFunc:g,thisObject:l},this.asyncDic[k]?this.asyncDic[k].push(j):(this.asyncDic[k]=[j],k=this.resConfig.getResourceItem(k),this.resLoader.loadItem(k))))},d.prototype.getResByUrl=function(j,g,l,h){if("undefined"==typeof h&&(h=""),j){h||(h=this.getTypeByUrl(j));var k=this.getAnalyzerByType(h).getRes(j);k?g.call(l,k):(g={key:j,compFunc:g,thisObject:l},this.asyncDic[j]?this.asyncDic[j].push(g):(this.asyncDic[j]=[g],j=new b.ResourceItem(j,j,h),this.resLoader.loadItem(j)))}else{g.call(l,null)}},d.prototype.getTypeByUrl=function(g){switch((g=g.substr(g.lastIndexOf(".")+1))&&(g=g.toLowerCase()),g){case b.ResourceItem.TYPE_XML:case b.ResourceItem.TYPE_JSON:case b.ResourceItem.TYPE_SHEET:break;case"png":case"jpg":case"gif":g=b.ResourceItem.TYPE_IMAGE;break;case"fnt":g=b.ResourceItem.TYPE_FONT;break;case"txt":g=b.ResourceItem.TYPE_TEXT;break;case"mp3":case"ogg":case"mpeg":case"wav":case"m4a":case"mp4":case"aiff":case"wma":case"mid":g=b.ResourceItem.TYPE_SOUND;break;default:g=b.ResourceItem.TYPE_BIN}return g},d.prototype.onResourceItemComp=function(h){var k=this.asyncDic[h.name];delete this.asyncDic[h.name],h=this.getAnalyzerByType(h.type);for(var g=k.length,m=0;g>m;m++){var j=k[m],l=h.getRes(j.key);j.compFunc.call(j.thisObject,l,j.key)}},d.prototype.destroyRes=function(h){var k=this.resConfig.getRawGroupByName(h);if(k){var g=this.loadedGroups.indexOf(h);-1!=g&&this.loadedGroups.splice(g,1),h=k.length;for(var l=0;h>l;l++){g=k[l],g.loaded=!1;var j=this.getAnalyzerByType(g.type);j.destroyRes(g.name)}return !0}return k=this.resConfig.getType(h),""==k?!1:(g=this.resConfig.getRawResourceItem(h),g.loaded=!1,j=this.getAnalyzerByType(k),j.destroyRes(h))},d.prototype.setMaxLoadingThread=function(e){1>e&&(e=1),this.resLoader.thread=e},d.GROUP_CONFIG="RES__CONFIG",d}(egret.EventDispatcher);c.prototype.__class__="Resource";var a=new c}(RES||(RES={})),__extends=this.__extends||function(b,c){function a(){this.constructor=b}for(var d in c){c.hasOwnProperty(d)&&(b[d]=c[d])}a.prototype=c.prototype,b.prototype=new a},function(a){var b=function(d){function c(e){"undefined"==typeof e&&(e=60),d.call(this),this.frameRate=e,this._time=0,60==e&&(c.requestAnimationFrame=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame,c.cancelAnimationFrame=window.cancelAnimationFrame||window.msCancelAnimationFrame||window.mozCancelAnimationFrame||window.webkitCancelAnimationFrame||window.oCancelAnimationFrame||window.cancelRequestAnimationFrame||window.msCancelRequestAnimationFrame||window.mozCancelRequestAnimationFrame||window.oCancelRequestAnimationFrame||window.webkitCancelRequestAnimationFrame),c.requestAnimationFrame||(c.requestAnimationFrame=function(f){return window.setTimeout(f,1000/e)}),c.cancelAnimationFrame||(c.cancelAnimationFrame=function(f){return window.clearTimeout(f)}),c.instance=this,this.registerListener()}return __extends(c,d),c.prototype.enterFrame=function(){var h=c.instance,j=c._thisObject,g=c._callback,i=a.getTimer(),f=i-h._time;h._requestAnimationId=c.requestAnimationFrame.call(window,c.prototype.enterFrame),g.call(j,f),h._time=i},c.prototype.executeMainLoop=function(f,g){c._callback=f,c._thisObject=g,this.enterFrame()},c.prototype.reset=function(){var f=c.instance;f._requestAnimationId&&(f._time=a.getTimer(),c.cancelAnimationFrame.call(window,f._requestAnimationId),f.enterFrame())},c.prototype.registerListener=function(){var f=function(){c.instance.reset()},h=function(){document[i]||f()};window.onfocus=f,window.onblur=function(){};var i,g;"undefined"!=typeof document.hidden?(i="hidden",g="visibilitychange"):"undefined"!=typeof document.mozHidden?(i="mozHidden",g="mozvisibilitychange"):"undefined"!=typeof document.msHidden?(i="msHidden",g="msvisibilitychange"):"undefined"!=typeof document.webkitHidden&&(i="webkitHidden",g="webkitvisibilitychange"),"onpageshow" in window&&"onpagehide" in window&&window.addEventListener("pageshow",f,!1),i&&g&&document.addEventListener(g,h,!1)},c}(a.DeviceContext);a.HTML5DeviceContext=b,b.prototype.__class__="egret.HTML5DeviceContext"}(egret||(egret={}));var egret_html5_localStorage;!function(a){a.getItem=function(b){return window.localStorage.getItem(b)},a.setItem=function(b,c){window.localStorage.setItem(b,c)},a.removeItem=function(b){window.localStorage.removeItem(b)},a.clear=function(){window.localStorage.clear()},a.init=function(){for(var b in a){egret.localStorage[b]=a[b]}}}(egret_html5_localStorage||(egret_html5_localStorage={})),egret_html5_localStorage.init(),__extends=this.__extends||function(b,c){function a(){this.constructor=b}for(var d in c){c.hasOwnProperty(d)&&(b[d]=c[d])}a.prototype=c.prototype,b.prototype=new a},function(a){var b=function(d){function c(f){d.call(this),this.globalAlpha=1,this.canvas=f,this.canvasContext=f.getContext("2d");var e=this.canvasContext.setTransform,g=this;this.canvasContext.setTransform=function(i,l,k,m,j,h){g._matrixA=i,g._matrixB=l,g._matrixC=k,g._matrixD=m,g._matrixTx=j,g._matrixTy=h,e.call(g.canvasContext,i,l,k,m,j,h)},this._matrixA=1,this._matrixC=this._matrixB=0,this._matrixD=1,this._transformTy=this._transformTx=this._matrixTy=this._matrixTx=0,d.call(this)}return __extends(c,d),c.prototype.clearScreen=function(){for(var h=a.RenderFilter.getInstance().getDrawAreaList(),f=0,j=h.length;j>f;f++){var g=h[f];this.clearRect(g.x,g.y,g.width,g.height)}this.renderCost=0},c.prototype.clearRect=function(g,h,f,j){this.canvasContext.clearRect(g,h,f,j)},c.prototype.drawImage=function(k,j,e,g,v,q,l,m,t){var f=a.MainContext.instance.rendererContext.texture_scale_factor;j/=f,e/=f,g/=f,v/=f,k=k._bitmapData,q+=this._transformTx,l+=this._transformTy,f=a.getTimer(),this.canvasContext.drawImage(k,j,e,g,v,q,l,m,t),d.prototype.drawImage.call(this,k,j,e,g,v,q,l,m,t),this.renderCost+=a.getTimer()-f},c.prototype.setTransform=function(e){1==e.a&&0==e.b&&0==e.c&&1==e.d&&1==this._matrixA&&0==this._matrixB&&0==this._matrixC&&1==this._matrixD?(this._transformTx=e.tx-this._matrixTx,this._transformTy=e.ty-this._matrixTy):(this._transformTx=this._transformTy=0,this._matrixA==e.a&&this._matrixB==e.b&&this._matrixC==e.c&&this._matrixD==e.d&&this._matrixTx==e.tx&&this._matrixTy==e.ty||this.canvasContext.setTransform(e.a,e.b,e.c,e.d,e.tx,e.ty))},c.prototype.setAlpha=function(g,f){g!=this.globalAlpha&&(this.canvasContext.globalAlpha=this.globalAlpha=g),f?(this.blendValue=f,this.canvasContext.globalCompositeOperation=f):this.blendValue!=a.BlendMode.NORMAL&&(this.blendValue=a.BlendMode.NORMAL,this.canvasContext.globalCompositeOperation=a.BlendMode.NORMAL)},c.prototype.setupFont=function(g){var h=this.canvasContext,f=g.italic?"italic ":"normal ",f=f+(g.bold?"bold ":"normal "),f=f+(g.size+"px "+g.fontFamily);h.font=f,h.textAlign="left",h.textBaseline="middle"},c.prototype.measureText=function(e){return this.canvasContext.measureText(e).width},c.prototype.drawText=function(g,f,p,l,m){var k=g._strokeColorString,e=g.stroke,j=this.canvasContext;j.fillStyle=g._textColorString,j.strokeStyle=k,e&&(j.lineWidth=2*e,j.strokeText(f,p+this._transformTx,l+this._transformTy,m||65535)),j.fillText(f,p+this._transformTx,l+this._transformTy,m||65535),d.prototype.drawText.call(this,g,f,p,l,m)},c.prototype.strokeRect=function(g,j,f,k,h){this.canvasContext.strokeStyle=h,this.canvasContext.strokeRect(g,j,f,k)},c.prototype.pushMask=function(e){this.canvasContext.save(),this.canvasContext.beginPath(),this.canvasContext.rect(e.x+this._transformTx,e.y+this._transformTy,e.width,e.height),this.canvasContext.clip(),this.canvasContext.closePath()},c.prototype.popMask=function(){this.canvasContext.restore(),this.canvasContext.setTransform(1,0,0,1,0,0)},c.prototype.onRenderStart=function(){this.canvasContext.save()},c.prototype.onRenderFinish=function(){this.canvasContext.restore(),this.canvasContext.setTransform(1,0,0,1,0,0)},c}(a.RendererContext);a.HTML5CanvasRenderer=b,b.prototype.__class__="egret.HTML5CanvasRenderer"}(egret||(egret={}));var egret_h5_graphics;!function(a){a.beginFill=function(d,c){"undefined"==typeof c&&(c=1);var e="rgba("+(d>>16)+","+((65280&d)>>8)+","+(255&d)+","+c+")";this.fillStyleColor=e,this.commandQueue.push(new b(this._setStyle,this,[e]))},a.drawRect=function(d,c,f,e){this.commandQueue.push(new b(function(h,k,g,l){var j=this.renderContext;this.canvasContext.beginPath(),this.canvasContext.rect(j._transformTx+h,j._transformTy+k,g,l),this.canvasContext.closePath()},this,[d,c,f,e])),this._fill()},a.drawCircle=function(d,c,e){this.commandQueue.push(new b(function(g,h,f){var j=this.renderContext;this.canvasContext.beginPath(),this.canvasContext.arc(j._transformTx+g,j._transformTy+h,f,0,2*Math.PI),this.canvasContext.closePath()},this,[d,c,e])),this._fill()},a.drawRoundRect=function(d,c,h,f,g,e){this.commandQueue.push(new b(function(k,p,j,u,m,q){var l=this.renderContext;k=l._transformTx+k,p=l._transformTy+p,m/=2,q=q?q/2:m,j=k+j,u=p+u,l=u-q,this.canvasContext.beginPath(),this.canvasContext.moveTo(j,l),this.canvasContext.quadraticCurveTo(j,u,j-m,u),this.canvasContext.lineTo(k+m,u),this.canvasContext.quadraticCurveTo(k,u,k,u-q),this.canvasContext.lineTo(k,p+q),this.canvasContext.quadraticCurveTo(k,p,k+m,p),this.canvasContext.lineTo(j-m,p),this.canvasContext.quadraticCurveTo(j,p,j,p+q),this.canvasContext.lineTo(j,l),this.canvasContext.closePath()},this,[d,c,h,f,g,e])),this._fill()},a.drawEllipse=function(d,c,f,e){this.commandQueue.push(new b(function(h,k,g,m){var j=this.renderContext;this.canvasContext.save(),h=j._transformTx+h,k=j._transformTy+k;var j=g>m?g:m,l=g/j;m/=j,this.canvasContext.scale(l,m),this.canvasContext.beginPath(),this.canvasContext.moveTo((h+g)/l,k/m),this.canvasContext.arc(h/l,k/m,j,0,2*Math.PI),this.canvasContext.closePath(),this.canvasContext.restore(),this.canvasContext.stroke()},this,[d,c,f,e])),this._fill()},a.lineStyle=function(e,d,l,j,k,g,c,f){"undefined"==typeof e&&(e=0/0),"undefined"==typeof d&&(d=0),"undefined"==typeof l&&(l=1),"undefined"==typeof j&&(j=!1),"undefined"==typeof k&&(k="normal"),"undefined"==typeof g&&(g=null),"undefined"==typeof c&&(c=null),"undefined"==typeof f&&(f=3),this.strokeStyleColor&&(this.createEndLineCommand(),this.commandQueue.push(this.endLineCommand)),this.strokeStyleColor=d="rgba("+(d>>16)+","+((65280&d)>>8)+","+(255&d)+","+l+")",this.commandQueue.push(new b(function(h,i){this.canvasContext.lineWidth=h,this.canvasContext.strokeStyle=i,this.canvasContext.beginPath()},this,[e,d])),"undefined"==typeof this.lineX&&(this.lineY=this.lineX=0),this.moveTo(this.lineX,this.lineY)},a.lineTo=function(d,c){this.commandQueue.push(new b(function(g,h){var f=this.renderContext;this.canvasContext.lineTo(f._transformTx+g,f._transformTy+h)},this,[d,c])),this.lineX=d,this.lineY=c},a.curveTo=function(d,c,f,e){this.commandQueue.push(new b(function(h,k,g,l){var j=this.renderContext;this.canvasContext.quadraticCurveTo(j._transformTx+h,j._transformTy+k,g,l)},this,[d,c,f,e])),this.lineX=f,this.lineY=e},a.moveTo=function(d,c){this.commandQueue.push(new b(function(g,h){var f=this.renderContext;this.canvasContext.moveTo(f._transformTx+g,f._transformTy+h)},this,[d,c]))},a.clear=function(){this.lineY=this.lineX=this.commandQueue.length=0,this.fillStyleColor=this.strokeStyleColor=null},a.createEndFillCommand=function(){this.endFillCommand||(this.endFillCommand=new b(function(){this.canvasContext.fill(),this.canvasContext.closePath()},this,null))},a.endFill=function(){null!=this.fillStyleColor&&this._fill(),this.fillStyleColor=null},a._fill=function(){this.fillStyleColor&&(this.createEndFillCommand(),this.commandQueue.push(this.endFillCommand))},a.createEndLineCommand=function(){this.endLineCommand||(this.endLineCommand=new b(function(){this.canvasContext.stroke(),this.canvasContext.closePath()},this,null))},a._draw=function(d){this.renderContext=d,d=this.canvasContext=this.renderContext.canvasContext,d.save();var f=this.commandQueue.length;this.strokeStyleColor&&f>0&&this.commandQueue[f-1]!=this.endLineCommand&&(this.createEndLineCommand(),this.commandQueue.push(this.endLineCommand),f=this.commandQueue.length);for(var c=0;f>c;c++){var g=this.commandQueue[c];g.method.apply(g.thisObject,g.args)}d.restore()};var b=function(){return function(d,f,c){this.method=d,this.thisObject=f,this.args=c}}();b.prototype.__class__="Command",a._setStyle=function(c){this.canvasContext.fillStyle=c,this.canvasContext.beginPath()},a.init=function(){for(var c in a){egret.Graphics.prototype[c]=a[c]}egret.RendererContext.createRendererContext=function(d){return new egret.HTML5CanvasRenderer(d)}}}(egret_h5_graphics||(egret_h5_graphics={})),egret_h5_graphics.init(),__extends=this.__extends||function(b,c){function a(){this.constructor=b}for(var d in c){c.hasOwnProperty(d)&&(b[d]=c[d])}a.prototype=c.prototype,b.prototype=new a},function(a){var b=function(d){function c(e){d.call(this),this.size=2000,this.vertSize=6,this.contextLost=!1,this.glContextId=0,this.currentBlendMode="",this.currentBaseTexture=null,this.currentBatchSize=0,this.maskList=[],this.maskDataFreeList=[],this.canvasContext=document.createElement("canvas").getContext("2d"),console.log("使用WebGL模式"),this.canvas=e,e.addEventListener("webglcontextlost",this.handleContextLost.bind(this),!1),e.addEventListener("webglcontextrestored",this.handleContextRestored.bind(this),!1),this.projectionX=e.width/2,this.projectionY=-e.height/2,e=6*this.size,this.vertices=new Float32Array(4*this.size*this.vertSize),this.indices=new Uint16Array(e);for(var g=0,f=0;e>g;g+=6,f+=4){this.indices[g+0]=f+0,this.indices[g+1]=f+1,this.indices[g+2]=f+2,this.indices[g+3]=f+0,this.indices[g+4]=f+2,this.indices[g+5]=f+3}this.initWebGL(),this.shaderManager=new a.WebGLShaderManager(this.gl),this.worldTransform=new a.Matrix,this.initBlendMode(),a.MainContext.instance.addEventListener(a.Event.FINISH_RENDER,this._draw,this),a.TextField.prototype._draw=function(h){this.getDirty()&&(this.cacheAsBitmap=!0),a.DisplayObject.prototype._draw.call(this,h)}}return __extends(c,d),c.prototype.handleContextLost=function(){this.contextLost=!0},c.prototype.handleContextRestored=function(){this.initWebGL(),this.shaderManager.setContext(this.gl),this.contextLost=!1},c.prototype.initWebGL=function(){for(var g,j={stencil:!0},f=["experimental-webgl","webgl"],k=0;k<f.length;k++){try{g=this.canvas.getContext(f[k],j)}catch(h){}if(g){break}}if(!g){throw Error("当前浏览器不支持webgl")}this.setContext(g)},c.prototype.setContext=function(e){this.gl=e,e.id=this.glContextId++,this.vertexBuffer=e.createBuffer(),this.indexBuffer=e.createBuffer(),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,this.indexBuffer),e.bufferData(e.ELEMENT_ARRAY_BUFFER,this.indices,e.STATIC_DRAW),e.bindBuffer(e.ARRAY_BUFFER,this.vertexBuffer),e.bufferData(e.ARRAY_BUFFER,this.vertices,e.DYNAMIC_DRAW),e.disable(e.DEPTH_TEST),e.disable(e.CULL_FACE),e.enable(e.BLEND),e.colorMask(!0,!0,!0,!0)},c.prototype.initBlendMode=function(){c.blendModesWebGL[a.BlendMode.NORMAL]=[this.gl.ONE,this.gl.ONE_MINUS_SRC_ALPHA],c.blendModesWebGL[a.BlendMode.ADD]=[this.gl.SRC_ALPHA,this.gl.DST_ALPHA]},c.prototype.start=function(){if(!this.contextLost){var g=this.gl;g.activeTexture(g.TEXTURE0),g.bindBuffer(g.ARRAY_BUFFER,this.vertexBuffer),g.bindBuffer(g.ELEMENT_ARRAY_BUFFER,this.indexBuffer);var h=this.shaderManager.defaultShader;g.uniform2f(h.projectionVector,this.projectionX,this.projectionY);var f=4*this.vertSize;g.vertexAttribPointer(h.aVertexPosition,2,g.FLOAT,!1,f,0),g.vertexAttribPointer(h.aTextureCoord,2,g.FLOAT,!1,f,8),g.vertexAttribPointer(h.colorAttribute,2,g.FLOAT,!1,f,16)}},c.prototype.clearScreen=function(){var h=this.gl;h.colorMask(!0,!0,!0,!0);for(var f=a.RenderFilter.getInstance().getDrawAreaList(),k=0,g=f.length;g>k;k++){var j=f[k];h.viewport(j.x,j.y,j.width,j.height),h.bindFramebuffer(h.FRAMEBUFFER,null),h.clearColor(0,0,0,0),h.clear(h.COLOR_BUFFER_BIT)}this.renderCost=0},c.prototype.setBlendMode=function(f){if(f||(f=a.BlendMode.NORMAL),this.currentBlendMode!=f){var g=c.blendModesWebGL[f];g&&(this.gl.blendFunc(g[0],g[1]),this.currentBlendMode=f)}},c.prototype.drawImage=function(F,B,x,t,w,q,I,C,H){if(!this.contextLost){var k=a.MainContext.instance.rendererContext.texture_scale_factor;B/=k,x/=k,t/=k,w/=k,this.createWebGLTexture(F),(F.webGLTexture!==this.currentBaseTexture||this.currentBatchSize>=this.size)&&(this._draw(),this.currentBaseTexture=F.webGLTexture);var v=this.worldTransform,A=v.a,G=v.b,E=v.c,J=v.d,D=v.tx,j=v.ty;0==q&&0==I||v.append(1,0,0,1,q,I),1==t/C&&1==w/H||v.append(C/t,0,0,H/w,0,0),q=v.a,I=v.b,C=v.c,H=v.d;var k=v.tx,z=v.ty;v.a=A,v.b=G,v.c=E,v.d=J,v.tx=D,v.ty=j,A=F._sourceWidth,G=F._sourceHeight,F=t,v=w,B/=A,x/=G,t/=A,w/=G,A=this.vertices,G=4*this.currentBatchSize*this.vertSize,E=this.worldAlpha,A[G++]=k,A[G++]=z,A[G++]=B,A[G++]=x,A[G++]=E,A[G++]=16777215,A[G++]=q*F+k,A[G++]=I*F+z,A[G++]=t+B,A[G++]=x,A[G++]=E,A[G++]=16777215,A[G++]=q*F+C*v+k,A[G++]=H*v+I*F+z,A[G++]=t+B,A[G++]=w+x,A[G++]=E,A[G++]=16777215,A[G++]=C*v+k,A[G++]=H*v+z,A[G++]=B,A[G++]=w+x,A[G++]=E,A[G++]=16777215,this.currentBatchSize++}},c.prototype._draw=function(){if(0!=this.currentBatchSize&&!this.contextLost){var g=a.getTimer();this.start();var f=this.gl;f.bindTexture(f.TEXTURE_2D,this.currentBaseTexture);var h=this.vertices.subarray(0,4*this.currentBatchSize*this.vertSize);f.bufferSubData(f.ARRAY_BUFFER,0,h),f.drawElements(f.TRIANGLES,6*this.currentBatchSize,f.UNSIGNED_SHORT,0),this.currentBatchSize=0,this.renderCost+=a.getTimer()-g,a.Profiler.getInstance().onDrawImage()}},c.prototype.setTransform=function(f){var g=this.worldTransform;g.a=f.a,g.b=f.b,g.c=f.c,g.d=f.d,g.tx=f.tx,g.ty=f.ty},c.prototype.setAlpha=function(f,g){this.worldAlpha=f,this.setBlendMode(g)},c.prototype.createWebGLTexture=function(f){if(!f.webGLTexture){var g=this.gl;f.webGLTexture=g.createTexture(),g.bindTexture(g.TEXTURE_2D,f.webGLTexture),g.pixelStorei(g.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),g.texImage2D(g.TEXTURE_2D,0,g.RGBA,g.RGBA,g.UNSIGNED_BYTE,f._bitmapData),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_MAG_FILTER,g.LINEAR),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_MIN_FILTER,g.LINEAR),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_WRAP_S,g.CLAMP_TO_EDGE),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_WRAP_T,g.CLAMP_TO_EDGE),g.bindTexture(g.TEXTURE_2D,null)}},c.prototype.pushMask=function(g){this._draw();var h=this.gl;0==this.maskList.length&&(h.enable(h.STENCIL_TEST),h.stencilFunc(h.ALWAYS,1,1));var f=this.maskDataFreeList.pop();f?(f.x=g.x,f.y=g.y,f.w=g.width,f.h=g.height):f={x:g.x,y:g.y,w:g.width,h:g.height},this.maskList.push(f),h.colorMask(!1,!1,!1,!1),h.stencilOp(h.KEEP,h.KEEP,h.INCR),this.renderGraphics(f),h.colorMask(!0,!0,!0,!0),h.stencilFunc(h.NOTEQUAL,0,this.maskList.length),h.stencilOp(h.KEEP,h.KEEP,h.KEEP)},c.prototype.popMask=function(){this._draw();var f=this.gl,g=this.maskList.pop();g&&(f.colorMask(!1,!1,!1,!1),f.stencilOp(f.KEEP,f.KEEP,f.DECR),this.renderGraphics(g),f.colorMask(!0,!0,!0,!0),f.stencilFunc(f.NOTEQUAL,0,this.maskList.length),f.stencilOp(f.KEEP,f.KEEP,f.KEEP),this.maskDataFreeList.push(g)),0==this.maskList.length&&f.disable(f.STENCIL_TEST)},c.prototype.setupFont=function(g){var h=this.canvasContext,f=g.italic?"italic ":"normal ",f=f+(g.bold?"bold ":"normal "),f=f+(g.size+"px "+g.fontFamily);h.font=f,h.textAlign="left",h.textBaseline="middle"},c.prototype.measureText=function(e){return this.canvasContext.measureText(e).width},c.prototype.renderGraphics=function(g){var h=this.gl,f=this.shaderManager.primitiveShader;this.graphicsPoints?(this.graphicsPoints.length=0,this.graphicsIndices.length=0):(this.graphicsPoints=[],this.graphicsIndices=[],this.graphicsBuffer=h.createBuffer(),this.graphicsIndexBuffer=h.createBuffer()),this.updateGraphics(g),this.shaderManager.activateShader(f),h.blendFunc(h.ONE,h.ONE_MINUS_SRC_ALPHA),h.uniformMatrix3fv(f.translationMatrix,!1,this.worldTransform.toArray(!0)),h.uniform2f(f.projectionVector,this.projectionX,-this.projectionY),h.uniform2f(f.offsetVector,0,0),h.uniform3fv(f.tintColor,[1,1,1]),h.uniform1f(f.alpha,this.worldAlpha),h.bindBuffer(h.ARRAY_BUFFER,this.graphicsBuffer),h.vertexAttribPointer(f.aVertexPosition,2,h.FLOAT,!1,24,0),h.vertexAttribPointer(f.colorAttribute,4,h.FLOAT,!1,24,8),h.bindBuffer(h.ELEMENT_ARRAY_BUFFER,this.graphicsIndexBuffer),h.drawElements(h.TRIANGLE_STRIP,this.graphicsIndices.length,h.UNSIGNED_SHORT,0),this.shaderManager.activateShader(this.shaderManager.defaultShader)},c.prototype.updateGraphics=function(f){var g=this.gl;this.buildRectangle(f),g.bindBuffer(g.ARRAY_BUFFER,this.graphicsBuffer),g.bufferData(g.ARRAY_BUFFER,new Float32Array(this.graphicsPoints),g.STATIC_DRAW),g.bindBuffer(g.ELEMENT_ARRAY_BUFFER,this.graphicsIndexBuffer),g.bufferData(g.ELEMENT_ARRAY_BUFFER,new Uint16Array(this.graphicsIndices),g.STATIC_DRAW)},c.prototype.buildRectangle=function(g){var k=g.x,f=g.y,m=g.w;g=g.h;var j=this.graphicsPoints,l=this.graphicsIndices,h=j.length/6;j.push(k,f),j.push(0,0,0,1),j.push(k+m,f),j.push(0,0,0,1),j.push(k,f+g),j.push(0,0,0,1),j.push(k+m,f+g),j.push(0,0,0,1),l.push(h,h,h+1,h+2,h+3,h+3)},c.blendModesWebGL={},c}(a.RendererContext);a.WebGLRenderer=b,b.prototype.__class__="egret.WebGLRenderer"}(egret||(egret={}));~function(a){var b=function(){function c(){}return c.compileProgram=function(g,d,h){h=c.compileFragmentShader(g,h),d=c.compileVertexShader(g,d);var f=g.createProgram();return g.attachShader(f,d),g.attachShader(f,h),g.linkProgram(f),g.getProgramParameter(f,g.LINK_STATUS)||console.log("无法初始化着色器"),f},c.compileFragmentShader=function(f,d){return c._compileShader(f,d,f.FRAGMENT_SHADER)},c.compileVertexShader=function(f,d){return c._compileShader(f,d,f.VERTEX_SHADER)},c._compileShader=function(f,g,d){return d=f.createShader(d),f.shaderSource(d,g),f.compileShader(d),f.getShaderParameter(d,f.COMPILE_STATUS)?d:(console.log(f.getShaderInfoLog(d)),null)},c.checkCanUseWebGL=function(){if(void 0==c.canUseWebGL){try{var f=document.createElement("canvas");c.canUseWebGL=!(!window.WebGLRenderingContext||!f.getContext("webgl")&&!f.getContext("experimental-webgl"))}catch(d){c.canUseWebGL=!1}}return c.canUseWebGL},c}();a.WebGLUtils=b,b.prototype.__class__="egret.WebGLUtils"}(egret||(egret={})),function(b){var c=function(){function e(f){this.maxAttibs=10,this.attribState=[],this.tempAttribState=[];for(var g=0;g<this.maxAttibs;g++){this.attribState[g]=!1}this.setContext(f)}return e.prototype.setContext=function(f){this.gl=f,this.primitiveShader=new d(f),this.defaultShader=new a(f),this.activateShader(this.defaultShader)},e.prototype.activateShader=function(f){this.gl.useProgram(f.program),this.setAttribs(f.attributes)},e.prototype.setAttribs=function(g){var h,f;for(f=this.tempAttribState.length,h=0;f>h;h++){this.tempAttribState[h]=!1}for(f=g.length,h=0;f>h;h++){this.tempAttribState[g[h]]=!0}for(g=this.gl,f=this.attribState.length,h=0;f>h;h++){this.attribState[h]!==this.tempAttribState[h]&&(this.attribState[h]=this.tempAttribState[h],this.tempAttribState[h]?g.enableVertexAttribArray(h):g.disableVertexAttribArray(h))}},e}();b.WebGLShaderManager=c,c.prototype.__class__="egret.WebGLShaderManager";var a=function(){function f(e){this.defaultVertexSrc="attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec2 aColor;\nuniform vec2 projectionVector;\nuniform vec2 offsetVector;\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nconst vec2 center = vec2(-1.0, 1.0);\nvoid main(void) {\n gl_Position = vec4( ((aVertexPosition + offsetVector) / projectionVector) + center , 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n vec3 color = mod(vec3(aColor.y/65536.0, aColor.y/256.0, aColor.y), 256.0) / 256.0;\n vColor = vec4(color * aColor.x, aColor.x);\n}",this.program=null,this.fragmentSrc="precision lowp float;\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nuniform sampler2D uSampler;\nvoid main(void) {\n gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;\n}",this.gl=e,this.init()}return f.prototype.init=function(){var h=this.gl,g=b.WebGLUtils.compileProgram(h,this.defaultVertexSrc,this.fragmentSrc);h.useProgram(g),this.uSampler=h.getUniformLocation(g,"uSampler"),this.projectionVector=h.getUniformLocation(g,"projectionVector"),this.offsetVector=h.getUniformLocation(g,"offsetVector"),this.dimensions=h.getUniformLocation(g,"dimensions"),this.aVertexPosition=h.getAttribLocation(g,"aVertexPosition"),this.aTextureCoord=h.getAttribLocation(g,"aTextureCoord"),this.colorAttribute=h.getAttribLocation(g,"aColor"),-1===this.colorAttribute&&(this.colorAttribute=2),this.attributes=[this.aVertexPosition,this.aTextureCoord,this.colorAttribute],this.program=g},f}();b.EgretShader=a,a.prototype.__class__="egret.EgretShader";var d=function(){function f(e){this.alpha=this.translationMatrix=this.attributes=this.colorAttribute=this.aVertexPosition=this.tintColor=this.offsetVector=this.projectionVector=this.program=null,this.fragmentSrc="precision mediump float;\nvarying vec4 vColor;\nvoid main(void) {\n gl_FragColor = vColor;\n}",this.vertexSrc="attribute vec2 aVertexPosition;\nattribute vec4 aColor;\nuniform mat3 translationMatrix;\nuniform vec2 projectionVector;\nuniform vec2 offsetVector;\nuniform float alpha;\nuniform vec3 tint;\nvarying vec4 vColor;\nvoid main(void) {\n vec3 v = translationMatrix * vec3(aVertexPosition , 1.0);\n v -= offsetVector.xyx;\n gl_Position = vec4( v.x / projectionVector.x -1.0, v.y / -projectionVector.y + 1.0 , 0.0, 1.0);\n vColor = aColor * vec4(tint * alpha, alpha);\n}",this.gl=e,this.init()}return f.prototype.init=function(){var h=this.gl,g=b.WebGLUtils.compileProgram(h,this.vertexSrc,this.fragmentSrc);h.useProgram(g),this.projectionVector=h.getUniformLocation(g,"projectionVector"),this.offsetVector=h.getUniformLocation(g,"offsetVector"),this.tintColor=h.getUniformLocation(g,"tint"),this.aVertexPosition=h.getAttribLocation(g,"aVertexPosition"),this.colorAttribute=h.getAttribLocation(g,"aColor"),this.attributes=[this.aVertexPosition,this.colorAttribute],this.translationMatrix=h.getUniformLocation(g,"translationMatrix"),this.alpha=h.getUniformLocation(g,"alpha"),this.program=g},f}();b.PrimitiveShader=d,d.prototype.__class__="egret.PrimitiveShader"}(egret||(egret={})),__extends=this.__extends||function(b,c){function a(){this.constructor=b}for(var d in c){c.hasOwnProperty(d)&&(b[d]=c[d])}a.prototype=c.prototype,b.prototype=new a},function(a){var b=function(d){function c(){d.call(this)}return __extends(c,d),c.prototype.proceed=function(j){function f(){a.IOErrorEvent.dispatchIOErrorEvent(j)}function l(){switch(j.dataFormat){case a.URLLoaderDataFormat.TEXT:j.data=k.responseText;break;case a.URLLoaderDataFormat.VARIABLES:j.data=new a.URLVariables(k.responseText);break;case a.URLLoaderDataFormat.BINARY:j.data=k.response;break;default:j.data=k.responseText}a.callLater(a.Event.dispatchEvent,a.Event,j,a.Event.COMPLETE)}if(j.dataFormat==a.URLLoaderDataFormat.TEXTURE){this.loadTexture(j)}else{if(j.dataFormat==a.URLLoaderDataFormat.SOUND){this.loadSound(j)}else{var h=j._request,k=this.getXHR();k.onerror=f,k.onload=l;var g=a.NetContext._getUrl(h);k.open(h.method,g,!0),this.setResponseType(k,j.dataFormat),h.method!=a.URLRequestMethod.GET&&h.data?h.data instanceof a.URLVariables?(k.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),k.send(h.data.toString())):(k.setRequestHeader("Content-Type","multipart/form-data"),k.send(h.data)):k.send()}}},c.prototype.loadSound=function(h){function f(e){window.clearTimeout(g.__timeoutId),g.removeEventListener("canplaythrough",f,!1),g.removeEventListener("error",j,!1),e=new a.Sound,e._setAudio(g),h.data=e,a.callLater(a.Event.dispatchEvent,a.Event,h,a.Event.COMPLETE)}function j(){window.clearTimeout(g.__timeoutId),g.removeEventListener("canplaythrough",f,!1),g.removeEventListener("error",j,!1),a.IOErrorEvent.dispatchIOErrorEvent(h)}try{var g=new Audio(h._request.url);g.__timeoutId=window.setTimeout(f,100),g.addEventListener("canplaythrough",f,!1),g.addEventListener("error",j,!1),g.load()}catch(h){}},c.prototype.getXHR=function(){return window.XMLHttpRequest?new window.XMLHttpRequest:new ActiveXObject("MSXML2.XMLHTTP")},c.prototype.setResponseType=function(g,f){switch(f){case a.URLLoaderDataFormat.TEXT:case a.URLLoaderDataFormat.VARIABLES:g.responseType=a.URLLoaderDataFormat.TEXT;break;case a.URLLoaderDataFormat.BINARY:g.responseType="arraybuffer";break;default:g.responseType=f}},c.prototype.loadTexture=function(g){var f=g._request,h=new Image;h.crossOrigin="Anonymous",h.onload=function(e){h.onerror=null,h.onload=null,e=new a.Texture,e._setBitmapData(h),g.data=e,a.callLater(a.Event.dispatchEvent,a.Event,g,a.Event.COMPLETE)},h.onerror=function(){h.onerror=null,h.onload=null,a.IOErrorEvent.dispatchIOErrorEvent(g)},h.src=f.url},c}(a.NetContext);a.HTML5NetContext=b,b.prototype.__class__="egret.HTML5NetContext"}(egret||(egret={})),__extends=this.__extends||function(b,c){function a(){this.constructor=b}for(var d in c){c.hasOwnProperty(d)&&(b[d]=c[d])}a.prototype=c.prototype,b.prototype=new a},function(a){var b=function(d){function c(e){d.call(this),this.canvas=e,this._isTouchDown=!1}return __extends(c,d),c.prototype.prevent=function(e){e.stopPropagation(),1!=e.isScroll&&e.preventDefault()},c.prototype.run=function(){var f=this;window.navigator.msPointerEnabled?(document.body.addEventListener("MSPointerDown",function(e){f._onTouchBegin(e),f.prevent(e)},!1),document.body.addEventListener("MSPointerMove",function(e){f._onTouchMove(e),f.prevent(e)},!1),document.body.addEventListener("MSPointerUp",function(e){f._onTouchEnd(e),f.prevent(e)},!1)):a.MainContext.deviceType==a.MainContext.DEVICE_MOBILE?this.addTouchListener():a.MainContext.deviceType==a.MainContext.DEVICE_PC&&(this.addTouchListener(),this.addMouseListener()),window.addEventListener("mousedown",function(e){f.inOutOfCanvas(e)?f.dispatchLeaveStageEvent():f._isTouchDown=!0}),window.addEventListener("mouseup",function(e){f._isTouchDown&&f.inOutOfCanvas(e)&&f.dispatchLeaveStageEvent(),f._isTouchDown=!1})},c.prototype.addMouseListener=function(){var e=this;document.body.addEventListener("mousedown",function(f){e._onTouchBegin(f)}),document.body.addEventListener("mousemove",function(f){e._onTouchMove(f)}),document.body.addEventListener("mouseup",function(f){e._onTouchEnd(f)})},c.prototype.addTouchListener=function(){var e=this;document.body.addEventListener("touchstart",function(g){for(var f=g.changedTouches.length,h=0;f>h;h++){e._onTouchBegin(g.changedTouches[h])}e.prevent(g)},!1),document.body.addEventListener("touchmove",function(g){for(var f=g.changedTouches.length,h=0;f>h;h++){e._onTouchMove(g.changedTouches[h])}e.prevent(g)},!1),document.body.addEventListener("touchend",function(g){for(var f=g.changedTouches.length,h=0;f>h;h++){e._onTouchEnd(g.changedTouches[h])}e.prevent(g)},!1),document.body.addEventListener("touchcancel",function(g){for(var f=g.changedTouches.length,h=0;f>h;h++){e._onTouchEnd(g.changedTouches[h])}e.prevent(g)},!1)},c.prototype.inOutOfCanvas=function(e){return e=this.getLocation(this.canvas,e),0>e.x||0>e.y||e.x>this.canvas.width||e.y>this.canvas.height?!0:!1},c.prototype.dispatchLeaveStageEvent=function(){a.MainContext.instance.stage.dispatchEventWith(a.Event.LEAVE_STAGE)},c.prototype._onTouchBegin=function(g){var h=this.getLocation(this.canvas,g),f=-1;g.hasOwnProperty("identifier")&&(f=g.identifier),this.onTouchBegan(h.x,h.y,f)},c.prototype._onTouchMove=function(g){var h=this.getLocation(this.canvas,g),f=-1;g.hasOwnProperty("identifier")&&(f=g.identifier),this.onTouchMove(h.x,h.y,f)},c.prototype._onTouchEnd=function(g){var h=this.getLocation(this.canvas,g),f=-1;g.hasOwnProperty("identifier")&&(f=g.identifier),this.onTouchEnd(h.x,h.y,f)},c.prototype.getLocation=function(k,g){var m,j,l=document.documentElement,h=window;"function"==typeof k.getBoundingClientRect?(j=k.getBoundingClientRect(),m=j.left,j=j.top):j=m=0,m+=h.pageXOffset-l.clientLeft,j+=h.pageYOffset-l.clientTop,null!=g.pageX?(l=g.pageX,h=g.pageY):(m-=document.body.scrollLeft,j-=document.body.scrollTop,l=g.clientX,h=g.clientY);var f=a.Point.identity;return f.x=(l-m)/a.StageDelegate.getInstance().getScaleX(),f.y=(h-j)/a.StageDelegate.getInstance().getScaleY(),f},c}(a.TouchContext);a.HTML5TouchContext=b,b.prototype.__class__="egret.HTML5TouchContext"}(egret||(egret={}));var ButtonControl=function(){function a(){}return a.init=function(b){b.touchEnabled=!0,b.addEventListener(egret.TouchEvent.TOUCH_END,this.onMouseHandlerStage,this)},a.onMouseHandlerStage=function(){0==a.d&&(a.fucker.y+=3,a.d=!0)},a.ffff=function(b,c){b.touchEnabled=!0,b.addEventListener(egret.TouchEvent.TOUCH_BEGIN,this.onMouseHandler1,c),b.addEventListener(egret.TouchEvent.TOUCH_END,this.onMouseHandler2,c)},a.dis=function(b){b.alpha=0.5},a.can=function(b){b.alpha=1},a.onMouseHandler1=function(b){a.d=!1,b=b.currentTarget,a.fucker=b,b.y-=3},a.onMouseHandler2=function(b){b=b.currentTarget,0==a.d&&(b.y+=3,a.d=!0)},a.createBitmapByName=function(b){var c=new egret.Bitmap;return b=RES.getRes(b),c.texture=b,c},a.showMsg=function(c,f,b,h,d){"undefined"==typeof d&&(d=!0);var g=new egret.TextField;f.addChild(g),g.size=25,g.y=h,g.x=-40+b,0>g.x&&(g.x=0),350<g.x&&(g.x=350),g.width=150,g.height=40,g.touchEnabled=!1,g.bold=!0,g.textAlign="center",g.textColor=0==d?16711680:39168,g.text=c,g.stroke=3,g.strokeColor=16777215,egret.Tween.get(g).to({y:h-50},800).call(function(){f.removeChild(g)},this),console.log("tipppppp")},a.d=!0,a.broken=!1,a.isMovie=!1,a}();ButtonControl.prototype.__class__="ButtonControl";var __extends=this.__extends||function(b,c){function a(){this.constructor=b}for(var d in c){c.hasOwnProperty(d)&&(b[d]=c[d])}a.prototype=c.prototype,b.prototype=new a},TimeBar=function(a){function b(){a.call(this),this.isPlaying=this.outTime=!1,this.canclick=!0,this.createView(),this.tk=new egret.Sound,this.tk=RES.getRes("tk")}return __extends(b,a),b.prototype.onTick=function(c){this.isPlaying&&(this.nowTimer=(new Date).getTime(),c=this.nowTimer-this.startTimer,this.infoText.text=(this.num-parseInt((c/1000).toString())).toString(),this.kuai.visible=10>parseInt(this.infoText.text)?!0:!1,0>=this.num-parseInt((c/1000).toString())&&this.over())},b.prototype.addTime=function(c){this.num+=c},b.prototype.createView=function(){this.time=ButtonControl.createBitmapByName("timeMc");var c=RES.getRes("hongdata"),d=RES.getRes("hong");this.kuai=new egret.MovieClip(c,d),this.kuai.gotoAndPlay("hong"),this.kuai.visible=!1,this.kuai.frameRate=4,this.kuai.addEventListener("play",this.onPlay,this),c=RES.getRes("yangjingdata"),d=RES.getRes("yangjing"),this.yangjing=new egret.MovieClip(c,d),this.yangjing.gotoAndStop("yanjing"),this.yangjing.addEventListener("end",this.onEnd,this),this.yangjing.touchEnabled=!0,this.yangjing.frameRate=5,this.addChild(this.kuai),this.addChild(this.time),this.addChild(this.yangjing),this.yangjing.scaleX=this.yangjing.scaleY=0.85,this.kuai.x=251.05,this.kuai.y=17,this.time.x=370,this.time.y=652,this.yangjing.x=73,this.yangjing.y=676,this.infoText=new egret.TextField,this.infoText.text="60",this.infoText.textColor=16777215,this.infoText.size=40,this.infoText.x=405,this.infoText.y=654,this.infoText.textAlign="center",this.infoText.height=44,this.infoText.width=94,this.infoText.touchEnabled=!1,this.infoText.bold=!0,this.addChild(this.infoText)},b.prototype.stop=function(){this.isPlaying=!1,this.removeEventListener(egret.Event.ENTER_FRAME,this.onTick,this)},b.prototype.over=function(){this.time.visible=!1,this.infoText.visible=!1,this.kuai.visible=!1,this.stop(),this.dispatchEvent(new egret.Event("时间到"))},b.prototype.start=function(c){this.num=c,this.isPlaying=!0,this.startTimer=(new Date).getTime(),this.addEventListener(egret.Event.ENTER_FRAME,this.onTick,this),this.infoText.visible=!0},b.prototype.onEnd=function(){this.canclick=!0,this.yangjing.gotoAndStop("yanjing")},b.prototype.onPlay=function(){this.kuai.visible},b}(egret.Sprite);TimeBar.prototype.__class__="TimeBar";var __extends=this.__extends||function(b,c){function a(){this.constructor=b}for(var d in c){c.hasOwnProperty(d)&&(b[d]=c[d])}a.prototype=c.prototype,b.prototype=new a},TipMc=function(a){function b(){a.call(this),this.createView()}return __extends(b,a),b.prototype.createView=function(){var c=ButtonControl.createBitmapByName("tip");this.addChild(c),c.x=-150,c.y=-120,this.textField=new egret.TextField,this.addChild(this.textField),this.textField.size=40,this.textField.y=-60,this.textField.x=-130,this.textField.width=250,this.textField.height=100,this.textField.bold=!0,this.textField.textAlign="center",this.textField.textColor=16711680,this.textField.text="资源加载中..."},b.prototype.setText=function(c){this.textField.text=c},b}(egret.Sprite);TipMc.prototype.__class__="TipMc";var CutTuControl=function(){function a(){}return a.initTu=function(b){a.tu=new egret.SpriteSheet(RES.getRes(b)),a.name=b},a.createPartBitmapByNum=function(d){var b=new egret.Bitmap,f=(d-1)%14*70,c=70*parseInt(((d-1)/14).toString()),f=a.tu.createTexture(a.name,f,c,70,70);return b.texture=f,b.name=d.toString(),b},a}();CutTuControl.prototype.__class__="CutTuControl";var __extends=this.__extends||function(b,c){function a(){this.constructor=b}for(var d in c){c.hasOwnProperty(d)&&(b[d]=c[d])}a.prototype=c.prototype,b.prototype=new a},LoadingUI=function(a){function b(){a.call(this),this.createView()}return __extends(b,a),b.prototype.createView=function(){this.textField=new egret.TextField,this.addChild(this.textField),this.textField.y=320,this.textField.x=120,this.textField.width=480,this.textField.height=100,this.textField.textColor=16777215,this.textField.text="资源加载中..."},b.prototype.change=function(){this.textField.textColor=0},b.prototype.setProgress=function(c,d){btGame.gameLoading(c/d);this.textField.text="资源加载中..."+c+"/"+d},b}(egret.Sprite);LoadingUI.prototype.__class__="LoadingUI";var PEIZHI_DATA=function(){function a(){}return a.placeData=[[2118.1,259.65,50,50],[1957.25,588.1,55,55],[1891.75,566.6,60,60],[1888.3,481.15,65,65],[1791.75,580.6,70,70],[1959.75,500.6,50,50],[1880.8,398.25,60,60],[50.2,196.5,50,50],[1805.3,484.1,55,55],[1831.75,285.65,60,60],[1960.25,392.2,65,65],[1469.9,343.5,70,70],[1700.7,575.95,50,50],[1931.7,307.65,60,60],[1639.35,394.15,65,65],[2049.95,392.6,70,70],[1461.3,550.1,55,55],[1614.8,585.6,60,60],[1176.4,307.15,65,65],[1227.9,386.6,70,70],[1674.8,499.6,60,60],[1352.4,310.15,65,65],[1453.8,441.6,70,70],[1650.7,295.7,50,50],[1720.25,425.15,55,55],[1543.8,400.65,60,60],[2033.05,233.25,70,70],[1801.75,360.6,50,50],[2124.95,361.55,60,60],[1305.85,489.65,70,70],[1303.35,582.1,65,65],[1387,596.6,50,50],[1303.85,397.6,60,60],[1134.35,517.1,65,65],[398.95,302.65,70,70],[1376.9,403.65,50,50],[1208.35,591.1,55,55],[2050.5,583.1,65,65],[1479.9,115.95,50,50],[994.85,585.6,60,60],[928.45,311.15,65,65],[1107.35,322.15,55,55],[1152.85,443.65,60,60],[1049.35,517.1,65,65],[735.95,325.65,70,70],[876.95,590.6,50,50],[965.35,216.15,55,55],[769.95,582.6,60,60],[135.2,577.6,70,70],[796.95,508.6,50,50],[587.95,579.6,60,60],[714.45,513.1,65,65],[886.95,137.5,70,70],[721.95,409.65,50,50],[1074,227.65,60,60],[683.5,204.15,65,65],[618,521.6,50,50],[829.95,421.65,60,60],[783.35,126,65,65],[314.95,287.65,50,50],[762.85,228.65,60,60],[450.45,115.45,65,65],[310.95,215.65,70,70],[545.1,357.65,50,50],[678.5,111.15,55,55],[416.35,454.1,65,65],[503,575.6,70,70],[303.45,354.15,55,55],[317.95,576.6,60,60],[407.45,578.1,65,65],[50.95,569.6,70,70],[221.6,214,55,55],[145.2,465.6,60,60],[161.6,133.15,65,65],[401.95,202.65,60,60],[1946.25,221,65,65],[229.1,297.65,70,70],[1947.25,120.45,55,55],[1746.75,118.5,60,60],[1855.3,133.15,65,65],[2041.8,318.65,50,50],[142.7,214.15,55,55],[1354.9,208.5,60,60],[231.6,568.45,65,65],[355.95,125.65,50,50],[1499.5,200.4,55,55],[1365.4,123.45,65,65],[1285.95,127.95,70,70],[1734.8,323.65,60,60],[1551.8,300.65,50,50],[1523.3,485.1,55,55],[142.7,293.2,55,55],[1384.8,513.6,60,60],[2119.95,134.95,70,70],[1600.25,500.1,55,55],[1535.3,585.1,65,65],[1217.9,488.6,50,50],[1165.9,225.65,60,60],[948.45,514.1,65,65],[2118.1,474.6,50,50],[1259.8,287.65,60,60],[2036,489.6,70,70],[981.35,410.15,55,55],[1020.35,318.15,55,55],[858.85,223.65,70,70],[1432.4,251.15,55,55],[858.35,523.1,55,55],[1114,591.6,50,50],[53.7,476.15,55,55],[840.45,307.15,65,65],[2033.75,132.65,50,50],[620.5,281,55,55],[647.5,359.2,65,65],[976.35,128.15,65,65],[450.45,376.15,65,65],[488.95,192.65,70,70],[500.5,280.15,65,65],[139.2,378.65,70,70],[52.7,121,55,55],[369.95,387.6,60,60],[578,422.6,50,50],[589.4,214.15,55,55],[508,483.65,60,60],[336.45,472.1,55,55],[43.95,378.65,50,50],[563,128.5,60,60],[1760.7,205.5,70,70],[1429.9,175.9,50,50],[1683.25,205.95,65,65],[42.2,290.65,70,70],[1584.1,208.15,55,55],[1573.1,126,65,65],[276.6,123.15,55,55],[1658.75,123.5,50,50],[1069,125.95,60,60],[245.6,419.15,55,55],[253,487.6,50,50],[1168.4,133.15,65,65],[1265,208.5,60,60],[1847.8,213.5,50,50],[651,445.6,50,50],[674.45,594.1,55,55],[898.85,410.55,50,50],[2131.95,573.6,50,50],[1071.5,414.1,65,65]],a.wupindata=[["鱼","眼睛","动物","尾巴","食物"],["鱼","眼睛","动物","尾巴","食物"],["鱼","眼睛","动物","尾巴","食物"],["鱼","眼睛","动物","尾巴","食物"],["鱼","眼睛","动物","尾巴","食物"],["手机"],["手机"],["鞋子"],["鞋子"],["鞋子"],["鞋子"],["手机"],["手机","叶子","草莓","水果","甜的东西"],["帽子"],["帽子"],["帽子"],["帽子"],["帽子"],["帽子"],["瓶子"],["瓶子"],["瓶子"],["花","叶子","植物"],["花","叶子","植物"],["花","叶子","植物"],["瓶子"],["瓶子"],["瓶子","花","叶子","植物"],["花","叶子","植物"],["瓶子","花","叶子","植物"],["瓶子","花","叶子","植物"],["发光的东西","灯泡"],["发光的东西","电器","台灯","星星"],["发光的东西","火","蜡烛"],["书本"],["包包"],["包包"],["包包"],["包包"],["书本"],["书本"],["镜子","爱心"],["镜子"],["镜子"],["口红"],["口红"],["口红"],["口红"],["口红"],["镜子","口红"],["包包"],["瓶子"],["瓶子"],["瓶子"],["瓶子"],["礼物盒"],["礼物盒"],["礼物盒"],["礼物盒"],["礼物盒"],["大便","眼睛"],["望远镜"],["武器"],["眼镜"],["眼镜"],["蔬菜","叶子","植物","食物"],["水桶"],["浇水壶"],["皇冠"],["爱心"],["鸡腿","食物"],["眼镜"],["眼镜"],["眼镜"],["爱心","字母"],["袜子"],["甜的东西","食物"],["甜的东西","食物","棒棒糖"],["甜的东西","食物","水果","叶子","草莓"],["食物","餐具"],["戒指"],["武器"],["食物","水果","叶子","甜的东西"],["武器"],["戒指"],["动物","尾巴","眼睛"],["房子","云"],["月亮","星星","发光的东西"],["乐器"],["笔"],["笔"],["钥匙"],["钥匙"],["乐符"],["乐符"],["照相机"],["照相机"],["照相机"],["照相机"],["收音机"],["收音机"],["笔"],["汽车","交通工具"],["交通工具"],["汽车","交通工具"],["望远镜"],["戒指"],["地球仪"],["梳子"],["钥匙"],["计算器"],["爱心"],["爱心"],["手套","星星"],["甜的东西","食物","棒棒糖"],["雨伞"],["雨伞"],["杯子"],["奖杯"],["奖杯"],["发光的东西","闪电"],["星星","发光的东西"],["星星","发光的东西"],["火","发光的东西"],["餐具","食物","甜的东西"],["尾巴","食物","动物","眼睛"],["星星","篮子"],["浇水壶"],["云"],["动物","螃蟹","食物","眼睛"],["武器"],["数字"],["字母"],["字母"],["字母"],["字母"],["字母"],["字母"],["字母"],["字母"],["字母"],["甜的东西","食物","爱心","棒棒糖"],["字母"],["字母"],["字母"],["字母"],["字母"],["字母"],["字母"],["字母"],["字母"],["字母"],["字母"],["字母"],["字母"],["字母"],["字母"],["火舞"],["火舞"],["书本"],["书本"],["数字"],["数字"],["数字"],["时钟"],["时钟"],["时钟"],["时钟"],["时钟"],["时钟"],["皇冠"],["水桶"],["云"],["火","发光的东西"],["火","发光的东西"],["火","发光的东西"],["篮子"],"篮子 水果 苹果 食物 甜的东西 香蕉".split(" "),["房子"],["房子","星星","发光的东西"],["武器"],["西瓜","水果","食物","甜的东西"],["西瓜","水果","食物","甜的东西"],["西瓜","水果","食物","甜的东西"],"苹果 水果 眼睛 叶子 食物 甜的东西".split(" "),"苹果 水果 眼睛 叶子 食物 甜的东西".split(" "),"苹果 水果 眼睛 叶子 牙齿 食物 甜的东西 笑脸".split(" "),"苹果 水果 眼睛 叶子 食物 甜的东西".split(" "),["苹果","水果","叶子","食物","甜的东西"],["苹果","水果","叶子","食物","甜的东西"],["水果","叶子","食物","甜的东西"],"草莓 水果 眼睛 叶子 牙齿 食物 甜的东西 笑脸".split(" "),"草莓 水果 眼睛 叶子 牙齿 食物 甜的东西".split(" "),"草莓 水果 叶子 牙齿 食物 甜的东西 笑脸".split(" "),["水果","叶子","食物","甜的东西"],["交通工具","尾巴"],["交通工具","尾巴"],["交通工具","汽车"],["交通工具","汽车"],["交通工具","汽车"],["交通工具","自行车"],"草莓 水果 眼睛 叶子 食物 甜的东西 笑脸".split(" "),"草莓 水果 眼睛 叶子 食物 甜的东西".split(" "),["树木","植物","叶子"],["树木","植物","叶子"],["树木","植物","叶子"],["树木","植物","叶子"],["树木","植物","叶子"],["乐器"],["爱心"],["爱心"],["爱心"],["云"],["云","发光的东西","闪电"],["云"],["乐器"],["甜的东西","食物","水果","叶子","草莓"],["武器"],["电器","发光的东西","插头","台灯"],["发光的东西","云"],["武器"],["乐器"],["电器"],["尾巴","眼睛","动物"],["乐器"],["电器","插头"],["电器"],["植物","水果","叶子","甜的东西","食物"],["自行车","交通工具"]],a}();PEIZHI_DATA.prototype.__class__="PEIZHI_DATA";var __extends=this.__extends||function(b,c){function a(){this.constructor=b}for(var d in c){c.hasOwnProperty(d)&&(b[d]=c[d])}a.prototype=c.prototype,b.prototype=new a},Sceen1=function(a){function b(){a.call(this),this.btn1s=new egret.Sprite,this.btn2s=new egret.Sprite,this.btn3s=new egret.Sprite,this.createView()}return __extends(b,a),b.prototype.createView=function(){var d=this.createBitmapByName("bg1"),f=this.createBitmapByName("startbtn"),c=this.createBitmapByName("more");this.btn1s.addChild(f),this.btn1s.name="开始",this.addChild(d),this.addChild(this.btn1s),this.addChild(c),this.btn1s.x=159,this.btn1s.y=480,c.x=159,c.y=561,ButtonControl.ffff(this.btn1s,this),this.btn1s.addEventListener(egret.TouchEvent.TOUCH_TAP,this.onMouseHandler,this),ButtonControl.ffff(c,this),c.addEventListener(egret.TouchEvent.TOUCH_TAP,this.onMouseHandler2,this)},b.prototype.onMouseHandler=function(c){"开始"==c.currentTarget.name&&this.dispatchEvent(new egret.Event("开始游戏"))},b.prototype.onMouseHandler2=function(){location.href=btGame.URL.getMoreGame()},b.prototype.createBitmapByName=function(c){var d=new egret.Bitmap;return c=RES.getRes(c),d.texture=c,d},b.prototype.onShare=function(){var c=this.createBitmapByName("sharequan");c.touchEnabled=!0,c.alpha=0.95,this.addChild(c),c.addEventListener(egret.TouchEvent.TOUCH_TAP,this.onBacktoGame,this)},b.prototype.onBacktoGame=function(c){this.removeChild(c.target)},b}(egret.Sprite);Sceen1.prototype.__class__="Sceen1";var __extends=this.__extends||function(b,c){function a(){this.constructor=b}for(var d in c){c.hasOwnProperty(d)&&(b[d]=c[d])}a.prototype=c.prototype,b.prototype=new a},Sceen2=function(a){function b(){a.call(this),this.mark=1,this._number3=this._number2=this._number1=0,this._name3=this._name2=this._name1="",this._nameArr=[],this._highScore=this._score=0,this.createView()}return __extends(b,a),b.prototype.showGame=function(){this.game=new Game(this),this.addChild(this.game),this.game.init(),this.timeBar=new TimeBar,this.timeBar.addEventListener("时间到",this.onOver,this),this.timeBar.start(60),this.tip=new TipMc,this.addChild(this.timeBar),this.timeBar.yangjing.addEventListener(egret.TouchEvent.TOUCH_TAP,this.eyeClick,this),this.createTextView(),localStorage.getItem("highScore")&&(this._highScore=parseInt(localStorage.getItem("highScore"))),this.dateOne(),this.dateTwo(),this.dateThree(),this.upDateOne(),this.upDateTwo(),this.upDateThree(),this.upDateScore()},b.prototype.eyeClick=function(c){1==this.timeBar.canclick&&6<=this.timeBar.num&&(this.timeBar.yangjing.gotoAndPlay("yanjing"),this.timeBar.canclick=!1,c=this.findName(),this.game.quickFind(c),this.timeBar.addTime(-10),ButtonControl.showMsg("时间减10秒",this.stage,this.timeBar.yangjing.x-50,this.timeBar.yangjing.y-50))},b.prototype.findName=function(){var c=this._name1;return this._number1<=this._number2&&this._number1<=this._number3?c=this._name1:this._number2<=this._number1&&this._number2<=this._number3?c=this._name2:this._number3<=this._number2&&this._number3<=this._number1&&(c=this._name3),c},b.prototype.upDateScore=function(){this.scoreTxt.text="分数 "+this._score.toString(),this._score>this._highScore&&(this._highScore=this._score,localStorage.setItem("highScore",this._highScore.toString()))},b.prototype.dateOne=function(){var c=[];do{c=this.game.choseObject(),this._number1=c[0],this._name1=c[1]}while(2>=this._number1||"时钟"==this._name1||"火舞"==this._name1);this._number1-=2,6<this._number1&&(this._number1=6)},b.prototype.dateTwo=function(){var c=[];do{c=this.game.choseObject(),this._number2=c[0],this._name2=c[1]}while(2>=this._number2||"时钟"==this._name2||"火舞"==this._name2);this._number2-=2,6<this._number2&&(this._number2=6)},b.prototype.dateThree=function(){var c=[];do{c=this.game.choseObject(),this._number3=c[0],this._name3=c[1]}while(2>=this._number3||"时钟"==this._name3||"火舞"==this._name3);this._number3-=2,6<this._number3&&(this._number3=6)},b.prototype.upDateOne=function(){this.number1.text=this._number1.toString(),this.name1.text=this._name1},b.prototype.upDateTwo=function(){this.number2.text=this._number2.toString(),this.name2.text=this._name2},b.prototype.upDateThree=function(){this.number3.text=this._number3.toString(),this.name3.text=this._name3},b.prototype.upDateSortName=function(){for(var c=this.game._showNameArr,d=c.length-1;d>=0;){c.splice(d,1),d--}this._number1<=this._number2&&this._number1<=this._number3?c=[this._name2,this._name3,this._name1]:this._number2<=this._number1&&this._number2<=this._number3?c=[this._name1,this._name3,this._name2]:this._number3<=this._number2&&this._number3<=this._number1&&(c=[this._name1,this._name2,this._name3]),this.game._showNameArr=c},b.prototype.checkName=function(d){if(this.upDateSortName(),d==this._name1){if(this._number1--,this.upDateOne(),0>=this._number1){this.upDateNameArr(d),this.dateOne(),this.tip.setText(this._name1+"\nX"+this._number1.toString()),this.addChild(this.tip),this.tip.x=this.stage.stageWidth/2,this.tip.y=this.stage.stageHeight/2,this.tip.scaleX=0,this.tip.scaleY=0,egret.Tween.get(this.tip).to({scaleX:1,scaleY:1},200);var f=this,c=setInterval(function(){f.tipSmall(),clearInterval(c)},2000)}}else{d==this._name2?(this._number2--,this.upDateTwo(),0>=this._number2&&(this.upDateNameArr(d),this.dateTwo(),this.tip.setText(this._name2+"\nX"+this._number2.toString()),this.addChild(this.tip),this.tip.x=this.stage.stageWidth/2,this.tip.y=this.stage.stageHeight/2,this.tip.scaleX=0,this.tip.scaleY=0,egret.Tween.get(this.tip).to({scaleX:1,scaleY:1},200),f=this,c=setInterval(function(){f.tipSmall(),clearInterval(c)},2000))):d==this._name3&&(this._number3--,this.upDateThree(),0>=this._number3&&(this.upDateNameArr(d),this.dateThree(),this.tip.setText(this._name3+"\nX"+this._number3.toString()),this.addChild(this.tip),this.tip.x=this.stage.stageWidth/2,this.tip.y=this.stage.stageHeight/2,this.tip.scaleX=0,this.tip.scaleY=0,egret.Tween.get(this.tip).to({scaleX:1,scaleY:1},200),f=this,c=setInterval(function(){f.tipSmall(),clearInterval(c)},2000)))}},b.prototype.upDateNameArr=function(d){for(var f=this.game._showNameArr,c=f.length-1;c>=0;){if(f[c]==d){f.splice(c,1);break}c--}},b.prototype.createView=function(){var c=ButtonControl.createBitmapByName("bg2");this.addChild(c),this._score=0},b.prototype.onOver=function(d){this.game.over(),d=ButtonControl.createBitmapByName("overbg"),this.addChild(d),d.touchEnabled=!0,this.infoText=new egret.TextField,this.infoText.text=this._score.toString(),this.infoText.textColor=16729088,this.infoText.size=100,this.infoText.x=119.05,this.infoText.y=244,this.infoText.textAlign="center",this.infoText.height=127,this.infoText.width=261,this.infoText.touchEnabled=!1,this.infoText.strokeColor=16777215,this.infoText.bold=!0,this.infoText.stroke=3,this.addChild(this.infoText),d=ButtonControl.createBitmapByName("zailaibtn");var g=ButtonControl.createBitmapByName("xuanyaobtn"),c=ButtonControl.createBitmapByName("fenxiangbtn"),k=ButtonControl.createBitmapByName("more");k.width=155,k.height=58,this.addChild(d),this.addChild(g),this.addChild(c),this.addChild(k),c.x=30,c.y=474,d.x=180,d.y=550,g.x=1177,g.y=550,k.x=280,k.y=474;var f=1,j="";10>this._score?(f=1,j="近视眼"):20>this._score?(f=2,j="水汪汪大眼睛"):35>this._score?(f=3,j="炯炯有神"):50>this._score?(f=4,j="电子监视器"):100>this._score?(f=5,j="显微镜"):150>this._score?(f=6,j="哈雷望眼镜"):300>this._score&&(f=7,j="火眼金睛"),f=ButtonControl.createBitmapByName("chenghao"+f.toString()),this.addChild(f),f.x=(this.stage.stageWidth-f.width)/2,f.y=358,ButtonControl.ffff(d,this),ButtonControl.ffff(g,this),ButtonControl.ffff(c,this),ButtonControl.ffff(k,this),g.addEventListener(egret.TouchEvent.TOUCH_TAP,this.onPai,this),d.addEventListener(egret.TouchEvent.TOUCH_TAP,this.onZailai,this),c.addEventListener(egret.TouchEvent.TOUCH_TAP,this.onFen,this),k.addEventListener(egret.TouchEvent.TOUCH_TAP,this.onMore,this);var h=this._score;btGame.setShare({title:"我在【找你妹】中得到"+h+"分,获得'"+j+"'的称号。快来挑战我吧!"})},b.prototype.onMore=function(){location.href=btGame.URL.getMoreGame()},b.prototype.onFen=function(){btGame.playShareTip()},b.prototype.onFuli=function(){this.dispatchEvent(new egret.Event("开始加载"))},b.prototype.onPai=function(){},b.prototype.onZailai=function(){this.dispatchEvent(new egret.Event("再来"))},b.prototype.tipBig1=function(){console.log("da"),clearInterval(this.mark),egret.Tween.get(this.tip).to({scaleX:0,scaleY:0},200).call(this.tipSmall,this)},b.prototype.tipBig=function(){var c=this,d=setInterval(function(){c.tipSmall(),clearInterval(d)},2000)},b.prototype.tipSmall=function(){this.removeChild(this.tip),this.timeBar.addTime(1),ButtonControl.showMsg("时间增加1秒",this.stage,this.timeBar.time.x,this.timeBar.time.y),this.upDateOne(),this.upDateTwo(),this.upDateThree()},b.prototype.createTextView=function(){this.number1=new egret.TextField,this.number1.textColor=16777215,this.number1.size=35,this.number1.x=127,this.number1.y=10,this.number1.textAlign="center",this.number1.height=40,this.number1.width=40,this.number1.touchEnabled=!1,this.number1.bold=!0,this.addChild(this.number1),this.number2=new egret.TextField,this.number2.textColor=16777215,this.number2.size=35,this.number2.x=294,this.number2.y=10,this.number2.textAlign="center",this.number2.height=40,this.number2.width=40,this.number2.touchEnabled=!1,this.number2.bold=!0,this.addChild(this.number2),this.number3=new egret.TextField,this.number3.textColor=16777215,this.number3.size=35,this.number3.x=460,this.number3.y=10,this.number3.textAlign="center",this.number3.height=40,this.number3.width=40,this.number3.touchEnabled=!1,this.number3.bold=!0,this.addChild(this.number3),this.name1=new egret.TextField,this.name1.textColor=16777215,this.name1.size=25,this.name1.x=2,this.name1.y=12,this.name1.height=32,this.name1.width=132,this.name1.touchEnabled=!1,this.name1.textAlign=egret.HorizontalAlign.RIGHT,this.name1.bold=!0,this.addChild(this.name1),this.name2=new egret.TextField,this.name2.textColor=16777215,this.name2.size=25,this.name2.x=169,this.name2.y=12,this.name2.height=32,this.name2.width=132,this.name2.touchEnabled=!1,this.name2.textAlign=egret.HorizontalAlign.RIGHT,this.name2.bold=!0,this.addChild(this.name2),this.name3=new egret.TextField,this.name3.textColor=16777215,this.name3.size=25,this.name3.x=332,this.name3.y=12,this.name3.height=32,this.name3.width=132,this.name3.touchEnabled=!1,this.name3.textAlign=egret.HorizontalAlign.RIGHT,this.name3.bold=!0,this.addChild(this.name3),this.scoreTxt=new egret.TextField,this.scoreTxt.textColor=16777215,this.scoreTxt.size=38,this.scoreTxt.x=164,this.scoreTxt.y=657,this.scoreTxt.height=40,this.scoreTxt.width=153,this.scoreTxt.touchEnabled=!1,this.scoreTxt.bold=!0,this.addChild(this.scoreTxt),this.scoreTxt.text="分数 "},b}(egret.Sprite);Sceen2.prototype.__class__="Sceen2";var __extends=this.__extends||function(b,c){function a(){this.constructor=b}for(var d in c){c.hasOwnProperty(d)&&(b[d]=c[d])}a.prototype=c.prototype,b.prototype=new a},Game=function(a){function b(d){a.call(this),this.arr=[],this._mcArr=[],this._newMcArr=[],this._nameArr=[],this._showNameArr=[],this._allNameArr=[],this.xxOld=this.xx=this.nandu=0,this.isyidong=this.isDown=!1,this.sceen=d,this.show(),this.rs=new egret.Sound,this.rs={play:function(){}},this.ws=new egret.Sound,this.ws={play:function(){}},d=RES.getRes("cuowudata");var c=RES.getRes("cuowu");this.cuowu=new egret.MovieClip(d,c),this.cuowu.addEventListener("end",this.onEnd,this),this.cuowu.gotoAndStop("cuowu"),this.cuowu.frameRate=18}return __extends(b,a),b.prototype.onEnd=function(){this.cuowu.gotoAndStop("cuowu"),this.removeChild(this.cuowu)},b.prototype.onMouseHandlerOn=function(c){this.isyidong=!1,this.isDown=!0,this.xx=c._stageX,this.xxOld=this.x},b.prototype.onMouseHandlerMove=function(c){this.isDown&&(c=this.xx-c._stageX,this.x=this.xxOld-c,10<Math.abs(c)&&(this.isyidong=!0)),100<this.x&&(this.x=100),this.x<-this.width+this.stage.stageWidth-100&&(this.x=-this.width+this.stage.stageWidth-100)},b.prototype.onMouseHandlerOut=function(){this.isDown=!1,0<this.x&&(this.x=0),this.x<-this.width+this.stage.stageWidth-10&&(this.x=-this.width+this.stage.stageWidth-10),console.log("songkai")},b.prototype.show=function(){this.arr=[],this._mcArr=[],this._newMcArr=[],this._showNameArr=[],this._allNameArr=[],this._nameArr=[],CutTuControl.initTu("wupin");for(var c=1;260>c;c++){this.arr.push(CutTuControl.createPartBitmapByNum(c))}this.createAllMc(),this._circle=ButtonControl.createBitmapByName("yuan")},b.prototype.chuli=function(){for(var c=0;c<PEIZHI_DATA.placeData.length;c++){this.arr[c].width=PEIZHI_DATA.placeData[c][2],this.arr[c].height=PEIZHI_DATA.placeData[c][3],this.arr[c].x=PEIZHI_DATA.placeData[c][0]-0.5*this.arr[c].width,this.arr[c].y=PEIZHI_DATA.placeData[c][1]-0.5*this.arr[c].height,this.addChild(this.arr[c])}},b.prototype.init=function(){console.log(this.stage),this.stage.addEventListener(egret.TouchEvent.TOUCH_BEGIN,this.onMouseHandlerOn,this),this.stage.addEventListener(egret.TouchEvent.TOUCH_MOVE,this.onMouseHandlerMove,this),this.stage.addEventListener(egret.TouchEvent.TOUCH_END,this.onMouseHandlerOut,this)},b.prototype.over=function(){this.stage.removeEventListener(egret.TouchEvent.TOUCH_BEGIN,this.onMouseHandlerOn,this),this.stage.removeEventListener(egret.TouchEvent.TOUCH_MOVE,this.onMouseHandlerMove,this),this.stage.removeEventListener(egret.TouchEvent.TOUCH_END,this.onMouseHandlerOut,this)},b.prototype.createAllMc=function(){var d=PEIZHI_DATA.wupindata.length;console.log(d,"aaaa");for(var f=0;f<PEIZHI_DATA.placeData.length;){var c=Math.floor(d*Math.random());this.createMc(c,PEIZHI_DATA.placeData[f][0],PEIZHI_DATA.placeData[f][1],PEIZHI_DATA.placeData[f][2],PEIZHI_DATA.placeData[f][3]),f++}},b.prototype.createMc=function(d,g,c,h,f){d=CutTuControl.createPartBitmapByNum(d+1),d.width=h,d.height=f,d.x=g-0.5*d.width,d.y=c-0.5*d.height,this._mcArr.push(d),d.touchEnabled=!0,d.addEventListener(egret.TouchEvent.TOUCH_TAP,this.mouseUp,this),this.addChild(d)},b.prototype.getdata=function(c){for(var d=0;d<this.arr.length;d++){if(c.name==this.arr[d].name){return console.log(PEIZHI_DATA.wupindata[d]),PEIZHI_DATA.wupindata[d]}}return null},b.prototype.mouseUp=function(d){var h=[],c=0,k=0,h=0,g=!1,j="xxx";if(1!=this.isyidong){this._circle&&this._circle.parent&&this.removeChild(this._circle);for(var f=this._showNameArr.length-1;f>=0;){for(h=this.getdata(d.target),c=h.length-1;c>=0;){if(this._showNameArr[f]==h[c]||"时钟"==h[c]||"火舞"==h[c]){for(g=!0,j=h[c],this.sceen&&"时钟"!=[c]&&"火舞"!=[c]&&this.sceen.checkName(this._showNameArr[f]),k=this._mcArr.length-1;k>=0;){if(this._mcArr[k].x==d.target.x&&this._mcArr[k].y==d.target.y){this._mcArr[k].removeEventListener(egret.TouchEvent.TOUCH_TAP,this.mouseUp,this),console.log("eeee"),this.tmpMc=this._mcArr[k],this.tmpx=this._mcArr[k].x,this.tmpy=this._mcArr[k].y,this.tmpW=this._mcArr[k].width,this.tmpH=this._mcArr[k].height,egret.Tween.get(this._mcArr[k]).to({scaleX:0,scaleY:0,x:this._mcArr[k].x+0.5*this._mcArr[k].width,y:this._mcArr[k].y+0.5*this._mcArr[k].height},150).call(this.onComplete,this),this._mcArr.splice(k,1);break}k--}}if(g){break}c--}if(g){break}f--}g?(console.log("对了"),"时钟"==j?h=0.8>Math.random()?1+Math.floor(2*Math.random()):3+Math.floor(3*Math.random()):"火舞"==j?h=5:(this.sceen._score++,this.sceen.upDateScore(),h=1),this.sceen.timeBar.addTime(h),ButtonControl.showMsg("时间加"+h.toString()+"秒",this.stage,this.tmpx+this.x,this.tmpy)):(this.cuowu.gotoAndPlay("cuowu"),this.addChild(this.cuowu),console.log("错了"),this.sceen.timeBar.addTime(-6),ButtonControl.showMsg("时间减6秒",this.stage,d.target.x+this.x,d.target.y,!1),this.cuowu.x=d.target.x+0.5*d.target.width,this.cuowu.y=d.target.y+0.5*d.target.height)}},b.prototype.choseObject=function(){for(var d=0,g=[],c=!1,h=0,f=0,d=[],g=0,c=!1,h=0,d=this._newMcArr.length-1;d>=0;){this._newMcArr.splice(d,1),d--}if(this._newMcArr=this._newMcArr.concat(this._mcArr),0!=this._showNameArr.length){for(d=this._newMcArr.length-1;d>=0;){for(g=PEIZHI_DATA.wupindata[parseInt(this._newMcArr[d].name)-1],c=!1,h=this._showNameArr.length-1;h>=0;){for(f=g.length-1;f>=0;){if(this._showNameArr[h]==g[f]){c=!0,this._newMcArr.splice(d,1);break}f--}if(c){break}h--}d--}}for(d=this._nameArr.length-1;d>=0;){this._nameArr.splice(d,1),d--}for(d=this._allNameArr.length-1;d>=0;){this._allNameArr.splice(d,1),d--}for(f=this._newMcArr.length-1;f>=0;){for(d=PEIZHI_DATA.wupindata[parseInt(this._newMcArr[f].name)-1],this._allNameArr=this._allNameArr.concat(d),g=d.length-1;g>=0;){for(c=!1,h=this._nameArr.length-1;h>=0;){if(d[g]==this._nameArr[h]){c=!0;break}h--}0==c&&this._nameArr.push(d[g]),g--}f--}for(c=Math.floor(this._nameArr.length*Math.random()),d=this._nameArr[c],g=0,this._showNameArr.push(this._nameArr[c]),c=this._allNameArr.length-1;c>=0;){this._allNameArr[c]==d&&g++,c--}return c=[],c.push(g,d),c},b.prototype.onComplete=function(c){c=Math.floor(PEIZHI_DATA.wupindata.length*Math.random()),this.createMc(c,this.tmpx+0.5*this.tmpW,this.tmpy+0.5*this.tmpH,this.tmpW,this.tmpH),c=this._mcArr[this._mcArr.length-1].scaleX;var d=this._mcArr[this._mcArr.length-1].scaleY;this._mcArr[this._mcArr.length-1].x+=0.5*this._mcArr[this._mcArr.length-1].width,this._mcArr[this._mcArr.length-1].y+=0.5*this._mcArr[this._mcArr.length-1].height,this._mcArr[this._mcArr.length-1].scaleX=0,this._mcArr[this._mcArr.length-1].scaleY=0,egret.Tween.get(this._mcArr[this._mcArr.length-1]).to({x:this.tmpx,y:this.tmpy,scaleX:c,scaleY:d},200),this.removeChild(this.tmpMc)},b.prototype.quickFind=function(d){for(var f=[],c=0,g=this._mcArr.length-1;g>=0;){for(f=PEIZHI_DATA.wupindata[parseInt(this._mcArr[g].name)-1],c=f.length-1;c>=0;){if(d==f[c]){return this._mcArr[g].width>this._mcArr[g].height?(this._circle.width=this._mcArr[g].width+40,this._circle.height=this._mcArr[g].width+40):(this._circle.width=this._mcArr[g].height+40,this._circle.height=this._mcArr[g].height+40),this._circle.x=this._mcArr[g].x-20,this._circle.y=this._mcArr[g].y-20,this.addChild(this._circle),this.x=320-this._mcArr[g].x,0<this.x&&(this.x=0),void (this.x<-this.width+this.stage.stageWidth&&(this.x=-this.width+this.stage.stageWidth))}c--}g--}},b}(egret.Sprite);Game.prototype.__class__="Game";var __extends=this.__extends||function(b,c){function a(){this.constructor=b}for(var d in c){c.hasOwnProperty(d)&&(b[d]=c[d])}a.prototype=c.prototype,b.prototype=new a},ZhaoNiMei=function(a){function b(){a.call(this),this.mark1=0,this.arr=[],this.addEventListener(egret.Event.ADDED_TO_STAGE,this.onAddToStage,this)}return __extends(b,a),b.prototype.onAddToStage=function(){this.loadingView=new LoadingUI,this.stage.addChild(this.loadingView),RES.addEventListener(RES.ResourceEvent.CONFIG_COMPLETE,this.onConfigComplete,this),RES.loadConfig("resource/resource.json","resource/"),ButtonControl.init(this)},b.prototype.onConfigComplete=function(){RES.removeEventListener(RES.ResourceEvent.CONFIG_COMPLETE,this.onConfigComplete,this),RES.addEventListener(RES.ResourceEvent.GROUP_COMPLETE,this.onResourceLoadComplete,this),RES.addEventListener(RES.ResourceEvent.GROUP_PROGRESS,this.onResourceProgress,this),RES.loadGroup("changjing1")},b.prototype.onResourceLoadComplete=function(c){"changjing1"==c.groupName?(console.log("changjing1"),this.stage.removeChild(this.loadingView),this.createGameScene1()):"changjing2"==c.groupName&&(console.log("changjing2"),this.stage.removeChild(this.loadingView),this.createGameScene2(),RES.loadGroup("sucai3"))},b.prototype.onResourceProgress=function(c){this.loadingView.setProgress(c.itemsLoaded,c.itemsTotal)},b.prototype.createGameScene1=function(){this.sceen1=new Sceen1,this.addChild(this.sceen1),this.sceen1.addEventListener("开始游戏",this.onPlayWhat,this)},b.prototype.createGameScene2=function(){this.sceen2=new Sceen2,this.addChild(this.sceen2),this.sceen2.addEventListener("再来",this.onBackMenu,this),this.sceen2.addEventListener("开始加载",this.onJiaZai,this),console.log("fffff"),this.sceen2.showGame()},b.prototype.onJiaZai=function(){},b.prototype.onBackMenu=function(){this.removeChild(this.sceen2),this.createGameScene1()},b.prototype.onPlayWhat=function(){this.removeChild(this.sceen1),this.sceen2?(console.log("here"),this.createGameScene2()):(this.stage.addChild(this.loadingView),RES.loadGroup("changjing2"))},b}(egret.DisplayObjectContainer);ZhaoNiMei.prototype.__class__="ZhaoNiMei";
|