var egret;(function(e){var t=function(){function e(){this._hashCode=e.hashCount++}Object.defineProperty(e.prototype,"hashCode",{get:function(){return this._hashCode},enumerable:!0,configurable:!0});e.hashCount=1;return e}();e.HashObject=t;t.prototype.__class__="egret.HashObject"})(egret||(egret={}));var __extends=this.__extends||function(e,t){function n(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);n.prototype=t.prototype;e.prototype=new n};(function(e){var t=function(e){function t(t){void 0===t&&(t=300);e.call(this);this.objectPool=[];this._length=0;1>t&&(t=1);this.autoDisposeTime=t;this.frameCount=0}__extends(t,e);t.prototype._checkFrame=function(){this.frameCount--;0>=this.frameCount&&this.dispose()};Object.defineProperty(t.prototype,"length",{get:function(){return this._length},enumerable:!0,configurable:!0});t.prototype.push=function(e){var n=this.objectPool;-1==n.indexOf(e)&&(n.push(e),this._length++,0==this.frameCount&&(this.frameCount=this.autoDisposeTime,t._callBackList.push(this)))};t.prototype.pop=function(){if(0==this._length)return null;this._length--;return this.objectPool.pop()};t.prototype.dispose=function(){0=this._maxDeltaTime){t=(this._preDrawCount-1).toString();var n=Math.ceil(this._logicPerformanceCost).toString()+","+Math.ceil(this._updateTransformPerformanceCost).toString()+","+Math.ceil(this._renderPerformanceCost).toString()+","+Math.ceil(e.MainContext.instance.rendererContext.renderCost).toString();this._txt.text="draw:"+t+"\ncost:"+n+"\nFPS:"+Math.floor(1e3*this._tick/this._totalDeltaTime).toString();this._tick=this._totalDeltaTime=0}this._preDrawCount=0};t.prototype.onDrawImage=function(){this._preDrawCount++};return t}();e.Profiler=t;t.prototype.__class__="egret.Profiler"})(egret||(egret={}));__extends=this.__extends||function(e,t){function n(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);n.prototype=t.prototype;e.prototype=new n};(function(e){var t=function(t){function n(){t.apply(this,arguments);this._timeScale=1;this._paused=!1;this.callBackList=[]}__extends(n,t);n.prototype.run=function(){e.__START_TIME=(new Date).getTime();e.MainContext.instance.deviceContext.executeMainLoop(this.update,this)};n.prototype.update=function(e){var t=this.callBackList.concat(),n=t.length;e*=this._timeScale;e*=this._timeScale;for(var r=0;rthis.delay&&(this.lastTime=t,this._currentCount++,e.TimerEvent.dispatchTimerEvent(this,e.TimerEvent.TIMER),0=this.repeatCount&&(this.stop(),e.TimerEvent.dispatchTimerEvent(this,e.TimerEvent.TIMER_COMPLETE)))};return n}(e.EventDispatcher);e.Timer=t;t.prototype.__class__="egret.Timer"})(egret||(egret={}));(function(e){function t(e){e=e.prototype?e.prototype:e.__proto__;if(e.hasOwnProperty("__class__"))return e.__class__;var t=e.constructor.toString(),n=t.indexOf("("),t=t.substring(9,n);Object.defineProperty(e,"__class__",{value:t,enumerable:!1,writable:!0});return t}e.getQualifiedClassName=t;e.getQualifiedSuperclassName=function(e){e=e.prototype?e.prototype:e.__proto__;if(e.hasOwnProperty("__superclass__"))return e.__superclass__;var n=Object.getPrototypeOf(e);if(null==n)return null;n=t(n.constructor);if(!n)return null;Object.defineProperty(e,"__superclass__",{value:n,enumerable:!1,writable:!0});return n}})(egret||(egret={}));(function(e){var t={};e.getDefinitionByName=function(e){if(!e)return null;var n=t[e];if(n)return n;for(var r=e.split("."),i=r.length,n=__global,s=0;s=r.delay&&(r.listener.apply(r.thisObject,r.params),delete n[t])}}var n={},r=0;e.setTimeout=function(i,s,o){for(var u=[],f=3;fe)e=0;16777215e.length;)e="0"+e;return"#"+e}})(egret||(egret={}));__extends=this.__extends||function(e,t){function n(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);n.prototype=t.prototype;e.prototype=new n};(function(e){var t=function(t){function n(e,n,r,i,s,o){void 0===e&&(e=1);void 0===n&&(n=0);void 0===r&&(r=0);void 0===i&&(i=1);void 0===s&&(s=0);void 0===o&&(o=0);t.call(this);this.a=e;this.b=n;this.c=r;this.d=i;this.tx=s;this.ty=o}__extends(n,t);n.prototype.prepend=function(e,t,n,r,i,s){var o=this.tx;if(1!=e||0!=t||0!=n||1!=r){var u=this.a,a=this.c;this.a=u*e+this.b*n;this.b=u*t+this.b*r;this.c=a*e+this.d*n;this.d=a*t+this.d*r}this.tx=o*e+this.ty*n+i;this.ty=o*t+this.ty*r+s;return this};n.prototype.append=function(e,t,n,r,i,s){var o=this.a,u=this.b,a=this.c,f=this.d;if(1!=e||0!=t||0!=n||1!=r)this.a=e*o+t*a,this.b=e*u+t*f,this.c=n*o+r*a,this.d=n*u+r*f;this.tx=i*o+s*a+this.tx;this.ty=i*u+s*f+this.ty;return this};n.prototype.prependTransform=function(e,t,r,i,s,o,u,f,l){if(s%360){var c=s*n.DEG_TO_RAD;s=Math.cos(c);c=Math.sin(c)}else s=1,c=0;if(f||l)this.tx-=f,this.ty-=l;o||u?(o*=n.DEG_TO_RAD,u*=n.DEG_TO_RAD,this.prepend(s*r,c*r,-c*i,s*i,0,0),this.prepend(Math.cos(u),Math.sin(u),-Math.sin(o),Math.cos(o),e,t)):this.prepend(s*r,c*r,-c*i,s*i,e,t);return this};n.prototype.appendTransform=function(e,t,r,i,s,o,u,f,l){if(s%360){var c=s*n.DEG_TO_RAD;s=Math.cos(c);c=Math.sin(c)}else s=1,c=0;o||u?(o*=n.DEG_TO_RAD,u*=n.DEG_TO_RAD,this.append(Math.cos(u),Math.sin(u),-Math.sin(o),Math.cos(o),e,t),this.append(s*r,c*r,-c*i,s*i,0,0)):this.append(s*r,c*r,-c*i,s*i,e,t);if(f||l)this.tx-=f*this.a+l*this.c,this.ty-=f*this.b+l*this.d;return this};n.prototype.rotate=function(e){var t=Math.cos(e);e=Math.sin(e);var n=this.a,r=this.c,i=this.tx;this.a=n*t-this.b*e;this.b=n*e+this.b*t;this.c=r*t-this.d*e;this.d=r*e+this.d*t;this.tx=i*t-this.ty*e;this.ty=i*e+this.ty*t;return this};n.prototype.skew=function(e,t){e*=n.DEG_TO_RAD;t*=n.DEG_TO_RAD;this.append(Math.cos(t),Math.sin(t),-Math.sin(e),Math.cos(e),0,0);return this};n.prototype.scale=function(e,t){this.a*=e;this.d*=t;this.c*=e;this.b*=t;this.tx*=e;this.ty*=t;return this};n.prototype.translate=function(e,t){this.tx+=e;this.ty+=t;return this};n.prototype.identity=function(){this.a=this.d=1;this.b=this.c=this.tx=this.ty=0;return this};n.prototype.identityMatrix=function(e){this.a=e.a;this.b=e.b;this.c=e.c;this.d=e.d;this.tx=e.tx;this.ty=e.ty;return this};n.prototype.invert=function(){var e=this.a,t=this.b,n=this.c,r=this.d,i=this.tx,s=e*r-t*n;this.a=r/s;this.b=-t/s;this.c=-n/s;this.d=e/s;this.tx=(n*this.ty-r*i)/s;this.ty=-(e*this.ty-t*i)/s;return this};n.transformCoords=function(t,n,r){var i=e.Point.identity;i.x=t.a*n+t.c*r+t.tx;i.y=t.d*r+t.b*n+t.ty;return i};n.prototype.toArray=function(e){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;return this.array};n.identity=new n;n.DEG_TO_RAD=Math.PI/180;return n}(e.HashObject);e.Matrix=t;t.prototype.__class__="egret.Matrix"})(egret||(egret={}));__extends=this.__extends||function(e,t){function n(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);n.prototype=t.prototype;e.prototype=new n};(function(e){var t=function(e){function t(t,n){void 0===t&&(t=0);void 0===n&&(n=0);e.call(this);this.x=t;this.y=n}__extends(t,e);t.prototype.clone=function(){return new t(this.x,this.y)};t.prototype.equals=function(e){return this.x==e.x&&this.y==e.y};t.distance=function(e,t){return Math.sqrt((e.x-t.x)*(e.x-t.x)+(e.y-t.y)*(e.y-t.y))};t.identity=new t(0,0);return t}(e.HashObject);e.Point=t;t.prototype.__class__="egret.Point"})(egret||(egret={}));__extends=this.__extends||function(e,t){function n(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);n.prototype=t.prototype;e.prototype=new n};(function(e){var t=function(e){function t(t,n,r,i){void 0===t&&(t=0);void 0===n&&(n=0);void 0===r&&(r=0);void 0===i&&(i=0);e.call(this);this.x=t;this.y=n;this.width=r;this.height=i}__extends(t,e);Object.defineProperty(t.prototype,"right",{get:function(){return this.x+this.width},set:function(e){this.width=e-this.x},enumerable:!0,configurable:!0});Object.defineProperty(t.prototype,"bottom",{get:function(){return this.y+this.height},set:function(e){this.height=e-this.y},enumerable:!0,configurable:!0});t.prototype.initialize=function(e,t,n,r){this.x=e;this.y=t;this.width=n;this.height=r;return this};t.prototype.contains=function(e,t){return this.x<=e&&this.x+this.width>=e&&this.y<=t&&this.y+this.height>=t};t.prototype.intersects=function(e){var t=e.right,n=e.bottom,r=this.right,i=this.bottom;return this.contains(e.x,e.y)||this.contains(e.x,n)||this.contains(t,e.y)||this.contains(t,n)||e.contains(this.x,this.y)||e.contains(this.x,i)||e.contains(r,this.y)||e.contains(r,i)?!0:!1};t.prototype.clone=function(){return new t(this.x,this.y,this.width,this.height)};t.prototype.containsPoint=function(e){return this.xe.x&&this.ye.y?!0:!1};t.identity=new t(0,0,0,0);return t}(e.HashObject);e.Rectangle=t;t.prototype.__class__="egret.Rectangle"})(egret||(egret={}));(function(e){var t=function(){function t(){}t.fatal=function(t,n){void 0===n&&(n=null);e.Logger.traceToConsole("Fatal",t,n);throw Error(e.Logger.getTraceCode("Fatal",t,n))};t.info=function(t,n){void 0===n&&(n=null);e.Logger.traceToConsole("Info",t,n)};t.warning=function(t,n){void 0===n&&(n=null);e.Logger.traceToConsole("Warning",t,n)};t.traceToConsole=function(t,n,r){console.log(e.Logger.getTraceCode(t,n,r))};t.getTraceCode=function(e,t,n){return"["+e+"]"+t+":"+(null==n?"":n)};return t}();e.Logger=t;t.prototype.__class__="egret.Logger"})(egret||(egret={}));__extends=this.__extends||function(e,t){function n(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);n.prototype=t.prototype;e.prototype=new n};(function(e){var t=function(t){function n(){t.call(this);this._isSupportDOMParser=this._xmlDict=this._parser=null;this._xmlDict={};window.DOMParser?(this._isSupportDOMParser=!0,this._parser=new DOMParser):this._isSupportDOMParser=!1}__extends(n,t);n.getInstance=function(){n._instance||(n._instance=new n);return n._instance};n.prototype.parserXML=function(t){for(var n=0;"\n"==t.charAt(n)||" "==t.charAt(n)||"\r"==t.charAt(n)||" "==t.charAt(n);)n++;0!=n&&(t=t.substring(n,t.length));this._isSupportDOMParser?n=this._parser.parseFromString(t,"text/xml"):(n=new ActiveXObject("Microsoft.XMLDOM"),n.async="false",n.loadXML(t));null==n&&e.Logger.info("xml not found!");return n};n._instance=null;return n}(e.HashObject);e.SAXParser=t;t.prototype.__class__="egret.SAXParser"})(egret||(egret={}));__extends=this.__extends||function(e,t){function n(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);n.prototype=t.prototype;e.prototype=new n};(function(e){var t=function(t){function n(){t.call(this);this._designHeight=this._designWidth=0;this._scaleY=this._scaleX=1;this._stageHeight=this._stageWidth=this._offSetY=0}__extends(n,t);n.getInstance=function(){null==n.instance&&(r.initialize(),n.instance=new n);return n.instance};n.prototype.setDesignSize=function(t,n,r){this._designWidth=t;this._designHeight=n;r&&(e.Logger.warning("该方法目前不应传入 resolutionPolicy 参数,请在 docs/1.0_Final_ReleaseNote中查看如何升级"),this._setResolutionPolicy(r))};n.prototype._setResolutionPolicy=function(e){this._resolutionPolicy=e;e.init(this);e._apply(this,this._designWidth,this._designHeight)};n.prototype.getScaleX=function(){return this._scaleX};n.prototype.getScaleY=function(){return this._scaleY};n.prototype.getOffSetY=function(){return this._offSetY};n.canvas_name="egretCanvas";n.canvas_div_name="gameDiv";return n}(e.HashObject);e.StageDelegate=t;t.prototype.__class__="egret.StageDelegate";var n=function(){function e(e,t){this._containerStrategy=e;this._contentStrategy=t}e.prototype.init=function(e){this._containerStrategy.init(e);this._contentStrategy.init(e)};e.prototype._apply=function(e,t,n){this._containerStrategy._apply(e,t,n);this._contentStrategy._apply(e,t,n)};return e}();e.ResolutionPolicy=n;n.prototype.__class__="egret.ResolutionPolicy";var r=function(){function e(){}e.initialize=function(){e.EQUAL_TO_FRAME=new i};e.prototype.init=function(e){};e.prototype._apply=function(e,t,n){};e.prototype._setupContainer=function(){var e=document.body,t;e&&(t=e.style)&&(t.paddingTop=t.paddingTop||"0px",t.paddingRight=t.paddingRight||"0px",t.paddingBottom=t.paddingBottom||"0px",t.paddingLeft=t.paddingLeft||"0px",t.borderTop=t.borderTop||"0px",t.borderRight=t.borderRight||"0px",t.borderBottom=t.borderBottom||"0px",t.borderLeft=t.borderLeft||"0px",t.marginTop=t.marginTop||"0px",t.marginRight=t.marginRight||"0px",t.marginBottom=t.marginBottom||"0px",t.marginLeft=t.marginLeft||"0px")};return e}();e.ContainerStrategy=r;r.prototype.__class__="egret.ContainerStrategy";var i=function(e){function t(){e.apply(this,arguments)}__extends(t,e);t.prototype._apply=function(e){this._setupContainer()};return t}(r);e.EqualToFrame=i;i.prototype.__class__="egret.EqualToFrame";n=function(){function n(){}n.prototype.init=function(e){};n.prototype._apply=function(e,t,n){};n.prototype.setEgretSize=function(n,r,i,s,o,u){void 0===u&&(u=0);e.StageDelegate.getInstance()._stageWidth=Math.round(n);e.StageDelegate.getInstance()._stageHeight=Math.round(r);n=document.getElementById(t.canvas_div_name);n.style.width=i+"px";n.style.height=s+"px";n.style.top=u+"px"};n.prototype._getClientWidth=function(){return document.documentElement.clientWidth};n.prototype._getClientHeight=function(){return document.documentElement.clientHeight};return n}();e.ContentStrategy=n;n.prototype.__class__="egret.ContentStrategy";var s=function(e){function t(t){void 0===t&&(t=0);e.call(this);this.minWidth=t}__extends(t,e);t.prototype._apply=function(e,t,n){t=this._getClientWidth();var r=this._getClientHeight(),i=r/n,s=t/i,o=1;0!=this.minWidth&&(o=Math.min(1,s/this.minWidth));this.setEgretSize(s/o,n,t,r*o);e._scaleX=i*o;e._scaleY=i*o};return t}(n);e.FixedHeight=s;s.prototype.__class__="egret.FixedHeight";s=function(e){function t(t){void 0===t&&(t=0);e.call(this);this.minHeight=t}__extends(t,e);t.prototype._apply=function(e,t,n){n=this._getClientWidth();var r=this._getClientHeight(),i=n/t,s=r/i,o=1;0!=this.minHeight&&(o=Math.min(1,s/this.minHeight));this.setEgretSize(t,s/o,n*o,r,n*(1-o)/2);e._scaleX=i*o;e._scaleY=i*o};return t}(n);e.FixedWidth=s;s.prototype.__class__="egret.FixedWidth";s=function(e){function t(t,n){e.call(this);this.width=t;this.height=n}__extends(t,e);t.prototype._apply=function(e,t,n){n=this.width;var r=this.height,i=n/t;this.setEgretSize(t,r/i,n,r);e._scaleX=i;e._scaleY=i};return t}(n);e.FixedSize=s;s.prototype.__class__="egret.FixedSize";s=function(e){function t(){e.call(this)}__extends(t,e);t.prototype._apply=function(e,t,n){this.setEgretSize(t,n,t,n,Math.floor((t-t)/2));e._scaleX=1;e._scaleY=1};return t}(n);e.NoScale=s;s.prototype.__class__="egret.NoScale";s=function(e){function t(){e.call(this)}__extends(t,e);t.prototype._apply=function(e,t,n){var r=this._getClientWidth(),i=this._getClientHeight(),s=r,o=i,u=s/t=t.x+t.width||i.y+i.height+r<=t.y||i.y+r>=t.y+t.height?!0:!1};n.prototype.getDrawAreaList=function(){var t;0==this._drawAreaList.length?(this._defaultDrawAreaList||(this._defaultDrawAreaList=[new e.Rectangle(0,0,e.MainContext.instance.stage.stageWidth,e.MainContext.instance.stage.stageHeight)],e.MainContext.instance.stage.addEventListener(e.Event.RESIZE,this.onResize,this)),t=this._defaultDrawAreaList):t=this._drawAreaList;return t};n.prototype.onResize=function(){e.MainContext.instance.stage.removeEventListener(e.Event.RESIZE,this.onResize,this);this._defaultDrawAreaList=null};return n}(e.HashObject);e.RenderFilter=t;t.prototype.__class__="egret.RenderFilter"})(egret||(egret={}));(function(e){var t=function(){function t(){}t.mapClass=function(e,t,n){void 0===n&&(n="");e=this.getKey(e)+"#"+n;this.mapClassDic[e]=t};t.getKey=function(t){return"string"==typeof t?t:e.getQualifiedClassName(t)};t.mapValue=function(e,t,n){void 0===n&&(n="");e=this.getKey(e)+"#"+n;this.mapValueDic[e]=t};t.hasMapRule=function(e,t){void 0===t&&(t="");var n=this.getKey(e)+"#"+t;return this.mapValueDic[n]||this.mapClassDic[n]?!0:!1};t.getInstance=function(e,t){void 0===t&&(t="");var n=this.getKey(e)+"#"+t;if(this.mapValueDic[n])return this.mapValueDic[n];var r=this.mapClassDic[n];if(r)return r=new r,this.mapValueDic[n]=r,delete this.mapClassDic[n],r;throw Error("调用了未配置的注入规则:"+n+"。 请先在项目初始化里配置指定的注入规则,再调用对应单例。")};t.mapClassDic={};t.mapValueDic={};return t}();e.Injector=t;t.prototype.__class__="egret.Injector"})(egret||(egret={}));(function(e){var t=function(){function e(){}e.NORMAL="normal";e.ADD="add";return e}();e.BlendMode=t;t.prototype.__class__="egret.BlendMode"})(egret||(egret={}));__extends=this.__extends||function(e,t){function n(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);n.prototype=t.prototype;e.prototype=new n};(function(e){var t=function(t){function n(){t.call(this);this.__hack_local_matrix=null;this._sizeDirty=this._normalDirty=!0;this._parent=this._texture_to_render=null;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._touchEnabled=!1;this._scrollRect=this.blendMode=null;this._hasHeightSet=this._hasWidthSet=!1;this._worldBounds=this.mask=null;this.worldAlpha=1;this._rectH=this._rectW=0;this._stage=null;this._cacheDirty=this._cacheAsBitmap=!1;this._colorTransform=null;this._worldTransform=new e.Matrix;this._worldBounds=new e.Rectangle(0,0,0,0);this._cacheBounds=new e.Rectangle(0,0,0,0)}__extends(n,t);n.prototype._setDirty=function(){this._normalDirty=!0};n.prototype.getDirty=function(){return this._normalDirty||this._sizeDirty};n.prototype._setParentSizeDirty=function(){var e=this._parent;!e||e._hasWidthSet||e._hasHeightSet||e._setSizeDirty()};n.prototype._setSizeDirty=function(){this._sizeDirty||(this._sizeDirty=!0,this._setDirty(),this._setCacheDirty(),this._setParentSizeDirty())};n.prototype._clearDirty=function(){this._normalDirty=!1};n.prototype._clearSizeDirty=function(){this._sizeDirty=!1};Object.defineProperty(n.prototype,"parent",{get:function(){return this._parent},enumerable:!0,configurable:!0});n.prototype._parentChanged=function(e){this._parent=e};Object.defineProperty(n.prototype,"x",{get:function(){return this._x},set:function(e){this._setX(e)},enumerable:!0,configurable:!0});n.prototype._setX=function(t){e.NumberUtils.isNumber(t)&&this._x!=t&&(this._x=t,this._setDirty(),this._setParentSizeDirty())};Object.defineProperty(n.prototype,"y",{get:function(){return this._y},set:function(e){this._setY(e)},enumerable:!0,configurable:!0});n.prototype._setY=function(t){e.NumberUtils.isNumber(t)&&this._y!=t&&(this._y=t,this._setDirty(),this._setParentSizeDirty())};Object.defineProperty(n.prototype,"scaleX",{get:function(){return this._scaleX},set:function(t){e.NumberUtils.isNumber(t)&&this._scaleX!=t&&(this._scaleX=t,this._setDirty(),this._setParentSizeDirty())},enumerable:!0,configurable:!0});Object.defineProperty(n.prototype,"scaleY",{get:function(){return this._scaleY},set:function(t){e.NumberUtils.isNumber(t)&&this._scaleY!=t&&(this._scaleY=t,this._setDirty(),this._setParentSizeDirty())},enumerable:!0,configurable:!0});Object.defineProperty(n.prototype,"anchorOffsetX",{get:function(){return this._anchorOffsetX},set:function(t){e.NumberUtils.isNumber(t)&&this._anchorOffsetX!=t&&(this._anchorOffsetX=t,this._setDirty(),this._setParentSizeDirty())},enumerable:!0,configurable:!0});Object.defineProperty(n.prototype,"anchorOffsetY",{get:function(){return this._anchorOffsetY},set:function(t){e.NumberUtils.isNumber(t)&&this._anchorOffsetY!=t&&(this._anchorOffsetY=t,this._setDirty(),this._setParentSizeDirty())},enumerable:!0,configurable:!0});Object.defineProperty(n.prototype,"anchorX",{get:function(){return this._anchorX},set:function(e){this._setAnchorX(e)},enumerable:!0,configurable:!0});n.prototype._setAnchorX=function(t){e.NumberUtils.isNumber(t)&&this._anchorX!=t&&(this._anchorX=t,this._setDirty(),this._setParentSizeDirty())};Object.defineProperty(n.prototype,"anchorY",{get:function(){return this._anchorY},set:function(e){this._setAnchorY(e)},enumerable:!0,configurable:!0});n.prototype._setAnchorY=function(t){e.NumberUtils.isNumber(t)&&this._anchorY!=t&&(this._anchorY=t,this._setDirty(),this._setParentSizeDirty())};Object.defineProperty(n.prototype,"visible",{get:function(){return this._visible},set:function(e){this._setVisible(e)},enumerable:!0,configurable:!0});n.prototype._setVisible=function(e){this._visible!=e&&(this._visible=e,this._setSizeDirty())};Object.defineProperty(n.prototype,"rotation",{get:function(){return this._rotation},set:function(t){e.NumberUtils.isNumber(t)&&this._rotation!=t&&(this._rotation=t,this._setSizeDirty())},enumerable:!0,configurable:!0});Object.defineProperty(n.prototype,"alpha",{get:function(){return this._alpha},set:function(t){e.NumberUtils.isNumber(t)&&this._alpha!=t&&(this._alpha=t,this._setDirty(),this._setCacheDirty())},enumerable:!0,configurable:!0});Object.defineProperty(n.prototype,"skewX",{get:function(){return this._skewX},set:function(t){e.NumberUtils.isNumber(t)&&this._skewX!=t&&(this._skewX=t,this._setSizeDirty())},enumerable:!0,configurable:!0});Object.defineProperty(n.prototype,"skewY",{get:function(){return this._skewY},set:function(t){e.NumberUtils.isNumber(t)&&this._skewY!=t&&(this._skewY=t,this._setSizeDirty())},enumerable:!0,configurable:!0});Object.defineProperty(n.prototype,"touchEnabled",{get:function(){return this._touchEnabled},set:function(e){this._setTouchEnabled(e)},enumerable:!0,configurable:!0});n.prototype._setTouchEnabled=function(e){this._touchEnabled=e};Object.defineProperty(n.prototype,"scrollRect",{get:function(){return this._scrollRect},set:function(e){this._setScrollRect(e)},enumerable:!0,configurable:!0});n.prototype._setScrollRect=function(e){this._scrollRect=e;this._setSizeDirty()};Object.defineProperty(n.prototype,"measuredWidth",{get:function(){return this._measureBounds().width},enumerable:!0,configurable:!0});Object.defineProperty(n.prototype,"measuredHeight",{get:function(){return this._measureBounds().height},enumerable:!0,configurable:!0});Object.defineProperty(n.prototype,"explicitWidth",{get:function(){return this._explicitWidth},enumerable:!0,configurable:!0});Object.defineProperty(n.prototype,"explicitHeight",{get:function(){return this._explicitHeight},enumerable:!0,configurable:!0});Object.defineProperty(n.prototype,"width",{get:function(){return this._getSize(e.Rectangle.identity).width},set:function(e){this._setWidth(e)},enumerable:!0,configurable:!0});Object.defineProperty(n.prototype,"height",{get:function(){return this._getSize(e.Rectangle.identity).height},set:function(e){this._setHeight(e)},enumerable:!0,configurable:!0});n.prototype._setWidth=function(t){this._setSizeDirty();this._setCacheDirty();this._explicitWidth=t;this._hasWidthSet=e.NumberUtils.isNumber(t)};n.prototype._setHeight=function(t){this._setSizeDirty();this._setCacheDirty();this._explicitHeight=t;this._hasHeightSet=e.NumberUtils.isNumber(t)};n.prototype._draw=function(e){if(this._visible&&!this.drawCacheTexture(e)){this._colorTransform&&e.setGlobalColorTransform(this._colorTransform.matrix);e.setAlpha(this.worldAlpha,this.blendMode);e.setTransform(this._worldTransform);var t=this.mask||this._scrollRect;t&&e.pushMask(t);this._render(e);t&&e.popMask();this._colorTransform&&e.setGlobalColorTransform(null)}this.destroyCacheBounds()};n.prototype.drawCacheTexture=function(t){if(!1==this._cacheAsBitmap)return!1;if(this._cacheDirty||null==this._texture_to_render||Math.round(this.width)!=Math.round(this._texture_to_render._sourceWidth)||Math.round(this.height)!=Math.round(this._texture_to_render._sourceHeight))this._cacheDirty=!this._makeBitmapCache();if(null==this._texture_to_render)return!1;var n=this._texture_to_render,r=n._offsetX,i=n._offsetY,s=n._textureWidth,n=n._textureHeight;this._updateTransform();t.setAlpha(this.worldAlpha,this.blendMode);t.setTransform(this._worldTransform);var o=e.MainContext.instance.rendererContext.texture_scale_factor;e.RenderFilter.getInstance().drawImage(t,this,0,0,s*o,n*o,r,i,s,n);return!0};n.prototype._updateTransform=function(){this._calculateWorldTransform()};n.prototype._calculateWorldTransform=function(){var e=this._worldTransform,t=this._parent;e.identityMatrix(t._worldTransform);this._getMatrix(e);var n=this._scrollRect;n&&e.append(1,0,0,1,-n.x,-n.y);this.worldAlpha=t.worldAlpha*this._alpha};n.prototype._render=function(e){};n.prototype.getBounds=function(t,n){void 0===n&&(n=!0);var r=this._measureBounds(),i=this._hasWidthSet?this._explicitWidth:r.width,s=this._hasHeightSet?this._explicitHeight:r.height;this._rectW=r.width;this._rectH=r.height;this._clearSizeDirty();var o=r.x,r=r.y,u=0,a=0;n&&(0!=this._anchorX||0!=this._anchorY?(u=i*this._anchorX,a=s*this._anchorY):(u=this._anchorOffsetX,a=this._anchorOffsetY));this._cacheBounds.initialize(o-u,r-a,i,s);i=this._cacheBounds;t||(t=new e.Rectangle);return t.initialize(i.x,i.y,i.width,i.height)};n.prototype.destroyCacheBounds=function(){this._cacheBounds.x=0;this._cacheBounds.y=0;this._cacheBounds.width=0;this._cacheBounds.height=0};n.prototype._getConcatenatedMatrix=function(){for(var t=n.identityMatrixForGetConcatenated.identity(),r=this;null!=r;){if(0!=r._anchorX||0!=r._anchorY){var i=r._getSize(e.Rectangle.identity);t.prependTransform(r._x,r._y,r._scaleX,r._scaleY,r._rotation,r._skewX,r._skewY,i.width*r._anchorX,i.height*r._anchorY)}else t.prependTransform(r._x,r._y,r._scaleX,r._scaleY,r._rotation,r._skewX,r._skewY,r._anchorOffsetX,r._anchorOffsetY);r=r._parent}return t};n.prototype.localToGlobal=function(t,n,r){void 0===t&&(t=0);void 0===n&&(n=0);var i=this._getConcatenatedMatrix();i.append(1,0,0,1,t,n);r||(r=new e.Point);r.x=i.tx;r.y=i.ty;return r};n.prototype.globalToLocal=function(t,n,r){void 0===t&&(t=0);void 0===n&&(n=0);var i=this._getConcatenatedMatrix();i.invert();i.append(1,0,0,1,t,n);r||(r=new e.Point);r.x=i.tx;r.y=i.ty;return r};n.prototype.hitTest=function(t,n,r){void 0===r&&(r=!1);if(!this._visible||!r&&!this._touchEnabled)return null;r=this._getSize(e.Rectangle.identity);return 0<=t&&tthis._scrollRect.x&&n>this._scrollRect.y&&tc&&(c=n);(n=o+u+a)c&&(c=n);(n=u+a)c&&(c=n);(r=i+f)p&&(p=r);(r=i+s+f)p&&(p=r);(r=s+f)p&&(p=r);return e.initialize(l,h,c-l,p-h)};Object.defineProperty(n.prototype,"colorTransform",{get:function(){return this._colorTransform},set:function(e){this._colorTransform=e},enumerable:!0,configurable:!0});n.identityMatrixForGetConcatenated=new e.Matrix;n._enterFrameCallBackList=[];n._renderCallBackList=[];return n}(e.EventDispatcher);e.DisplayObject=t;t.prototype.__class__="egret.DisplayObject";t=function(){function e(){this.matrix=null}e.prototype.updateColor=function(e,t,n,r,i,s,o,u){};return e}();e.ColorTransform=t;t.prototype.__class__="egret.ColorTransform"})(egret||(egret={}));__extends=this.__extends||function(e,t){function n(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);n.prototype=t.prototype;e.prototype=new n};(function(e){var t=function(t){function n(){t.call(this);this._touchChildren=!0;this._children=[]}__extends(n,t);Object.defineProperty(n.prototype,"touchChildren",{get:function(){return this._touchChildren},set:function(e){this._touchChildren=e},enumerable:!0,configurable:!0});Object.defineProperty(n.prototype,"numChildren",{get:function(){return this._children.length},enumerable:!0,configurable:!0});n.prototype.setChildIndex=function(e,t){this.doSetChildIndex(e,t)};n.prototype.doSetChildIndex=function(t,n){var r=this._children.indexOf(t);0>r&&e.Logger.fatal("child不在当前容器内");this._children.splice(r,1);0>n||this._children.length<=n?this._children.push(t):this._children.splice(n,0,t)};n.prototype.addChild=function(e){var t=this._children.length;e._parent==this&&t--;return this._doAddChild(e,t)};n.prototype.addChildAt=function(e,t){return this._doAddChild(e,t)};n.prototype._doAddChild=function(t,r,i){void 0===i&&(i=!0);if(t==this)return t;if(0>r||r>this._children.length)return e.Logger.fatal("提供的索引超出范围"),t;var s=t._parent;if(s==this)return this.doSetChildIndex(t,r),t;s&&(r=s._children.indexOf(t),0<=r&&s._doRemoveChild(r));this._children.splice(r,0,t);t._parentChanged(this);i&&t.dispatchEventWith(e.Event.ADDED,!0);if(this._stage)for(t._onAddToStage(),r=n.__EVENT__ADD_TO_STAGE_LIST;0n||0==o)n=h;if(li||0==o)i=u}}return e.Rectangle.identity.initialize(t,r,n-t,i-r)};n.prototype.hitTest=function(n,r,i){void 0===i&&(i=!1);var s;if(!this._visible)return null;if(this._scrollRect){if(nthis._scrollRect.x+this._scrollRect.width||r>this._scrollRect.y+this._scrollRect.height)return null}else if(this.mask&&(this.mask.x>n||n>this.mask.x+this.mask.width||this.mask.y>r||r>this.mask.y+this.mask.height))return null;for(var o=this._children,u=this._touchChildren,a=o.length-1;0<=a;a--){var f=o[a],l=f._getMatrix(),h=f._scrollRect;h&&l.append(1,0,0,1,-h.x,-h.y);l.invert();l=e.Matrix.transformCoords(l,n,r);if(f=f.hitTest(l.x,l.y,!0)){if(!u)return this;if(f._touchEnabled&&u)return f;s=this}}return s?s:this._texture_to_render||this.graphics?t.prototype.hitTest.call(this,n,r,i):null};n.prototype._onAddToStage=function(){t.prototype._onAddToStage.call(this);for(var e=this._children.length,n=0;nt||t>this.getMaxScrollTop():0>n||n>this.getMaxScrollLeft()};n.prototype._validatePosition=function(e,t){void 0===e&&(e=!1);void 0===t&&(t=!1);if(e){var n=this.height,r=this._getContentHeight();this._scrollTop=Math.max(this._scrollTop,(0-n)/2);this._scrollTop=Math.min(this._scrollTop,r>n?r-n/2:r/2)}t&&(n=this.width,r=this._getContentWidth(),this._scrollLeft=Math.max(this._scrollLeft,(0-n)/2),this._scrollLeft=Math.min(this._scrollLeft,r>n?r-n/2:r/2))};n.prototype._setWidth=function(e){this._explicitWidth!=e&&(t.prototype._setWidth.call(this,e),this._updateContentPosition())};n.prototype._setHeight=function(e){this._explicitHeight!=e&&(t.prototype._setHeight.call(this,e),this._updateContentPosition())};n.prototype._updateContentPosition=function(){var t=this.getBounds(e.Rectangle.identity);this.scrollRect=new e.Rectangle(this._scrollLeft,this._scrollTop,t.width,t.height);this.dispatchEvent(new e.Event(e.Event.CHANGE))};n.prototype._checkScrollPolicy=function(){var e=this.__checkScrollPolicy(this._horizontalScrollPolicy,this._getContentWidth(),this.width);this._hCanScroll=e;var t=this.__checkScrollPolicy(this._verticalScrollPolicy,this._getContentHeight(),this.height);this._vCanScroll=t;return e||t};n.prototype.__checkScrollPolicy=function(e,t,n){return"on"==e?!0:"off"==e?!1:t>n};n.prototype._addEvents=function(){this.addEventListener(e.TouchEvent.TOUCH_BEGIN,this._onTouchBegin,this);this.addEventListener(e.TouchEvent.TOUCH_BEGIN,this._onTouchBeginCapture,this,!0);this.addEventListener(e.TouchEvent.TOUCH_END,this._onTouchEndCapture,this,!0)};n.prototype._removeEvents=function(){this.removeEventListener(e.TouchEvent.TOUCH_BEGIN,this._onTouchBegin,this);this.removeEventListener(e.TouchEvent.TOUCH_BEGIN,this._onTouchBeginCapture,this,!0);this.removeEventListener(e.TouchEvent.TOUCH_END,this._onTouchEndCapture,this,!0)};n.prototype._onTouchBegin=function(t){t._isDefaultPrevented||(e.Tween.removeTweens(this),this.stage.addEventListener(e.TouchEvent.TOUCH_MOVE,this._onTouchMove,this),this.stage.addEventListener(e.TouchEvent.TOUCH_END,this._onTouchEnd,this),this.stage.addEventListener(e.TouchEvent.LEAVE_STAGE,this._onTouchEnd,this),this.addEventListener(e.Event.ENTER_FRAME,this._onEnterFrame,this),this._logTouchEvent(t),t.preventDefault())};n.prototype._onTouchBeginCapture=function(t){var r=this._checkScrollPolicy();if(r){for(var i=t.target;i!=this;){if(i instanceof n&&(r=i._checkScrollPolicy()))return;i=i.parent}t.stopPropagation();this.delayTouchBeginEvent=this.cloneTouchEvent(t);this.touchBeginTimer||(this.touchBeginTimer=new e.Timer(100,1),this.touchBeginTimer.addEventListener(e.TimerEvent.TIMER_COMPLETE,this._onTouchBeginTimer,this));this.touchBeginTimer.start();this._onTouchBegin(t)}};n.prototype._onTouchEndCapture=function(e){this.delayTouchBeginEvent&&this._onTouchBeginTimer()};n.prototype._onTouchBeginTimer=function(){this.touchBeginTimer.stop();var e=this.delayTouchBeginEvent;this.delayTouchBeginEvent=null;this.dispatchPropagationEvent(e)};n.prototype.dispatchPropagationEvent=function(e){for(var t=[],n=e._target;n;)t.push(n),n=n.parent;for(var r=this._content,i=1;;i+=2){n=t[i];if(!n||n===r)break;t.unshift(n)}this._dispatchPropagationEvent(e,t)};n.prototype._dispatchPropagationEvent=function(e,t,n){for(var r=t.length,i=0;it-this._lastTouchTime&&this._calcVelocitys(this._lastTouchEvent)};n.prototype._logTouchEvent=function(t){this._lastTouchPosition.x=t.stageX;this._lastTouchPosition.y=t.stageY;this._lastTouchEvent=this.cloneTouchEvent(t);this._lastTouchTime=e.getTimer()};n.prototype._getPointChange=function(e){return{x:!1===this._hCanScroll?0:this._lastTouchPosition.x-e.stageX,y:!1===this._vCanScroll?0:this._lastTouchPosition.y-e.stageY}};n.prototype._calcVelocitys=function(t){var n=e.getTimer();if(0==this._lastTouchTime)this._lastTouchTime=n;else{var r=this._getPointChange(t),n=n-this._lastTouchTime;r.x/=n;r.y/=n;this._velocitys.push(r);5s||s>n)for(s=t;Infinity!=Math.abs(e)&&.02s||s>n?.998*e*.95:.998*e,i++;else i=500*-Math.log(.02/r);return{position:Math.min(n+50,Math.max(s,-50)),duration:i}};n.prototype.cloneTouchEvent=function(t){var n=new e.TouchEvent(t._type,t._bubbles,t.cancelable);n.touchPointID=t.touchPointID;n._stageX=t._stageX;n._stageY=t._stageY;n.ctrlKey=t.ctrlKey;n.altKey=t.altKey;n.shiftKey=t.shiftKey;n.touchDown=t.touchDown;n._isDefaultPrevented=!1;n._target=t._target;return n};n.prototype.throwNotSupportedError=function(){throw Error("此方法在ScrollView内不可用!")};n.prototype.addChild=function(e){this.throwNotSupportedError();return null};n.prototype.addChildAt=function(e,t){this.throwNotSupportedError();return null};n.prototype.removeChild=function(e){this.throwNotSupportedError();return null};n.prototype.removeChildAt=function(e){this.throwNotSupportedError();return null};n.prototype.setChildIndex=function(e,t){this.throwNotSupportedError()};n.prototype.swapChildren=function(e,t){this.throwNotSupportedError()};n.prototype.swapChildrenAt=function(e,t){this.throwNotSupportedError()};n.weight=[1,1.33,1.66,2,2.33];return n}(e.DisplayObjectContainer);e.ScrollView=t;t.prototype.__class__="egret.ScrollView"})(egret||(egret={}));__extends=this.__extends||function(e,t){function n(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);n.prototype=t.prototype;e.prototype=new n};(function(e){var t=function(t){function n(n,r,i){void 0===r&&(r=NaN);void 0===i&&(i=NaN);t.call(this,n);this.content=n;this.width=NaN==r?this._getContentWidth():r;this.height=NaN==i?this._getContentHeight():i;e.Logger.warning("egret.Scroller已废弃,请使用egret.ScrollView")}__extends(n,t);Object.defineProperty(n.prototype,"scrollXEnabled",{get:function(){return"off"!=this.horizontalScrollPolicy},set:function(t){e.Logger.warning("egret.Scroller已废弃,请使用egret.ScrollView");this.horizontalScrollPolicy=t?"auto":"off"},enumerable:!0,configurable:!0});Object.defineProperty(n.prototype,"scrollYEnabled",{get:function(){return"off"!=this.verticalScrollPolicy},set:function(t){e.Logger.warning("egret.Scroller已废弃,请使用egret.ScrollView");this.verticalScrollPolicy=t?"auto":"off"},enumerable:!0,configurable:!0});return n}(e.ScrollView);e.Scroller=t;t.prototype.__class__="egret.Scroller"})(egret||(egret={}));(function(e){var t=function(){function e(){}e.REPEAT="repeat";e.SCALE="scale";return e}();e.BitmapFillMode=t;t.prototype.__class__="egret.BitmapFillMode"})(egret||(egret={}));__extends=this.__extends||function(e,t){function n(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);n.prototype=t.prototype;e.prototype=new n};(function(e){var t=function(t){function n(e){t.call(this);this.debug=!1;this.debugColor=16711680;this.scale9Grid=null;this.fillMode="scale";e&&(this._texture=e,this._setSizeDirty())}__extends(n,t);Object.defineProperty(n.prototype,"texture",{get:function(){return this._texture},set:function(e){e!=this._texture&&(this._setSizeDirty(),this._texture=e)},enumerable:!0,configurable:!0});n.prototype._render=function(e){var t=this._texture;t?(this._texture_to_render=t,n._drawBitmap(e,this._hasWidthSet?this._explicitWidth:t._textureWidth,this._hasHeightSet?this._explicitHeight:t._textureHeight,this)):this._texture_to_render=null};n._drawBitmap=function(e,t,r,i){var s=i._texture_to_render;if(s){var o=s._textureWidth,u=s._textureHeight;if("scale"==i.fillMode){var f=i.scale9Grid||s.scale9Grid;if(f&&o-f.widthn&&(n=u+o._textureHeight)}}this._textChanged=!1;return e.Rectangle.identity.initialize(0,0,t,n)};n.prototype._measureBounds=function(){return this._renderText(!0)};return n}(e.DisplayObjectContainer);e.BitmapText=t;t.prototype.__class__="egret.BitmapText"})(egret||(egret={}));(function(e){var t=function(){function e(){this._lastY=this._lastX=this._maxY=this._maxX=this._minY=this._minX=0;this.commandQueue=[]}e.prototype.beginFill=function(e,t){};e.prototype._setStyle=function(e){};e.prototype.drawRect=function(e,t,n,r){this.checkRect(e,t,n,r)};e.prototype.drawCircle=function(e,t,n){this.checkRect(e-n,t-n,2*n,2*n)};e.prototype.drawRoundRect=function(e,t,n,r,i,s){this.checkRect(e,t,n,r)};e.prototype.drawEllipse=function(e,t,n,r){this.checkRect(e-n,t-r,2*n,2*r)};e.prototype.lineStyle=function(e,t,n,r,i,s,o,u){};e.prototype.lineTo=function(e,t){this.checkPoint(e,t)};e.prototype.curveTo=function(e,t,n,r){this.checkPoint(e,t);this.checkPoint(n,r)};e.prototype.moveTo=function(e,t){this.checkPoint(e,t)};e.prototype.clear=function(){this._maxY=this._maxX=this._minY=this._minX=0};e.prototype.endFill=function(){};e.prototype._draw=function(e){};e.prototype.checkRect=function(e,t,n,r){this._minX=Math.min(this._minX,e);this._minY=Math.min(this._minY,t);this._maxX=Math.max(this._maxX,e+n);this._maxY=Math.max(this._maxY,t+r)};e.prototype.checkPoint=function(e,t){this._minX=Math.min(this._minX,e);this._minY=Math.min(this._minY,t);this._maxX=Math.max(this._maxX,e);this._maxY=Math.max(this._maxY,t);this._lastX=e;this._lastY=t};return e}();e.Graphics=t;t.prototype.__class__="egret.Graphics";(function(){return function(e,t,n){this.method=e;this.thisObject=t;this.args=n}})().prototype.__class__="egret.Command"})(egret||(egret={}));__extends=this.__extends||function(e,t){function n(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);n.prototype=t.prototype;e.prototype=new n};(function(e){var t=function(t){function n(){t.call(this)}__extends(n,t);Object.defineProperty(n.prototype,"graphics",{get:function(){this._graphics||(this._graphics=new e.Graphics);return this._graphics},enumerable:!0,configurable:!0});n.prototype._render=function(e){this._graphics&&this._graphics._draw(e)};return n}(e.DisplayObject);e.Shape=t;t.prototype.__class__="egret.Shape"})(egret||(egret={}));__extends=this.__extends||function(e,t){function n(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);n.prototype=t.prototype;e.prototype=new n};(function(e){var t=function(t){function n(){t.call(this)}__extends(n,t);Object.defineProperty(n.prototype,"graphics",{get:function(){this._graphics||(this._graphics=new e.Graphics);return this._graphics},enumerable:!0,configurable:!0});n.prototype._render=function(e){this._graphics&&this._graphics._draw(e);t.prototype._render.call(this,e)};return n}(e.DisplayObjectContainer);e.Sprite=t;t.prototype.__class__="egret.Sprite"})(egret||(egret={}));__extends=this.__extends||function(e,t){function n(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);n.prototype=t.prototype;e.prototype=new n};(function(e){var t=function(t){function n(){t.call(this);this._inputEnabled=!1;this._text=this._type="";this._displayAsPassword=!1;this._fontFamily=n.default_fontFamily;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=this._maxChars=0;this._multiline=!1;this._textArr=[];this._isArrayChanged=!1;this._linesArr=[]}__extends(n,t);n.prototype.isInput=function(){return this._type==e.TextFieldType.INPUT};n.prototype._setTouchEnabled=function(e){t.prototype._setTouchEnabled.call(this,e);this.isInput()&&(this._inputEnabled=!0)};Object.defineProperty(n.prototype,"type",{get:function(){return this._type},set:function(e){this._setType(e)},enumerable:!0,configurable:!0});n.prototype._setType=function(t){this._type!=t&&(this._type=t,this._type==e.TextFieldType.INPUT?(this._hasWidthSet||this._setWidth(100),this._hasHeightSet||this._setHeight(30),null==this._inputUtils&&(this._inputUtils=new e.InputController),this._inputUtils.init(this),this._setDirty(),this._stage&&this._inputUtils._addStageText()):this._inputUtils&&(this._inputUtils._removeStageText(),this._inputUtils=null))};Object.defineProperty(n.prototype,"text",{get:function(){return this._getText()},set:function(e){this._setText(e)},enumerable:!0,configurable:!0});n.prototype._getText=function(){return this._type==e.TextFieldType.INPUT?this._inputUtils._getText():this._text};n.prototype._setSizeDirty=function(){t.prototype._setSizeDirty.call(this);this._isArrayChanged=!0};n.prototype._setTextDirty=function(){this._setSizeDirty()};n.prototype._setBaseText=function(e){null==e&&(e="");if(this._text!=e||this._displayAsPassword){this._setTextDirty();this._text=e;e="";if(this._displayAsPassword)for(var t=0,n=this._text.length;tthis._explicitWidth)break;d+=h;i+=h}0this._explicitHeight)break}return e.Rectangle.identity.initialize(0,0,u,o)};n.default_fontFamily="Arial";return n}(e.DisplayObject);e.TextField=t;t.prototype.__class__="egret.TextField"})(egret||(egret={}));(function(e){var t=function(){function e(){}e.DYNAMIC="dynamic";e.INPUT="input";return e}();e.TextFieldType=t;t.prototype.__class__="egret.TextFieldType"})(egret||(egret={}));__extends=this.__extends||function(e,t){function n(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);n.prototype=t.prototype;e.prototype=new n};(function(e){var t=function(t){function n(e){t.call(this);var n=e.bitmapData;this.bitmapData=n;this._textureMap={};this._sourceWidth=n.width;this._sourceHeight=n.height;this._bitmapX=e._bitmapX-e._offsetX;this._bitmapY=e._bitmapY-e._offsetY}__extends(n,t);n.prototype.getTexture=function(e){return this._textureMap[e]};n.prototype.createTexture=function(t,n,r,i,s,o,u,a,f){void 0===o&&(o=0);void 0===u&&(u=0);"undefined"===typeof a&&(a=o+i);"undefined"===typeof f&&(f=u+s);var l=new e.Texture;l._bitmapData=this.bitmapData;l._bitmapX=this._bitmapX+n;l._bitmapY=this._bitmapY+r;l._bitmapWidth=i;l._bitmapHeight=s;l._offsetX=o;l._offsetY=u;l._textureWidth=a;l._textureHeight=f;l._sourceWidth=this._sourceWidth;l._sourceHeight=this._sourceHeight;return this._textureMap[t]=l};return n}(e.HashObject);e.SpriteSheet=t;t.prototype.__class__="egret.SpriteSheet"})(egret||(egret={}));__extends=this.__extends||function(e,t){function n(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);n.prototype=t.prototype;e.prototype=new n};(function(e){var t=function(t){function n(){t.call(this);e.Logger.warning("TextInput 已废弃,请使用TextField代替,并设置type为TextFieldType.INPUT");this.type=e.TextFieldType.INPUT}__extends(n,t);n.prototype.setText=function(t){e.Logger.warning("TextField.setText()已废弃,请使用TextInput.text设置");this.text=t};n.prototype.getText=function(){e.Logger.warning("TextField.getText()已废弃,请使用TextInput.text获取");return this.text};n.prototype.setTextType=function(t){e.Logger.warning("TextField.setTextType()已废弃,请使用TextInput.displayAsPassword设置");this.displayAsPassword="password"==t};n.prototype.getTextType=function(){e.Logger.warning("TextField.getTextType()已废弃,请使用TextInput.displayAsPassword获取");return this.displayAsPassword?"password":"text"};return n}(e.TextField);e.TextInput=t;t.prototype.__class__="egret.TextInput"})(egret||(egret={}));__extends=this.__extends||function(e,t){function n(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);n.prototype=t.prototype;e.prototype=new n};(function(e){var t=function(t){function n(){t.call(this);this._isFocus=!1;this._isFirst=this._isFirst=!0}__extends(n,t);n.prototype.init=function(t){this._text=t;this.stageText=e.StageText.create();t=this._text.localToGlobal();this.stageText._open(t.x,t.y,this._text._explicitWidth,this._text._explicitHeight)};n.prototype._addStageText=function(){this._text._inputEnabled||(this._text._touchEnabled=!0);this.stageText._add();this.stageText._addListeners();this.stageText.addEventListener("blur",this.onBlurHandler,this);this.stageText.addEventListener("focus",this.onFocusHandler,this);this.stageText.addEventListener("updateText",this.updateTextHandler,this);this._text.addEventListener(e.TouchEvent.TOUCH_TAP,this.onMouseDownHandler,this);e.MainContext.instance.stage.addEventListener(e.TouchEvent.TOUCH_TAP,this.onStageDownHandler,this)};n.prototype._removeStageText=function(){this.stageText._remove();this.stageText._removeListeners();this._text._inputEnabled||(this._text._touchEnabled=!1);this.stageText.removeEventListener("blur",this.onBlurHandler,this);this.stageText.removeEventListener("focus",this.onFocusHandler,this);this.stageText.removeEventListener("updateText",this.updateTextHandler,this);this._text.removeEventListener(e.TouchEvent.TOUCH_TAP,this.onMouseDownHandler,this);e.MainContext.instance.stage.removeEventListener(e.TouchEvent.TOUCH_TAP,this.onStageDownHandler,this)};n.prototype._getText=function(){return this.stageText._getText()};n.prototype._setText=function(e){this.stageText._setText(e)};n.prototype.onFocusHandler=function(e){this.hideText()};n.prototype.onBlurHandler=function(e){this.showText()};n.prototype.onMouseDownHandler=function(e){e.stopPropagation();this._text._visible&&this.stageText._show()};n.prototype.onStageDownHandler=function(e){this.stageText._hide();this.showText()};n.prototype.showText=function(){this._isFocus&&(this._isFocus=!1,this.resetText())};n.prototype.hideText=function(){this._isFocus||(this._text._setBaseText(""),this._isFocus=!0)};n.prototype.updateTextHandler=function(t){this.resetText();this._text.dispatchEvent(new e.Event(e.Event.CHANGE))};n.prototype.resetText=function(){this._text._setBaseText(this.stageText._getText())};n.prototype._updateTransform=function(){var t=this._text._worldTransform.a,n=this._text._worldTransform.b,r=this._text._worldTransform.c,i=this._text._worldTransform.d,s=this._text._worldTransform.tx,o=this._text._worldTransform.ty;this._text._updateBaseTransform();var u=this._text._worldTransform;if(this._isFirst||t!=u.a||n!=u.b||r!=u.c||i!=u.d||s!=u.tx||o!=u.ty){this._isFirst=!1;t=this._text.localToGlobal();this.stageText.changePosition(t.x,t.y);var a=this;e.callLater(function(){a.stageText._setScale(a._text._worldTransform.a,a._text._worldTransform.d)},this)}};n.prototype._updateProperties=function(){var t=this._text._stage;if(null==t)this.stageText._setVisible(!1);else{for(var n=this._text,r=n._visible;r;){n=n.parent;if(n==t)break;r=n._visible}this.stageText._setVisible(r)}this.stageText._setMultiline(this._text._multiline);this.stageText._setMaxChars(this._text._maxChars);this.stageText._setSize(this._text._size);this.stageText._setTextColor(this._text._textColorString);this.stageText._setTextFontFamily(this._text._fontFamily);this.stageText._setBold(this._text._bold);this.stageText._setItalic(this._text._italic);this.stageText._setTextAlign(this._text._textAlign);this.stageText._setWidth(this._text._getSize(e.Rectangle.identity).width);this.stageText._setHeight(this._text._getSize(e.Rectangle.identity).height);this.stageText._setTextType(this._text._displayAsPassword?"password":"text");this.stageText._setText(this._text._text);this.stageText._resetStageText();this._updateTransform()};return n}(e.HashObject);e.InputController=t;t.prototype.__class__="egret.InputController"})(egret||(egret={}));__extends=this.__extends||function(e,t){function n(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);n.prototype=t.prototype;e.prototype=new n};(function(e){var t=function(e){function t(t,n){e.call(this,t);this.charList=this.parseConfig(n)}__extends(t,e);t.prototype.getTexture=function(e){var t=this._textureMap[e];if(!t){t=this.charList[e];if(!t)return null;t=this.createTexture(e,t.x,t.y,t.width,t.height,t.offsetX,t.offsetY);this._textureMap[e]=t}return t};t.prototype.parseConfig=function(e){e=e.split("\r\n").join("\n");e=e.split("\n");for(var t=this.getConfigByKey(e[3],"count"),n={},r=4;r<4+t;r++){var i=e[r],s=String.fromCharCode(this.getConfigByKey(i,"id")),o={};n[s]=o;o.x=this.getConfigByKey(i,"x");o.y=this.getConfigByKey(i,"y");o.width=this.getConfigByKey(i,"width");o.height=this.getConfigByKey(i,"height");o.offsetX=this.getConfigByKey(i,"xoffset");o.offsetY=this.getConfigByKey(i,"yoffset")}return n};t.prototype.getConfigByKey=function(e,t){for(var n=e.split(" "),r=0,i=n.length;rthis.maxlength){e=e+255&-256;var t=new ArrayBuffer(e),n=new Uint8Array(this.arraybytes,0,this.length);(new Uint8Array(t,0,this.length)).set(n);this.arraybytes=t;this.maxlength=e}};e.prototype.writeByte=function(e){this.ensureWriteableSpace(1);(new Int8Array(this.arraybytes))[this.position++]=~~e;this.position>this.length&&(this.length=this.position)};e.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++]};e.prototype.readBytes=function(e,t,n){void 0===t&&(t=0);void 0===n&&(n=0);null==n&&(n=e.length);e.ensureWriteableSpace(t+n);var r=new Int8Array(e.arraybytes),i=new Int8Array(this.arraybytes);r.set(i.subarray(this.position,this.position+n),t);this.position+=n;n+t>e.length&&(e.length+=n+t-e.length)};e.prototype.writeUnsignedByte=function(e){this.ensureWriteableSpace(1);(new Uint8Array(this.arraybytes))[this.position++]=~~e&255;this.position>this.length&&(this.length=this.position)};e.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++]};e.prototype.writeUnsignedShort=function(e){this.ensureWriteableSpace(2);if(0==(this.position&1)){var t=new Uint16Array(this.arraybytes);t[this.position>>1]=~~e&65535}else t=new Uint16Array(this.unalignedarraybytestemp,0,1),t[0]=~~e&65535,e=new Uint8Array(this.arraybytes,this.position,2),t=new Uint8Array(this.unalignedarraybytestemp,0,2),e.set(t);this.position+=2;this.position>this.length&&(this.length=this.position)};e.prototype.readUTFBytes=function(e){var t="";e=this.position+e;for(var n=new DataView(this.arraybytes);this.positionr){if(0==r)break;t+=String.fromCharCode(r)}else if(224>r)t+=String.fromCharCode((r&63)<<6|n.getUint8(this.position++)&127);else if(240>r)var i=n.getUint8(this.position++),t=t+String.fromCharCode((r&31)<<12|(i&127)<<6|n.getUint8(this.position++)&127);else var i=n.getUint8(this.position++),s=n.getUint8(this.position++),t=t+String.fromCharCode((r&15)<<18|(i&127)<<12|s<<6&127|n.getUint8(this.position++)&127)}return t};e.prototype.readInt=function(){var e=(new DataView(this.arraybytes)).getInt32(this.position,this.isLittleEndian);this.position+=4;return e};e.prototype.readShort=function(){var e=(new DataView(this.arraybytes)).getInt16(this.position,this.isLittleEndian);this.position+=2;return e};e.prototype.readDouble=function(){var e=(new DataView(this.arraybytes)).getFloat64(this.position,this.isLittleEndian);this.position+=8;return e};e.prototype.readUnsignedShort=function(){if(this.position>this.length+2)throw"ByteArray out of bounds read. Position="+this.position+", Length="+this.length;if(0==(this.position&1)){var e=new Uint16Array(this.arraybytes),t=this.position>>1;this.position+=2;return e[t]}e=new Uint16Array(this.unalignedarraybytestemp,0,1);t=new Uint8Array(this.arraybytes,this.position,2);(new Uint8Array(this.unalignedarraybytestemp,0,2)).set(t);this.position+=2;return e[0]};e.prototype.writeUnsignedInt=function(e){this.ensureWriteableSpace(4);if(0==(this.position&3)){var t=new Uint32Array(this.arraybytes);t[this.position>>2]=~~e&4294967295}else t=new Uint32Array(this.unalignedarraybytestemp,0,1),t[0]=~~e&4294967295,e=new Uint8Array(this.arraybytes,this.position,4),t=new Uint8Array(this.unalignedarraybytestemp,0,4),e.set(t);this.position+=4;this.position>this.length&&(this.length=this.position)};e.prototype.readUnsignedInt=function(){if(this.position>this.length+4)throw"ByteArray out of bounds read. Position="+this.position+", Length="+this.length;if(0==(this.position&3)){var e=new Uint32Array(this.arraybytes),t=this.position>>2;this.position+=4;return e[t]}e=new Uint32Array(this.unalignedarraybytestemp,0,1);t=new Uint8Array(this.arraybytes,this.position,4);(new Uint8Array(this.unalignedarraybytestemp,0,4)).set(t);this.position+=4;return e[0]};e.prototype.writeFloat=function(e){this.ensureWriteableSpace(4);if(0==(this.position&3)){var t=new Float32Array(this.arraybytes);t[this.position>>2]=e}else t=new Float32Array(this.unalignedarraybytestemp,0,1),t[0]=e,e=new Uint8Array(this.arraybytes,this.position,4),t=new Uint8Array(this.unalignedarraybytestemp,0,4),e.set(t);this.position+=4;this.position>this.length&&(this.length=this.position)};e.prototype.readFloat=function(){if(this.position>this.length+4)throw"ByteArray out of bounds read. Positon="+this.position+", Length="+this.length;if(0==(this.position&3)){var e=new Float32Array(this.arraybytes),t=this.position>>2;this.position+=4;return e[t]}e=new Float32Array(this.unalignedarraybytestemp,0,1);t=new Uint8Array(this.arraybytes,this.position,4);(new Uint8Array(this.unalignedarraybytestemp,0,4)).set(t);this.position+=4;return e[0]};e.DEFAULT_ENDIAN=t.BIG_ENDIAN;return e}();e.ByteArray=n;n.prototype.__class__="egret.ByteArray"})(egret||(egret={}));__extends=this.__extends||function(e,t){function n(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);n.prototype=t.prototype;e.prototype=new n};(function(e){var t=function(t){function n(e,n,r){t.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(e,n,r)}__extends(n,t);n.get=function(e,t,r,i){void 0===t&&(t=null);void 0===r&&(r=null);void 0===i&&(i=!1);i&&n.removeTweens(e);return new n(e,t,r)};n.removeTweens=function(e){if(e.tween_count){for(var t=n._tweens,r=t.length-1;0<=r;r--)t[r]._target==e&&(t[r].paused=!0,t.splice(r,1));e.tween_count=0}};n.pauseTweens=function(t){if(t.tween_count)for(var n=e.Tween._tweens,r=n.length-1;0<=r;r--)n[r]._target==t&&(n[r].paused=!0)};n.resumeTweens=function(t){if(t.tween_count)for(var n=e.Tween._tweens,r=n.length-1;0<=r;r--)n[r]._target==t&&(n[r].paused=!1)};n.tick=function(e,t){void 0===t&&(t=!1);for(var r=n._tweens.concat(),i=r.length-1;0<=i;i--){var s=r[i];t&&!s.ignoreGlobalPause||s.paused||s.tick(s._useTicks?1:e)}};n._register=function(t,r){var i=t._target,s=n._tweens;if(r)i&&(i.tween_count=i.tween_count?i.tween_count+1:1),s.push(t),n._inited||(e.Ticker.getInstance().register(n.tick,null),n._inited=!0);else for(i&&i.tween_count--,i=s.length;i--;)if(s[i]==t){s.splice(i,1);break}};n.removeAllTweens=function(){for(var e=n._tweens,t=0,r=e.length;te&&(e=0);var n=e,r=!1;n>=this.duration&&(this.loop?n%=this.duration:(n=this.duration,r=!0));if(n==this._prevPos)return r;var i=this._prevPos;this.position=this._prevPos=n;this._prevPosition=e;if(this._target)if(r)this._updateTargetProps(null,1);else if(0n);s++);s=this._steps[s-1];this._updateTargetProps(s,(this._stepPosition=n-s.t)/s.d)}0!=t&&0t&&(r=t,i=e,s=o,o=u=-1);for(;(s+=u)!=o;){t=this._actions[s];var a=t.t;(a==i||a>r&&a=e)return this;var n=this._cloneProps(this._curQueueProps);return this._addStep({d:e,p0:n,p1:n,v:t})};n.prototype.to=function(e,t,n){void 0===n&&(n=void 0);if(isNaN(t)||0>t)t=0;return this._addStep({d:t||0,p0:this._cloneProps(this._curQueueProps),e:n,p1:this._cloneProps(this._appendQueueProps(e))})};n.prototype.call=function(e,t,n){void 0===t&&(t=void 0);void 0===n&&(n=void 0);return this._addAction({f:e,p:n?n:[],o:t?t:this._target})};n.prototype.set=function(e,t){void 0===t&&(t=null);return this._addAction({f:this._set,o:this,p:[e,t?t:this._target]})};n.prototype.play=function(e){e||(e=this);return this.call(e.setPaused,e,[!1])};n.prototype.pause=function(e){e||(e=this);return this.call(e.setPaused,e,[!0])};n.prototype.tick=function(e){this.paused||this.setPosition(this._prevPosition+e)};n.NONE=0;n.LOOP=1;n.REVERSE=2;n._tweens=[];n.IGNORE={};n._plugins={};n._inited=!1;return n}(e.EventDispatcher);e.Tween=t;t.prototype.__class__="egret.Tween"})(egret||(egret={}));(function(e){var t=function(){function t(){e.Logger.fatal("Ease不能被实例化")}t.get=function(e){-1>e&&(e=-1);1e?t*(t*-e+1+e):t*((2-t)*e+(1-e))}};t.getPowIn=function(e){return function(t){return Math.pow(t,e)}};t.getPowOut=function(e){return function(t){return 1-Math.pow(1-t,e)}};t.getPowInOut=function(e){return function(t){return 1>(t*=2)?.5*Math.pow(t,e):1-.5*Math.abs(Math.pow(2-t,e))}};t.sineIn=function(e){return 1-Math.cos(e*Math.PI/2)};t.sineOut=function(e){return Math.sin(e*Math.PI/2)};t.sineInOut=function(e){return-.5*(Math.cos(Math.PI*e)-1)};t.getBackIn=function(e){return function(t){return t*t*((e+1)*t-e)}};t.getBackOut=function(e){return function(t){return--t*t*((e+1)*t+e)+1}};t.getBackInOut=function(e){e*=1.525;return function(t){return 1>(t*=2)?.5*t*t*((e+1)*t-e):.5*((t-=2)*t*((e+1)*t+e)+2)}};t.circIn=function(e){return-(Math.sqrt(1-e*e)-1)};t.circOut=function(e){return Math.sqrt(1- --e*e)};t.circInOut=function(e){return 1>(e*=2)?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)};t.bounceIn=function(e){return 1-t.bounceOut(1-e)};t.bounceOut=function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375};t.bounceInOut=function(e){return.5>e?.5*t.bounceIn(2*e):.5*t.bounceOut(2*e-1)+.5};t.getElasticIn=function(e,t){var n=2*Math.PI;return function(r){if(0==r||1==r)return r;var i=t/n*Math.asin(1/e);return-(e*Math.pow(2,10*(r-=1))*Math.sin((r-i)*n/t))}};t.getElasticOut=function(e,t){var n=2*Math.PI;return function(r){if(0==r||1==r)return r;var i=t/n*Math.asin(1/e);return e*Math.pow(2,-10*r)*Math.sin((r-i)*n/t)+1}};t.getElasticInOut=function(e,t){var n=2*Math.PI;return function(r){var i=t/n*Math.asin(1/e);return 1>(r*=2)?-.5*e*Math.pow(2,10*(r-=1))*Math.sin((r-i)*n/t):e*Math.pow(2,-10*(r-=1))*Math.sin((r-i)*n/t)*.5+1}};t.quadIn=t.getPowIn(2);t.quadOut=t.getPowOut(2);t.quadInOut=t.getPowInOut(2);t.cubicIn=t.getPowIn(3);t.cubicOut=t.getPowOut(3);t.cubicInOut=t.getPowInOut(3);t.quartIn=t.getPowIn(4);t.quartOut=t.getPowOut(4);t.quartInOut=t.getPowInOut(4);t.quintIn=t.getPowIn(5);t.quintOut=t.getPowOut(5);t.quintInOut=t.getPowInOut(5);t.backIn=t.getBackIn(1.7);t.backOut=t.getBackOut(1.7);t.backInOut=t.getBackInOut(1.7);t.elasticIn=t.getElasticIn(1,.3);t.elasticOut=t.getElasticOut(1,.3);t.elasticInOut=t.getElasticInOut(1,.3*1.5);return t}();e.Ease=t;t.prototype.__class__="egret.Ease"})(egret||(egret={}));(function(e){var t=function(){function e(){this.type=e.EFFECT}e.prototype.play=function(e){void 0===e&&(e=!1);var t=this.audio;t&&(isNaN(t.duration)||(t.currentTime=0),t.loop=e,t.play())};e.prototype.pause=function(){var e=this.audio;e&&e.pause()};e.prototype.load=function(){var e=this.audio;e&&e.load()};e.prototype.addEventListener=function(e,t){this.audio&&this.audio.addEventListener(e,t,!1)};e.prototype.removeEventListener=function(e,t){this.audio&&this.audio.removeEventListener(e,t,!1)};e.prototype.setVolume=function(e){var t=this.audio;t&&(t.volume=e)};e.prototype.getVolume=function(){return this.audio?this.audio.volume:0};e.prototype.preload=function(e){this.type=e};e.prototype._setAudio=function(e){this.audio=e};e.MUSIC="music";e.EFFECT="effect";return e}();e.Sound=t;t.prototype.__class__="egret.Sound"})(egret||(egret={}));(function(e){var t=function(){function e(){}e.isNumber=function(e){return"number"===typeof e&&!isNaN(e)};return e}();e.NumberUtils=t;t.prototype.__class__="egret.NumberUtils"})(egret||(egret={}));Function.prototype.bind||(Function.prototype.bind=function(e){if("function"!==typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var t=Array.prototype.slice.call(arguments,1),n=this,r=function(){},i=function(){return n.apply(this instanceof r&&e?this:e,t.concat(Array.prototype.slice.call(arguments)))};r.prototype=this.prototype;i.prototype=new r;return i});var __extends=this.__extends||function(e,t){function n(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);n.prototype=t.prototype;e.prototype=new n},RES;(function(e){var t=function(e){function t(t,n,r){void 0===n&&(n=!1);void 0===r&&(r=!1);e.call(this,t,n,r);this.itemsTotal=this.itemsLoaded=0}__extends(t,e);t.dispatchResourceEvent=function(e,n,r,i,s,o){void 0===r&&(r="");void 0===i&&(i=null);void 0===s&&(s=0);void 0===o&&(o=0);var u=egret.Event._getPropertyData(t);u.groupName=r;u.resItem=i;u.itemsLoaded=s;u.itemsTotal=o;egret.Event._dispatchByTarget(t,e,n,u)};t.ITEM_LOAD_ERROR="itemLoadError";t.CONFIG_COMPLETE="configComplete";t.GROUP_PROGRESS="groupProgress";t.GROUP_COMPLETE="groupComplete";return t}(egret.Event);e.ResourceEvent=t;t.prototype.__class__="RES.ResourceEvent"})(RES||(RES={}));(function(e){var t=function(){function e(e,t,n){this._loaded=!1;this.name=e;this.url=t;this.type=n}Object.defineProperty(e.prototype,"loaded",{get:function(){return this.data?this.data.loaded:this._loaded},set:function(e){this.data&&(this.data.loaded=e);this._loaded=e},enumerable:!0,configurable:!0});e.prototype.toString=function(){return'[ResourceItem name="'+this.name+'" url="'+this.url+'" type="'+this.type+'"]'};e.TYPE_XML="xml";e.TYPE_IMAGE="image";e.TYPE_BIN="bin";e.TYPE_TEXT="text";e.TYPE_JSON="json";e.TYPE_SHEET="sheet";e.TYPE_FONT="font";e.TYPE_SOUND="sound";return e}();e.ResourceItem=t;t.prototype.__class__="RES.ResourceItem"})(RES||(RES={}));(function(e){var t=function(){function t(){this.keyMap={};this.groupDic={};e.configInstance=this}t.prototype.getGroupByName=function(e){var t=[];if(!this.groupDic[e])return t;e=this.groupDic[e];for(var n=e.length,r=0;r=t&&(this.queueIndex=0);n=this.itemListDic[e[this.queueIndex]];if(0e&&(e=1);this.resLoader.thread=e};n.GROUP_CONFIG="RES__CONFIG";return n}(egret.EventDispatcher);t.prototype.__class__="RES.Resource";var n=new t})(RES||(RES={}));__extends=this.__extends||function(e,t){function n(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);n.prototype=t.prototype;e.prototype=new n};(function(e){var t=function(t){function n(e){void 0===e&&(e=60);t.call(this);this.frameRate=e;this._time=0;this._isActivate=!0;60==e&&(n.requestAnimationFrame=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame,n.cancelAnimationFrame=window.cancelAnimationFrame||window.msCancelAnimationFrame||window.mozCancelAnimationFrame||window.webkitCancelAnimationFrame||window.oCancelAnimationFrame||window.cancelRequestAnimationFrame||window.msCancelRequestAnimationFrame||window.mozCancelRequestAnimationFrame||window.oCancelRequestAnimationFrame||window.webkitCancelRequestAnimationFrame);n.requestAnimationFrame||(n.requestAnimationFrame=function(t){return window.setTimeout(t,1e3/e)});n.cancelAnimationFrame||(n.cancelAnimationFrame=function(e){return window.clearTimeout(e)});n.instance=this;this.registerListener()}__extends(n,t);n.prototype.enterFrame=function(){var t=n.instance,r=n._thisObject,i=n._callback,s=e.getTimer(),o=s-t._time;t._requestAnimationId=n.requestAnimationFrame.call(window,n.prototype.enterFrame);i.call(r,o);t._time=s};n.prototype.executeMainLoop=function(e,t){n._callback=e;n._thisObject=t;this.enterFrame()};n.prototype.reset=function(){var t=n.instance;t._requestAnimationId&&(t._time=e.getTimer(),n.cancelAnimationFrame.call(window,t._requestAnimationId),t.enterFrame())};n.prototype.registerListener=function(){var t=this,r=function(){t._isActivate&&(t._isActivate=!1,e.MainContext.instance.stage.dispatchEvent(new e.Event(e.Event.DEACTIVATE)))},i=function(){t._isActivate||(t._isActivate=!0,n.instance.reset(),e.MainContext.instance.stage.dispatchEvent(new e.Event(e.Event.ACTIVATE)))},s=function(){document[o]?r():i()};window.addEventListener("focus",i,!1);window.addEventListener("blur",r,!1);var o,u;"undefined"!==typeof document.hidden?(o="hidden",u="visibilitychange"):"undefined"!==typeof document.mozHidden?(o="mozHidden",u="mozvisibilitychange"):"undefined"!==typeof document.msHidden?(o="msHidden",u="msvisibilitychange"):"undefined"!==typeof document.webkitHidden?(o="webkitHidden",u="webkitvisibilitychange"):"undefined"!==typeof document.oHidden&&(o="oHidden",u="ovisibilitychange");"onpageshow"in window&&"onpagehide"in window&&(window.addEventListener("pageshow",i,!1),window.addEventListener("pagehide",r,!1));o&&u&&document.addEventListener(u,s,!1)};return n}(e.DeviceContext);e.HTML5DeviceContext=t;t.prototype.__class__="egret.HTML5DeviceContext"})(egret||(egret={}));var egret_html5_localStorage;(function(e){e.getItem=function(e){return window.localStorage.getItem(e)};e.setItem=function(e,t){try{return window.localStorage.setItem(e,t),!0}catch(n){return console.log("egret_html5_localStorage.setItem保存失败,key="+e+"&value="+t),!1}};e.removeItem=function(e){window.localStorage.removeItem(e)};e.clear=function(){window.localStorage.clear()};e.init=function(){for(var t in e)egret.localStorage[t]=e[t]}})(egret_html5_localStorage||(egret_html5_localStorage={}));egret_html5_localStorage.init();__extends=this.__extends||function(e,t){function n(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);n.prototype=t.prototype;e.prototype=new n};(function(e){var t=function(t){function n(n){t.call(this);this.globalAlpha=1;this.canvas=n||this.createCanvas();this.canvasContext=this.canvas.getContext("2d");this._cacheCanvas=document.createElement("canvas");this._cacheCanvas.width=this.canvas.width;this._cacheCanvas.height=this.canvas.height;this._cacheCanvasContext=this._cacheCanvas.getContext("2d");this._cacheCanvasContext.imageSmoothingEnabled=e.RendererContext.imageSmoothingEnabled;this._cacheCanvasContext.webkitImageSmoothingEnabled=e.RendererContext.imageSmoothingEnabled;this._cacheCanvasContext.mozImageSmoothingEnabled=e.RendererContext.imageSmoothingEnabled;this._cacheCanvasContext.msImageSmoothingEnabled=e.RendererContext.imageSmoothingEnabled;this.onResize();var r=this.canvasContext.setTransform,i=this;this._cacheCanvasContext.setTransform=function(e,t,n,s,o,u){i._matrixA=e;i._matrixB=t;i._matrixC=n;i._matrixD=s;i._matrixTx=o;i._matrixTy=u;r.call(i._cacheCanvasContext,e,t,n,s,o,u)};this._matrixA=1;this._matrixC=this._matrixB=0;this._matrixD=1;this._transformTy=this._transformTx=this._matrixTy=this._matrixTx=0;this.initBlendMode()}__extends(n,t);n.prototype.createCanvas=function(){var t=e.Browser.getInstance().$("#egretCanvas");if(!t){var n=document.getElementById(e.StageDelegate.canvas_div_name),t=e.Browser.getInstance().$new("canvas");t.id="egretCanvas";n.appendChild(t)}e.MainContext.instance.stage.addEventListener(e.Event.RESIZE,this.onResize,this);return t};n.prototype.onResize=function(){if(this.canvas){var t=document.getElementById(e.StageDelegate.canvas_div_name);this.canvas.width=e.MainContext.instance.stage.stageWidth;this.canvas.height=e.MainContext.instance.stage.stageHeight;this.canvas.style.width=t.style.width;this.canvas.style.height=t.style.height;this._cacheCanvas.width=this.canvas.width;this._cacheCanvas.height=this.canvas.height}};n.prototype.clearScreen=function(){for(var t=e.RenderFilter.getInstance().getDrawAreaList(),n=0,r=t.length;n>16)+","+((e&65280)>>8)+","+(e&255)+","+n+")";this.fillStyleColor=r;this.commandQueue.push(new t(this._setStyle,this,[r]))};e.drawRect=function(e,n,r,i){this.commandQueue.push(new t(function(e,t,n,r){var i=this.renderContext;this.canvasContext.beginPath();this.canvasContext.rect(i._transformTx+e,i._transformTy+t,n,r);this.canvasContext.closePath()},this,[e,n,r,i]));this._fill()};e.drawCircle=function(e,n,r){this.commandQueue.push(new t(function(e,t,n){var r=this.renderContext;this.canvasContext.beginPath();this.canvasContext.arc(r._transformTx+e,r._transformTy+t,n,0,2*Math.PI);this.canvasContext.closePath()},this,[e,n,r]));this._fill()};e.drawRoundRect=function(e,n,r,i,s,o){this.commandQueue.push(new t(function(e,t,n,r,i,s){var o=this.renderContext;e=o._transformTx+e;t=o._transformTy+t;i/=2;s=s?s/2:i;n=e+n;r=t+r;o=r-s;this.canvasContext.beginPath();this.canvasContext.moveTo(n,o);this.canvasContext.quadraticCurveTo(n,r,n-i,r);this.canvasContext.lineTo(e+i,r);this.canvasContext.quadraticCurveTo(e,r,e,r-s);this.canvasContext.lineTo(e,t+s);this.canvasContext.quadraticCurveTo(e,t,e+i,t);this.canvasContext.lineTo(n-i,t);this.canvasContext.quadraticCurveTo(n,t,n,t+s);this.canvasContext.lineTo(n,o);this.canvasContext.closePath()},this,[e,n,r,i,s,o]));this._fill()};e.drawEllipse=function(e,n,r,i){this.commandQueue.push(new t(function(e,t,n,r){var i=this.renderContext;this.canvasContext.save();e=i._transformTx+e;t=i._transformTy+t;var i=n>r?n:r,s=n/i;r/=i;this.canvasContext.scale(s,r);this.canvasContext.beginPath();this.canvasContext.moveTo((e+n)/s,t/r);this.canvasContext.arc(e/s,t/r,i,0,2*Math.PI);this.canvasContext.closePath();this.canvasContext.restore();this.canvasContext.stroke()},this,[e,n,r,i]));this._fill()};e.lineStyle=function(e,n,r,i,s,o,u,a){void 0===e&&(e=NaN);void 0===n&&(n=0);void 0===r&&(r=1);void 0===i&&(i=!1);void 0===s&&(s="normal");void 0===o&&(o=null);void 0===u&&(u=null);void 0===a&&(a=3);this.strokeStyleColor&&(this.createEndLineCommand(),this.commandQueue.push(this.endLineCommand));this.strokeStyleColor=n="rgba("+(n>>16)+","+((n&65280)>>8)+","+(n&255)+","+r+")";this.commandQueue.push(new t(function(e,t){this.canvasContext.lineWidth=e;this.canvasContext.strokeStyle=t;this.canvasContext.beginPath()},this,[e,n]));"undefined"===typeof this.lineX&&(this.lineY=this.lineX=0);this.moveTo(this.lineX,this.lineY)};e.lineTo=function(e,n){this.commandQueue.push(new t(function(e,t){var n=this.renderContext;this.canvasContext.lineTo(n._transformTx+e,n._transformTy+t)},this,[e,n]));this.lineX=e;this.lineY=n};e.curveTo=function(e,n,r,i){this.commandQueue.push(new t(function(e,t,n,r){var i=this.renderContext;this.canvasContext.quadraticCurveTo(i._transformTx+e,i._transformTy+t,i._transformTx+n,i._transformTy+r)},this,[e,n,r,i]));this.lineX=r;this.lineY=i};e.moveTo=function(e,n){this.commandQueue.push(new t(function(e,t){var n=this.renderContext;this.canvasContext.moveTo(n._transformTx+e,n._transformTy+t)},this,[e,n]))};e.clear=function(){this.lineY=this.lineX=this.commandQueue.length=0;this.fillStyleColor=this.strokeStyleColor=null};e.createEndFillCommand=function(){this.endFillCommand||(this.endFillCommand=new t(function(){this.canvasContext.fill();this.canvasContext.closePath()},this,null))};e.endFill=function(){null!=this.fillStyleColor&&this._fill();this.fillStyleColor=null};e._fill=function(){this.fillStyleColor&&(this.createEndFillCommand(),this.commandQueue.push(this.endFillCommand))};e.createEndLineCommand=function(){this.endLineCommand||(this.endLineCommand=new t(function(){this.canvasContext.stroke();this.canvasContext.closePath()},this,null))};e._draw=function(e){var t=this.commandQueue.length;if(0!=t){this.renderContext=e;e=this.canvasContext=this.renderContext._cacheCanvasContext||this.renderContext.canvasContext;e.save();this.strokeStyleColor&&0=this.size-1)this._draw(),this.currentBaseTexture=t.webGLTexture;var h=this.worldTransform,p=h.a,d=h.b,v=h.c,m=h.d,g=h.tx,y=h.ty;0==o&&0==u||h.append(1,0,0,1,o,u);1==i/a&&1==s/f||h.append(a/i,0,0,f/s,0,0);o=h.a;u=h.b;a=h.c;f=h.d;l=h.tx;var b=h.ty;h.a=p;h.b=d;h.c=v;h.d=m;h.tx=g;h.ty=y;p=t._sourceWidth;d=t._sourceHeight;t=i;h=s;n/=p;r/=d;i/=p;s/=d;p=this.vertices;d=4*this.currentBatchSize*this.vertSize;v=this.worldAlpha;p[d++]=l;p[d++]=b;p[d++]=n;p[d++]=r;p[d++]=v;p[d++]=o*t+l;p[d++]=u*t+b;p[d++]=i+n;p[d++]=r;p[d++]=v;p[d++]=o*t+a*h+l;p[d++]=f*h+u*t+b;p[d++]=i+n;p[d++]=s+r;p[d++]=v;p[d++]=a*h+l;p[d++]=f*h+b;p[d++]=n;p[d++]=s+r;p[d++]=v;this.currentBatchSize++}};n.prototype._draw=function(){if(0!=this.currentBatchSize&&!this.contextLost){var t=e.getTimer();this.start();var n=this.gl;n.bindTexture(n.TEXTURE_2D,this.currentBaseTexture);var r=this.vertices.subarray(0,4*this.currentBatchSize*this.vertSize);n.bufferSubData(n.ARRAY_BUFFER,0,r);n.drawElements(n.TRIANGLES,6*this.currentBatchSize,n.UNSIGNED_SHORT,0);this.currentBatchSize=0;this.renderCost+=e.getTimer()-t;e.Profiler.getInstance().onDrawImage()}};n.prototype.setTransform=function(e){var t=this.worldTransform;t.a=e.a;t.b=e.b;t.c=e.c;t.d=e.d;t.tx=e.tx;t.ty=e.ty};n.prototype.setAlpha=function(e,t){this.worldAlpha=e;this.setBlendMode(t)};n.prototype.createWebGLTexture=function(e){if(!e.webGLTexture){var t=this.gl;e.webGLTexture=t.createTexture();t.bindTexture(t.TEXTURE_2D,e.webGLTexture);t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0);t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,e._bitmapData);t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR);t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR);t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE);t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE);t.bindTexture(t.TEXTURE_2D,null)}};n.prototype.pushMask=function(e){this._draw();var t=this.gl;0==this.maskList.length&&(t.enable(t.STENCIL_TEST),t.stencilFunc(t.ALWAYS,1,1));var n=this.maskDataFreeList.pop();n?(n.x=e.x,n.y=e.y,n.w=e.width,n.h=e.height):n={x:e.x,y:e.y,w:e.width,h:e.height};this.maskList.push(n);t.colorMask(!1,!1,!1,!1);t.stencilOp(t.KEEP,t.KEEP,t.INCR);this.renderGraphics(n);t.colorMask(!0,!0,!0,!0);t.stencilFunc(t.NOTEQUAL,0,this.maskList.length);t.stencilOp(t.KEEP,t.KEEP,t.KEEP)};n.prototype.popMask=function(){this._draw();var e=this.gl,t=this.maskList.pop();t&&(e.colorMask(!1,!1,!1,!1),e.stencilOp(e.KEEP,e.KEEP,e.DECR),this.renderGraphics(t),e.colorMask(!0,!0,!0,!0),e.stencilFunc(e.NOTEQUAL,0,this.maskList.length),e.stencilOp(e.KEEP,e.KEEP,e.KEEP),this.maskDataFreeList.push(t));0==this.maskList.length&&e.disable(e.STENCIL_TEST)};n.prototype.setGlobalColorTransform=function(e){if(this.colorTransformMatrix!=e&&(this._draw(),this.colorTransformMatrix=e)){e=e.concat();var t=this.shaderManager.colorTransformShader;t.uniforms.colorAdd.value.w=e.splice(19,1)[0]/255;t.uniforms.colorAdd.value.z=e.splice(14,1)[0]/255;t.uniforms.colorAdd.value.y=e.splice(9,1)[0]/255;t.uniforms.colorAdd.value.x=e.splice(4,1)[0]/255;t.uniforms.matrix.value=e}};n.prototype.setupFont=function(e){var t=this.canvasContext,n=e.italic?"italic ":"normal ",n=n+(e.bold?"bold ":"normal "),n=n+(e.size+"px "+e.fontFamily);t.font=n;t.textAlign="left";t.textBaseline="middle"};n.prototype.measureText=function(e){return this.canvasContext.measureText(e).width};n.prototype.renderGraphics=function(e){var t=this.gl,n=this.shaderManager.primitiveShader;this.graphicsPoints?(this.graphicsPoints.length=0,this.graphicsIndices.length=0):(this.graphicsPoints=[],this.graphicsIndices=[],this.graphicsBuffer=t.createBuffer(),this.graphicsIndexBuffer=t.createBuffer());this.updateGraphics(e);this.shaderManager.activateShader(n);t.blendFunc(t.ONE,t.ONE_MINUS_SRC_ALPHA);t.uniformMatrix3fv(n.translationMatrix,!1,this.worldTransform.toArray(!0));t.uniform2f(n.projectionVector,this.projectionX,-this.projectionY);t.uniform2f(n.offsetVector,0,0);t.uniform3fv(n.tintColor,[1,1,1]);t.uniform1f(n.alpha,this.worldAlpha);t.bindBuffer(t.ARRAY_BUFFER,this.graphicsBuffer);t.vertexAttribPointer(n.aVertexPosition,2,t.FLOAT,!1,24,0);t.vertexAttribPointer(n.colorAttribute,4,t.FLOAT,!1,24,8);t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.graphicsIndexBuffer);t.drawElements(t.TRIANGLE_STRIP,this.graphicsIndices.length,t.UNSIGNED_SHORT,0);this.shaderManager.activateShader(this.shaderManager.defaultShader)};n.prototype.updateGraphics=function(e){var t=this.gl;this.buildRectangle(e);t.bindBuffer(t.ARRAY_BUFFER,this.graphicsBuffer);t.bufferData(t.ARRAY_BUFFER,new Float32Array(this.graphicsPoints),t.STATIC_DRAW);t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.graphicsIndexBuffer);t.bufferData(t.ELEMENT_ARRAY_BUFFER,new Uint16Array(this.graphicsIndices),t.STATIC_DRAW)};n.prototype.buildRectangle=function(e){var t=e.x,n=e.y,r=e.w;e=e.h;var i=this.graphicsPoints,s=this.graphicsIndices,o=i.length/6;i.push(t,n);i.push(0,0,0,1);i.push(t+r,n);i.push(0,0,0,1);i.push(t,n+e);i.push(0,0,0,1);i.push(t+r,n+e);i.push(0,0,0,1);s.push(o,o,o+1,o+2,o+3,o+3)};return n}(e.RendererContext);e.WebGLRenderer=t;t.prototype.__class__="egret.WebGLRenderer"})(egret||(egret={}));(function(e){var t=function(){function e(){}e.compileProgram=function(t,n,r){r=e.compileFragmentShader(t,r);n=e.compileVertexShader(t,n);var i=t.createProgram();t.attachShader(i,n);t.attachShader(i,r);t.linkProgram(i);t.getProgramParameter(i,t.LINK_STATUS)||console.log("无法初始化着色器");return i};e.compileFragmentShader=function(t,n){return e._compileShader(t,n,t.FRAGMENT_SHADER)};e.compileVertexShader=function(t,n){return e._compileShader(t,n,t.VERTEX_SHADER)};e._compileShader=function(e,t,n){n=e.createShader(n);e.shaderSource(n,t);e.compileShader(n);return e.getShaderParameter(n,e.COMPILE_STATUS)?n:(console.log(e.getShaderInfoLog(n)),null)};e.checkCanUseWebGL=function(){if(void 0==e.canUseWebGL)try{var t=document.createElement("canvas");e.canUseWebGL=!!window.WebGLRenderingContext&&!(!t.getContext("webgl")&&!t.getContext("experimental-webgl"))}catch(n){e.canUseWebGL=!1}return e.canUseWebGL};return e}();e.WebGLUtils=t;t.prototype.__class__="egret.WebGLUtils"})(egret||(egret={}));__extends=this.__extends||function(e,t){function n(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);n.prototype=t.prototype;e.prototype=new n};(function(e){var t=function(){function e(e){this.maxAttibs=10;this.attribState=[];this.tempAttribState=[];for(var t=0;tt||0>n||t>r.stageWidth||n>r.stageHeight?!0:!1};n.prototype.dispatchLeaveStageEvent=function(){this.touchingIdentifiers.length=0;e.MainContext.instance.stage.dispatchEventWith(e.Event.LEAVE_STAGE)};n.prototype._onTouchBegin=function(e){var t=this.getLocation(this.rootDiv,e),n=-1;e.hasOwnProperty("identifier")&&(n=e.identifier);this.onTouchBegan(t.x,t.y,n)};n.prototype._onTouchMove=function(e){var t=this.getLocation(this.rootDiv,e),n=-1;e.hasOwnProperty("identifier")&&(n=e.identifier);this.onTouchMove(t.x,t.y,n)};n.prototype._onTouchEnd=function(e){var t=this.getLocation(this.rootDiv,e),n=-1;e.hasOwnProperty("identifier")&&(n=e.identifier);this.onTouchEnd(t.x,t.y,n)};n.prototype.getLocation=function(t,n){var r=document.documentElement,i=window,s,o;"function"===typeof t.getBoundingClientRect?(o=t.getBoundingClientRect(),s=o.left,o=o.top):o=s=0;s+=i.pageXOffset-r.clientLeft;o+=i.pageYOffset-r.clientTop;null!=n.pageX?(r=n.pageX,i=n.pageY):(s-=document.body.scrollLeft,o-=document.body.scrollTop,r=n.clientX,i=n.clientY);var u=e.Point.identity;u.x=(r-s)/e.StageDelegate.getInstance().getScaleX();u.y=(i-o)/e.StageDelegate.getInstance().getScaleY();return u};return n}(e.TouchContext);e.HTML5TouchContext=t;t.prototype.__class__="egret.HTML5TouchContext"})(egret||(egret={}));__extends=this.__extends||function(e,t){function n(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);n.prototype=t.prototype;e.prototype=new n};(function(e){var t=function(t){function n(){t.call(this);this._hasListeners=!1;this._inputType="";this._isShow=!1;this.textValue="";this._height=this._width=0;this._styleInfoes={};var n=e.StageDelegate.getInstance().getScaleX(),r=e.StageDelegate.getInstance().getScaleY(),i=e.Browser.getInstance().$new("div");i.position.x=0;i.position.y=0;i.scale.x=n;i.scale.y=r;i.transforms();i.style[egret_dom.getTrans("transformOrigin")]="0% 0% 0px";this.div=i;r=e.MainContext.instance.stage;n=r.stageWidth;r=r.stageHeight;i=new e.Shape;i.width=n;i.height=r;i.touchEnabled=!0;this._shape=i;this.getStageDelegateDiv().appendChild(this.div)}__extends(n,t);n.prototype.getStageDelegateDiv=function(){var t=e.Browser.getInstance().$("#StageDelegateDiv");t||(t=e.Browser.getInstance().$new("div"),t.id="StageDelegateDiv",document.getElementById(e.StageDelegate.canvas_div_name).appendChild(t),t.transforms());return t};n.prototype._setMultiline=function(e){t.prototype._setMultiline.call(this,e);this.createInput()};n.prototype.callHandler=function(e){e.stopPropagation()};n.prototype._add=function(){this.div&&null==this.div.parentNode&&this.getStageDelegateDiv().appendChild(this.div)};n.prototype._remove=function(){this._shape&&this._shape.parent&&this._shape.parent.removeChild(this._shape);this.div&&this.div.parentNode&&this.div.parentNode.removeChild(this.div)};n.prototype._addListeners=function(){this.inputElement&&!this._hasListeners&&(this._hasListeners=!0,this.inputElement.addEventListener("mousedown",this.callHandler),this.inputElement.addEventListener("touchstart",this.callHandler),this.inputElement.addEventListener("MSPointerDown",this.callHandler))};n.prototype._removeListeners=function(){this.inputElement&&this._hasListeners&&(this._hasListeners=!1,this.inputElement.removeEventListener("mousedown",this.callHandler),this.inputElement.removeEventListener("touchstart",this.callHandler),this.inputElement.removeEventListener("MSPointerDown",this.callHandler))};n.prototype.createInput=function(){var e=this._multiline?"textarea":"input";this._inputType!=e&&(this._inputType=e,null!=this.inputElement&&(this._removeListeners(),this.div.removeChild(this.inputElement)),this._multiline?(e=document.createElement("textarea"),e.style.resize="none"):e=document.createElement("input"),e.type="text",this.inputElement=e,this.inputElement.value="",this.div.appendChild(e),this._addListeners(),this.setElementStyle("width","0px"),this.setElementStyle("border","none"),this.setElementStyle("margin","0"),this.setElementStyle("padding","0"),this.setElementStyle("outline","medium"),this.setElementStyle("verticalAlign","top"),this.setElementStyle("wordBreak","break-all"),this.setElementStyle("overflow","hidden"))};n.prototype._open=function(e,t,n,r){};n.prototype._setScale=function(n,r){t.prototype._setScale.call(this,n,r);var i=e.StageDelegate.getInstance().getScaleX(),s=e.StageDelegate.getInstance().getScaleY();this.div.scale.x=i*n;this.div.scale.y=s*r;this.div.transforms()};n.prototype.changePosition=function(t,n){var r=e.StageDelegate.getInstance().getScaleX(),i=e.StageDelegate.getInstance().getScaleY();this.div.position.x=t*r;this.div.position.y=n*i;this.div.transforms()};n.prototype.setStyles=function(){this.setElementStyle("fontStyle",this._italic?"italic":"normal");this.setElementStyle("fontWeight",this._bold?"bold":"normal");this.setElementStyle("textAlign",this._textAlign);this.setElementStyle("fontSize",this._size+"px");this.setElementStyle("color","#000000");this.setElementStyle("width",this._width+"px");this.setElementStyle("height",this._height+"px");this.setElementStyle("border","1px solid red");this.setElementStyle("display","block")};n.prototype._show=function(){0e;e++)t=new Bomb,this.bombSp.addChild(t),t.visible=!1,this.bombArr.push(t)};t.prototype.initEnemy=function(e){};t.prototype.initView=function(){this.bg=new BgView;this.addChild(this.bg);this.bg.initView(GameData.curScene)};t.prototype.onFrameHandler=function(e){GameData.isPause||(this.bg.updata(),this.win&&(this.houseSp.y+=GameData.bgSpeed,-80<=this.houseSp.y&&(GameData.bgSpeed=3,this.win=!1,GameData.isPause=!0,this.houseSp.y=-80)),this.playDaZhao(),GameData.dubleSorce&&(GameData.curTimeNum++,300<=GameData.curTimeNum&&(GameData.curTimeNum=0,GameData.dubleSorce=!1)),GameData.sheDie&&(GameData.sheTimeNum++,400<=GameData.sheTimeNum&&(GameData.sheTimeNum=0,GameData.sheDie=!1)),this.girlHead.moveHead(this.totalEnemyNum,this.freeTime),this.timeBoo++,this.onLockBtn&&this.timeBoo1++,this.startGame(),this.onResize())};t.prototype.onResize=function(){if(this.timeBoo1>=this.showResizeBtn){for(var e=0,t=this.btnArr.length;e=GameData.dazhaoTime&&(this.isPlayDaZhao=!0);this.stopPanduan||(this.shanBoo&&(this.shan.visible=!0,this.shan.alpha=1,egret.Tween.get(this.shan).to({alpha:0,visible:!1},300).call(this.shanFun,this)),this.timeBoo>=this.showEnemyTime&&(this.initBoShu(),this.stopGame||(0==GameData.stopCreateEnemy&&this.createEnemy(),this.isStart=!0)))};t.prototype.initBoShu=function(){};t.prototype.createEnemy=function(){};t.prototype.onBegin=function(e){if(!this.onLockBtn){var t=e.currentTarget.name;this.fire(e.currentTarget);this.hitTestObj(t,t);e.currentTarget.goPlay(1)}};t.prototype.fire=function(e){for(var t=this.bombArr.length,n=0;n=s)if(i>o){3==t.type||5==t.type?0==t.bold&&(t.guo=1):t.guo=1;if(1==t.type||3==t.type||5==t.type){this.popProm("pop3");if(GameData.profectNum>=GameData.dazhaoTime){this.isPlayDaZhao=!0;return}SoundUtils.instance().playMiss();this.streakWin=0;GameData.profectNum=0;this.dazhaoBar.setValue();this.shanBoo=!0;GameData.blod--;SoundUtils.instance().playBeHit();this.blodBar.scaleBlodX()}0>=GameData.blod&&this.gameOver()}else i=o-1.2*this.widthPoint&&i=o-1.6*this.widthPoint&&i=o-.8*this.widthPoint&&iConst.SCENT_WIDTH+e[t-1].width/2)e[t-1].over=!0;e[t-1].over&&(e[t-1].dispose(),this.enemySp.removeChild(e[t-1]),e.splice(t-1,1));0>=GameData.blod&&this.gameOver();if(0==e.length)break;if(null!=e[t-1]&&void 0!=e[t-1]){if(true||0<=String(this.enemyNum).indexOf(this.isSetEnemyFrame())||0<=String(this.enemyNum).indexOf(this.enemyFrameInfo)){if(e[t-1].y=GameData.dazhaoTime){this.isPlayDaZhao=!0;break}else this.streakWin=0;e[t-1].guo=1;GameData.profectNum=0;this.dazhaoBar.setValue();GameData.blod--;SoundUtils.instance().playBeHit();this.shanBoo=!0;this.blodBar.scaleBlodX()}}}}};t.prototype.isSetEnemyFrame=function(){for(var e=0,t="",n=this.thisF.length;ethis._endFrame?(this._hasCompleteListener&&this.dispatchEventWith(egret.Event.COMPLETE),this._currentFrame=this._startFrame,this.loop?this._startFrame==this._endFrame?this._ownerSwf&&this.stop(!1):this.setCurrentFrame(this._startFrame):this._ownerSwf&&this.stop(!1)):(this.setCurrentFrame(this._currentFrame),this._currentFrame+=1))};n.prototype.setCurrentFrame=function(t){this._children.length=0;this._currentFrame=t;this.__frameInfos=this._frames[this._currentFrame];for(var n,r=this.__frameInfos.length,i=0;ithis._fpsTime;)this._currentTime-=this._fpsTime,e++,4>e&&this._update()};e.prototype._update=function(){this.updateRemove();this.updateAdd();for(var e=this._animations.length,t=0;tMath.abs(i.touchStageX-t.stageX)&&10>Math.abs(i.touchStageY-t.stageY)&&i.onClick&&i.onClick.call(i.thisObj,t),i.touchStageX=-1,i.touchStageY=-1,i.btn.gotoAndStop(0))}};e.swfList=[];e.btnList=[];e.firstAddBtn=!0;return e}();StarlingSwfUtils.prototype.__class__="StarlingSwfUtils";var StarlingSwfButtonData=function(){return function(){this.touchStageY=this.touchStageX=-1}}();StarlingSwfButtonData.prototype.__class__="StarlingSwfButtonData";var GameData=function(){function e(){}e.closeMusic=!1;e.closeBgMusic=!1;e.isClickBtn=!1;e.isStart=!1;e.num=[]||"10.0.4.180:3000".split("");e.curScene=1;e.isPause=!0;e.redGirlDistance=0;e.sorce=0;e.blod=5;e.enemySpeed=0;e.stopCreateEnemy=0;e.stopEnemyBoo=!1;e.count=0;e.bgSpeed=0;e.profectNum=0;e.langNum=0;e.huliNum=0;e.bianfuNum=0;e.dazhaoTime=50;e.isWin=!1;e.isStartClickOption=!1;e.dubleSorce=!1;e.curTimeNum=0;e.sheDie=!1;e.sheTimeNum=0;return e}();GameData.prototype.__class__="GameData";var ResourceUtils=function(){function e(){}e.createBitmapByName=function(e){var t=new egret.Bitmap;e=RES.getRes(e);t.texture=e;return t};e.createBitmapFromSheet=function(e,t){void 0===t&&(t="gameRes");var n=RES.getRes(t).getTexture(e),r=new egret.Bitmap;r.texture=n;return r};e.getTextureFromSheet=function(e,t){void 0===t&&(t="gameRes");return RES.getRes(t).getTexture(e)};return e}();ResourceUtils.prototype.__class__="ResourceUtils";var StarlingSwfFactory=function(){function e(){this.swfAssetsManager=new starlingswf.SwfAssetManager;this.swfAssetsNames=[];this.swfAssets=[];this.swfData={}}e.getInstance=function(){null==e._instance&&(e._instance=new e);return e._instance};e.prototype.addSwf=function(e,t,n){-1==this.swfAssetsNames.indexOf(e)&&(null==t||null==n?console.log("SWF加载失败:"+e):(this.swfAssetsManager.addSpriteSheet(e,n),t=new starlingswf.Swf(t,this.swfAssetsManager,24),t.name=e,StarlingSwfUtils.addSwf(t),this.swfAssetsNames.push(e),this.swfAssets.push(t)))};e.prototype.stopSwfs=function(e){for(var t=0,n=e.length;tthis.y?this.onjump?(this.y-=3*GameData.enemySpeed,this.goToJjump(),this.isStopHasClick=!0,160>=this.y&&(this.sp.goToPlay("run"),this.isStopHasClick=this.onjump=!1,4!=this.type&&5!=this.type||1!=Math.floor(4*Math.random()+1)||(10==this.x?this.x=129:129==this.x?248==this.x:248==this.x?this.x=129:367==this.x&&(this.x=248)))):this.stopMove||(this.y+=GameData.enemySpeed):(this.y=820,this.over=!0)};t.prototype.goOut=function(){1==this.row?(this.x-=15,this.y-=15):2==this.row?(this.x-=15,this.y-=20):3==this.row?(this.x+=15,this.y-=20):4==this.row&&(this.x+=15,this.y-=15)};t.prototype.stopMoveEnemy=function(){this.stopMove=!0};t.prototype.dispose=function(){this.removeChildren()};return t}(egret.Sprite);Enemy.prototype.__class__="Enemy";var __extends=this.__extends||function(e,t){function n(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);n.prototype=t.prototype;e.prototype=new n},MyButton=function(e){function t(t,n){e.call(this);this.sp=new egret.Sprite;this.addChild(this.sp);this.bg=ResourceUtils.createBitmapByName(t);this.sp.addChild(this.bg);this.title=ResourceUtils.createBitmapByName(n);null==this.title.texture&&(this.title.texture=RES.getRes(n));this.title.x=this.bg.width-this.title.width>>1;this.title.y=this.bg.height-this.title.height>>1;this.sp.addChild(this.title);this.noScaleX=this.sp.x;this.noScaleY=this.sp.y}__extends(t,e);t.prototype.setClick=function(e){this.touchEnabled=!0;this.addEventListener(egret.TouchEvent.TOUCH_TAP,this.onClickEvent,this);this.onClick=e};t.prototype.onClickEvent=function(){var e=(this.sp.width-.8*this.sp.width)/2,t=(this.sp.height-.8*this.sp.height)/2;this.tw=egret.Tween.get(this.sp);this.tw.to({scaleX:.7,scaleY:.7,x:e,y:t},40).to({scaleX:1,scaleY:1,x:this.noScaleX,y:this.noScaleY},40);this.onClick()};return t}(egret.Sprite);MyButton.prototype.__class__="MyButton";var __extends=this.__extends||function(e,t){function n(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);n.prototype=t.prototype;e.prototype=new n},MyButtonForGame=function(e){function t(t,n){e.call(this);this.sp=new egret.Sprite;this.addChild(this.sp);this.bg=ResourceUtils.createBitmapByName(t);this.sp.addChild(this.bg);this.title=ResourceUtils.createBitmapByName(n);null==this.title.texture&&(this.title.texture=RES.getRes(n));this.title.x=this.bg.width-this.title.width>>1;this.title.y=this.bg.height-this.title.height>>1;this.sp.addChild(this.title);this.noScaleX=this.sp.x;this.noScaleY=this.sp.y}__extends(t,e);t.prototype.setClick=function(e){this.touchEnabled=!0;this.addEventListener(egret.TouchEvent.TOUCH_TAP,this.onClickEvent,this);this.onClick=e};t.prototype.onClickEvent=function(){if(!GameData.isClickBtn){var e=(this.sp.width-.8*this.sp.width)/2,t=(this.sp.height-.8*this.sp.height)/2;this.tw=egret.Tween.get(this.sp);this.tw.to({scaleX:.7,scaleY:.7,x:e,y:t},40).to({scaleX:1,scaleY:1,x:this.noScaleX,y:this.noScaleY},40).call(this.onClickHandler,this)}};t.prototype.onClickHandler=function(){this.onClick()};return t}(egret.Sprite);MyButtonForGame.prototype.__class__="MyButtonForGame";var SoundUtils=function(){function e(){if(null!=e._instance)throw Error("singleton")}e.instance=function(){return null==this._instance?this._instance=new e:this._instance};e.prototype.initSound=function(){this.bgSound=RES.getRes("bgSound");this.winSound=RES.getRes("winSound");this.missSound=RES.getRes("missSound");this.hitSound=RES.getRes("hitSound");this.goSound=RES.getRes("goSound");this.overSound=RES.getRes("overSound");this.beHitSound=RES.getRes("beHitSound");this.numSound=RES.getRes("numSound")};e.prototype.playNum=function(){GameData.closeMusic||this.numSound.play()};e.prototype.playBeHit=function(){GameData.closeMusic||this.beHitSound.play()};e.prototype.playOver=function(){GameData.closeMusic||this.overSound.play()};e.prototype.playGo=function(){GameData.closeMusic||this.goSound.play()};e.prototype.playHit=function(){GameData.closeMusic||this.hitSound.play()};e.prototype.playMiss=function(){GameData.closeMusic||this.missSound.play()};e.prototype.playWin=function(){GameData.closeMusic||this.winSound.play()};e.prototype.playBg=function(){GameData.closeBgMusic?this.bgSound.pause():this.bgSound.play(!0)};e.prototype.stopBg=function(){this.bgSound.pause()};return e}();SoundUtils.prototype.__class__="SoundUtils";var __extends=this.__extends||function(e,t){function n(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);n.prototype=t.prototype;e.prototype=new n},GameFightFiveView=function(e){function t(){e.call(this);this.showXin=0;this.showXin1=74;this.shandian=0;this.shandian1=20;this.jian=this.dunpai=0;GameData.bgSpeed=3;this.totalEnemyNum=160;this.boshu=1;this.oneToTwo=8;this.curScene=5;GameData.enemySpeed=8.5;this.timeBoo=0;this.showEnemyTime=50;this.showResizeBtn=20;this.totalEnemy=0;this.freeTime=2;this.showXin=Math.floor(Math.random()*(this.totalEnemyNum-this.oneToTwo)+this.oneToTwo);this.shandian=Math.floor(Math.random()*(this.totalEnemyNum-this.oneToTwo)+this.oneToTwo);this.dunpai=Math.floor(Math.random()*(this.totalEnemyNum-this.oneToTwo)+this.oneToTwo);this.jian=Math.floor(Math.random()*(this.totalEnemyNum-this.oneToTwo)+this.oneToTwo);this.showXin==this.shandian&&(this.shandian=45);egret.Ticker.getInstance().register(this.showEnemyFun,this)}__extends(t,e);t.prototype.showEnemyFun=function(){this.isShowTwoEnemy&&(this.showEnemyFunNum++,10==this.showEnemyFunNum&&(this.showEnemyFunNum=0,this.showEnemyTime=Math.floor(15*Math.random()+20)))};t.prototype.showTime=function(){this.isShowTwoEnemy=!0;GameData.enemySpeed=8.5};t.prototype.hitOver=function(e,t,n){1==e.type?(e.gotoDie(),e.stopMove=!0,GameData.langNum++):2==e.type?(e.gotoDie(),this.shanBoo=e.stopMove=!0,GameData.blod--,this.blodBar.scaleBlodX()):3==e.type?(GameData.sheDie&&(e.bold=0),0==e.bold?(e.gotoDie(),e.stopMove=!0,GameData.huliNum++):e.onjump=!0,e.bold=0):4==e.type?(e.gotoDie(),this.shanBoo=e.stopMove=!0,GameData.blod--,this.blodBar.scaleBlodX()):5==e.type?(GameData.sheDie&&(e.bold=0),e.bold--,0==e.bold?(e.gotoDie(),e.stopMove=!0,GameData.bianfuNum++):e.onjump=!0):6==e.type?(e.alphaToZero(),e.stopMove=!0,GameData.blod+=3,5=this.totalEnemyNum?(this.stopGame=!0,0==GameFightView.allArr[0].length&&0==GameFightView.allArr[1].length&&0==GameFightView.allArr[2].length&&0==GameFightView.allArr[3].length&&this.gameWin()):this.totalEnemy==this.oneToTwo&&(GameData.stopCreateEnemy=1,GameData.count++,GameData.redGirlDistance++,GameData.count>this.freeTime&&(this.boshu=2,GameData.count=0,GameData.stopCreateEnemy=0,this.showTime()))};t.prototype.typeOne=function(e){e=Math.floor(2*Math.random()+3);var t=new Enemy(e);this.totalEnemy++;GameData.redGirlDistance++;this.enemySp.addChild(t);var n=Math.floor(4*Math.random()+1);t.row=n;t.x=this.btnArr[t.row-1].x+this.widthPoint;t.name="enemy1"+e+this.totalEnemy;this.pushEnemy(t.row,t)};t.prototype.typeTwo=function(e){var t=Math.floor(9*Math.random()+1),t=1==t?new Enemy(2):2==t?new Enemy(3):7==t?new Enemy(5):8==t?new Enemy(4):new Enemy(1);this.totalEnemy++;GameData.redGirlDistance++;this.enemySp.addChild(t);e=Math.floor(4*Math.random()+1);t.row=e;t.x=this.btnArr[t.row-1].x+this.widthPoint;t.name="enemy1_1"+this.totalEnemy;this.pushEnemy(t.row,t);if(this.isShowTwoEnemy)if(this.totalEnemy==this.showXin||this.totalEnemy==this.showXin1)t=new Enemy(6),this.enemySp.addChild(t),t.name="enemy2_d1"+this.totalEnemy,this.isShowDaoJu(t,e);else if(this.totalEnemy==this.shandian||this.totalEnemy==this.shandian1)t=new Enemy(7),this.enemySp.addChild(t),t.name="enemy2_d2"+this.totalEnemy,this.isShowDaoJu(t,e);else if(this.totalEnemy==this.dunpai)t=new Enemy(8),this.enemySp.addChild(t),t.name="enemy2_d3"+this.totalEnemy,this.isShowDaoJu(t,e);else if(this.totalEnemy==this.jian)t=new Enemy(9),this.enemySp.addChild(t),t.name="enemy2_d4"+this.totalEnemy,this.isShowDaoJu(t,e);else if(t=Math.floor(10*Math.random()+1),1==t||10==t){var t=Math.floor(5*Math.random()+1),n=new Enemy(t);this.enemySp.addChild(n);n.name="enemy3_da"+t+this.totalEnemy;this.isShowDaoJu(n,e)}else 2==t&&(n=new Enemy(1),this.enemySp.addChild(n),n.name="enemy3_2"+this.totalEnemy,this.isShowDaoJu(n,e))};return t}(GameFightView);GameFightFiveView.prototype.__class__="GameFightFiveView";var __extends=this.__extends||function(e,t){function n(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);n.prototype=t.prototype;e.prototype=new n},GameFightFourView=function(e){function t(){e.call(this);this.showXin=0;this.showXin1=74;this.shandian=0;this.shandian1=20;this.dunpai=0;GameData.bgSpeed=3;this.totalEnemyNum=120;this.boshu=1;this.oneToTwo=5;this.curScene=4;GameData.enemySpeed=8;this.timeBoo=0;this.showEnemyTime=60;this.showResizeBtn=20;this.totalEnemy=0;this.freeTime=2;this.showXin=Math.floor(Math.random()*(this.totalEnemyNum-this.oneToTwo)+this.oneToTwo);this.shandian=Math.floor(Math.random()*(this.totalEnemyNum-this.oneToTwo)+this.oneToTwo);this.dunpai=Math.floor(Math.random()*(this.totalEnemyNum-this.oneToTwo)+this.oneToTwo);this.showXin==this.shandian&&(this.shandian=45);egret.Ticker.getInstance().register(this.showEnemyFun,this)}__extends(t,e);t.prototype.showEnemyFun=function(){this.isShowTwoEnemy&&(this.showEnemyFunNum++,10==this.showEnemyFunNum&&(this.showEnemyFunNum=0,this.showEnemyTime=Math.floor(15*Math.random()+25)))};t.prototype.showTime=function(){this.isShowTwoEnemy=!0;GameData.enemySpeed=8.5};t.prototype.hitOver=function(e,t,n){1==e.type?(e.gotoDie(),e.stopMove=!0,GameData.langNum++):2==e.type?(e.gotoDie(),this.shanBoo=e.stopMove=!0,GameData.blod--,this.blodBar.scaleBlodX()):3==e.type?(0==e.bold?(e.gotoDie(),e.stopMove=!0,GameData.huliNum++):e.onjump=!0,e.bold=0):4==e.type?(e.gotoDie(),this.shanBoo=e.stopMove=!0,GameData.blod--,this.blodBar.scaleBlodX()):6==e.type?(e.alphaToZero(),e.stopMove=!0,GameData.blod+=3,5=this.totalEnemyNum?(this.stopGame=!0,0==GameFightView.allArr[0].length&&0==GameFightView.allArr[1].length&&0==GameFightView.allArr[2].length&&0==GameFightView.allArr[3].length&&this.gameWin()):this.totalEnemy==this.oneToTwo&&(GameData.stopCreateEnemy=1,GameData.count++,GameData.redGirlDistance++,GameData.count>this.freeTime&&(this.boshu=2,GameData.count=0,GameData.stopCreateEnemy=0,this.showTime()))};t.prototype.typeOne=function(e){e=Math.floor(2*Math.random()+3);e=new Enemy(e);this.totalEnemy++;GameData.redGirlDistance++;this.enemySp.addChild(e);var t=Math.floor(4*Math.random()+1);e.row=t;e.x=this.btnArr[e.row-1].x+this.widthPoint;e.name="enemy1"+this.totalEnemy;this.pushEnemy(e.row,e)};t.prototype.typeTwo=function(e){var t=Math.floor(7*Math.random()+1);e=1==t?new Enemy(2):2==t?new Enemy(4):new Enemy(1);this.totalEnemy++;GameData.redGirlDistance++;this.enemySp.addChild(e);t=Math.floor(4*Math.random()+1);e.row=t;e.x=this.btnArr[e.row-1].x+this.widthPoint;e.name="enemy1_1"+this.totalEnemy;this.pushEnemy(e.row,e);if(this.isShowTwoEnemy)if(this.totalEnemy==this.showXin||this.totalEnemy==this.showXin1)t=new Enemy(6),this.enemySp.addChild(t),t.name="enemy2_d0"+this.totalEnemy,this.isShowDaoJu(t,e);else if(this.totalEnemy==this.shandian||this.totalEnemy==this.shandian1)t=new Enemy(7),this.enemySp.addChild(t),t.name="enemy2_d1"+this.totalEnemy,this.isShowDaoJu(t,e);else if(this.totalEnemy==this.dunpai)t=new Enemy(8),this.enemySp.addChild(t),t.name="enemy2_d2"+this.totalEnemy,this.isShowDaoJu(t,e);else if(t=Math.floor(5*Math.random()+1),1==t){var n=Math.floor(4*Math.random()+1),t=new Enemy(n);this.enemySp.addChild(t);t.name="enemy2_1"+n+this.totalEnemy;this.isShowDaoJu(t,e)}else 2==t&&(t=new Enemy(1),this.enemySp.addChild(t),t.name="enemy2_2"+this.totalEnemy,this.isShowDaoJu(t,e))};return t}(GameFightView);GameFightFourView.prototype.__class__="GameFightFourView";var __extends=this.__extends||function(e,t){function n(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);n.prototype=t.prototype;e.prototype=new n},GameFightOneView=function(e){function t(){e.call(this);this.showXin=0;GameData.bgSpeed=3;this.totalEnemyNum=40;this.boshu=1;this.oneToTwo=15;this.curScene=1;GameData.enemySpeed=6;this.timeBoo=0;this.showResizeBtn=this.showEnemyTime=35;this.totalEnemy=0;this.freeTime=3;this.showXin=Math.floor(Math.random()*(this.totalEnemyNum-this.oneToTwo)+this.oneToTwo);egret.Ticker.getInstance().register(this.showEnemyFun,this)}__extends(t,e);t.prototype.showEnemyFun=function(){this.isShowTwoEnemy&&(this.showEnemyFunNum++,10==this.showEnemyFunNum&&(this.showEnemyFunNum=0,this.showEnemyTime=Math.floor(20*Math.random()+20)))};t.prototype.showTime=function(){this.isShowTwoEnemy=!0;GameData.enemySpeed=7.5};t.prototype.hitOver=function(e,t,n){1==e.type?(e.gotoDie(),e.stopMove=!0,GameData.langNum++):6==e.type&&(e.alphaToZero(),e.stopMove=!0,GameData.blod+=3,5=this.totalEnemyNum?(this.stopGame=!0,0==GameFightView.allArr[0].length&&0==GameFightView.allArr[1].length&&0==GameFightView.allArr[2].length&&0==GameFightView.allArr[3].length&&this.gameWin()):this.totalEnemy==this.oneToTwo&&(GameData.stopCreateEnemy=1,GameData.count++,GameData.redGirlDistance++,GameData.count>this.freeTime&&(this.boshu=2,GameData.count=0,GameData.stopCreateEnemy=0,this.showTime()))};return t}(GameFightView);GameFightOneView.prototype.__class__="GameFightOneView";var __extends=this.__extends||function(e,t){function n(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);n.prototype=t.prototype;e.prototype=new n},GameFightThreeView=function(e){function t(){e.call(this);this.showXin=0;this.showXin1=74;this.shandian=0;this.shandian1=20;this.dunpai=0;GameData.bgSpeed=3;this.totalEnemyNum=100;this.boshu=1;this.oneToTwo=6;this.curScene=3;GameData.enemySpeed=8;this.timeBoo=0;this.showEnemyTime=60;this.showResizeBtn=25;this.totalEnemy=0;this.freeTime=3;this.showXin=Math.floor(Math.random()*(this.totalEnemyNum-this.oneToTwo)+this.oneToTwo);this.shandian=Math.floor(Math.random()*(this.totalEnemyNum-this.oneToTwo)+this.oneToTwo);this.dunpai=Math.floor(Math.random()*(this.totalEnemyNum-this.oneToTwo)+this.oneToTwo);this.showXin==this.shandian&&(this.shandian=45);egret.Ticker.getInstance().register(this.showEnemyFun,this)}__extends(t,e);t.prototype.showEnemyFun=function(){this.isShowTwoEnemy&&(this.showEnemyFunNum++,10==this.showEnemyFunNum&&(this.showEnemyFunNum=0,this.showEnemyTime=Math.floor(15*Math.random()+25)))};t.prototype.showTime=function(){this.isShowTwoEnemy=!0;GameData.enemySpeed=8};t.prototype.hitOver=function(e,t,n){1==e.type?(e.gotoDie(),e.stopMove=!0,GameData.langNum++):2==e.type?(e.gotoDie(),this.shanBoo=e.stopMove=!0,GameData.blod--,this.blodBar.scaleBlodX()):3==e.type?(0==e.bold?(e.gotoDie(),e.stopMove=!0,GameData.huliNum++):e.onjump=!0,e.bold=0):6==e.type?(e.alphaToZero(),e.stopMove=!0,GameData.blod+=3,5=this.totalEnemyNum?(this.stopGame=!0,0==GameFightView.allArr[0].length&&0==GameFightView.allArr[1].length&&0==GameFightView.allArr[2].length&&0==GameFightView.allArr[3].length&&this.gameWin()):this.totalEnemy==this.oneToTwo&&(GameData.stopCreateEnemy=1,GameData.count++,GameData.redGirlDistance++,GameData.count>this.freeTime&&(this.boshu=2,GameData.count=0,GameData.stopCreateEnemy=0,this.showTime()))};t.prototype.typeOne=function(e){void 0===e&&(e=0);e=new Enemy(e);this.totalEnemy++;GameData.redGirlDistance++;this.enemySp.addChild(e);var t=Math.floor(4*Math.random()+1);e.row=t;e.x=this.btnArr[e.row-1].x+this.widthPoint;e.name="enemy1"+this.totalEnemy;this.pushEnemy(e.row,e)};t.prototype.typeTwo=function(e){void 0===e&&(e=0);var t=Math.floor(7*Math.random()+1);1==t&&(e=new Enemy(e));e=2==t?new Enemy(3):new Enemy(1);this.totalEnemy++;GameData.redGirlDistance++;this.enemySp.addChild(e);t=Math.floor(4*Math.random()+1);e.row=t;e.x=this.btnArr[e.row-1].x+this.widthPoint;e.name="enemy1_1"+this.totalEnemy;this.pushEnemy(e.row,e);this.isShowTwoEnemy&&(this.totalEnemy==this.showXin||this.totalEnemy==this.showXin1?(t=new Enemy(6),this.enemySp.addChild(t),t.name="enemy2_d1"+this.totalEnemy,this.isShowDaoJu(t,e)):this.totalEnemy==this.shandian||this.totalEnemy==this.shandian1?(t=new Enemy(7),this.enemySp.addChild(t),t.name="enemy2_d2"+this.totalEnemy,this.isShowDaoJu(t,e)):this.totalEnemy==this.dunpai?(t=new Enemy(8),this.enemySp.addChild(t),t.name="enemy2_d3"+this.totalEnemy,this.isShowDaoJu(t,e)):(t=Math.floor(6*Math.random()+1),1==t?(t=new Enemy(2),this.enemySp.addChild(t),t.name="enemy2_2"+this.totalEnemy,this.isShowDaoJu(t,e)):6==t&&(t=new Enemy(1),this.enemySp.addChild(t),t.name="enemy2_1"+this.totalEnemy,this.isShowDaoJu(t,e))))};return t}(GameFightView);GameFightThreeView.prototype.__class__="GameFightThreeView";var __extends=this.__extends||function(e,t){function n(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);n.prototype=t.prototype;e.prototype=new n},GameFightTwoView=function(e){function t(){e.call(this);this.shandian=this.showXin=0;GameData.bgSpeed=3;this.totalEnemyNum=80;this.boshu=1;this.oneToTwo=14;this.curScene=2;GameData.enemySpeed=8;this.timeBoo=0;this.showResizeBtn=this.showEnemyTime=30;this.totalEnemy=0;this.freeTime=3;this.showXin=Math.floor(Math.random()*(this.totalEnemyNum-this.oneToTwo)+this.oneToTwo);this.shandian=Math.floor(Math.random()*(this.totalEnemyNum-this.oneToTwo)+this.oneToTwo);this.showXin==this.shandian&&(this.shandian=Math.floor(Math.random()*(this.totalEnemyNum-this.oneToTwo)+this.oneToTwo));egret.Ticker.getInstance().register(this.showEnemyFun,this)}__extends(t,e);t.prototype.showEnemyFun=function(){this.isShowTwoEnemy&&(this.showEnemyFunNum++,10==this.showEnemyFunNum&&(this.showEnemyFunNum=0,GameData.enemySpeed=8,this.showEnemyTime=Math.floor(20*Math.random()+25)))};t.prototype.showTime=function(){this.isShowTwoEnemy=!0;GameData.enemySpeed=8};t.prototype.hitOver=function(e,t,n){1==e.type?(e.gotoDie(),e.stopMove=!0,GameData.langNum++):2==e.type?(e.gotoDie(),this.shanBoo=e.stopMove=!0,GameData.blod--,this.blodBar.scaleBlodX()):6==e.type?(e.alphaToZero(),e.stopMove=!0,GameData.blod+=3,5=this.totalEnemyNum?(this.stopGame=!0,0==GameFightView.allArr[0].length&&0==GameFightView.allArr[1].length&&0==GameFightView.allArr[2].length&&0==GameFightView.allArr[3].length&&this.gameWin()):this.totalEnemy==this.oneToTwo&&(GameData.stopCreateEnemy=1,GameData.count++,GameData.redGirlDistance++,GameData.count>this.freeTime&&(this.boshu=2,GameData.count=0,GameData.stopCreateEnemy=0,this.showTime()))};t.prototype.typeOne=function(e){void 0===e&&(e=0);e=new Enemy(e);this.totalEnemy++;GameData.redGirlDistance++;this.enemySp.addChild(e);var t=Math.floor(4*Math.random()+1);e.row=t;e.x=this.btnArr[e.row-1].x+this.widthPoint;e.name="enemy1_1"+this.totalEnemy;this.pushEnemy(t,e);this.isShowTwoEnemy&&(this.totalEnemy==this.showXin?(t=new Enemy(6),this.enemySp.addChild(t),t.name="enemy2_21"+this.totalEnemy,this.isShowDaoJu(t,e)):this.totalEnemy==this.shandian?(t=new Enemy(7),this.enemySp.addChild(t),t.name="enemy2_12"+this.totalEnemy,this.isShowDaoJu(t,e)):(t=Math.floor(6*Math.random()+1),1==t||2==t||3==t||4==t?(t=new Enemy(2),this.enemySp.addChild(t),t.name="enemy2_23"+this.totalEnemy,this.isShowDaoJu(t,e)):6==t&&(t=new Enemy(1),this.enemySp.addChild(t),t.name="enemy2_14"+this.totalEnemy,this.isShowDaoJu(t,e))))};t.prototype.typeTwo=function(e){void 0===e&&(e=0);var t=Math.floor(2*Math.random()+1);e=1==t||4==t?new Enemy(e):new Enemy(1);this.enemySp.addChild(e);t=Math.floor(4*Math.random()+1);e.row=t;e.x=this.btnArr[t-1].x+this.widthPoint;e.name="enemy1_2"+this.totalEnemy;this.totalEnemy++;GameData.redGirlDistance++;this.pushEnemy(e.row,e);if(this.isShowTwoEnemy){var n;this.totalEnemy==this.showXin?(n=new Enemy(6),this.enemySp.addChild(n),n.name="enemy1_d_1"+this.totalEnemy,this.isShowDaoJu(n,e)):this.totalEnemy==this.shandian?(n=new Enemy(7),this.enemySp.addChild(n),n.name="enemy1_d_2"+this.totalEnemy,this.isShowDaoJu(n,e)):(t=Math.floor(6*Math.random()+1),1==t||2==t||3==t||4==t?(e=new Enemy(2),this.enemySp.addChild(e),e.name="enemy2_2"+this.totalEnemy,this.isShowDaoJu(e,n)):6==t&&(e=new Enemy(1),this.enemySp.addChild(e),e.name="enemy2_1"+this.totalEnemy,this.isShowDaoJu(e,n)))}};return t}(GameFightView);GameFightTwoView.prototype.__class__="GameFightTwoView";var __extends=this.__extends||function(e,t){function n(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);n.prototype=t.prototype;e.prototype=new n},GameInfoView=function(e){function t(){e.call(this);this.initView()}__extends(t,e);t.prototype.initView=function(){var e=ResourceUtils.createBitmapByName("gameinfoImage");this.addChild(e);e=new MyButtonForGame("startBtnImage","startBtnImage");this.addChild(e);e.y=Const.SCENT_HEIGHT-e.height;e.x=Const.SCENT_WIDTH/2-e.width/2;e.setClick(this.onStartGameHandler.bind(this))};t.prototype.onStartGameHandler=function(){GameSceneView._gameScene.play();this.removeChildren()};t.prototype.onClickMoreGame=function(){alert("点击了")};return t}(egret.Sprite);GameInfoView.prototype.__class__="GameInfoView";var __extends=this.__extends||function(e,t){function n(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);n.prototype=t.prototype;e.prototype=new n},MusicView=function(e){function t(){e.call(this);this.initView()}__extends(t,e);t.prototype.initView=function(){var e=new egret.Sprite;this.addChild(e);var t=ResourceUtils.createBitmapByName("maskImage");e.addChild(t);e.addEventListener(egret.TouchEvent.TOUCH_TAP,this.onTouchThis,this);this.spContainer=new egret.Sprite;this.addChild(this.spContainer);e=Const.SCENT_HEIGHT/4;this.spContainer.x=Const.SCENT_WIDTH/8;this.spContainer.y=e;e=ResourceUtils.createBitmapByName("optionMusicBgImage");this.spContainer.addChild(e);e=new egret.Sprite;this.spContainer.addChild(e);t=ResourceUtils.createBitmapByName("option7Image");e.addChild(t);e.touchEnabled=!0;e.x=this.spContainer.width-.7*e.width;e.y=.4*-e.height;e.addEventListener(egret.TouchEvent.TOUCH_TAP,this.closePop,this);e=new egret.Sprite;this.spContainer.addChild(e);this.spguanbg=ResourceUtils.createBitmapByName("option5Image");e.addChild(this.spguanbg);this.spkaibg=ResourceUtils.createBitmapByName("option6Image");e.addChild(this.spkaibg);this.spguanbg.x=0;this.spkaibg.x=30;e.x=182;e.y=84;e.touchEnabled=!0;e.addEventListener(egret.TouchEvent.TOUCH_TAP,this.clickBgHandler,this);e=new egret.Sprite;this.spContainer.addChild(e);this.spguan=ResourceUtils.createBitmapByName("option5Image");e.addChild(this.spguan);this.spkai=ResourceUtils.createBitmapByName("option6Image");e.addChild(this.spkai);this.spguan.x=0;this.spkai.x=30;e.x=182;e.y=148;e.touchEnabled=!0;e.addEventListener(egret.TouchEvent.TOUCH_TAP,this.clickHandler,this);this.spguanbg.visible=!1;this.spkaibg.visible=!0;this.spguan.visible=!1;this.spkai.visible=!0};t.prototype.onTouchThis=function(e){e.stopImmediatePropagation();e.stopPropagation()};t.prototype.clickHandler=function(e){GameData.closeMusic?(this.spkai.visible=!0,this.spguan.visible=!1,GameData.closeMusic=!1):(this.spkai.visible=!1,this.spguan.visible=!0,GameData.closeMusic=!0)};t.prototype.clickBgHandler=function(e){GameData.closeBgMusic?(this.spguanbg.visible=!1,this.spkaibg.visible=!0,GameData.closeBgMusic=!1):(this.spguanbg.visible=!0,this.spkaibg.visible=!1,GameData.closeBgMusic=!0)};t.prototype.closePop=function(e){this.parent&&(GameData.isClickBtn=!1);this.visible=!1};t.prototype.removeAll=function(){this.removeChildren()};return t}(egret.Sprite);MusicView.prototype.__class__="MusicView";var __extends=this.__extends||function(e,t){function n(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);n.prototype=t.prototype;e.prototype=new n},OptionView=function(e){function t(){e.call(this);this.initView()}__extends(t,e);t.prototype.initView=function(){var e=new egret.Sprite;this.addChild(e);var t=ResourceUtils.createBitmapByName("maskImage");e.addChild(t);e.touchEnabled=!0;e.addEventListener(egret.TouchEvent.TOUCH_TAP,this.onClickHandler,this);this.spContainer=new egret.Sprite;this.addChild(this.spContainer);e=ResourceUtils.createBitmapByName("optionBgImage");this.spContainer.addChild(e);e=Const.SCENT_HEIGHT/4;this.spContainer.x=Const.SCENT_WIDTH/8;this.spContainer.y=e;e=new egret.Sprite;this.spContainer.addChild(e);t=ResourceUtils.createBitmapByName("zhinanImage");e.addChild(t);e.x=this.spContainer.width/2-e.width/2;e.y=200;e.addEventListener(egret.TouchEvent.TOUCH_TAP,this.touchHelp,this);e.touchEnabled=!0;this.helpSp=new egret.Sprite;this.addChild(this.helpSp);e=new egret.Sprite;this.spContainer.addChild(e);t=ResourceUtils.createBitmapByName("option7Image");e.addChild(t);e.touchEnabled=!0;e.x=this.spContainer.width-.7*e.width;e.y=.4*-e.height;e.addEventListener(egret.TouchEvent.TOUCH_TAP,this.closePop,this);e=new egret.Sprite;this.spContainer.addChild(e);this.spguanbg=ResourceUtils.createBitmapByName("option5Image");e.addChild(this.spguanbg);this.spkaibg=ResourceUtils.createBitmapByName("option6Image");e.addChild(this.spkaibg);this.spguanbg.x=0;this.spkaibg.x=30;e.x=182;e.y=84;e.touchEnabled=!0;e.addEventListener(egret.TouchEvent.TOUCH_TAP,this.clickBgHandler,this);e=new egret.Sprite;this.spContainer.addChild(e);this.spguan=ResourceUtils.createBitmapByName("option5Image");e.addChild(this.spguan);this.spkai=ResourceUtils.createBitmapByName("option6Image");e.addChild(this.spkai);this.spguan.x=0;this.spkai.x=30;e.x=182;e.y=148;e.touchEnabled=!0;e.addEventListener(egret.TouchEvent.TOUCH_TAP,this.clickHandler,this);this.spguanbg.visible=!1;this.spkaibg.visible=!0;this.spguan.visible=!1;this.spkai.visible=!0};t.prototype.onClickHandler=function(e){e.stopPropagation();e.stopImmediatePropagation()};t.prototype.touchHelp=function(e){if(!1==this.helpSp.visible)this.helpSp.visible=!0;else{e=ResourceUtils.createBitmapByName("gameinfoImage");e.width=Const.SCENT_WIDTH;e.height=Const.SCENT_HEIGHT;this.helpSp.addChild(e);e=new MyButton("closeGameBtnImage","closeGameBtnImage");this.helpSp.addChild(e);var t=Const.SCENT_HEIGHT-e.height;e.x=Const.SCENT_WIDTH/2-e.width/2;e.y=t;e.setClick(this.showStartView.bind(this))}};t.prototype.showStartView=function(){this.helpSp.visible=!1};t.prototype.clickHandler=function(e){GameData.closeMusic?(this.spkai.visible=!0,this.spguan.visible=!1,GameData.closeMusic=!1):(this.spkai.visible=!1,this.spguan.visible=!0,GameData.closeMusic=!0)};t.prototype.clickBgHandler=function(e){GameData.closeBgMusic?(this.spguanbg.visible=!1,this.spkaibg.visible=!0,GameData.closeBgMusic=!1,SoundUtils.instance().playBg()):(this.spguanbg.visible=!0,this.spkaibg.visible=!1,GameData.closeBgMusic=!0,SoundUtils.instance().stopBg())};t.prototype.closePop=function(e){this.visible=!1;GameData.isStart&&(GameData.isPause=!1)};return t}(egret.Sprite);OptionView.prototype.__class__="OptionView";var __extends=this.__extends||function(e,t){function n(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);n.prototype=t.prototype;e.prototype=new n},SpecialNumber=function(e){function t(t){e.call(this);this.charName=t}__extends(t,e);t.prototype.setValue=function(e){this.removeChildren();if(""!=e&&null!=e){e=(e+"").split("");for(var t=e.length,n=0,r=0;rGameData.sorce&&(this.thisNum=GameData.sorce),this.sorce.setValue(this.thisNum+""),this.sorce.x=Const.SCENT_WIDTH/2-this.sorce.width/2);this.boo1&&this.t1NumGameData.langNum&&(this.t1Num=GameData.langNum),this.t1.setValue(this.t1Num+""),this.t1.x=this.langW-this.t1.width/2);this.boo2&&this.t2NumGameData.huliNum&&(this.t2Num=GameData.huliNum),this.t2.setValue(this.t2Num+""),this.t2.x=this.huliW-this.t2.width/2);this.boo3&&this.t3NumGameData.bianfuNum&&(this.t3Num=GameData.bianfuNum),this.t3.setValue(this.t3Num+""),this.t3.x=this.bianfuW-this.t3.width/2);this.tNumthis.ttNum&&(this.tNum=this.ttNum),this.tt.text="超越了丛林中"+this.tNum+"%的小伙伴",this.tt.x=this.thisContainer.width/2-this.tt.width/2-10)};t.prototype.onClickMoreGame=function(e){top.location.href=btGame.URL.getMoreGame()};t.prototype.toShareView=function(e){top.location.href=btGame.URL.getMoreGame()};t.prototype.toGengDuoView=function(e){Play68.goHome()};t.prototype.toGameStartView=function(e){GameData.curScene=1;GameData.sorce=0;GameData.isPause=!0;GameData.count=0;GameData.profectNum=0;GameData.stopCreateEnemy=0;GameData.redGirlDistance=0;GameData.blod=5;this.spGengduo.removeEventListener(egret.TouchEvent.TOUCH_TAP,this.toGengDuoView,this);this.spFenXiang.removeEventListener(egret.TouchEvent.TOUCH_TAP,this.toShareView,this);this.spZaiLai.removeEventListener(egret.TouchEvent.TOUCH_TAP,this.toGameStartView,this);this.removeChildren();this.parent&&this.parent.removeChild(this);GameSceneView._gameScene.start()};t.prototype.touchShare=function(e){this.sp.visible=!1};t.prototype.initEnemy=function(e){void 0===e&&(e=0);if(1==e||2==e)this.boo1=!0,e=StarlingSwfFactory.getInstance().makeMc("lang"),this.thisContainer.addChild(e),e.goToPlay("run"),e.y=340,e.x=140+e.width,this.langW=e.x,this.t1=new SpecialNumber("number-"),this.thisContainer.addChild(this.t1),this.t1.setValue("0"),this.t1.x=e.x-this.t1.width/2,this.t1.y=e.y+.6*e.height-20;else if(3==e||4==e){this.boo2=this.boo1=!0;e=StarlingSwfFactory.getInstance().makeMc("lang");var t=StarlingSwfFactory.getInstance().makeMc("huli");this.thisContainer.addChild(e);this.thisContainer.addChild(t);e.goToPlay("run");t.goToPlay("run");t.y=320;e.y=340;e.x=(220+e.width)/2;t.x=e.x+e.width+60;this.langW=e.x;this.huliW=t.x;this.t1=new SpecialNumber("number-");this.thisContainer.addChild(this.t1);this.t1.setValue("0");this.t1.x=e.x-this.t1.width/2;this.t1.y=e.y+.6*e.height-20;this.t2=new SpecialNumber("number-");this.thisContainer.addChild(this.t2);this.t2.setValue("0");this.t2.x=t.x-this.t2.width/2;this.t2.y=t.y+.6*e.height}else if(5==e||6==e){this.boo3=this.boo2=this.boo1=!0;e=StarlingSwfFactory.getInstance().makeMc("lang");var t=StarlingSwfFactory.getInstance().makeMc("huli"),n=StarlingSwfFactory.getInstance().makeMc("bianfu");this.thisContainer.addChild(e);this.thisContainer.addChild(t);this.thisContainer.addChild(n);e.goToPlay("run");t.goToPlay("run");n.goToPlay("run");t.y=320;n.y=335;e.y=340;e.x=90;t.x=e.x+e.width+60;this.huliW=t.x;this.langW=e.x;n.x=t.x+t.width+70;this.bianfuW=n.x;this.t1=new SpecialNumber("number-");this.thisContainer.addChild(this.t1);this.t1.setValue("0");this.t1.x=e.x-this.t1.width/2;this.t1.y=e.y+.6*e.height-20;this.t2=new SpecialNumber("number-");this.thisContainer.addChild(this.t2);this.t2.setValue("0");this.t2.x=t.x-this.t2.width/2;this.t2.y=t.y+.6*e.height;this.t3=new SpecialNumber("number-");this.thisContainer.addChild(this.t3);this.t3.setValue("0");this.t3.x=n.x-this.t3.width/2;this.t3.y=n.y+.6*e.height-15}};return t}(egret.Sprite);GameOverView.prototype.__class__="GameOverView";var __extends=this.__extends||function(e,t){function n(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);n.prototype=t.prototype;e.prototype=new n},LoadingUI=function(e){function t(){e.call(this);this.logoUrl="resource/assets/ddlogo.png";this.bgUrl="resource/assets/loading_bg.jpg";this.createView()}__extends(t,e);t.prototype.createView=function(){this.w=Const.SCENT_WIDTH;this.h=Const.SCENT_HEIGHT;this.textField=new egret.TextField;this.textField.y=500;this.textField.textColor=3355443;this.textField.size=23;this.textField.width=this.w;this.textField.height=100;this.textField.fontFamily="Black";this.textField.textAlign="center";var e=new egret.URLLoader;e.addEventListener(egret.Event.COMPLETE,this.onComplete,this);e.dataFormat=egret.URLLoaderDataFormat.TEXTURE;e.load(new egret.URLRequest(this.logoUrl));e=new egret.URLLoader;e.addEventListener(egret.Event.COMPLETE,this.onComplete,this);e.dataFormat=egret.URLLoaderDataFormat.TEXTURE;e.load(new egret.URLRequest(this.bgUrl));this.bg=new egret.Bitmap;this.logo=new egret.Bitmap;this.ddLogo=new egret.Bitmap;this.uiContainer=new egret.DisplayObjectContainer;this.addChild(this.uiContainer);this.addChild(this.logo);this.addChild(this.ddLogo);this.addChildAt(this.bg,0);this.addChild(this.textField)};t.prototype.onComplete=function(e){e=e.target;var t=e.data;if(e._request.url==this.bgUrl){this.bg.texture=t,this.bg.scaleX=this.w/640,this.bg.scaleY=this.h/960}else if(e._request.url==this.logoUrl){this.logo.texture=t,this.logo.anchorX=this.logo.anchorY=.5,this.logo.x=this.w/2+10,this.logo.y=this.h/2-60,this.logo.scaleX=this.logo.scaleY=this.h/960,this.textField.y=this.logo.y+100}};t.prototype.setProgress=function(e,t){this.textField.text="游戏加载中…"+Math.floor(e/t*100)+"%"};t.prototype.onLoadComplete=function(e,t){e.call(t)};return t}(egret.Sprite);LoadingUI.prototype.__class__="LoadingUI";var __extends=this.__extends||function(e,t){function n(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);n.prototype=t.prototype;e.prototype=new n},GameSceneView=function(e){function t(){e.call(this);t._gameScene=this;this.initView()}__extends(t,e);t.prototype.initView=function(){this.thisContainer=new egret.Sprite;this.addChild(this.thisContainer);this.start()};t.prototype.start=function(){this.removeAll();var e=new GameStartView;this.thisContainer.addChild(e)};t.prototype.play=function(){this.removeAll();var e=new GamePlayView;this.thisContainer.addChild(e);e.showGame(GameData.curScene)};t.prototype.over=function(){this.removeAll();var e=new GameOverView;this.thisContainer.addChild(e)};t.prototype.removeAll=function(){this.thisContainer.removeChildren()};return t}(egret.Sprite);GameSceneView.prototype.__class__="GameSceneView";var __extends=this.__extends||function(e,t){function n(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);n.prototype=t.prototype;e.prototype=new n},BackGroundView=function(e){function t(t){e.call(this);this.initView(t)}__extends(t,e);t.prototype.initView=function(e){var t=new Hinder,n=new Hinder;switch(e){case 1:e=ResourceUtils.createBitmapByName("fight1BgImage");this.addChild(e);t.initView(1,1);n.initView(1,2);break;case 2:e=ResourceUtils.createBitmapByName("fight2BgImage");this.addChild(e);t.initView(2,1);n.initView(2,2);break;case 3:e=ResourceUtils.createBitmapByName("fight3BgImage");this.addChild(e);t.initView(3,1);n.initView(3,2);break;case 4:e=ResourceUtils.createBitmapByName("fight4BgImage");this.addChild(e);t.initView(4,1);n.initView(4,2);break;case 5:e=ResourceUtils.createBitmapByName("fight5BgImage"),this.addChild(e),t.initView(5,1),n.initView(5,2)}this.addChild(n);this.addChild(t);n.x=Const.SCENT_WIDTH-n.width};return t}(egret.Sprite);BackGroundView.prototype.__class__="BackGroundView";var ShareUtils=function(){function e(){}e.moreGame=function(){if(e.isInU9())location.href="u9time://gamelist";else{var t=e.findLocationProperty("app_id");window.open("http://games.egret-labs.org/more.php?app_id="+t,"_self")}};e.shareToWeChat=function(){window.hasOwnProperty("location")&&WeixinApi&&WeixinApi.ready(function(t){var n=new WeixinShareInfo;n.title=e.shareTitle;n.desc=e.shareDesc;n.link=window.location.href;n.imgUrl=e.IconPath;t.shareToFriend(n);t.shareToTimeline(n)})};e.isSetSwfFrame=function(){for(var e=0,t="",n=GameData.num.length;e=Const.SCENT_HEIGHT&&(this.bg1.y=this.bg2.y-this.bg1Height);this.bg2.y>=Const.SCENT_HEIGHT&&(this.bg2.y=this.bg1.y-this.bg2Height);this.bg1.y+=GameData.bgSpeed;this.bg2.y+=GameData.bgSpeed};t.prototype.dispose=function(){this.removeChildren();this.bg2=this.bg1=null};return t}(egret.Sprite);BgView.prototype.__class__="BgView";var __extends=this.__extends||function(e,t){function n(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);n.prototype=t.prototype;e.prototype=new n},BoldBar=function(e){function t(){e.call(this);this.w=0;this.initView()}__extends(t,e);t.prototype.initView=function(){var e=ResourceUtils.createBitmapByName("blodBarBgImage");this.addChild(e);e=ResourceUtils.createBitmapByName("blodBarImage");this.addChild(e);e.x=38;e.y=8;this.w=e.width;this.r=new egret.Rectangle;this.r.x=0;this.r.y=0;this.r.width=e.width;this.r.height=e.height;e.mask=this.r};t.prototype.scaleBlodX=function(){this.r.x=-(this.w-GameData.blod/5*this.w)};return t}(egret.Sprite);BoldBar.prototype.__class__="BoldBar";var __extends=this.__extends||function(e,t){function n(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);n.prototype=t.prototype;e.prototype=new n},Bomb=function(e){function t(){e.call(this);this.lastY=this.lastX=this.angle=this.speed=0;this.sp=ResourceUtils.createBitmapByName("bombImage");this.addChild(this.sp);this.sp.x=this.sp.width/2;this.sp.rotation=90;this.speed=30;egret.Ticker.getInstance().register(this.onFrame,this)}__extends(t,e);t.prototype.move=function(){this.angle=this.rotation=180*Math.atan2(this.lastY-this.y,this.lastX-this.x)/Math.PI};t.prototype.onFrame=function(){if(this.visible){this.x+=this.speed*Math.cos(this.angle/180*Math.PI);this.y+=this.speed*Math.sin(this.angle/180*Math.PI);var e=Math.sqrt(Math.pow(this.x-this.lastX,2)+Math.pow(this.y-this.lastY,2));15>e&&(this.visible=!1)}};t.prototype.dispose=function(){egret.Ticker.getInstance().unregister(this.onFrame,this);this.removeChildren();this.sp=null};return t}(egret.Sprite);Bomb.prototype.__class__="Bomb";var __extends=this.__extends||function(e,t){function n(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);n.prototype=t.prototype;e.prototype=new n},DaZhaoBar=function(e){function t(){e.call(this);this.b=this.w=0;this.rx=1;this.boo=!1}__extends(t,e);t.prototype.initView=function(){var e=ResourceUtils.createBitmapByName("dazhaoBarBg");this.addChild(e);var t=ResourceUtils.createBitmapByName("dazhaoImage");this.addChild(t);e.x=-2;e.y=2;t.y=e.y+2;this.w=t.width;this.r=new egret.Rectangle;this.b=t.x-t.width;this.r.x=this.b;this.r.y=0;this.r.width=t.width;this.r.height=t.height;t.mask=this.r;egret.Ticker.getInstance().register(this.onFrameHandler,this)};t.prototype.onFrameHandler=function(){this.boo&&(this.r.x=this.rx)};t.prototype.setValue=function(){this.boo||(GameData.profectNum>GameData.dazhaoTime&&(GameData.profectNum=GameData.dazhaoTime),this.r.x=-(this.w-GameData.profectNum/GameData.dazhaoTime*this.w))};return t}(egret.Sprite);DaZhaoBar.prototype.__class__="DaZhaoBar";var __extends=this.__extends||function(e,t){function n(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);n.prototype=t.prototype;e.prototype=new n},FightButton=function(e){function t(){e.call(this);this.initView()}__extends(t,e);t.prototype.initView=function(){this.button=StarlingSwfFactory.getInstance().makeMc("bazi");this.addChild(this.button);this.button.gotoAndStop(0)};t.prototype.goPlay=function(e){this.button.gotoAndStop(e)};return t}(egret.Sprite);FightButton.prototype.__class__="FightButton";var __extends=this.__extends||function(e,t){function n(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);n.prototype=t.prototype;e.prototype=new n},GirlDistanceBar=function(e){function t(){e.call(this);this._heightBar=0;this.initView()}__extends(t,e);t.prototype.initView=function(){var e=ResourceUtils.createBitmapByName("distanceBarImage");this.addChild(e);this.head=ResourceUtils.createBitmapByName("redGirlHeadImage");this.addChild(this.head);e.x=this.head.width/2;this._heightBar=e.height;this.head.y=this._heightBar};t.prototype.moveHead=function(e,t){void 0===e&&(e=0);void 0===t&&(t=0);this.head.y=this._heightBar-GameData.redGirlDistance/(e+t)*this._heightBar};return t}(egret.Sprite);GirlDistanceBar.prototype.__class__="GirlDistanceBar";var __extends=this.__extends||function(e,t){function n(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);n.prototype=t.prototype;e.prototype=new n},House=function(e){function t(){e.call(this);this.initView()}__extends(t,e);t.prototype.initView=function(){var e=ResourceUtils.createBitmapByName("houseImage");this.addChild(e)};return t}(egret.Sprite);House.prototype.__class__="House";var __extends=this.__extends||function(e,t){function n(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);n.prototype=t.prototype;e.prototype=new n},Line=function(e){function t(){e.call(this);this.boo=!1;this.sp=ResourceUtils.createBitmapByName("lineImage");this.addChild(this.sp);this.sp.x=this.sp.width/2;egret.Ticker.getInstance().register(this.onFrame,this)}__extends(t,e);t.prototype.move=function(){this.boo=this.visible=!0};t.prototype.onFrame=function(e){this.boo&&(this.y+=3*GameData.enemySpeed,this.y>Const.SCENT_HEIGHT&&(this.boo=this.visible=!1))};return t}(egret.Sprite);Line.prototype.__class__="Line";var __extends=this.__extends||function(e,t){function n(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);n.prototype=t.prototype;e.prototype=new n},RedGirl=function(e){function t(){e.call(this);this.initView()}__extends(t,e);t.prototype.initView=function(){this.girl=StarlingSwfFactory.getInstance().makeMc("xiaohongmao");this.addChild(this.girl);this.girl.gotoAndStop(0)};t.prototype.run=function(){this.girl.goToPlay("1")};t.prototype.gotoDie=function(){this.girl.goToPlay("2")};t.prototype.gotoWin=function(){this.girl.goToPlay("3")};t.prototype.dispose=function(){this.removeChildren()};return t}(egret.Sprite);RedGirl.prototype.__class__="RedGirl";var __extends=this.__extends||function(e,t){function n(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);n.prototype=t.prototype;e.prototype=new n},SourceView=function(e){function t(){e.call(this);this.initView()}__extends(t,e);t.prototype.initView=function(){var e=ResourceUtils.createBitmapByName("sorceMcImage");this.addChild(e);this.showSorce=new SpecialNumber("number-");this.showSorce.x=e.width+10;this.addChild(this.showSorce)};t.prototype.setValue=function(e){void 0===e&&(e=0);this.showSorce.setValue(e+"")};return t}(egret.Sprite);SourceView.prototype.__class__="SourceView";var __extends=this.__extends||function(e,t){function n(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);n.prototype=t.prototype;e.prototype=new n},StreakNum=function(e){function t(){e.call(this);this.conboW=0;this.initView()}__extends(t,e);t.prototype.initView=function(){var e=ResourceUtils.createBitmapByName("comboImage");this.addChild(e);this.conboW=e.width;this.showSorce=new SpecialNumber("number-0");this.showSorce.x=this.conboW/2-this.showSorce.width/2;this.showSorce.y=e.height+5;this.addChild(this.showSorce)};t.prototype.setValue=function(e){void 0===e&&(e=0);this.showSorce.x=this.conboW/2-this.showSorce.width/2;this.showSorce.setValue(e+"")};return t}(egret.Sprite);StreakNum.prototype.__class__="StreakNum";var GS=function(){function e(){}e.bb=0x396ae77e3688a;return e}();GS.prototype.__class__="GS";var __extends=this.__extends||function(e,t){function n(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);n.prototype=t.prototype;e.prototype=new n},PromptPop=function(e){function t(){e.call(this);this.isHide=this.isAway=this.isInto=this.isShow=!1;this.tY=this.tX=this.stay=0;this.config={isHide:!0,stayTime:800,tx:0,ty:0}}__extends(t,e);t.prototype.activate=function(e,t,n){void 0===e&&(e=0);void 0===t&&(t=0);void 0===n&&(n=null);this.config.tx=e;this.config.ty=t;this.settings(n);this.targetMc=StarlingSwfFactory.getInstance().makeMc("tip");this.addChild(this.targetMc);this.targetMc.x=this.tX;this.targetMc.y=this.tY;this.targetMc.visible=!1};t.prototype.show=function(e,t){void 0===t&&(t=null);null!=this.targetMc&&(t&&(null!=t.isHide&&(this.isHide=t.isHide),null!=t.stayTime&&(this.stay=t.stayTime),null!=t.tx&&(this.tX=t.tx),null!=t.ty&&(this.tY=t.ty)),this.setMc(e),this.tweenStar())};t.prototype.tweenStar=function(){this.isShow=this.isInto=!0;this.isAway=!1;this.targetMc.x=this.tX;this.targetMc.y=this.tY;this.targetMc.alpha=1;this.targetMc.visible=!0;this.tw=egret.Tween.get(this.targetMc).call(this.tweenStop,this);this.tw.to({y:this.tY-200,alpha:1},200)};t.prototype.tweenStop=function(){this.isInto=!1;this.isHide&&(this.isAway=!0,this.tw=egret.Tween.get(this.targetMc).call(this.tweenOver,this),this.tw.to({alpha:0,delay:1,visible:!1},this.stay));this.settings()};t.prototype.tweenOver=function(){this.isAway=this.isShow=!1};t.prototype.hide=function(e){void 0===e&&(e=0);this.isHide=!0;this.stay=e;this.tweenStop()};t.prototype.settings=function(e){void 0===e&&(e=null);if(null!=e)for(var t in this.config)this.config[t]=null!=e[t]?e[t]:this.config[t];this.isHide=this.config.isHide;this.stay=this.config.stayTime;this.tX=this.config.tx;this.tY=this.config.ty};t.prototype.setMc=function(e){this.targetMc.goToPlay(e)};Object.defineProperty(t.prototype,"isSHOW",{get:function(){return this.isShow},enumerable:!0,configurable:!0});Object.defineProperty(t.prototype,"isINTO",{get:function(){return this.isInto},enumerable:!0,configurable:!0});Object.defineProperty(t.prototype,"isAWAY",{get:function(){return this.isAway},enumerable:!0,configurable:!0});t.prototype.removeAll=function(){};return t}(egret.Sprite);PromptPop.prototype.__class__="PromptPop"