第一次提交
This commit is contained in:
commit
8121362a03
4412 files changed
+1091845
No files matched your search
@@ -0,0 +1,6 @@
|
||||
function __extends(t,e){function i(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);i.prototype=e.prototype,t.prototype=new i}var egret;!function(t){function e(){return""}function i(t){throw new Error("#"+t)}function n(){}function r(){}function s(){}t.getString=e,t.$error=i,t.$warn=n,t.$markReadOnly=r,t.$markCannotUse=s}(egret||(egret={}));var egret;!function(t){function e(t,e,i){var n=t.prototype;n.__class__=e;var r=[e];i&&(r=r.concat(i));var s=n.__types__;if(n.__types__)for(var a=s.length,o=0;a>o;o++){var h=s[o];-1==r.indexOf(h)&&r.push(h)}n.__types__=r}t.registerClass=e}(egret||(egret={}));var __define=this.__define||function(t,e,i,n){Object.defineProperty(t,e,{configurable:!0,enumerable:!0,get:i,set:n})},egret;!function(t){t.$hashCount=1;var e=function(){function e(){this.$hashCode=t.$hashCount++}var i=__define,n=e,r=n.prototype;return i(r,"hashCode",function(){return this.$hashCode}),e}();t.HashObject=e,t.registerClass(e,"egret.HashObject",["egret.IHashObject"])}(egret||(egret={}));var egret;!function(t){var e=[],i=function(i){function n(t){void 0===t&&(t=null),i.call(this),this.$EventDispatcher={0:t?t:this,1:{},2:{},3:0}}__extends(n,i);var r=n,s=r.prototype;return s.$getEventMap=function(t){var e=this.$EventDispatcher,i=t?e[2]:e[1];return i},s.addEventListener=function(t,e,i,n,r){this.$addListener(t,e,i,n,r)},s.once=function(t,e,i,n,r){this.$addListener(t,e,i,n,r,!0)},s.$addListener=function(t,e,i,n,r,s){var a=this.$EventDispatcher,o=n?a[2]:a[1],h=o[t];h?0!==a[3]&&(o[t]=h=h.concat()):h=o[t]=[],this.$insertEventBin(h,t,e,i,n,r,s)},s.$insertEventBin=function(t,e,i,n,r,s,a){s=0|+s;for(var o=-1,h=t.length,l=0;h>l;l++){var u=t[l];if(u.listener==i&&u.thisObject==n&&u.target==this)return!1;-1==o&&u.priority<s&&(o=l)}var c={type:e,listener:i,thisObject:n,priority:s,target:this,useCapture:r,dispatchOnce:!!a};return-1!==o?t.splice(o,0,c):t.push(c),!0},s.removeEventListener=function(t,e,i,n){var r=this.$EventDispatcher,s=n?r[2]:r[1],a=s[t];a&&(0!==r[3]&&(s[t]=a=a.concat()),this.$removeEventBin(a,e,i),0==a.length&&(s[t]=null))},s.$removeEventBin=function(t,e,i){for(var n=t.length,r=0;n>r;r++){var s=t[r];if(s.listener==e&&s.thisObject==i&&s.target==this)return t.splice(r,1),!0}return!1},s.hasEventListener=function(t){var e=this.$EventDispatcher;return!(!e[1][t]&&!e[2][t])},s.willTrigger=function(t){return this.hasEventListener(t)},s.dispatchEvent=function(t){return t.$currentTarget=this.$EventDispatcher[0],t.$setTarget(t.$currentTarget),this.$notifyListener(t,!1)},s.$notifyListener=function(t,i){var n=this.$EventDispatcher,r=i?n[2]:n[1],s=r[t.$type];if(!s)return!0;var a=s.length;if(0==a)return!0;var o=e;n[3]++;for(var h=0;a>h;h++){var l=s[h];if(l.listener.call(l.thisObject,t),l.dispatchOnce&&o.push(l),t.$isPropagationImmediateStopped)break}for(n[3]--;o.length;){var l=o.pop();l.target.removeEventListener(l.type,l.listener,l.thisObject,l.useCapture)}return!t.$isDefaultPrevented},s.dispatchEventWith=function(e,i,n,r){if(i||this.hasEventListener(e)){var s=t.Event.create(t.Event,e,i,r);s.data=n;var a=this.dispatchEvent(s);return t.Event.release(s),a}return!0},n}(t.HashObject);t.EventDispatcher=i,t.registerClass(i,"egret.EventDispatcher",["egret.IEventDispatcher"])}(egret||(egret={}));var egret;!function(t){var e=[],i=function(i){function n(t,e,n,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===n&&(n=0),void 0===r&&(r=0),i.call(this),this.x=t,this.y=e,this.width=n,this.height=r}__extends(n,i);var r=__define,s=n,a=s.prototype;return n.release=function(t){t&&e.push(t)},n.create=function(){var t=e.pop();return t||(t=new n),t},r(a,"right",function(){return this.x+this.width},function(t){this.width=t-this.x}),r(a,"bottom",function(){return this.y+this.height},function(t){this.height=t-this.y}),r(a,"left",function(){return this.x},function(t){this.width+=this.x-t,this.x=t}),r(a,"top",function(){return this.y},function(t){this.height+=this.y-t,this.y=t}),r(a,"topLeft",function(){return new t.Point(this.left,this.top)},function(t){this.top=t.y,this.left=t.x}),r(a,"bottomRight",function(){return new t.Point(this.right,this.bottom)},function(t){this.bottom=t.y,this.right=t.x}),a.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this},a.setTo=function(t,e,i,n){return this.x=t,this.y=e,this.width=i,this.height=n,this},a.contains=function(t,e){return this.x<=t&&this.x+this.width>=t&&this.y<=e&&this.y+this.height>=e},a.intersection=function(t){return this.clone().$intersectInPlace(t)},a.inflate=function(t,e){this.x-=t,this.width+=2*t,this.y-=e,this.height+=2*e},a.$intersectInPlace=function(t){var e=this.x,i=this.y,n=t.x,r=t.y,s=Math.max(e,n),a=Math.min(e+this.width,n+t.width);if(a>=s){var o=Math.max(i,r),h=Math.min(i+this.height,r+t.height);if(h>=o)return this.setTo(s,o,a-s,h-o),this}return this.setEmpty(),this},a.intersects=function(t){return Math.max(this.x,t.x)<=Math.min(this.right,t.right)&&Math.max(this.y,t.y)<=Math.min(this.bottom,t.bottom)},a.isEmpty=function(){returnLine truncated
|
||||
}}var h=this.$displayList||this.$parentDisplayList;this.assignParentDisplayList(s,h,null),s.$propagateFlagsDown(1648),s.$setParent(null);var l=r.indexOf(s);return-1!=l&&r.splice(l,1),this.$propagateFlagsUp(4),s},s.setChildIndex=function(t,e){e=0|+e,(0>e||e>=this.$children.length)&&(e=this.$children.length-1),this.doSetChildIndex(t,e)},s.doSetChildIndex=function(t,e){var i=this.$children.indexOf(t);i!=e&&(this.$childRemoved(t,i),this.$children.splice(i,1),this.$children.splice(e,0,t),this.$childAdded(t,e),t.$invalidateTransform(),this.$propagateFlagsUp(4))},s.swapChildrenAt=function(t,e){t=0|+t,e=0|+e,t>=0&&t<this.$children.length&&e>=0&&e<this.$children.length&&this.doSwapChildrenAt(t,e)},s.swapChildren=function(t,e){var i=this.$children.indexOf(t),n=this.$children.indexOf(e);-1==i||-1==n||this.doSwapChildrenAt(i,n)},s.doSwapChildrenAt=function(t,e){if(t>e){var i=e;e=t,t=i}else if(t==e)return;var n=this.$children,r=n[t],s=n[e];this.$childRemoved(r,t),this.$childRemoved(s,e),n[t]=s,n[e]=r,this.$childAdded(s,t),this.$childAdded(r,e),r.$invalidateTransform(),s.$invalidateTransform(),this.$propagateFlagsUp(4)},s.removeChildren=function(){for(var t=this.$children,e=t.length-1;e>=0;e--)this.$doRemoveChild(e)},s.$childAdded=function(t,e){},s.$childRemoved=function(t,e){},s.$onAddToStage=function(t,i){e.prototype.$onAddToStage.call(this,t,i);var n=this.$children,r=n.length;i++;for(var s=0;r>s;s++){var a=this.$children[s];a.$onAddToStage(t,i)}},s.$onRemoveFromStage=function(){e.prototype.$onRemoveFromStage.call(this);for(var t=this.$children,i=t.length,n=0;i>n;n++){var r=t[n];r.$onRemoveFromStage()}},s.$measureChildBounds=function(e){var i=this.$children,n=i.length;if(0!=n){for(var r=0,s=0,a=0,o=0,h=!1,l=-1;n>l;l++){var u=-1==l?e:i[l].$getTransformedBounds(this,t.$TempRectangle);u.isEmpty()||(h?(r=Math.min(r,u.x),s=Math.max(s,u.x+u.width),a=Math.min(a,u.y),o=Math.max(o,u.y+u.height)):(h=!0,r=u.x,s=r+u.width,a=u.y,o=a+u.height))}e.setTo(r,a,s-r,o-a)}},n(s,"touchChildren",function(){return this.$getTouchChildren()},function(t){this.$setTouchChildren(!!t)}),s.$getTouchChildren=function(){return this.$touchChildren},s.$setTouchChildren=function(t){return this.$touchChildren==t?!1:(this.$touchChildren=t,!0)},s.$invalidate=function(t){if(e.prototype.$invalidate.call(this,t),t){var i=this.$displayList||this.$parentDisplayList,n=this.$children;if(n)for(var r=n.length-1;r>=0;r--)this.markChildDirty(n[r],i)}},s.$invalidateTransform=function(){this.markChildDirty(this,this.$parentDisplayList)},s.markChildDirty=function(t,e){if(!t.$hasFlags(512)){t.$setFlags(512);var i=t.$displayList;if((i||t.$renderNode)&&e&&e.markDirty(i||t),!i){var n=t.$children;if(n)for(var r=n.length-1;r>=0;r--)this.markChildDirty(n[r],e)}}},s.$cacheAsBitmapChanged=function(){e.prototype.$cacheAsBitmapChanged.call(this);for(var t=this.$displayList||this.$parentDisplayList,i=this.$children,n=i.length-1;n>=0;n--)this.assignParentDisplayList(i[n],t,t)},s.assignParentDisplayList=function(t,e,i){t.$parentDisplayList=i,t.$setFlags(512);var n=t.$displayList;if((t.$renderNode||n)&&e&&e.markDirty(n||t),!n){var r=t.$children;if(r)for(var s=r.length-1;s>=0;s--)this.assignParentDisplayList(r[s],e,i)}},s.$hitTest=function(t,i){if(!this.$visible)return null;var n=this.$getInvertedConcatenatedMatrix(),r=n.a*t+n.c*i+n.tx,s=n.b*t+n.d*i+n.ty,a=this.$scrollRect?this.$scrollRect:this.$maskRect;if(a&&!a.contains(r,s))return null;if(this.$mask&&!this.$mask.$hitTest(t,i))return null;for(var o=this.$children,h=!1,l=null,u=o.length-1;u>=0;u--){var c=o[u];if(!c.$maskedObject&&(l=c.$hitTest(t,i))){if(h=!0,l.$touchEnabled)break;l=null}}return l?this.$touchChildren?l:this:h?this:e.prototype.$hitTest.call(this,t,i)},s.$setAlpha=function(t){return t=+t||0,t==this.$alpha?!1:(this.$alpha=t,this.$propagateFlagsDown(64),this.$invalidate(),this.$invalidateAllChildren(),!0)},s.$invalidateAllChildren=function(){var t=this.$children;if(t)for(var e=t.length-1;e>=0;e--){var i=t[e];i.$invalidate(),i.$children&&i.$invalidateAllChildren()}},i.$EVENT_ADD_TO_STAGE_LIST=[],i.$EVENT_REMOVE_FROM_STAGE_LIST=[],i}(t.DisplayObject);t.DisplayObjectContainer=e,t.registerClass(e,"egret.DisplayObjectContainer")}(egret||(egret={}));var egret;!function(t){var e=function(){function t(){}var e=t;e.prototype;return t.LINEAR="linear",t.RADIAL="radial",t}();t.GradientType=e,t.registerClass(e,"egret.GradientType")}(egret||(egret={}));var egret;!function(t){function e(t){return t%=2*Math.PI,0>t&&(t+=2*Math.PI),t}var i=function(i){function n(){i.call(this),this.lastX=0,this.lastY=0,this.fillPath=null,this.strokePath=null,this.topLeftStrokeWidth=0,this.bottomRightStrokeWidth=0,this.minX=1/0,this.minY=1/0,this.maxX=-(1/0),this.maxY=-(1/0),this.includeLastPosition=!0,this.$renderNode=new t.sys.GraphicsNode}__extends(n,i);var r=n,s=r.prototype;return s.$setTarget=function(t){this.targetDisplay&&(this.targetDisplay.$renderNode=null),t.$renderNode=this.$renderNode,this.targetDisplay=t},s.setStrokeWidth=function(t){switch(t){cLine truncated
|
||||
}__extends(e,t);var i=__define,n=e,r=n.prototype;return i(r,"distance",function(){return this.$distance},function(t){this.$distance!=t&&(this.$distance=t,this.invalidate())}),i(r,"angle",function(){return this.$angle},function(t){this.$angle!=t&&(this.$angle=t,this.invalidate())}),i(r,"hideObject",function(){return this.$hideObject},function(t){this.$hideObject!=t&&(this.$hideObject=t,this.invalidate())}),r.$toJson=function(){return'{"distance": '+this.$distance+', "angle": '+this.$angle+', "color": '+this.$color+', "red": '+this.$red+', "green": '+this.$green+', "blue": '+this.$blue+', "alpha": '+this.$alpha+', "blurX": '+this.$blurX+', "blurY": '+this.blurY+', "strength": '+this.$strength+', "quality": '+this.$quality+', "inner": '+this.$inner+', "knockout": '+this.$knockout+', "hideObject": '+this.$hideObject+"}"},e}(t.GlowFilter);t.DropShadowFilter=e,t.registerClass(e,"egret.DropShadowFilter")}(egret||(egret={}));var egret;!function(t){var e=Math.PI,i=2*e,n=e/180,r=[],s=function(s){function a(t,e,i,n,r,a){void 0===t&&(t=1),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=1),void 0===r&&(r=0),void 0===a&&(a=0),s.call(this),this.a=t,this.b=e,this.c=i,this.d=n,this.tx=r,this.ty=a}__extends(a,s);var o=a,h=o.prototype;return a.release=function(t){t&&r.push(t)},a.create=function(){var t=r.pop();return t||(t=new a),t},h.clone=function(){return new a(this.a,this.b,this.c,this.d,this.tx,this.ty)},h.concat=function(t){var e=this.a*t.a,i=0,n=0,r=this.d*t.d,s=this.tx*t.a+t.tx,a=this.ty*t.d+t.ty;(0!==this.b||0!==this.c||0!==t.b||0!==t.c)&&(e+=this.b*t.c,r+=this.c*t.b,i+=this.a*t.b+this.b*t.d,n+=this.c*t.a+this.d*t.c,s+=this.ty*t.c,a+=this.tx*t.b),this.a=e,this.b=i,this.c=n,this.d=r,this.tx=s,this.ty=a},h.copyFrom=function(t){return this.a=t.a,this.b=t.b,this.c=t.c,this.d=t.d,this.tx=t.tx,this.ty=t.ty,this},h.identity=function(){this.a=this.d=1,this.b=this.c=this.tx=this.ty=0},h.invert=function(){this.$invertInto(this)},h.$invertInto=function(t){var e=this.a,i=this.b,n=this.c,r=this.d,s=this.tx,a=this.ty;if(0==i&&0==n)return t.b=t.c=0,void(0==e||0==r?t.a=t.d=t.tx=t.ty=0:(e=t.a=1/e,r=t.d=1/r,t.tx=-e*s,t.ty=-r*a));var o=e*r-i*n;if(0==o)return void t.identity();o=1/o;var h=t.a=r*o;i=t.b=-i*o,n=t.c=-n*o,r=t.d=e*o,t.tx=-(h*s+n*a),t.ty=-(i*s+r*a)},h.rotate=function(e){if(e=+e,0!==e){e/=n;var i=t.NumberUtils.cos(e),r=t.NumberUtils.sin(e),s=this.a,a=this.b,o=this.c,h=this.d,l=this.tx,u=this.ty;this.a=s*i-a*r,this.b=s*r+a*i,this.c=o*i-h*r,this.d=o*r+h*i,this.tx=l*i-u*r,this.ty=l*r+u*i}},h.scale=function(t,e){1!==t&&(this.a*=t,this.c*=t,this.tx*=t),1!==e&&(this.b*=e,this.d*=e,this.ty*=e)},h.setTo=function(t,e,i,n,r,s){return this.a=t,this.b=e,this.c=i,this.d=n,this.tx=r,this.ty=s,this},h.transformPoint=function(e,i,n){var r=this.a*e+this.c*i+this.tx,s=this.b*e+this.d*i+this.ty;return n?(n.setTo(r,s),n):new t.Point(r,s)},h.translate=function(t,e){this.tx+=t,this.ty+=e},h.equals=function(t){return this.a==t.a&&this.b==t.b&&this.c==t.c&&this.d==t.d&&this.tx==t.tx&&this.ty==t.ty},h.prepend=function(t,e,i,n,r,s){var a=this.tx;if(1!=t||0!=e||0!=i||1!=n){var o=this.a,h=this.c;this.a=o*t+this.b*i,this.b=o*e+this.b*n,this.c=h*t+this.d*i,this.d=h*e+this.d*n}return this.tx=a*t+this.ty*i+r,this.ty=a*e+this.ty*n+s,this},h.append=function(t,e,i,n,r,s){var a=this.a,o=this.b,h=this.c,l=this.d;return(1!=t||0!=e||0!=i||1!=n)&&(this.a=t*a+e*h,this.b=t*o+e*l,this.c=i*a+n*h,this.d=i*o+n*l),this.tx=r*a+s*h+this.tx,this.ty=r*o+s*l+this.ty,this},h.deltaTransformPoint=function(e){var i=this,n=i.a*e.x+i.c*e.y,r=i.b*e.x+i.d*e.y;return new t.Point(n,r)},h.toString=function(){return"(a="+this.a+", b="+this.b+", c="+this.c+", d="+this.d+", tx="+this.tx+", ty="+this.ty+")"},h.createBox=function(e,i,r,s,a){void 0===r&&(r=0),void 0===s&&(s=0),void 0===a&&(a=0);var o=this;if(0!==r){r/=n;var h=t.NumberUtils.cos(r),l=t.NumberUtils.sin(r);o.a=h*e,o.b=l*i,o.c=-l*e,o.d=h*i}else o.a=e,o.b=0,o.c=0,o.d=i;o.tx=s,o.ty=a},h.createGradientBox=function(t,e,i,n,r){void 0===i&&(i=0),void 0===n&&(n=0),void 0===r&&(r=0),this.createBox(t/1638.4,e/1638.4,i,n+t/2,r+e/2)},h.$transformBounds=function(t){var e=this.a,i=this.b,n=this.c,r=this.d,s=this.tx,a=this.ty,o=t.x,h=t.y,l=o+t.width,u=h+t.height,c=e*o+n*h+s,d=i*o+r*h+a,f=e*l+n*h+s,g=i*l+r*h+a,p=e*l+n*u+s,v=i*l+r*u+a,$=e*o+n*u+s,m=i*o+r*u+a,y=0;c>f&&(y=c,c=f,f=y),p>$&&(y=p,p=$,$=y),t.x=Math.floor(p>c?c:p),t.width=Math.ceil((f>$?f:$)-t.x),d>g&&(y=d,d=g,g=y),v>m&&(y=v,v=m,m=y),t.y=Math.floor(v>d?d:v),t.height=Math.ceil((g>m?g:m)-t.y)},h.getDeterminant=function(){return this.a*this.d-this.b*this.c},h.$getScaleX=function(){var t=this;if(1==t.a&&0==t.b)return 1;var e=Math.sqrt(t.a*t.a+t.b*t.b);return this.getDeterminant()<0?-e:e},h.$getScaleY=function(){var t=this;if(0==t.c&&1==t.d)return 1;var e=Math.sqrt(t.c*t.c+t.d*t.d);return this.getDeterminant()<0?-e:e},h.$getSkewX=function(){return Math.atan2(this.d,this.c)-e/2},h.$getSkewY=function(){return Math.atan2(this.b,this.a)},h.$updateScaleAndRotation=function(e,r,s,a){if(!(0!=s&&s!Line truncated
|
||||
this.callLaterAsyncs();for(var h=0;s>h;h++)n[h].call(r[h],o)&&(a=!0);var l=t.getTimer(),u=o-this.lastTimeStamp;if(this.lastTimeStamp=o,u>=this.frameDeltaTime)this.lastCount=this.frameInterval;else{if(this.lastCount-=1e3,this.lastCount>0)return void(a&&this.render(!1,this.costEnterFrame+l-i));this.lastCount+=this.frameInterval}this.render(!0,this.costEnterFrame+l-i);var c=t.getTimer();this.broadcastEnterFrame();var d=t.getTimer();this.costEnterFrame=d-c},r.render=function(t,i){var n=this.playerList,r=n.length;if(0!=r){this.callLaters(),e.$invalidateRenderFlag&&(this.broadcastRender(),e.$invalidateRenderFlag=!1);for(var s=0;r>s;s++)n[s].$render(t,i);e.$requestRenderingFlag=!1}},r.broadcastEnterFrame=function(){var e=t.DisplayObject.$enterFrameCallBackList,i=e.length;if(0!=i){e=e.concat();for(var n=0;i>n;n++)e[n].dispatchEventWith(t.Event.ENTER_FRAME)}},r.broadcastRender=function(){var e=t.DisplayObject.$renderCallBackList,i=e.length;if(0!=i){e=e.concat();for(var n=0;i>n;n++)e[n].dispatchEventWith(t.Event.RENDER)}},r.callLaters=function(){var e,i,n;if(t.$callLaterFunctionList.length>0&&(e=t.$callLaterFunctionList,t.$callLaterFunctionList=[],i=t.$callLaterThisList,t.$callLaterThisList=[],n=t.$callLaterArgsList,t.$callLaterArgsList=[]),e)for(var r=e.length,s=0;r>s;s++){var a=e[s];null!=a&&a.apply(i[s],n[s])}},r.callLaterAsyncs=function(){if(t.$callAsyncFunctionList.length>0){var e=t.$callAsyncFunctionList,i=t.$callAsyncThisList,n=t.$callAsyncArgsList;t.$callAsyncFunctionList=[],t.$callAsyncThisList=[],t.$callAsyncArgsList=[];for(var r=0;r<e.length;r++){var s=e[r];null!=s&&s.apply(i[r],n[r])}}},i}();e.SystemTicker=i,t.registerClass(i,"egret.sys.SystemTicker"),e.$ticker=new e.SystemTicker}(e=t.sys||(t.sys={}))}(egret||(egret={}));var egret;!function(t){var e;!function(e){var i=function(e){function i(t){e.call(this),this.maxTouches=0,this.useTouchesCount=0,this.touchDownTarget={},this.lastTouchX=-1,this.lastTouchY=-1,this.stage=t}__extends(i,e);var n=i,r=n.prototype;return r.$initMaxTouches=function(){this.maxTouches=this.stage.$maxTouches},r.onTouchBegin=function(e,i,n){if(!(this.useTouchesCount>=this.maxTouches)){this.lastTouchX=e,this.lastTouchY=i;var r=this.findTarget(e,i);null==this.touchDownTarget[n]&&(this.touchDownTarget[n]=r,this.useTouchesCount++),t.TouchEvent.dispatchTouchEvent(r,t.TouchEvent.TOUCH_BEGIN,!0,!0,e,i,n,!0)}},r.onTouchMove=function(e,i,n){if(null!=this.touchDownTarget[n]&&(this.lastTouchX!=e||this.lastTouchY!=i)){this.lastTouchX=e,this.lastTouchY=i;var r=this.findTarget(e,i);t.TouchEvent.dispatchTouchEvent(r,t.TouchEvent.TOUCH_MOVE,!0,!0,e,i,n,!0)}},r.onTouchEnd=function(e,i,n){if(null!=this.touchDownTarget[n]){var r=this.findTarget(e,i),s=this.touchDownTarget[n];delete this.touchDownTarget[n],this.useTouchesCount--,t.TouchEvent.dispatchTouchEvent(r,t.TouchEvent.TOUCH_END,!0,!0,e,i,n,!1),s==r?t.TouchEvent.dispatchTouchEvent(r,t.TouchEvent.TOUCH_TAP,!0,!0,e,i,n,!1):t.TouchEvent.dispatchTouchEvent(s,t.TouchEvent.TOUCH_RELEASE_OUTSIDE,!0,!0,e,i,n,!1)}},r.findTarget=function(t,e){var i=this.stage.$hitTest(t,e);return i||(i=this.stage),i},i}(t.HashObject);e.TouchHandler=i,t.registerClass(i,"egret.sys.TouchHandler")}(e=t.sys||(t.sys={}))}(egret||(egret={}));var egret;!function(t){var e;!function(e){var i=function(){function i(){this.type=0,this.needRedraw=!1,this.renderAlpha=1,this.renderVisible=!0,this.renderMatrix=new t.Matrix,this.renderRegion=new e.Region,this.moved=!1,this.drawData=[],this.renderCount=0}var n=i,r=n.prototype;return r.cleanBeforeRender=function(){this.drawData.length=0,this.renderCount=0},r.$getRenderCount=function(){return this.renderCount},i}();e.RenderNode=i,t.registerClass(i,"egret.sys.RenderNode")}(e=t.sys||(t.sys={}))}(egret||(egret={}));var egret;!function(t){var e;!function(e){var i=function(e){function i(){e.call(this),this.image=null,this.smoothing=!0,this.blendMode=null,this.alpha=0/0,this.filter=null,this.type=1}__extends(i,e);var n=i,r=n.prototype;return r.drawImage=function(t,e,i,n,r,s,a,o){this.drawData.push(t,e,i,n,r,s,a,o),this.renderCount++},r.cleanBeforeRender=function(){e.prototype.cleanBeforeRender.call(this),this.image=null,this.matrix=null,this.blendMode=null,this.alpha=0/0,this.filter=null},i.$updateTextureData=function(e,n,r,s,a,o,h,l,u,c,d,f,g,p,v,$,m){if(n){var y=t.$TextureScaleFactor;if(e.smoothing=m,e.image=n,e.imageWidth=g,e.imageHeight=p,v)i.$updateTextureDataWithScale9Grid(e,v,r,s,a,o,h,l,u,c,d,f);else if($==t.BitmapFillMode.SCALE){var T=d/u*y,x=f/c*y;e.drawImage(r,s,a,o,h,l,T*a,x*o)}else if($==t.BitmapFillMode.CLIP){var b=Math.min(u,d),_=Math.min(c,f),E=a*y,C=o*y;i.drawClipImage(e,y,r,s,E,C,h,l,b,_)}else for(var E=a*y,C=o*y,F=0;d>F;F+=u)for(var w=0;f>w;w+=c){var b=Math.min(d-F,u),_=Math.min(f-w,c);i.drawClipImage(e,y,r,s,E,C,h,l,b,_,F,w)}}},i.$updateTextureDataWithScale9Grid=function(e,i,n,r,s,a,o,h,l,u,c,d){var f=s,g=a;c-=l-s*t.$TextureScaleFactor,d-=u-a*t.$TextureScaleFactor;var p=i.x-o,v=i.y-h,$=p/t.$TextureScaleFactor,m=v/t.$TextureScaleFaLine truncated
|
||||
}return n},n.getConfigByKey=function(t,e){for(var i=t.split(" "),n=0,r=i.length;r>n;n++){var s=i[n];if(e==s.substring(0,e.length)){var a=s.substring(e.length+1);return parseInt(a)}}return 0},e}(t.SpriteSheet);t.BitmapFont=e,t.registerClass(e,"egret.BitmapFont")}(egret||(egret={}));var egret;!function(t){var e=function(e){function i(){e.call(this),this.$textOffsetX=0,this.$textOffsetY=0,this.$textStartX=0,this.$textStartY=0,this.$lineHeights=[],this.$renderNode=new t.sys.BitmapNode,this.$BitmapText={0:0/0,1:0/0,2:"",3:0,4:0,5:null,6:!1,7:!1,8:!1,9:!1,10:"left",11:"top",12:t.Bitmap.defaultSmoothing}}__extends(i,e);var n=__define,r=i,s=r.prototype;return n(s,"smoothing",function(){var t=this.$BitmapText;return t[12]},function(t){t=!!t;var e=this.$BitmapText;t!=e[12]&&(e[12]=t,this.$invalidate())}),n(s,"text",function(){return this.$BitmapText[2]},function(t){this.$setText(t)}),s.$setText=function(t){null==t&&(t=""),t=String(t);var e=this.$BitmapText;return t==e[2]?!1:(e[2]=t,this.$invalidateContentBounds(),!0)},s.$getWidth=function(){var t=this.$BitmapText[0];return isNaN(t)?this.$getContentBounds().width:t},s.$setWidth=function(t){var e=this.$BitmapText;return 0>t||t==e[0]?!1:(e[0]=t,this.$invalidateContentBounds(),!0)},s.$invalidateContentBounds=function(){e.prototype.$invalidateContentBounds.call(this),this.$BitmapText[7]=!0},s.$getHeight=function(){var t=this.$BitmapText[1];return isNaN(t)?this.$getContentBounds().height:t},s.$setHeight=function(t){var e=this.$BitmapText;return 0>t||t==e[1]?!1:(e[1]=t,this.$invalidateContentBounds(),!0)},n(s,"font",function(){return this.$BitmapText[5]},function(t){this.$setFont(t)}),s.$setFont=function(t){var e=this.$BitmapText;return e[5]==t?!1:(e[5]=t,this.$BitmapText[6]=!0,this.$invalidateContentBounds(),!0)},n(s,"lineSpacing",function(){return this.$BitmapText[3]},function(t){this.$setLineSpacing(t)}),s.$setLineSpacing=function(t){t=+t||0;var e=this.$BitmapText;return e[3]==t?!1:(e[3]=t,this.$invalidateContentBounds(),!0)},n(s,"letterSpacing",function(){return this.$BitmapText[4]},function(t){this.$setLetterSpacing(t)}),s.$setLetterSpacing=function(t){t=+t||0;var e=this.$BitmapText;return e[4]==t?!1:(e[4]=t,this.$invalidateContentBounds(),!0)},n(s,"textAlign",function(){return this.$BitmapText[10]},function(t){this.$setTextAlign(t)}),s.$setTextAlign=function(t){var e=this.$BitmapText;return e[10]==t?!1:(e[10]=t,this.$invalidateContentBounds(),!0)},n(s,"verticalAlign",function(){return this.$BitmapText[11]},function(t){this.$setVerticalAlign(t)}),s.$setVerticalAlign=function(t){var e=this.$BitmapText;return e[11]==t?!1:(e[11]=t,this.$invalidateContentBounds(),!0)},s.$render=function(){var e=this.$BitmapText,n=this.$getTextLines(),r=n.length;if(0!=r){var s=this.$textLinesWidth,a=e[5],o=this.$renderNode;a.$texture&&(o.image=a.$texture._bitmapData),o.smoothing=e[12];for(var h=a._getFirstCharHeight(),l=Math.ceil(h*i.EMPTY_FACTOR),u=!isNaN(e[1]),c=e[8],d=e[0],f=e[1],g=e[10],p=this.$textOffsetY+this.$textStartY,v=this.$lineHeights,$=0;r>$;$++){var m=v[$];if(u&&$>0&&p+m>f)break;var y=n[$],T=y.length,x=this.$textOffsetX;if(g!=t.HorizontalAlign.LEFT){var b=d>c?d:c;g==t.HorizontalAlign.RIGHT?x+=b-s[$]:g==t.HorizontalAlign.CENTER&&(x+=Math.floor((b-s[$])/2))}for(var _=0;T>_;_++){var E=y.charAt(_),C=a.getTexture(E);if(C){var F=C._bitmapWidth,w=C._bitmapHeight;o.imageWidth=C._sourceWidth,o.imageHeight=C._sourceHeight,o.drawImage(C._bitmapX,C._bitmapY,F,w,x+C._offsetX,p+C._offsetY,C.$getScaleBitmapWidth(),C.$getScaleBitmapHeight()),x+=(a.getConfig(E,"xadvance")||C.$getTextureWidth())+e[4]}else" "==E?x+=l:t.$warn(1046,E)}p+=m+e[3]}}},s.$measureContentBounds=function(t){var e=this.$getTextLines();0==e.length?t.setEmpty():t.setTo(this.$textOffsetX+this.$textStartX,this.$textOffsetY+this.$textStartY,this.$BitmapText[8]-this.$textOffsetX,this.$BitmapText[9]-this.$textOffsetY)},n(s,"textWidth",function(){return this.$getTextLines(),this.$BitmapText[8]}),n(s,"textHeight",function(){return this.$getTextLines(),this.$BitmapText[9]}),s.$getTextLines=function(){function e(t){return y&&r.length>0&&g>y?!1:(g+=l+c,o||h||(u-=d),r.push(t),a.push(l),s.push(u),f=Math.max(u,f),!0)}var n=this.$BitmapText;if(!n[7])return this.textLines;var r=[];this.textLines=r;var s=[];this.$textLinesWidth=s,n[7]=!1;var a=[];if(this.$lineHeights=a,!n[2]||!n[5])return r;for(var o,h,l,u,c=n[3],d=n[4],f=0,g=0,p=0,v=0,$=!isNaN(n[0]),m=n[0],y=n[1],T=n[5],x=T._getFirstCharHeight(),b=Math.ceil(x*i.EMPTY_FACTOR),_=n[2],E=_.split(/(?:\r\n|\r|\n)/),C=E.length,F=!0,w=0;C>w;w++){var R=E[w],S=R.length;l=0,u=0,o=!0,h=!1;for(var D=0;S>D;D++){o||(u+=d);var O=R.charAt(D),L=void 0,M=void 0,A=0,N=0,I=T.getTexture(O);if(I)L=I.$getTextureWidth(),M=I.$getTextureHeight(),A=I._offsetX,N=I._offsetY;else{if(" "!=O){t.$warn(1046,O),o&&(o=!1);continue}L=b,M=x}if(o&&(o=!1,p=Math.min(A,p)),F&&(F=!1,v=Math.min(N,v)),$&&D>0&&u+L>m){if(!e(R.substring(0,D)))break;R=R.substring(D),S=R.length,D=0,u=D==S-1?L:T.getConfig(O,"xadvance")||L,l=M}else u+=D==S-Line truncated
|
||||
return this.position+=i.SIZE_OF_UINT16,t},s.readUTF=function(){if(!this.validate(i.SIZE_OF_UINT16))return null;var t=this.data.getUint16(this.position,this.endian==e.LITTLE_ENDIAN);return this.position+=i.SIZE_OF_UINT16,t>0?this.readUTFBytes(t):""},s.readUTFBytes=function(t){if(!this.validate(t))return null;var e=new Uint8Array(this.buffer,this.bufferOffset+this.position,t);return this.position+=t,this.decodeUTF8(e)},s.writeBoolean=function(t){this.validateBuffer(i.SIZE_OF_BOOLEAN),this.data.setUint8(this.position++,t?1:0)},s.writeByte=function(t){this.validateBuffer(i.SIZE_OF_INT8),this.data.setInt8(this.position++,t)},s.writeBytes=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=0);var n;if(!(0>e)&&!(0>i)&&(n=0==i?t.length-e:Math.min(t.length-e,i),n>0)){this.validateBuffer(n);for(var r=new DataView(t.buffer),s=n,a=4;s>a;s-=a)this.data.setUint32(this._position,r.getUint32(e)),this.position+=a,e+=a;for(;s>0;s--)this.data.setUint8(this.position++,r.getUint8(e++))}},s.writeDouble=function(t){this.validateBuffer(i.SIZE_OF_FLOAT64),this.data.setFloat64(this.position,t,this.endian==e.LITTLE_ENDIAN),this.position+=i.SIZE_OF_FLOAT64},s.writeFloat=function(t){this.validateBuffer(i.SIZE_OF_FLOAT32),this.data.setFloat32(this.position,t,this.endian==e.LITTLE_ENDIAN),this.position+=i.SIZE_OF_FLOAT32},s.writeInt=function(t){this.validateBuffer(i.SIZE_OF_INT32),this.data.setInt32(this.position,t,this.endian==e.LITTLE_ENDIAN),this.position+=i.SIZE_OF_INT32},s.writeShort=function(t){this.validateBuffer(i.SIZE_OF_INT16),this.data.setInt16(this.position,t,this.endian==e.LITTLE_ENDIAN),this.position+=i.SIZE_OF_INT16},s.writeUnsignedInt=function(t){this.validateBuffer(i.SIZE_OF_UINT32),this.data.setUint32(this.position,t,this.endian==e.LITTLE_ENDIAN),this.position+=i.SIZE_OF_UINT32},s.writeUnsignedShort=function(t){this.validateBuffer(i.SIZE_OF_UINT16),this.data.setUint16(this.position,t,this.endian==e.LITTLE_ENDIAN),this.position+=i.SIZE_OF_UINT16},s.writeUTF=function(t){var n=this.encodeUTF8(t),r=n.length;this.validateBuffer(i.SIZE_OF_UINT16+r),this.data.setUint16(this.position,r,this.endian==e.LITTLE_ENDIAN),this.position+=i.SIZE_OF_UINT16,this._writeUint8Array(n,!1)},s.writeUTFBytes=function(t){this._writeUint8Array(this.encodeUTF8(t))},s.toString=function(){return"[ByteArray] length:"+this.length+", bytesAvailable:"+this.bytesAvailable},s._writeUint8Array=function(t,e){void 0===e&&(e=!0),e&&this.validateBuffer(this.position+t.length);for(var i=0;i<t.length;i++)this.data.setUint8(this.position++,t[i])},s.validate=function(e){return this.data.byteLength>0&&this._position+e<=this.data.byteLength?!0:void t.$error(1025)},s.validateBuffer=function(t,e){if(void 0===e&&(e=!1),this.write_position=t>this.write_position?t:this.write_position,t+=this._position,this.data.byteLength<t||e){var i=new Uint8Array(new ArrayBuffer(t+this.BUFFER_EXT_SIZE)),n=Math.min(this.data.buffer.byteLength,t+this.BUFFER_EXT_SIZE);i.set(new Uint8Array(this.data.buffer,0,n)),this.buffer=i.buffer}},s.encodeUTF8=function(t){for(var e=0,i=this.stringToCodePoints(t),n=[];i.length>e;){var r=i[e++];if(this.inRange(r,55296,57343))this.encoderError(r);else if(this.inRange(r,0,127))n.push(r);else{var s=void 0,a=void 0;for(this.inRange(r,128,2047)?(s=1,a=192):this.inRange(r,2048,65535)?(s=2,a=224):this.inRange(r,65536,1114111)&&(s=3,a=240),n.push(this.div(r,Math.pow(64,s))+a);s>0;){var o=this.div(r,Math.pow(64,s-1));n.push(128+o%64),s-=1}}}return new Uint8Array(n)},s.decodeUTF8=function(t){for(var e,i=!1,n=0,r="",s=0,a=0,o=0,h=0;t.length>n;){var l=t[n++];if(l==this.EOF_byte)e=0!=a?this.decoderError(i):this.EOF_code_point;else if(0==a)this.inRange(l,0,127)?e=l:(this.inRange(l,194,223)?(a=1,h=128,s=l-192):this.inRange(l,224,239)?(a=2,h=2048,s=l-224):this.inRange(l,240,244)?(a=3,h=65536,s=l-240):this.decoderError(i),s*=Math.pow(64,a),e=null);else if(this.inRange(l,128,191))if(o+=1,s+=(l-128)*Math.pow(64,a-o),o!==a)e=null;else{var u=s,c=h;s=0,a=0,o=0,h=0,e=this.inRange(u,c,1114111)&&!this.inRange(u,55296,57343)?u:this.decoderError(i,l)}else s=0,a=0,o=0,h=0,n--,e=this.decoderError(i,l);null!==e&&e!==this.EOF_code_point&&(65535>=e?e>0&&(r+=String.fromCharCode(e)):(e-=65536,r+=String.fromCharCode(55296+(e>>10&1023)),r+=String.fromCharCode(56320+(1023&e))))}return r},s.encoderError=function(e){t.$error(1026,e)},s.decoderError=function(e,i){return e&&t.$error(1027),i||65533},s.inRange=function(t,e,i){return t>=e&&i>=t},s.div=function(t,e){return Math.floor(t/e)},s.stringToCodePoints=function(t){for(var e=[],i=0,n=t.length;i<t.length;){var r=t.charCodeAt(i);if(this.inRange(r,55296,57343))if(this.inRange(r,56320,57343))e.push(65533);else if(i==n-1)e.push(65533);else{var s=t.charCodeAt(i+1);if(this.inRange(s,56320,57343)){var a=1023&r,o=1023&s;i+=1,e.push(65536+(a<<10)+o)}else e.push(65533)}else e.push(r);i+=1}return e},i.SIZE_OF_BOOLEAN=1,i.SIZE_OF_INT8=1,i.SIZE_OF_INT16=2,i.SIZE_OF_INT32=4,i.SIZE_OF_UINT8=1,i.SIZE_OF_UINT16=2,i.SIZE_OF_UINT32=4,i.SIZE_OF_FLOAT32=4,i.SIZE_OF_Line truncated
|
||||
@@ -0,0 +1,4 @@
|
||||
var egret;!function(e){var t;!function(t){var i="egret.BitmapData";e.registerClass(HTMLImageElement,i),e.registerClass(HTMLCanvasElement,i),e.registerClass(HTMLVideoElement,i)}(t=e.web||(e.web={}))}(egret||(egret={}));var egret;!function(e){function t(t){return t.hashCode=t.$hashCode=e.$hashCount++,t}e.$toBitmapData=t}(egret||(egret={}));var egret;!function(e){var t;!function(t){var i=function(){function e(){}var t=(__define,e);t.prototype;return e.call=function(e,t){},e.addCallback=function(e,t){},e}();t.WebExternalInterface=i,e.registerClass(i,"egret.web.WebExternalInterface",["egret.ExternalInterface"]),e.ExternalInterface=i}(t=e.web||(e.web={}))}(egret||(egret={}));var egret;!function(e){var t;!function(t){var i;!function(i){function r(e){return window.localStorage.getItem(e)}function n(t,i){try{return window.localStorage.setItem(t,i),!0}catch(r){return e.$warn(1047,t,i),!1}}function a(e){window.localStorage.removeItem(e)}function s(){window.localStorage.clear()}t.getItem=r,t.setItem=n,t.removeItem=a,t.clear=s}(i=t.web||(t.web={}))}(t=e.localStorage||(e.localStorage={}))}(egret||(egret={}));var egret;!function(e){var t;!function(t){var i=function(i){function r(){i.call(this),this.loaded=!1}__extends(r,i);var n=__define,a=r,s=a.prototype;return n(s,"length",function(){if(this.originAudio)return this.originAudio.duration;throw new Error("sound not loaded!")}),s.load=function(t){function i(){a(),h.indexOf("firefox")>=0&&(o.pause(),o.muted=!1),s.loaded=!0,s.dispatchEventWith(e.Event.COMPLETE)}function n(){a(),s.dispatchEventWith(e.IOErrorEvent.IO_ERROR)}function a(){o.removeEventListener("canplaythrough",i),o.removeEventListener("error",n)}var s=this;this.url=t;var o=new Audio(t);o.addEventListener("canplaythrough",i),o.addEventListener("error",n);var h=navigator.userAgent.toLowerCase();h.indexOf("firefox")>=0&&(o.autoplay=!0,o.muted=!0),o.load(),this.originAudio=o,r.$recycle(this.url,o)},s.play=function(i,n){i=+i||0,n=+n||0;var a=r.$pop(this.url);null==a&&(a=this.originAudio.cloneNode()),a.autoplay=!0;var s=new t.HtmlSoundChannel(a);return s.$url=this.url,s.$loops=n,s.$startTime=i,s.$play(),e.sys.$pushSoundChannel(s),s},s.close=function(){0==this.loaded&&this.originAudio&&(this.originAudio.src=""),this.originAudio&&(this.originAudio=null),r.$clear(this.url)},r.$clear=function(e){var t=r.audios[e];t&&(t.length=0)},r.$pop=function(e){var t=r.audios[e];return t&&t.length>0?t.pop():null},r.$recycle=function(e,t){var i=r.audios[e];null==r.audios[e]&&(i=r.audios[e]=[]),i.push(t)},r.MUSIC="music",r.EFFECT="effect",r.audios={},r}(e.EventDispatcher);t.HtmlSound=i,e.registerClass(i,"egret.web.HtmlSound",["egret.Sound"])}(t=e.web||(e.web={}))}(egret||(egret={}));var egret;!function(e){var t;!function(t){var i=function(i){function r(t){var r=this;i.call(this),this.$startTime=0,this.audio=null,this.isStopped=!1,this.canPlay=function(){r.audio.removeEventListener("canplay",r.canPlay);try{r.audio.currentTime=r.$startTime}catch(e){}finally{r.audio.play()}},this.onPlayEnd=function(){return 1==r.$loops?(r.stop(),void r.dispatchEventWith(e.Event.SOUND_COMPLETE)):(r.$loops>0&&r.$loops--,void r.$play())},t.addEventListener("ended",this.onPlayEnd),this.audio=t}__extends(r,i);var n=__define,a=r,s=a.prototype;return s.$play=function(){if(this.isStopped)return void e.$error(1036);try{this.audio.currentTime=this.$startTime}catch(t){return void this.audio.addEventListener("canplay",this.canPlay)}this.audio.play()},s.stop=function(){if(this.audio){this.isStopped||e.sys.$popSoundChannel(this),this.isStopped=!0;var i=this.audio;i.pause(),i.removeEventListener("ended",this.onPlayEnd),this.audio=null,t.HtmlSound.$recycle(this.$url,i)}},n(s,"volume",function(){return this.audio?this.audio.volume:1},function(t){return this.isStopped?void e.$error(1036):void(this.audio&&(this.audio.volume=t))}),n(s,"position",function(){return this.audio?this.audio.currentTime:0}),r}(e.EventDispatcher);t.HtmlSoundChannel=i,e.registerClass(i,"egret.web.HtmlSoundChannel",["egret.SoundChannel","egret.IEventDispatcher"])}(t=e.web||(e.web={}))}(egret||(egret={}));var egret;!function(e){var t;!function(t){var i=function(i){function r(){i.call(this),this.loaded=!1}__extends(r,i);var n=__define,a=r,s=a.prototype;return s.load=function(i){var r=this;this.url=i,QZAppExternal.preloadSound(function(t){0==t.code?(r.loaded=!0,r.dispatchEventWith(e.Event.COMPLETE)):r.dispatchEventWith(e.IOErrorEvent.IO_ERROR)},{bid:-1,url:t.Html5Capatibility._QQRootPath+i,refresh:1})},n(s,"length",function(){throw new Error("qq sound not supported!")}),s.play=function(i,r){i=+i||0,r=+r||0;var n=new t.QQSoundChannel;return n.$url=this.url,n.$loops=r,n.$type=this.type,n.$startTime=i,n.$play(),e.sys.$pushSoundChannel(n),n},s.close=function(){},r.MUSIC="music",r.EFFECT="effect",r}(e.EventDispatcher);t.QQSound=i,e.registerClass(i,"egret.web.QQSound",["egret.Sound"])}(t=e.web||(e.web={}))}(egret||(egret={}));var egret;!function(e){var t;!function(t){var i=function(t){function i(){var i=this;t.Line truncated
|
||||
}else r.width!=e&&(r.width=e),r.height!=t&&(r.height=t);this.clear()},a.resizeTo=function(e,t,n,a){r||(r=i());var s=(this.context,this.surface),o=r,h=o.getContext("2d");r=s,this.context=h,this.surface=o,o.width=Math.max(e,257),o.height=Math.max(t,257),h.setTransform(1,0,0,1,0,0),h.drawImage(s,n,a),s.height=1,s.width=1},a.setDirtyRegionPolicy=function(e){},a.beginClip=function(e,t,i){t=+t||0,i=+i||0;var r=this.context;r.save(),r.beginPath(),r.setTransform(1,0,0,1,t,i);for(var n=e.length,a=0;n>a;a++){var s=e[a];r.clearRect(s.minX,s.minY,s.width,s.height),r.rect(s.minX,s.minY,s.width,s.height)}r.clip()},a.endClip=function(){this.context.restore()},a.getPixels=function(e,t,i,r){return void 0===i&&(i=1),void 0===r&&(r=1),this.context.getImageData(e,t,i,r).data},a.toDataURL=function(e,t){return this.surface.toDataURL(e,t)},a.clear=function(){this.context.setTransform(1,0,0,1,0,0),this.context.clearRect(0,0,this.surface.width,this.surface.height)},a.destroy=function(){this.surface.width=this.surface.height=0},e}();t.CanvasRenderBuffer=n,e.registerClass(n,"egret.web.CanvasRenderBuffer",["egret.sys.RenderBuffer"])}(t=e.web||(e.web={}))}(egret||(egret={}));var egret;!function(e){var t;!function(t){var i=function(t){function i(i,r){var n=this;t.call(this),this.onTouchBegin=function(e){var t=n.getLocation(e);n.touch.onTouchBegin(t.x,t.y,e.identifier)},this.onTouchMove=function(e){var t=n.getLocation(e);n.touch.onTouchMove(t.x,t.y,e.identifier)},this.onTouchEnd=function(e){var t=n.getLocation(e);n.touch.onTouchEnd(t.x,t.y,e.identifier)},this.scaleX=1,this.scaleY=1,this.rotation=0,this.canvas=r,this.touch=new e.sys.TouchHandler(i),this.addListeners()}__extends(i,t);var r=(__define,i),n=r.prototype;return n.addListeners=function(){var t=this;window.navigator.msPointerEnabled?(this.canvas.addEventListener("MSPointerDown",function(e){e.identifier=e.pointerId,t.onTouchBegin(e),t.prevent(e)},!1),this.canvas.addEventListener("MSPointerMove",function(e){e.identifier=e.pointerId,t.onTouchMove(e),t.prevent(e)},!1),this.canvas.addEventListener("MSPointerUp",function(e){e.identifier=e.pointerId,t.onTouchEnd(e),t.prevent(e)},!1)):(e.Capabilities.$isMobile||this.addMouseListener(),this.addTouchListener())},n.addMouseListener=function(){this.canvas.addEventListener("mousedown",this.onTouchBegin),this.canvas.addEventListener("mousemove",this.onTouchMove),this.canvas.addEventListener("mouseup",this.onTouchEnd)},n.addTouchListener=function(){var e=this;this.canvas.addEventListener("touchstart",function(t){for(var i=t.changedTouches.length,r=0;i>r;r++)e.onTouchBegin(t.changedTouches[r]);e.prevent(t)},!1),this.canvas.addEventListener("touchmove",function(t){for(var i=t.changedTouches.length,r=0;i>r;r++)e.onTouchMove(t.changedTouches[r]);e.prevent(t)},!1),this.canvas.addEventListener("touchend",function(t){for(var i=t.changedTouches.length,r=0;i>r;r++)e.onTouchEnd(t.changedTouches[r]);e.prevent(t)},!1),this.canvas.addEventListener("touchcancel",function(t){for(var i=t.changedTouches.length,r=0;i>r;r++)e.onTouchEnd(t.changedTouches[r]);e.prevent(t)},!1)},n.prevent=function(e){e.stopPropagation(),1==e.isScroll||this.canvas.userTyping||e.preventDefault()},n.getLocation=function(t){t.identifier=+t.identifier||0;var i=document.documentElement,r=this.canvas.getBoundingClientRect(),n=r.left+window.pageXOffset-i.clientLeft,a=r.top+window.pageYOffset-i.clientTop,s=t.pageX-n,o=s,h=t.pageY-a,l=h;return 90==this.rotation?(o=h,l=r.width-s):-90==this.rotation&&(o=r.height-h,l=s),o/=this.scaleX,l/=this.scaleY,e.$TempPoint.setTo(Math.round(o),Math.round(l))},n.updateScaleMode=function(e,t,i){this.scaleX=e,this.scaleY=t,this.rotation=i},n.$updateMaxTouches=function(){this.touch.$initMaxTouches()},i}(e.HashObject);t.WebTouchHandler=i,e.registerClass(i,"egret.web.WebTouchHandler")}(t=e.web||(e.web={}))}(egret||(egret={}));var egret;!function(e){var t;!function(t){var i=function(t){function i(e){t.call(this),this.isActivate=!0,this.stage=e,this.registerListener()}__extends(i,t);var r=(__define,i),n=r.prototype;return n.registerListener=function(){var t=this,i=function(){t.isActivate&&(t.isActivate=!1,t.stage.dispatchEvent(new e.Event(e.Event.DEACTIVATE)))},r=function(){t.isActivate||(t.isActivate=!0,t.stage.dispatchEvent(new e.Event(e.Event.ACTIVATE)))},n=function(){document[a]?i():r()};window.addEventListener("focus",r,!1),window.addEventListener("blur",i,!1);var a,s;"undefined"!=typeof document.hidden?(a="hidden",s="visibilitychange"):"undefined"!=typeof document.mozHidden?(a="mozHidden",s="mozvisibilitychange"):"undefined"!=typeof document.msHidden?(a="msHidden",s="msvisibilitychange"):"undefined"!=typeof document.webkitHidden?(a="webkitHidden",s="webkitvisibilitychange"):"undefined"!=typeof document.oHidden&&(a="oHidden",s="ovisibilitychange"),"onpageshow"in window&&"onpagehide"in window&&(window.addEventListener("pageshow",r,!1),window.addEventListener("pagehide",i,!1)),a&&s&&document.addEventListener(s,n,!1);var o=navigator.userAgent,h=/micromessenger/gLine truncated
|
||||
}__extends(t,e);var i=(__define,t),r=i.prototype;return r.setBlur=function(e,t){var i=this.uniforms.blur;(i.value.x!=e||i.value.y!=t)&&(i.value.x=e,i.value.y=t,i.dirty=!0)},r.setTextureSize=function(e,t){var i=this.uniforms.uTextureSize;(e!=i.value.x||t!=i.value.y)&&(i.value.x=e,i.value.y=t,i.dirty=!0)},t}(t.TextureShader);t.BlurShader=i,e.registerClass(i,"egret.web.BlurShader")}(t=e.web||(e.web={}))}(egret||(egret={}));var egret;!function(e){var t;!function(t){var i=function(e){function t(){e.apply(this,arguments),this.fragmentSrc="precision mediump float;\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nuniform mat4 matrix;\nuniform vec4 colorAdd;\nuniform sampler2D uSampler;\nvoid main(void) {\nvec4 texColor = texture2D(uSampler, vTextureCoord);\nif(texColor.a > 0.) {texColor = vec4(texColor.rgb / texColor.a, texColor.a);\n}vec4 locColor = clamp(texColor * matrix + colorAdd, 0., 1.);\ngl_FragColor = vColor * vec4(locColor.rgb * locColor.a, locColor.a);\n}",this.uniforms={projectionVector:{type:"2f",value:{x:0,y:0},dirty:!0},matrix:{type:"mat4",value:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],dirty:!0},colorAdd:{type:"4f",value:{x:0,y:0,z:0,w:0},dirty:!0}}}__extends(t,e);var i=(__define,t),r=i.prototype;return r.setMatrix=function(e){var t=this.uniforms.matrix;(t.value[0]!=e[0]||t.value[0]!=e[0]||t.value[1]!=e[1]||t.value[2]!=e[2]||t.value[3]!=e[3]||t.value[4]!=e[5]||t.value[5]!=e[6]||t.value[6]!=e[7]||t.value[7]!=e[8]||t.value[8]!=e[10]||t.value[9]!=e[11]||t.value[10]!=e[12]||t.value[11]!=e[13]||t.value[12]!=e[15]||t.value[13]!=e[16]||t.value[14]!=e[17]||t.value[15]!=e[18])&&(t.value[0]=e[0],t.value[1]=e[1],t.value[2]=e[2],t.value[3]=e[3],t.value[4]=e[5],t.value[5]=e[6],t.value[6]=e[7],t.value[7]=e[8],t.value[8]=e[10],t.value[9]=e[11],t.value[10]=e[12],t.value[11]=e[13],t.value[12]=e[15],t.value[13]=e[16],t.value[14]=e[17],t.value[15]=e[18],t.dirty=!0);var i=this.uniforms.colorAdd;(i.value.x!=e[4]/255||i.value.y!=e[9]/255||i.value.z!=e[14]/255||i.value.w!=e[19]/255)&&(i.value.x=e[4]/255,i.value.y=e[9]/255,i.value.z=e[14]/255,i.value.w=e[19]/255,i.dirty=!0)},t}(t.TextureShader);t.ColorTransformShader=i,e.registerClass(i,"egret.web.ColorTransformShader")}(t=e.web||(e.web={}))}(egret||(egret={}));var egret;!function(e){var t;!function(t){var i=function(e){function t(){e.apply(this,arguments),this.fragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","uniform sampler2D uSampler;","uniform float distance;","uniform float angle;","uniform vec4 color;","uniform float alpha;","uniform float blurX;","uniform float blurY;","uniform float strength;","uniform float inner;","uniform float knockout;","uniform float hideObject;","uniform vec2 uTextureSize;vec2 px = vec2(1.0 / uTextureSize.x, 1.0 / uTextureSize.y);","float random(vec3 scale, float seed)","{","return fract(sin(dot(gl_FragCoord.xyz + seed, scale)) * 43758.5453 + seed);","}","void main(void) {","const float linearSamplingTimes = 7.0;","const float circleSamplingTimes = 12.0;","vec4 ownColor = texture2D(uSampler, vTextureCoord);","vec4 curColor;","float totalAlpha = 0.0;","float maxTotalAlpha = 0.0;","float curDistanceX = 0.0;","float curDistanceY = 0.0;","float offsetX = distance * cos(angle) * px.x;","float offsetY = distance * sin(angle) * px.y;","const float PI = 3.14159265358979323846264;","float cosAngle;","float sinAngle;","float offset = PI * 2.0 / circleSamplingTimes * random(vec3(12.9898, 78.233, 151.7182), 0.0);","float stepX = blurX * px.x / linearSamplingTimes;","float stepY = blurY * px.y / linearSamplingTimes;","for (float a = 0.0; a <= PI * 2.0; a += PI * 2.0 / circleSamplingTimes) {","cosAngle = cos(a + offset);","sinAngle = sin(a + offset);","for (float i = 1.0; i <= linearSamplingTimes; i++) {","curDistanceX = i * stepX * cosAngle;","curDistanceY = i * stepY * sinAngle;","curColor = texture2D(uSampler, vec2(vTextureCoord.x + curDistanceX - offsetX, vTextureCoord.y + curDistanceY + offsetY));","totalAlpha += (linearSamplingTimes - i) * curColor.a;","maxTotalAlpha += (linearSamplingTimes - i);","}","}","ownColor.a = max(ownColor.a, 0.0001);","ownColor.rgb = ownColor.rgb / ownColor.a;","float outerGlowAlpha = (totalAlpha / maxTotalAlpha) * strength * alpha * (1. - inner) * max(min(hideObject, knockout), 1. - ownColor.a);","float innerGlowAlpha = ((maxTotalAlpha - totalAlpha) / maxTotalAlpha) * strength * alpha * inner * ownColor.a;","ownColor.a = max(ownColor.a * knockout * (1. - hideObject), 0.0001);","vec3 mix1 = mix(ownColor.rgb, color.rgb, innerGlowAlpha / (innerGlowAlpha + ownColor.a));","vec3 mix2 = mix(mix1, color.rgb, outerGlowAlpha / (innerGlowAlpha + ownColor.a + outerGlowAlpha));","float resultAlpha = min(ownColor.a + outerGlowAlpha + innerGlowAlpha, 1.);","gl_FragColor = vec4(mix2 * resultAlpha, resultAlpha);","}"].join("\n"),this.uniforms={projectionVector:{type:"2f",value:{x:0,y:0},dirty:!0},distance:{type:"1f",value:15,dirty:!0},angle:{type:"1f",value:1,dirty:!0},color:{type:"4f",value:{x:1,y:0,z:0,w:0},dirty:!0},alLine truncated
|
||||
for(var n=0;r>n;n++){var a=e[n];this.context.clearRect(a.minX,a.minY,a.width,a.height)}if(r>0){if(this.$hasScissor||1!=r)this.scissorEnabled=!1;else{var a=e[0];e=e.slice(1);var s=a.minX+t,o=a.minY+i,h=a.width,l=a.height;this.context.enableScissor(s,-o-l+this.height,h,l),this.scissorEnabled=!0}e.length>0?(this.context.pushMask(e),this.maskPushed=!0):this.maskPushed=!1,this.offsetX=t,this.offsetY=i}else this.maskPushed=!1;this.context.popBuffer()},o.endClip=function(){(this.maskPushed||this.scissorEnabled)&&(this.context.pushBuffer(this),this.maskPushed&&(this.setTransform(1,0,0,1,this.offsetX,this.offsetY),this.context.popMask()),this.scissorEnabled&&this.context.disableScissor(),this.context.popBuffer())},o.getPixels=function(e,t,i,r){void 0===i&&(i=1),void 0===r&&(r=1);var n=new Uint8Array(4*i*r),a=this.rootRenderTarget.useFrameBuffer;this.rootRenderTarget.useFrameBuffer=!0,this.rootRenderTarget.activate(),this.context.getPixels(e,t,i,r,n),this.rootRenderTarget.useFrameBuffer=a,this.rootRenderTarget.activate();for(var s=new Uint8Array(4*i*r),o=0;r>o;o++)for(var h=0;i>h;h++)s[4*(i*(r-o-1)+h)]=n[4*(i*o+h)],s[4*(i*(r-o-1)+h)+1]=n[4*(i*o+h)+1],s[4*(i*(r-o-1)+h)+2]=n[4*(i*o+h)+2],s[4*(i*(r-o-1)+h)+3]=n[4*(i*o+h)+3];return s},o.toDataURL=function(e,t){return this.context.surface.toDataURL(e,t)},o.destroy=function(){this.context.destroy()},o.onRenderFinish=function(){this.$drawCalls=0,this.root&&(!this._dirtyRegionPolicy&&this.dirtyRegionPolicy&&this.drawSurfaceToFrameBuffer(0,0,this.rootRenderTarget.width,this.rootRenderTarget.height,0,0,this.rootRenderTarget.width,this.rootRenderTarget.height,!0),this._dirtyRegionPolicy&&this.drawFrameBufferToSurface(0,0,this.rootRenderTarget.width,this.rootRenderTarget.height,0,0,this.rootRenderTarget.width,this.rootRenderTarget.height),this._dirtyRegionPolicy=this.dirtyRegionPolicy)},o.drawFrameBufferToSurface=function(e,t,i,r,n,a,s,o,h){void 0===h&&(h=!1),this.rootRenderTarget.useFrameBuffer=!1,this.rootRenderTarget.activate(),this.context.disableStencilTest(),this.context.disableScissorTest(),this.setTransform(1,0,0,1,0,0),this.globalAlpha=1,this.context.setGlobalCompositeOperation("source-over"),h&&this.context.clear(),this.context.drawImage(this.rootRenderTarget,e,t,i,r,n,a,s,o,i,r),this.context.$drawWebGL(),this.rootRenderTarget.useFrameBuffer=!0,this.rootRenderTarget.activate(),this.restoreStencil(),this.restoreScissor()},o.drawSurfaceToFrameBuffer=function(e,t,i,r,n,a,s,o,h){void 0===h&&(h=!1),this.rootRenderTarget.useFrameBuffer=!0,this.rootRenderTarget.activate(),this.context.disableStencilTest(),this.context.disableScissorTest(),this.setTransform(1,0,0,1,0,0),this.globalAlpha=1,this.context.setGlobalCompositeOperation("source-over"),h&&this.context.clear(),this.context.drawImage(this.context.surface,e,t,i,r,n,a,s,o,i,r),this.context.$drawWebGL(),this.rootRenderTarget.useFrameBuffer=!1,this.rootRenderTarget.activate(),this.restoreStencil(),this.restoreScissor()},o.clear=function(){this.context.clear()},o.setTransform=function(e,t,i,r,n,a){var s=this.globalMatrix;s.a=e,s.b=t,s.c=i,s.d=r,s.tx=n,s.ty=a},o.transform=function(e,t,i,r,n,a){var s=this.globalMatrix,o=s.a,h=s.b,l=s.c,u=s.d;(1!=e||0!=t||0!=i||1!=r)&&(s.a=e*o+t*l,s.b=e*h+t*u,s.c=i*o+r*l,s.d=i*h+r*u),s.tx=n*o+a*l+s.tx,s.ty=n*h+a*u+s.ty},o.translate=function(e,t){var i=this.globalMatrix;i.tx+=e,i.ty+=t},o.saveTransform=function(){var e=this.globalMatrix,t=this.savedGlobalMatrix;t.a=e.a,t.b=e.b,t.c=e.c,t.d=e.d,t.tx=e.tx,t.ty=e.ty},o.restoreTransform=function(){var e=this.globalMatrix,t=this.savedGlobalMatrix;e.a=t.a,e.b=t.b,e.c=t.c,e.d=t.d,e.tx=t.tx,e.ty=t.ty},n.create=function(e,t){var i=r.pop();if(i){i.resize(e,t);var a=i.globalMatrix;a.a=1,a.b=0,a.c=0,a.d=1,a.tx=0,a.ty=0}else i=new n(e,t),i.$computeDrawCall=!1;return i},n.release=function(e){r.push(e)},n}(e.HashObject);t.WebGLRenderBuffer=i,e.registerClass(i,"egret.web.WebGLRenderBuffer",["egret.sys.RenderBuffer"]);var r=[]}(t=e.web||(e.web={}))}(egret||(egret={}));var egret;!function(e){var t;!function(t){var i=["source-over","lighter","destination-out"],r="source-over",n=[],a=function(){function a(){this.nestLevel=0}var s=(__define,a),o=s.prototype;return o.render=function(e,t,i,r,a){this.nestLevel++;var s=t,o=s.context,h=a?e:null;o.pushBuffer(s),this.drawDisplayObject(e,s,r,i,null,null,h),o.$drawWebGL();var l=s.$drawCalls;if(s.onRenderFinish(),o.popBuffer(),this.nestLevel--,0===this.nestLevel){n.length>6&&(n.length=6);for(var u=n.length,c=0;u>c;c++)n[c].resize(0,0)}return l},o.drawDisplayObject=function(t,i,r,n,a,s,o){var h,l=0;if(a&&!o?(a.isDirty&&(l+=a.drawToSurface()),h=a.$renderNode):h=t.$getRenderNode(),h){if(r){var u=h.renderRegion;if(s&&!s.intersects(u))h.needRedraw=!1;else if(!h.needRedraw)for(var c=r.length,d=0;c>d;d++)if(u.intersects(r[d])){h.needRedraw=!0;break}}else h.needRedraw=!0;if(h.needRedraw){l++;var f=void 0,p=void 0;o?(f=t.$getConcatenatedAlphaAt(o,t.$getConcatenatedAlpha()),p=e.Matrix.create().copyFrom(t.$getConcatenatedMatrix()),t.$getLine truncated
|
||||
@@ -0,0 +1,2 @@
|
||||
var egret;!function(t){var e=function(t){function e(e,i,r){t.call(this),this._name=e,this._frame=0|i,r&&(this._end=0|r)}__extends(e,t);var i=__define,r=e,s=r.prototype;return i(s,"name",function(){return this._name}),i(s,"frame",function(){return this._frame}),i(s,"end",function(){return this._end}),s.clone=function(){return new e(this._name,this._frame,this._end)},e}(t.EventDispatcher);t.FrameLabel=e,t.registerClass(e,"egret.FrameLabel")}(egret||(egret={}));var egret;!function(t){var e=function(e){function i(i){e.call(this),this.$bitmapData=null,this.offsetPoint=t.Point.create(0,0),this.$movieClipData=null,this.frames=null,this.$totalFrames=0,this.frameLabels=null,this.$frameLabelStart=0,this.$frameLabelEnd=0,this.frameEvents=null,this.frameIntervalTime=0,this.$eventPool=null,this.$isPlaying=!1,this.isStopped=!0,this.playTimes=0,this.$currentFrameNum=0,this.$nextFrameNum=0,this.displayedKeyFrameNum=0,this.passedTime=0,this.$frameRate=0/0,this.lastTime=0,this.$smoothing=t.Bitmap.defaultSmoothing,this.$renderNode=new t.sys.BitmapNode,this.setMovieClipData(i)}__extends(i,e);var r=__define,s=i,n=s.prototype;return r(n,"smoothing",function(){return this.$smoothing},function(t){t=!!t,t!=this.$smoothing&&(this.$smoothing=t,this.$invalidate())}),n.$init=function(){this.$reset();var t=this.$movieClipData;t&&t.$isDataValid()&&(this.frames=t.frames,this.$totalFrames=t.numFrames,this.frameLabels=t.labels,this.frameEvents=t.events,this.$frameRate!=this.$frameRate&&(this.$frameRate=t.frameRate),this.frameIntervalTime=1e3/this.$frameRate,this._initFrame())},n.$reset=function(){this.frames=null,this.playTimes=0,this.$isPlaying=!1,this.setIsStopped(!0),this.$currentFrameNum=0,this.$nextFrameNum=1,this.displayedKeyFrameNum=0,this.passedTime=0,this.$eventPool=[]},n._initFrame=function(){this.$movieClipData.$isTextureValid()&&(this.advanceFrame(),this.constructFrame())},n.$render=function(){var e=this.$bitmapData;if(e){var i=Math.round(this.offsetPoint.x),r=Math.round(this.offsetPoint.y),s=e._bitmapWidth,n=e._bitmapHeight,o=e.$getTextureWidth(),a=e.$getTextureHeight(),h=Math.round(e.$getScaleBitmapWidth()),l=Math.round(e.$getScaleBitmapHeight()),c=e._sourceWidth,u=e._sourceHeight;t.sys.BitmapNode.$updateTextureData(this.$renderNode,e._bitmapData,e._bitmapX,e._bitmapY,s,n,i,r,o,a,h,l,c,u,null,t.BitmapFillMode.SCALE,this.$smoothing)}},n.$measureContentBounds=function(t){var e=this.$bitmapData;if(e){var i=this.offsetPoint.x,r=this.offsetPoint.y,s=e.$getTextureWidth(),n=e.$getTextureHeight();t.setTo(i,r,s,n)}else t.setEmpty()},n.$onAddToStage=function(t,i){e.prototype.$onAddToStage.call(this,t,i),this.$isPlaying&&this.$totalFrames>1&&this.setIsStopped(!1)},n.$onRemoveFromStage=function(){e.prototype.$onRemoveFromStage.call(this),this.setIsStopped(!0)},n.getFrameLabelByName=function(t,e){void 0===e&&(e=!1),e&&(t=t.toLowerCase());var i=this.frameLabels;if(i)for(var r=null,s=0;s<i.length;s++)if(r=i[s],e?r.name.toLowerCase()==t:r.name==t)return r;return null},n.getFrameStartEnd=function(t){var e=this.frameLabels;if(e)for(var i=null,r=0;r<e.length;r++)if(i=e[r],t==i.name){this.$frameLabelStart=i.frame,this.$frameLabelEnd=i.end;break}},n.getFrameLabelByFrame=function(t){var e=this.frameLabels;if(e)for(var i=null,r=0;r<e.length;r++)if(i=e[r],i.frame==t)return i;return null},n.getFrameLabelForFrame=function(t){var e=null,i=null,r=this.frameLabels;if(r)for(var s=0;s<r.length;s++){if(i=r[s],i.frame>t)return e;e=i}return e},n.play=function(t){void 0===t&&(t=0),this.$isPlaying=!0,this.setPlayTimes(t),this.$totalFrames>1&&this.$stage&&this.setIsStopped(!1)},n.stop=function(){this.$isPlaying=!1,this.setIsStopped(!0)},n.prevFrame=function(){this.gotoAndStop(this.$currentFrameNum-1)},n.nextFrame=function(){this.gotoAndStop(this.$currentFrameNum+1)},n.gotoAndPlay=function(e,i){void 0===i&&(i=0),(0==arguments.length||arguments.length>2)&&t.$error(1022,"MovieClip.gotoAndPlay()"),"string"==typeof e?this.getFrameStartEnd(e):(this.$frameLabelStart=0,this.$frameLabelEnd=0),this.play(i),this.gotoFrame(e)},n.gotoAndStop=function(e){1!=arguments.length&&t.$error(1022,"MovieClip.gotoAndStop()"),this.stop(),this.gotoFrame(e)},n.gotoFrame=function(e){var i;"string"==typeof e?i=this.getFrameLabelByName(e).frame:(i=parseInt(e+"",10),i!=e&&t.$error(1022,"Frame Label Not Found")),1>i?i=1:i>this.$totalFrames&&(i=this.$totalFrames),i!=this.$nextFrameNum&&(this.$nextFrameNum=i,this.advanceFrame(),this.constructFrame(),this.handlePendingEvent())},n.advanceTime=function(e){var i=this,r=e-i.lastTime;i.lastTime=e;var s=i.frameIntervalTime,n=i.passedTime+r;i.passedTime=n%s;var o=n/s;if(1>o)return!1;for(var a;o>=1;){if(o--,i.$nextFrameNum++,a=this.frameEvents[i.$nextFrameNum],a&&""!=a&&t.MovieClipEvent.dispatchMovieClipEvent(i,t.MovieClipEvent.FRAME_LABEL,a),i.$nextFrameNum>i.$totalFrames||i.$frameLabelStart>0&&i.$nextFrameNum>i.$frameLabelEnd)if(-1==i.playTimes)i.$eventPool.push(t.Event.LOOP_COMPLETE),i.$nextFrameNum=1;else{if(i.playTimes--,!(i.playTimes>0)){i.$nextFraLine truncated
|
||||
}(egret||(egret={}));var egret;!function(t){var e=function(e){function i(){e.call(this)}__extends(i,e);var r=__define,s=i,n=s.prototype;return r(n,"stage",function(){return t.sys.$TempStage}),r(i,"runtimeType",function(){return t.$warn(1041,"egret.MainContext.runtimeType","egret.Capabilities.runtimeType"),i._runtimeType}),n.run=function(){},r(i,"instance",function(){return null==i._instance&&(i._instance=new i),i._instance}),i.deviceType=null,i.DEVICE_PC="web",i.DEVICE_MOBILE="native",i.RUNTIME_HTML5="runtimeHtml5",i.RUNTIME_NATIVE="runtimeNative",i}(t.EventDispatcher);t.MainContext=e,t.registerClass(e,"egret.MainContext")}(egret||(egret={}));var testDeviceType1=function(){if(!this.navigator)return!0;var t=navigator.userAgent.toLowerCase();return-1!=t.indexOf("mobile")||-1!=t.indexOf("android")},testRuntimeType1=function(){return this.navigator?!0:!1};egret.MainContext.deviceType=testDeviceType1()?egret.MainContext.DEVICE_MOBILE:egret.MainContext.DEVICE_PC,egret.MainContext._runtimeType=testRuntimeType1()?egret.MainContext.RUNTIME_HTML5:egret.MainContext.RUNTIME_NATIVE,delete testDeviceType1,delete testRuntimeType1;var egret;!function(t){var e=function(e){function i(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(i,e);var r=__define,s=i,n=s.prototype;return i.$init=function(){t.sys.$ticker.$startTick(i.onUpdate,i)},i.onUpdate=function(t){for(var e=i._callBackList,r=e.length-1;r>=0;r--)e[r].$checkFrame();return!1},n.$checkFrame=function(){this.frameCount--,this.frameCount<=0&&this.dispose()},r(n,"length",function(){return this._length}),n.push=function(t){var e=this.objectPool;-1==e.indexOf(t)&&(e.push(t),t.__recycle&&t.__recycle(),this._length++,0==this.frameCount&&(this.frameCount=this.autoDisposeTime,i._callBackList.push(this)))},n.pop=function(){return 0==this._length?null:(this._length--,this.objectPool.pop())},n.dispose=function(){this._length>0&&(this.objectPool=[],this._length=0),this.frameCount=0;var t=i._callBackList,e=t.indexOf(this);-1!=e&&t.splice(e,1)},i._callBackList=[],i}(t.HashObject);t.Recycler=e,t.registerClass(e,"egret.Recycler"),e.$init()}(egret||(egret={}));var egret;!function(t){function e(e,i,h){for(var l=[],c=3;c<arguments.length;c++)l[c-3]=arguments[c];var u={listener:e,thisObject:i,delay:h,originDelay:h,params:l};return o++,1==o&&(a=t.getTimer(),t.sys.$ticker.$startTick(r,null)),n++,s[n]=u,n}function i(e){s[e]&&(o--,delete s[e],0==o&&t.sys.$ticker.$stopTick(r,null))}function r(t){var e=t-a;a=t;for(var i in s){var r=s[i];r.delay-=e,r.delay<=0&&(r.delay=r.originDelay,r.listener.apply(r.thisObject,r.params))}return!1}var s={},n=0,o=0,a=0;t.setInterval=e,t.clearInterval=i}(egret||(egret={}));var egret;!function(t){function e(e,i,h){for(var l=[],c=3;c<arguments.length;c++)l[c-3]=arguments[c];var u={listener:e,thisObject:i,delay:h,params:l};return o++,1==o&&t.sys.$ticker&&(a=t.getTimer(),t.sys.$ticker.$startTick(r,null)),n++,s[n]=u,n}function i(e){s[e]&&(o--,delete s[e],0==o&&t.sys.$ticker&&t.sys.$ticker.$stopTick(r,null))}function r(t){var e=t-a;a=t;for(var r in s){var n=r,o=s[n];o.delay-=e,o.delay<=0&&(o.listener.apply(o.thisObject,o.params),i(n))}return!1}var s={},n=0,o=0,a=0;t.setTimeout=e,t.clearTimeout=i}(egret||(egret={}));
|
||||
@@ -0,0 +1 @@
|
||||
var egret;!function(e){var t;!function(t){var n=function(t){function n(){t.call(this)}__extends(n,t);var r=(__define,n),a=r.prototype;return a.proceed=function(t){function n(e){t.dispatchEvent(e)}function r(e){o(),t.dispatchEvent(e)}function a(){switch(o(),t.dataFormat){case e.URLLoaderDataFormat.VARIABLES:t.data=new e.URLVariables(d.response);break;default:t.data=d.response}window.setTimeout(function(){e.Event.dispatchEvent(t,e.Event.COMPLETE)},0)}function o(){d.removeEventListener(e.Event.COMPLETE,a,i),d.removeEventListener(e.IOErrorEvent.IO_ERROR,r,i),d.removeEventListener(e.ProgressEvent.PROGRESS,n,i)}var i=this;if(t.dataFormat==e.URLLoaderDataFormat.TEXTURE)return void this.loadTexture(t);if(t.dataFormat==e.URLLoaderDataFormat.SOUND)return void this.loadSound(t);var s=t._request,E=i.getVirtualUrl(e.$getUrl(s)),d=new e.HttpRequest;if(d.addEventListener(e.Event.COMPLETE,a,this),d.addEventListener(e.IOErrorEvent.IO_ERROR,r,this),d.addEventListener(e.ProgressEvent.PROGRESS,n,this),d.open(E,s.method),d.responseType=this.getResponseType(t.dataFormat),s.method!=e.URLRequestMethod.GET&&s.data)if(s.data instanceof e.URLVariables){d.setRequestHeader("Content-Type","application/x-www-form-urlencoded");var v=s.data;d.send(v.toString())}else d.setRequestHeader("Content-Type","multipart/form-data"),d.send(s.data);else d.send()},a.getResponseType=function(t){switch(t){case e.URLLoaderDataFormat.TEXT:case e.URLLoaderDataFormat.VARIABLES:return e.URLLoaderDataFormat.TEXT;case e.URLLoaderDataFormat.BINARY:return"arraybuffer";default:return t}},a.loadSound=function(t){function n(e){t.dispatchEvent(e)}function r(e){o(),t.dispatchEvent(e)}function a(n){o(),t.data=E,window.setTimeout(function(){t.dispatchEventWith(e.Event.COMPLETE)},0)}function o(){E.removeEventListener(e.Event.COMPLETE,a,i),E.removeEventListener(e.IOErrorEvent.IO_ERROR,r,i),E.removeEventListener(e.ProgressEvent.PROGRESS,n,i)}var i=this,s=this.getVirtualUrl(t._request.url),E=new e.Sound;E.addEventListener(e.Event.COMPLETE,a,i),E.addEventListener(e.IOErrorEvent.IO_ERROR,r,i),E.addEventListener(e.ProgressEvent.PROGRESS,n,i),E.load(s)},a.loadTexture=function(t){function n(e){t.dispatchEvent(e)}function r(e){o(),t.dispatchEvent(e)}function a(n){o();var r=E.data;r.source.setAttribute("bitmapSrc",s);var a=new e.Texture;a._setBitmapData(r),t.data=a,window.setTimeout(function(){t.dispatchEventWith(e.Event.COMPLETE)},i)}function o(){E.removeEventListener(e.Event.COMPLETE,a,i),E.removeEventListener(e.IOErrorEvent.IO_ERROR,r,i),E.removeEventListener(e.ProgressEvent.PROGRESS,n,i)}var i=this,s=this.getVirtualUrl(t._request.url),E=new e.ImageLoader;E.addEventListener(e.Event.COMPLETE,a,i),E.addEventListener(e.IOErrorEvent.IO_ERROR,r,i),E.addEventListener(e.ProgressEvent.PROGRESS,n,i),E.load(s)},a.getChangeList=function(){return[]},a.getVirtualUrl=function(e){return e},n.getNetContext=function(){return null==n._instance&&(n._instance=new n),n._instance},n}(e.HashObject);t.HTML5NetContext=n,e.registerClass(n,"egret.web.HTML5NetContext",["egret.NetContext"]),e.NetContext=n}(t=e.web||(e.web={}))}(egret||(egret={}));
|
||||
@@ -0,0 +1 @@
|
||||
var RES;!function(e){var t=function(){function e(e,t,r){this.groupName="",this.data=null,this._loaded=!1,this.name=e,this.url=t,this.type=r}var t=__define,r=e,i=r.prototype;return t(i,"loaded",function(){return this.data?this.data.loaded:this._loaded},function(e){this.data&&(this.data.loaded=e),this._loaded=e}),i.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",e}();e.ResourceItem=t,egret.registerClass(t,"RES.ResourceItem")}(RES||(RES={}));var RES;!function(e){var t=function(){function t(){this.keyMap={},this.groupDic={},e.configInstance=this}var r=(__define,t),i=r.prototype;return i.getGroupByName=function(e){var t=new Array;if(!this.groupDic[e])return t;for(var r=this.groupDic[e],i=r.length,n=0;i>n;n++){var s=r[n];t.push(this.parseResourceItem(s))}return t},i.getRawGroupByName=function(e){return this.groupDic[e]?this.groupDic[e]:[]},i.createGroup=function(e,t,r){if(void 0===r&&(r=!1),!r&&this.groupDic[e]||!t||0==t.length)return!1;for(var i=this.groupDic,n=[],s=t.length,a=0;s>a;a++){var o=t[a],u=i[o];if(u)for(var l=u.length,c=0;l>c;c++){var h=u[c];-1==n.indexOf(h)&&n.push(h)}else{var h=this.keyMap[o];h?-1==n.indexOf(h)&&n.push(h):egret.$warn(3200,o)}}return 0==n.length?!1:(this.groupDic[e]=n,!0)},i.parseConfig=function(e,t){if(e){var r=e.resources;if(r)for(var i=r.length,n=0;i>n;n++){var s=r[n],a=s.url;a&&-1==a.indexOf("://")&&(s.url=t+a),this.addItemToKeyMap(s)}var o=e.groups;if(o)for(var u=o.length,n=0;u>n;n++){for(var l=o[n],c=[],h=l.keys.split(","),f=h.length,d=0;f>d;d++){var g=h[d].trim(),s=this.keyMap[g];s&&-1==c.indexOf(s)&&c.push(s)}this.groupDic[l.name]=c}}},i.addSubkey=function(e,t){var r=this.keyMap[t];r&&!this.keyMap[e]&&(this.keyMap[e]=r)},i.addItemToKeyMap=function(e){if(this.keyMap[e.name]||(this.keyMap[e.name]=e),e.hasOwnProperty("subkeys")){var t=e.subkeys.split(",");e.subkeys=t;for(var r=t.length,i=0;r>i;i++){var n=t[i];null==this.keyMap[n]&&(this.keyMap[n]=e)}}},i.getName=function(e){var t=this.keyMap[e];return t?t.name:""},i.getType=function(e){var t=this.keyMap[e];return t?t.type:""},i.getRawResourceItem=function(e){return this.keyMap[e]},i.getResourceItem=function(e){var t=this.keyMap[e];return t?this.parseResourceItem(t):null},i.parseResourceItem=function(t){var r=new e.ResourceItem(t.name,t.url,t.type);return r.data=t,r},t}();e.ResourceConfig=t,egret.registerClass(t,"RES.ResourceConfig")}(RES||(RES={}));var RES;!function(e){var t=function(t){function r(){t.call(this),this.thread=2,this.loadingCount=0,this.callBack=null,this.resInstance=null,this.groupTotalDic={},this.numLoadedDic={},this.itemListDic={},this.groupErrorDic={},this.retryTimesDic={},this.maxRetryTimes=3,this.failedList=new Array,this.priorityQueue={},this.lazyLoadList=new Array,this.analyzerDic={},this.queueIndex=0}__extends(r,t);var i=(__define,r),n=i.prototype;return n.isGroupInLoading=function(e){return void 0!==this.itemListDic[e]},n.loadGroup=function(t,r,i){if(void 0===i&&(i=0),!this.itemListDic[r]&&r){if(!t||0==t.length){egret.$warn(3201,r);var n=new e.ResourceEvent(e.ResourceEvent.GROUP_LOAD_ERROR);return n.groupName=r,void this.dispatchEvent(n)}this.priorityQueue[i]?this.priorityQueue[i].push(r):this.priorityQueue[i]=[r],this.itemListDic[r]=t;for(var s=t.length,a=0;s>a;a++){var o=t[a];o.groupName=r}this.groupTotalDic[r]=t.length,this.numLoadedDic[r]=0,this.next()}},n.loadItem=function(e){this.lazyLoadList.push(e),e.groupName="",this.next()},n.next=function(){for(;this.loadingCount<this.thread;){var e=this.getOneResourceItem();if(!e)break;if(this.loadingCount++,e.loaded)this.onItemComplete(e);else{var t=this.resInstance.$getAnalyzerByType(e.type);t.loadFile(e,this.onItemComplete,this)}}},n.getOneResourceItem=function(){if(this.failedList.length>0)return this.failedList.shift();var e=Number.NEGATIVE_INFINITY;for(var t in this.priorityQueue)e=Math.max(e,t);var r=this.priorityQueue[e];if(!r||0==r.length)return 0==this.lazyLoadList.length?null:this.lazyLoadList.pop();for(var i,n=r.length,s=0;n>s&&(this.queueIndex>=n&&(this.queueIndex=0),i=this.itemListDic[r[this.queueIndex]],!(i.length>0));s++)this.queueIndex++;return 0==i.length?null:i.shift()},n.onItemComplete=function(t){this.loadingCount--;var r=t.groupName;if(!t.loaded){var i=this.retryTimesDic[t.name]||1;if(!(i>this.maxRetryTimes))return this.retryTimesDic[t.name]=i+1,this.failedList.push(t),void this.next();delete this.retryTimesDic[t.name],e.ResourceEvent.dispatchResourceEvent(this.resInstance,e.ResourceEvent.ITEM_LOAD_ERROR,r,t)}if(r){this.numLoadedDic[r]++;var n=this.numLoadedDic[r],s=this.groupTotalDic[r];if(t.loaded||(this.groupErrorDic[r]=!0),e.ResourceEvent.dispatchResourceEvent(this.resInstance,e.ResourceEvent.GROUP_PROGRESS,r,t,n,s),n==s){var a=this.groupErrorDic[r];this.removeGroupName(r),delete this.groupTotalDic[r],delete this.numLoadedDic[Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
var egret;!function(t){var e=function(){function e(){t.$error(1014)}var n=(__define,e);n.prototype;return e.get=function(t){return-1>t&&(t=-1),t>1&&(t=1),function(e){return 0==t?e:0>t?e*(e*-t+1+t):e*((2-e)*t+(1-t))}},e.getPowIn=function(t){return function(e){return Math.pow(e,t)}},e.getPowOut=function(t){return function(e){return 1-Math.pow(1-e,t)}},e.getPowInOut=function(t){return function(e){return(e*=2)<1?.5*Math.pow(e,t):1-.5*Math.abs(Math.pow(2-e,t))}},e.sineIn=function(t){return 1-Math.cos(t*Math.PI/2)},e.sineOut=function(t){return Math.sin(t*Math.PI/2)},e.sineInOut=function(t){return-.5*(Math.cos(Math.PI*t)-1)},e.getBackIn=function(t){return function(e){return e*e*((t+1)*e-t)}},e.getBackOut=function(t){return function(e){return--e*e*((t+1)*e+t)+1}},e.getBackInOut=function(t){return t*=1.525,function(e){return(e*=2)<1?.5*(e*e*((t+1)*e-t)):.5*((e-=2)*e*((t+1)*e+t)+2)}},e.circIn=function(t){return-(Math.sqrt(1-t*t)-1)},e.circOut=function(t){return Math.sqrt(1- --t*t)},e.circInOut=function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},e.bounceIn=function(t){return 1-e.bounceOut(1-t)},e.bounceOut=function(t){return 1/2.75>t?7.5625*t*t:2/2.75>t?7.5625*(t-=1.5/2.75)*t+.75:2.5/2.75>t?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},e.bounceInOut=function(t){return.5>t?.5*e.bounceIn(2*t):.5*e.bounceOut(2*t-1)+.5},e.getElasticIn=function(t,e){var n=2*Math.PI;return function(i){if(0==i||1==i)return i;var s=e/n*Math.asin(1/t);return-(t*Math.pow(2,10*(i-=1))*Math.sin((i-s)*n/e))}},e.getElasticOut=function(t,e){var n=2*Math.PI;return function(i){if(0==i||1==i)return i;var s=e/n*Math.asin(1/t);return t*Math.pow(2,-10*i)*Math.sin((i-s)*n/e)+1}},e.getElasticInOut=function(t,e){var n=2*Math.PI;return function(i){var s=e/n*Math.asin(1/t);return(i*=2)<1?-.5*(t*Math.pow(2,10*(i-=1))*Math.sin((i-s)*n/e)):t*Math.pow(2,-10*(i-=1))*Math.sin((i-s)*n/e)*.5+1}},e.quadIn=e.getPowIn(2),e.quadOut=e.getPowOut(2),e.quadInOut=e.getPowInOut(2),e.cubicIn=e.getPowIn(3),e.cubicOut=e.getPowOut(3),e.cubicInOut=e.getPowInOut(3),e.quartIn=e.getPowIn(4),e.quartOut=e.getPowOut(4),e.quartInOut=e.getPowInOut(4),e.quintIn=e.getPowIn(5),e.quintOut=e.getPowOut(5),e.quintInOut=e.getPowInOut(5),e.backIn=e.getBackIn(1.7),e.backOut=e.getBackOut(1.7),e.backInOut=e.getBackInOut(1.7),e.elasticIn=e.getElasticIn(1,.3),e.elasticOut=e.getElasticOut(1,.3),e.elasticInOut=e.getElasticInOut(1,.3*1.5),e}();t.Ease=e,t.registerClass(e,"egret.Ease")}(egret||(egret={}));var egret;!function(t){var e=function(e){function n(t,n,i){e.call(this),this._target=null,this._useTicks=!1,this.ignoreGlobalPause=!1,this.loop=!1,this.pluginData=null,this._steps=null,this.paused=!1,this.duration=0,this._prevPos=-1,this.position=null,this._prevPosition=0,this._stepPosition=0,this.passive=!1,this.initialize(t,n,i)}__extends(n,e);var i=(__define,n),s=i.prototype;return n.get=function(t,e,i,s){return void 0===e&&(e=null),void 0===i&&(i=null),void 0===s&&(s=!1),s&&n.removeTweens(t),new n(t,e,i)},n.removeTweens=function(t){if(t.tween_count){for(var e=n._tweens,i=e.length-1;i>=0;i--)e[i]._target==t&&(e[i].paused=!0,e.splice(i,1));t.tween_count=0}},n.pauseTweens=function(e){if(e.tween_count)for(var n=t.Tween._tweens,i=n.length-1;i>=0;i--)n[i]._target==e&&(n[i].paused=!0)},n.resumeTweens=function(e){if(e.tween_count)for(var n=t.Tween._tweens,i=n.length-1;i>=0;i--)n[i]._target==e&&(n[i].paused=!1)},n.tick=function(t,e){void 0===e&&(e=!1);var i=t-n._lastTime;n._lastTime=t;for(var s=n._tweens.concat(),r=s.length-1;r>=0;r--){var u=s[r];e&&!u.ignoreGlobalPause||u.paused||u.$tick(u._useTicks?1:i)}return!1},n._register=function(e,i){var s=e._target,r=n._tweens;if(i)s&&(s.tween_count=s.tween_count>0?s.tween_count+1:1),r.push(e),n._inited||(n._lastTime=t.getTimer(),t.sys.$ticker.$startTick(n.tick,null),n._inited=!0);else{s&&s.tween_count--;for(var u=r.length;u--;)if(r[u]==e)return void r.splice(u,1)}},n.removeAllTweens=function(){for(var t=n._tweens,e=0,i=t.length;i>e;e++){var s=t[e];s.paused=!0,s._target.tweenjs_count=0}t.length=0},s.initialize=function(t,e,i){this._target=t,e&&(this._useTicks=e.useTicks,this.ignoreGlobalPause=e.ignoreGlobalPause,this.loop=e.loop,e.onChange&&this.addEventListener("change",e.onChange,e.onChangeObj),e.override&&n.removeTweens(t)),this.pluginData=i||{},this._curQueueProps={},this._initQueueProps={},this._steps=[],e&&e.paused?this.paused=!0:n._register(this,!0),e&&null!=e.position&&this.setPosition(e.position,n.NONE)},s.setPosition=function(t,e){void 0===e&&(e=1),0>t&&(t=0);var n=t,i=!1;if(n>=this.duration&&(this.loop?n%=this.duration:(n=this.duration,i=!0)),n==this._prevPos)return i;i&&this.setPaused(!0);var s=this._prevPos;if(this.position=this._prevPos=n,this._prevPosition=t,this._target&&this._steps.length>0){for(var r=this._steps.length,u=-1,o=0;r>o&&!("step"==this._steps[o].type&&(u=o,this._steps[o].t<=n&&this._steps[o].t+this._steps[o].d>=n));o++);for(var o=0;r>o;o++)if("action"==this._steps[o].type)0!=e&&(this._useTicks?Line truncated
|
||||
Reference in new issue
Block a user