第一次提交
This commit is contained in:
commit
8121362a03
4412 files changed
+1091845
No files matched your search
@@ -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={}));
|
||||
Reference in new issue
Block a user