├── _config.yml ├── favicon.ico ├── resource ├── assets │ ├── bg0.jpg │ ├── bg001.jpg │ ├── bg002.jpg │ ├── bg003.png │ ├── bg004.jpg │ ├── bg1.jpg │ ├── bg2.jpg │ ├── bg3.jpg │ ├── bg4.jpg │ ├── bg5.jpg │ ├── bg6.jpg │ ├── bg7.jpg │ ├── bg000n.jpg │ └── egret_icon.png ├── config │ └── description.json └── default.res.json ├── wingProperties.json ├── template ├── runtime │ ├── native_loader.js │ ├── runtime_loader.js │ └── native_require.js ├── web │ └── index.html └── debug │ └── index.html ├── manifest.json ├── tsconfig.json ├── egretProperties.json ├── bin-debug ├── LoadingUI.js.map ├── LoadingUI.js ├── Main.js.map └── Main.js ├── README.md ├── src ├── LoadingUI.ts └── Main.ts ├── index.html ├── promise └── bin │ ├── promise.min.js │ └── promise.js └── libs └── modules ├── tween ├── tween.min.js └── tween.d.ts ├── res └── res.min.js └── game └── game.min.js /_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-cayman -------------------------------------------------------------------------------- /favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/Hearthstone/master/favicon.ico -------------------------------------------------------------------------------- /resource/assets/bg0.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/Hearthstone/master/resource/assets/bg0.jpg -------------------------------------------------------------------------------- /resource/assets/bg001.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/Hearthstone/master/resource/assets/bg001.jpg -------------------------------------------------------------------------------- /resource/assets/bg002.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/Hearthstone/master/resource/assets/bg002.jpg -------------------------------------------------------------------------------- /resource/assets/bg003.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/Hearthstone/master/resource/assets/bg003.png -------------------------------------------------------------------------------- /resource/assets/bg004.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/Hearthstone/master/resource/assets/bg004.jpg -------------------------------------------------------------------------------- /resource/assets/bg1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/Hearthstone/master/resource/assets/bg1.jpg -------------------------------------------------------------------------------- /resource/assets/bg2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/Hearthstone/master/resource/assets/bg2.jpg -------------------------------------------------------------------------------- /resource/assets/bg3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/Hearthstone/master/resource/assets/bg3.jpg -------------------------------------------------------------------------------- /resource/assets/bg4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/Hearthstone/master/resource/assets/bg4.jpg -------------------------------------------------------------------------------- /resource/assets/bg5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/Hearthstone/master/resource/assets/bg5.jpg -------------------------------------------------------------------------------- /resource/assets/bg6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/Hearthstone/master/resource/assets/bg6.jpg -------------------------------------------------------------------------------- /resource/assets/bg7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/Hearthstone/master/resource/assets/bg7.jpg -------------------------------------------------------------------------------- /resource/assets/bg000n.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/Hearthstone/master/resource/assets/bg000n.jpg -------------------------------------------------------------------------------- /resource/assets/egret_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/Hearthstone/master/resource/assets/egret_icon.png -------------------------------------------------------------------------------- /wingProperties.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourcePlugin":{ 3 | "configs":[{ 4 | "configPath":"resource/default.res.json", 5 | "relativePath":"resource/" 6 | }] 7 | }, 8 | "theme":"resource/default.thm.json" 9 | } -------------------------------------------------------------------------------- /template/runtime/native_loader.js: -------------------------------------------------------------------------------- 1 | require("launcher/native_require.js"); 2 | 3 | egret_native.egtMain = function () { 4 | egret_native.nativeType = "native"; 5 | 6 | egret_native.egretInit(); 7 | egret_native.egretStart(); 8 | }; 9 | -------------------------------------------------------------------------------- /template/runtime/runtime_loader.js: -------------------------------------------------------------------------------- 1 | require("launcher/native_require.js"); 2 | 3 | egret_native.egtMain = function () { 4 | egret_native.nativeType = "runtime"; 5 | 6 | egret_native.egretInit(); 7 | egret_native.egretStart(); 8 | }; -------------------------------------------------------------------------------- /resource/config/description.json: -------------------------------------------------------------------------------- 1 | [ 2 | "炉石传说,Free,Multi-platform", 3 | "Push Game Forward", 4 | "HTML5 炉石传说" 5 | ] -------------------------------------------------------------------------------- /manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "initial": [ 3 | "libs/modules/egret/egret.js", 4 | "libs/modules/egret/egret.web.js", 5 | "libs/modules/game/game.js", 6 | "libs/modules/res/res.js", 7 | "libs/modules/tween/tween.js", 8 | "promise/bin/promise.js" 9 | ], 10 | "game": [ 11 | "bin-debug/LoadingUI.js", 12 | "bin-debug/Main.js" 13 | ] 14 | } -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "outDir": "bin-debug", 5 | "experimentalDecorators": true, 6 | "lib": [ 7 | "es5", 8 | "dom", 9 | "es2015.promise" 10 | ] 11 | }, 12 | "exclude": [ 13 | "node_modules" 14 | ] 15 | } -------------------------------------------------------------------------------- /egretProperties.json: -------------------------------------------------------------------------------- 1 | { 2 | "native": { 3 | "path_ignore": [] 4 | }, 5 | "publish": { 6 | "web": 0, 7 | "native": 1, 8 | "path": "bin-release" 9 | }, 10 | "egret_version": "5.0.1", 11 | "template": {}, 12 | "modules": [ 13 | { 14 | "name": "egret" 15 | }, 16 | { 17 | "name": "game" 18 | }, 19 | { 20 | "name": "res" 21 | }, 22 | { 23 | "name": "tween" 24 | }, 25 | { 26 | "name": "promise", 27 | "path": "./promise" 28 | } 29 | ] 30 | } -------------------------------------------------------------------------------- /bin-debug/LoadingUI.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"LoadingUI.js","sourceRoot":"","sources":["../src/LoadingUI.ts"],"names":[],"mappings":"AAAA,sFAAsF;AACtF,EAAE;AACF,iDAAiD;AACjD,wBAAwB;AACxB,sEAAsE;AACtE,+EAA+E;AAC/E,EAAE;AACF,uEAAuE;AACvE,sEAAsE;AACtE,0EAA0E;AAC1E,4EAA4E;AAC5E,6EAA6E;AAC7E,8CAA8C;AAC9C,6EAA6E;AAC7E,8EAA8E;AAC9E,EAAE;AACF,+EAA+E;AAC/E,gFAAgF;AAChF,2EAA2E;AAC3E,gFAAgF;AAChF,gFAAgF;AAChF,8EAA8E;AAC9E,6EAA6E;AAC7E,wEAAwE;AACxE,gFAAgF;AAChF,sDAAsD;AACtD,EAAE;AACF,sFAAsF;;;;;;;;;AAEtF;IAAwB,6BAAY;IAEhC;QAAA,YACI,iBAAO,SAEV;QADG,KAAI,CAAC,UAAU,EAAE,CAAC;;IACtB,CAAC;IAIO,8BAAU,GAAlB;QACI,IAAI,CAAC,SAAS,GAAG,IAAI,KAAK,CAAC,SAAS,EAAE,CAAC;QACvC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAC9B,IAAI,CAAC,SAAS,CAAC,CAAC,GAAG,GAAG,CAAC;QACvB,IAAI,CAAC,SAAS,CAAC,KAAK,GAAG,GAAG,CAAC;QAC3B,IAAI,CAAC,SAAS,CAAC,MAAM,GAAG,GAAG,CAAC;QAC5B,IAAI,CAAC,SAAS,CAAC,SAAS,GAAG,QAAQ,CAAC;IACxC,CAAC;IAEM,+BAAW,GAAlB,UAAmB,OAAc,EAAE,KAAY;QAC3C,IAAI,CAAC,SAAS,CAAC,IAAI,GAAG,eAAa,OAAO,SAAI,KAAO,CAAC;IAC1D,CAAC;IACL,gBAAC;AAAD,CAAC,AArBD,CAAwB,KAAK,CAAC,MAAM,GAqBnC;AArBK,UAAA,SAAS,wBAqBd,CAAA"} -------------------------------------------------------------------------------- /resource/default.res.json: -------------------------------------------------------------------------------- 1 | { 2 | "groups": [ 3 | { 4 | "keys": "egret_icon_png,description_json,bg1_jpg,bg0_jpg,bg2_jpg,bg3_jpg,bg4_jpg,bg5_jpg,bg6_jpg,bg7_jpg", 5 | "name": "heroes" 6 | } 7 | ], 8 | "resources": [ 9 | { 10 | "url": "assets/egret_icon.png", 11 | "type": "image", 12 | "name": "egret_icon_png" 13 | }, 14 | { 15 | "url": "config/description.json", 16 | "type": "json", 17 | "name": "description_json" 18 | }, 19 | { 20 | "url": "assets/bg1.jpg", 21 | "type": "image", 22 | "name": "bg1_jpg" 23 | }, 24 | { 25 | "url": "assets/bg0.jpg", 26 | "type": "image", 27 | "name": "bg0_jpg" 28 | }, 29 | { 30 | "url": "assets/bg2.jpg", 31 | "type": "image", 32 | "name": "bg2_jpg" 33 | }, 34 | { 35 | "url": "assets/bg3.jpg", 36 | "type": "image", 37 | "name": "bg3_jpg" 38 | }, 39 | { 40 | "url": "assets/bg4.jpg", 41 | "type": "image", 42 | "name": "bg4_jpg" 43 | }, 44 | { 45 | "url": "assets/bg5.jpg", 46 | "type": "image", 47 | "name": "bg5_jpg" 48 | }, 49 | { 50 | "url": "assets/bg6.jpg", 51 | "type": "image", 52 | "name": "bg6_jpg" 53 | }, 54 | { 55 | "url": "assets/bg7.jpg", 56 | "type": "image", 57 | "name": "bg7_jpg" 58 | } 59 | ] 60 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Welcome to GitHub Pages 2 | 3 | You can use the [editor on GitHub](https://github.com/ZainChen/Hearthstone/edit/master/README.md) to maintain and preview the content for your website in Markdown files. 4 | 5 | Whenever you commit to this repository, GitHub Pages will run [Jekyll](https://jekyllrb.com/) to rebuild the pages in your site, from the content in your Markdown files. 6 | 7 | ### Markdown 8 | 9 | Markdown is a lightweight and easy-to-use syntax for styling your writing. It includes conventions for 10 | 11 | ```markdown 12 | Syntax highlighted code block 13 | 14 | # Header 1 15 | ## Header 2 16 | ### Header 3 17 | 18 | - Bulleted 19 | - List 20 | 21 | 1. Numbered 22 | 2. List 23 | 24 | **Bold** and _Italic_ and `Code` text 25 | 26 | [Link](url) and ![Image](src) 27 | ``` 28 | 29 | For more details see [GitHub Flavored Markdown](https://guides.github.com/features/mastering-markdown/). 30 | 31 | ### Jekyll Themes 32 | 33 | Your Pages site will use the layout and styles from the Jekyll theme you have selected in your [repository settings](https://github.com/ZainChen/Hearthstone/settings). The name of this theme is saved in the Jekyll `_config.yml` configuration file. 34 | 35 | ### Support or Contact 36 | 37 | Having trouble with Pages? Check out our [documentation](https://help.github.com/categories/github-pages-basics/) or [contact support](https://github.com/contact) and we’ll help you sort it out. 38 | -------------------------------------------------------------------------------- /template/runtime/native_require.js: -------------------------------------------------------------------------------- 1 | var manifest = JSON.parse(egret_native.readFileSync("manifest.json")); 2 | var game_file_list = manifest.initial.concat(manifest.game); 3 | 4 | var window = this; 5 | 6 | egret_native.setSearchPaths([""]); 7 | 8 | egret_native.requireFiles = function () { 9 | for (var key in game_file_list) { 10 | var src = game_file_list[key]; 11 | require(src); 12 | } 13 | }; 14 | 15 | egret_native.egretInit = function () { 16 | if(egret_native.featureEnable) { 17 | //控制一些优化方案是否开启 18 | var result = egret_native.featureEnable({ 19 | 20 | }); 21 | } 22 | egret_native.requireFiles(); 23 | //egret.dom为空实现 24 | egret.dom = {}; 25 | egret.dom.drawAsCanvas = function () { 26 | }; 27 | }; 28 | 29 | egret_native.egretStart = function () { 30 | var option = { 31 | //以下为自动修改,请勿修改 32 | //----auto option start---- 33 | entryClassName: "Main", 34 | frameRate: 30, 35 | scaleMode: "noBorder", 36 | contentWidth: 414, 37 | contentHeight: 736, 38 | showPaintRect: false, 39 | showFPS: false, 40 | fpsStyles: "x:0,y:0,size:12,textColor:0xffffff,bgAlpha:0.9", 41 | showLog: false, 42 | logFilter: "", 43 | maxTouches: 2, 44 | textureScaleFactor: 1 45 | //----auto option end---- 46 | }; 47 | 48 | egret.native.NativePlayer.option = option; 49 | egret.runEgret(); 50 | egret_native.Label.createLabel("/system/fonts/DroidSansFallback.ttf", 20, "", 0); 51 | egret_native.EGTView.preSetOffScreenBufferEnable(true); 52 | }; -------------------------------------------------------------------------------- /src/LoadingUI.ts: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (c) 2014-present, Egret Technology. 4 | // All rights reserved. 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above copyright 11 | // notice, this list of conditions and the following disclaimer in the 12 | // documentation and/or other materials provided with the distribution. 13 | // * Neither the name of the Egret nor the 14 | // names of its contributors may be used to endorse or promote products 15 | // derived from this software without specific prior written permission. 16 | // 17 | // THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS "AS IS" AND ANY EXPRESS 18 | // OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 | // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 20 | // IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 22 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA, 23 | // OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 24 | // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 26 | // EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | // 28 | ////////////////////////////////////////////////////////////////////////////////////// 29 | 30 | class LoadingUI extends egret.Sprite { 31 | 32 | public constructor() { 33 | super(); 34 | this.createView(); 35 | } 36 | 37 | private textField:egret.TextField; 38 | 39 | private createView():void { 40 | this.textField = new egret.TextField(); 41 | this.addChild(this.textField); 42 | this.textField.y = 300; 43 | this.textField.width = 480; 44 | this.textField.height = 100; 45 | this.textField.textAlign = "center"; 46 | } 47 | 48 | public setProgress(current:number, total:number):void { 49 | this.textField.text = `Loading...${current}/${total}`; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Egret 7 | 8 | 9 | 10 | 11 | 12 | 13 | 23 | 24 | 25 | 26 |
37 |
38 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /template/web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Egret 7 | 8 | 9 | 10 | 11 | 12 | 13 | 23 | 24 | 25 | 26 |
37 |
38 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /template/debug/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Egret 7 | 8 | 9 | 10 | 11 | 12 | 13 | 23 | 24 | 25 | 26 |
37 |
38 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /bin-debug/LoadingUI.js: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (c) 2014-present, Egret Technology. 4 | // All rights reserved. 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above copyright 11 | // notice, this list of conditions and the following disclaimer in the 12 | // documentation and/or other materials provided with the distribution. 13 | // * Neither the name of the Egret nor the 14 | // names of its contributors may be used to endorse or promote products 15 | // derived from this software without specific prior written permission. 16 | // 17 | // THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS "AS IS" AND ANY EXPRESS 18 | // OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 | // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 20 | // IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 22 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA, 23 | // OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 24 | // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 26 | // EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | // 28 | ////////////////////////////////////////////////////////////////////////////////////// 29 | var __reflect = (this && this.__reflect) || function (p, c, t) { 30 | p.__class__ = c, t ? t.push(c) : t = [c], p.__types__ = p.__types__ ? t.concat(p.__types__) : t; 31 | }; 32 | var __extends = (this && this.__extends) || function (d, b) { 33 | for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; 34 | function __() { this.constructor = d; } 35 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); 36 | }; 37 | var LoadingUI = (function (_super) { 38 | __extends(LoadingUI, _super); 39 | function LoadingUI() { 40 | var _this = _super.call(this) || this; 41 | _this.createView(); 42 | return _this; 43 | } 44 | LoadingUI.prototype.createView = function () { 45 | this.textField = new egret.TextField(); 46 | this.addChild(this.textField); 47 | this.textField.y = 300; 48 | this.textField.width = 480; 49 | this.textField.height = 100; 50 | this.textField.textAlign = "center"; 51 | }; 52 | LoadingUI.prototype.setProgress = function (current, total) { 53 | this.textField.text = "Loading..." + current + "/" + total; 54 | }; 55 | return LoadingUI; 56 | }(egret.Sprite)); 57 | __reflect(LoadingUI.prototype, "LoadingUI"); 58 | //# sourceMappingURL=LoadingUI.js.map -------------------------------------------------------------------------------- /promise/bin/promise.min.js: -------------------------------------------------------------------------------- 1 | !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.ES6Promise=e()}(this,function(){"use strict";function t(t){return"function"==typeof t||"object"==typeof t&&null!==t}function e(t){return"function"==typeof t}function n(t){I=t}function r(t){J=t}function o(){return function(){return process.nextTick(a)}}function i(){return"undefined"!=typeof H?function(){H(a)}:c()}function s(){var t=0,e=new V(a),n=document.createTextNode("");return e.observe(n,{characterData:!0}),function(){n.data=t=++t%2}}function u(){var t=new MessageChannel;return t.port1.onmessage=a,function(){return t.port2.postMessage(0)}}function c(){var t=setTimeout;return function(){return t(a,1)}}function a(){for(var t=0;tt&&(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 r=e/n*Math.asin(1/t);return-(t*Math.pow(2,10*(i-=1))*Math.sin((i-r)*n/e))}},e.getElasticOut=function(t,e){var n=2*Math.PI;return function(i){if(0==i||1==i)return i;var r=e/n*Math.asin(1/t);return t*Math.pow(2,-10*i)*Math.sin((i-r)*n/e)+1}},e.getElasticInOut=function(t,e){var n=2*Math.PI;return function(i){var r=e/n*Math.asin(1/t);return(i*=2)<1?-.5*(t*Math.pow(2,10*(i-=1))*Math.sin((i-r)*n/e)):t*Math.pow(2,-10*(i-=1))*Math.sin((i-r)*n/e)*.5+1}},e}();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),t.Ease=e,__reflect(e.prototype,"egret.Ease")}(egret||(egret={}));var egret;!function(t){var e=function(e){function n(t,n,i){var r=e.call(this)||this;return r._target=null,r._useTicks=!1,r.ignoreGlobalPause=!1,r.loop=!1,r.pluginData=null,r._steps=null,r.paused=!1,r.duration=0,r._prevPos=-1,r.position=null,r._prevPosition=0,r._stepPosition=0,r.passive=!1,r.initialize(t,n,i),r}return __extends(n,e),n.get=function(t,e,i,r){return void 0===i&&(i=null),void 0===r&&(r=!1),r&&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 r=n._tweens.concat(),s=r.length-1;s>=0;s--){var o=r[s];e&&!o.ignoreGlobalPause||o.paused||o.$tick(o._useTicks?1:i)}return!1},n._register=function(e,i){var r=e._target,s=n._tweens;if(i)r&&(r.tween_count=r.tween_count>0?r.tween_count+1:1),s.push(e),n._inited||(n._lastTime=t.getTimer(),t.ticker.$startTick(n.tick,null),n._inited=!0);else{r&&r.tween_count--;for(var o=s.length;o--;)if(s[o]==e)return void s.splice(o,1)}},n.removeAllTweens=function(){for(var t=n._tweens,e=0,i=t.length;i>e;e++){var r=t[e];r.paused=!0,r._target.tweenjs_count=0}t.length=0},n.prototype.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)},n.prototype.setPosition=function(t,e){void 0===e&&(e=1),0>t&&(t=0);var n=t,i=!1;if(n>=this.duration)if(this.loop){var r=n%this.duration;n=n>0&&0===r?this.duration:r}else n=this.duration,i=!0;if(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 o=this._steps.length,u=-1,a=0;o>a&&!("step"==this._steps[a].type&&(u=a,this._steps[a].t<=n&&this._steps[a].t+this._steps[a].d>=n));a++);for(var a=0;o>a;a++)if("action"==this._steps[a].type)0!=e&&(this._useTicks?this._runAction(this._steps[a],n,n):1==e&&s>n?(s!=this.duration&&this._runAction(this._steps[a],s,this.duration),this._runAction(this._steps[a],0,n,!0)):this._runAction(this._steps[a],s,n));else if("step"==this._steps[a].type&&u==a){var p=this._steps[u];this._updateTargetProps(p,Math.min((this._stepPosition=n-p.t)/p.d,1))}}return this.dispatchEventWith("change"),i},n.prototype._runAction=function(t,e,n,i){void 0===i&&(i=!1);var r=e,s=n;e>n&&(r=n,s=e);var o=t.t;(o==s||o>r&&s>o||i&&o==e)&&t.f.apply(t.o,t.p)},n.prototype._updateTargetProps=function(t,e){var i,r,s,o,u,a;if(t||1!=e){if(this.passive=!!t.v,this.passive)return;t.e&&(e=t.e(e,0,1,1)),i=t.p0,r=t.p1}else this.passive=!1,i=r=this._curQueueProps;for(var p in this._initQueueProps){null==(o=i[p])&&(i[p]=o=this._initQueueProps[p]),null==(u=r[p])&&(r[p]=u=o),s=o==u||0==e||1==e||"number"!=typeof o?1==e?u:o:o+(u-o)*e;var h=!1;if(a=n._plugins[p])for(var c=0,_=a.length;_>c;c++){var f=a[c].tween(this,p,s,i,r,e,!!t&&i==r,!t);f==n.IGNORE?h=!0:s=f}h||(this._target[p]=s)}},n.prototype.setPaused=function(t){return this.paused==t?this:(this.paused=t,n._register(this,!t),this)},n.prototype._cloneProps=function(t){var e={};for(var n in t)e[n]=t[n];return e},n.prototype._addStep=function(t){return t.d>0&&(t.type="step",this._steps.push(t),t.t=this.duration,this.duration+=t.d),this},n.prototype._appendQueueProps=function(t){var e,i,r,s,o;for(var u in t)if(void 0===this._initQueueProps[u]){if(i=this._target[u],e=n._plugins[u])for(r=0,s=e.length;s>r;r++)i=e[r].init(this,u,i);this._initQueueProps[u]=this._curQueueProps[u]=void 0===i?null:i}else i=this._curQueueProps[u];for(var u in t){if(i=this._curQueueProps[u],e=n._plugins[u])for(o=o||{},r=0,s=e.length;s>r;r++)e[r].step&&e[r].step(this,u,i,t[u],o);this._curQueueProps[u]=t[u]}return o&&this._appendQueueProps(o),this._curQueueProps},n.prototype._addAction=function(t){return t.t=this.duration,t.type="action",this._steps.push(t),this},n.prototype._set=function(t,e){for(var n in t)e[n]=t[n]},n.prototype.wait=function(t,e){if(null==t||0>=t)return this;var n=this._cloneProps(this._curQueueProps);return this._addStep({d:t,p0:n,p1:n,v:e})},n.prototype.to=function(t,e,n){return void 0===n&&(n=void 0),(isNaN(e)||0>e)&&(e=0),this._addStep({d:e||0,p0:this._cloneProps(this._curQueueProps),e:n,p1:this._cloneProps(this._appendQueueProps(t))}),this.set(t)},n.prototype.call=function(t,e,n){return void 0===e&&(e=void 0),void 0===n&&(n=void 0),this._addAction({f:t,p:n?n:[],o:e?e:this._target})},n.prototype.set=function(t,e){return void 0===e&&(e=null),this._appendQueueProps(t),this._addAction({f:this._set,o:this,p:[t,e?e:this._target]})},n.prototype.play=function(t){return t||(t=this),this.call(t.setPaused,t,[!1])},n.prototype.pause=function(t){return t||(t=this),this.call(t.setPaused,t,[!0])},n.prototype.$tick=function(t){this.paused||this.setPosition(this._prevPosition+t)},n}(t.EventDispatcher);e.NONE=0,e.LOOP=1,e.REVERSE=2,e._tweens=[],e.IGNORE={},e._plugins={},e._inited=!1,e._lastTime=0,t.Tween=e,__reflect(e.prototype,"egret.Tween")}(egret||(egret={}));var egret;!function(t){var e;!function(e){function n(e){if("function"==typeof e)return e;var n=t.Ease[e];return"function"==typeof n?n:null}function i(t,e,n,i){var r=t.prototype;r.__meta__=r.__meta__||{},r.__meta__[e]=n,i&&(r.__defaultProperty__=e)}var r=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.name="",e}return __extends(e,t),e}(t.EventDispatcher);e.BasePath=r,__reflect(r.prototype,"egret.tween.BasePath");var s=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.props=void 0,e.duration=500,e.ease=void 0,e}return __extends(e,t),e}(r);e.To=s,__reflect(s.prototype,"egret.tween.To");var o=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.duration=500,e.passive=void 0,e}return __extends(e,t),e}(r);e.Wait=o,__reflect(o.prototype,"egret.tween.Wait");var u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.props=void 0,e}return __extends(e,t),e}(r);e.Set=u,__reflect(u.prototype,"egret.tween.Set");var a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.delta=0,e}return __extends(e,t),e}(r);e.Tick=a,__reflect(a.prototype,"egret.tween.Tick");var p=function(e){function i(){return e.call(this)||this}return __extends(i,e),Object.defineProperty(i.prototype,"props",{get:function(){return this._props},set:function(t){this._props=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"target",{get:function(){return this._target},set:function(t){this._target=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"paths",{get:function(){return this._paths},set:function(t){this._paths=t||[]},enumerable:!0,configurable:!0}),i.prototype.play=function(t){this.tween?(this.tween.setPaused(!1),void 0!==t&&null!==t&&this.tween.setPosition(t)):this.createTween()},i.prototype.pause=function(){this.tween&&this.tween.setPaused(!0)},i.prototype.stop=function(){this.pause(),this.tween=null},i.prototype.createTween=function(){this.tween=t.Tween.get(this._target,this._props),this._paths&&this.applyPaths()},i.prototype.applyPaths=function(){for(var t=0;t=0&&e===this._paths.length-1&&this.dispatchEventWith("complete")},i}(t.EventDispatcher);e.TweenItem=p,__reflect(p.prototype,"egret.tween.TweenItem"),i(p,"paths","Array",!0);var h=function(t){function e(){var e=t.call(this)||this;return e.completeCount=0,e}return __extends(e,t),Object.defineProperty(e.prototype,"items",{get:function(){return this._items},set:function(t){this.completeCount=0,this.registerEvent(!1),this._items=t,this.registerEvent(!0)},enumerable:!0,configurable:!0}),e.prototype.registerEvent=function(t){var e=this;this._items&&this._items.forEach(function(n){t?n.addEventListener("complete",e.itemComplete,e):n.removeEventListener("complete",e.itemComplete,e)})},e.prototype.play=function(t){if(this._items)for(var e=0;e { 55 | // custom lifecycle plugin 56 | 57 | context.onUpdate = () => { 58 | console.log('hello,world') 59 | } 60 | }) 61 | 62 | egret.lifecycle.onPause = () => { 63 | egret.ticker.pause(); 64 | } 65 | 66 | egret.lifecycle.onResume = () => { 67 | egret.ticker.resume(); 68 | } 69 | 70 | 71 | //设置加载进度界面 72 | //Config to load process interface 73 | this.loadingView = new LoadingUI(); 74 | this.stage.addChild(this.loadingView); 75 | 76 | //初始化Resource资源加载库 77 | //initiate Resource loading library 78 | RES.addEventListener(RES.ResourceEvent.CONFIG_COMPLETE, this.onConfigComplete, this); 79 | RES.loadConfig("resource/default.res.json", "resource/"); 80 | } 81 | 82 | /** 83 | * 配置文件加载完成,开始预加载preload资源组。 84 | * configuration file loading is completed, start to pre-load the preload resource group 85 | */ 86 | private onConfigComplete(event: RES.ResourceEvent): void { 87 | RES.removeEventListener(RES.ResourceEvent.CONFIG_COMPLETE, this.onConfigComplete, this); 88 | RES.addEventListener(RES.ResourceEvent.GROUP_COMPLETE, this.onResourceLoadComplete, this); 89 | RES.addEventListener(RES.ResourceEvent.GROUP_LOAD_ERROR, this.onResourceLoadError, this); 90 | RES.addEventListener(RES.ResourceEvent.GROUP_PROGRESS, this.onResourceProgress, this); 91 | RES.addEventListener(RES.ResourceEvent.ITEM_LOAD_ERROR, this.onItemLoadError, this); 92 | RES.loadGroup("heroes"); //加载资源组 93 | } 94 | 95 | /** 96 | * preload资源组加载完成 97 | * Preload resource group is loaded 98 | */ 99 | private onResourceLoadComplete(event: RES.ResourceEvent) { 100 | if (event.groupName == "heroes") { //判断所加载的资源是哪个资源组 101 | this.stage.removeChild(this.loadingView); 102 | RES.removeEventListener(RES.ResourceEvent.GROUP_COMPLETE, this.onResourceLoadComplete, this); 103 | RES.removeEventListener(RES.ResourceEvent.GROUP_LOAD_ERROR, this.onResourceLoadError, this); 104 | RES.removeEventListener(RES.ResourceEvent.GROUP_PROGRESS, this.onResourceProgress, this); 105 | RES.removeEventListener(RES.ResourceEvent.ITEM_LOAD_ERROR, this.onItemLoadError, this); 106 | this.createGameScene(); //资源组加载完成 107 | } 108 | } 109 | 110 | /** 111 | * 资源组加载出错 112 | * The resource group loading failed 113 | */ 114 | private onItemLoadError(event: RES.ResourceEvent) { 115 | console.warn("Url:" + event.resItem.url + " has failed to load"); 116 | } 117 | 118 | /** 119 | * 资源组加载出错 120 | * The resource group loading failed 121 | */ 122 | private onResourceLoadError(event: RES.ResourceEvent) { 123 | //TODO 124 | console.warn("Group:" + event.groupName + " has failed to load"); 125 | //忽略加载失败的项目 126 | //Ignore the loading failed projects 127 | this.onResourceLoadComplete(event); 128 | } 129 | 130 | /** 131 | * preload资源组加载进度 132 | * Loading process of preload resource group 133 | */ 134 | private onResourceProgress(event: RES.ResourceEvent) { 135 | if (event.groupName == "preload") { 136 | this.loadingView.setProgress(event.itemsLoaded, event.itemsTotal); 137 | } 138 | } 139 | 140 | private textfield: egret.TextField; 141 | 142 | /** 143 | * 创建游戏场景 144 | * Create a game scene 145 | */ 146 | private createGameScene() { 147 | //插入 log 148 | console.log("志银"); 149 | var bg:egret.Shape = new egret.Shape(); //首先建立一个egret.Shape对象bg,这是由于egret.Shape对象有图形绘制功能。我们要绘制的背景的工作就用这个对象来完成。 150 | bg.graphics.beginFill(0x000000); //在绘制前,定义图形的填充颜色 151 | bg.graphics.drawRect(0, 0, this.stage.stageWidth, this.stage.stageHeight); 152 | bg.graphics.endFill(); //endFill用来结束绘制工作。 153 | super.addChild( bg ); //这是Egret引擎操作显示列表的一个最常用的方法,就是将某个显示对象添加到某个显示容器上 154 | 155 | 156 | var tx:egret.TextField = new egret.TextField(); 157 | tx.text = "I'm ZainChen, I will use Egret create a fantasy mobile game!"; 158 | tx.size = 32; 159 | tx.x = 20; 160 | tx.y = 20; 161 | tx.width = this.stage.stageWidth - 40; 162 | this.addChild( tx ); 163 | 164 | 165 | tx.touchEnabled = true; //允许该显示对象响应Touch事件 166 | //tx.addEventListener( egret.TouchEvent.TOUCH_TAP, this.touchHandler, this ); //新增一个方法的引用,这就是事件处理函数,我们需要事件处理函数中对用户操作做出对应的反应 167 | tx.addEventListener( egret.TouchEvent.TOUCH_TAP, 168 | function( evt:egret.TouchEvent ):void{ 169 | tx.textColor = 0x00ff00; 170 | }, this ); 171 | 172 | var batman7:egret.Bitmap = new egret.Bitmap( RES.getRes("bg7_jpg") ); 173 | batman7.x = 0; 174 | batman7.y = 0; 175 | console.log(batman7.$getHeight); 176 | this.addChild( batman7 ); 177 | console.log( "createGameScene", RES.getRes("bg7_jpg") ); //查看bg.jpg是否加载成功 178 | 179 | var batman6:egret.Bitmap = new egret.Bitmap( RES.getRes("bg6_jpg") ); 180 | batman6.x = 0; 181 | batman6.y = 0; 182 | console.log(batman6.$getHeight); 183 | this.addChild( batman6 ); 184 | console.log( "createGameScene", RES.getRes("bg6_jpg") ); //查看bg.jpg是否加载成功 185 | 186 | var batman5:egret.Bitmap = new egret.Bitmap( RES.getRes("bg5_jpg") ); 187 | batman5.x = 0; 188 | batman5.y = 0; 189 | console.log(batman5.$getHeight); 190 | this.addChild( batman5 ); 191 | console.log( "createGameScene", RES.getRes("bg5_jpg") ); //查看bg.jpg是否加载成功 192 | 193 | var batman4:egret.Bitmap = new egret.Bitmap( RES.getRes("bg4_jpg") ); 194 | batman4.x = 0; 195 | batman4.y = 0; 196 | console.log(batman4.$getHeight); 197 | this.addChild( batman4 ); 198 | console.log( "createGameScene", RES.getRes("bg4_jpg") ); //查看bg.jpg是否加载成功 199 | 200 | var batman3:egret.Bitmap = new egret.Bitmap( RES.getRes("bg3_jpg") ); 201 | batman3.x = 0; 202 | batman3.y = 0; 203 | console.log(batman3.$getHeight); 204 | this.addChild( batman3 ); 205 | console.log( "createGameScene", RES.getRes("bg3_jpg") ); //查看bg.jpg是否加载成功 206 | 207 | var batman2:egret.Bitmap = new egret.Bitmap( RES.getRes("bg2_jpg") ); 208 | batman2.x = 0; 209 | batman2.y = 0; 210 | console.log(batman2.$getHeight); 211 | this.addChild( batman2 ); 212 | console.log( "createGameScene", RES.getRes("bg2_jpg") ); //查看bg.jpg是否加载成功 213 | 214 | var batman1:egret.Bitmap = new egret.Bitmap( RES.getRes("bg1_jpg") ); 215 | batman1.x = 0; 216 | batman1.y = 0; 217 | console.log(batman1.$getHeight); 218 | this.addChild( batman1 ); 219 | console.log( "createGameScene", RES.getRes("bg1_jpg") ); //查看bg.jpg是否加载成功 220 | 221 | var batman:egret.Bitmap = new egret.Bitmap( RES.getRes("bg0_jpg") ); 222 | batman.x = 0; 223 | batman.y = 0; 224 | console.log(batman.$getHeight); 225 | this.addChild( batman ); 226 | console.log( "createGameScene", RES.getRes("bg0_jpg") ); //查看bg.jpg是否加载成功 227 | 228 | 229 | 230 | /* 231 | batman.anchorOffsetX = 30; 232 | batman.anchorOffsetY = 40; 233 | batman.x += 30; 234 | batman.y += 40; 235 | */ 236 | /* 237 | this.stage.addEventListener( egret.TouchEvent.TOUCH_TAP, function(){ 238 | switch ( ++ self.times % 3 ) { 239 | case 0: egret.Tween.get( batman ).to( { x:50 }, 300, egret.Ease.circIn ); break; 240 | case 1: break; 241 | case 2: break; 242 | } 243 | }, this ); 244 | */ 245 | 246 | this.times = -1; 247 | var self = this; 248 | //创建一个计时器对象 249 | var timer:egret.Timer = new egret.Timer(2000,5); 250 | //注册事件侦听器 251 | timer.addEventListener(egret.TimerEvent.TIMER, function(){ 252 | egret.Tween.get( batman ).to( { x:700 }, 300, egret.Ease.circIn ); 253 | }, this ); 254 | //timer.addEventListener(egret.TimerEvent.TIMER_COMPLETE,this.timerComFunc,this); 255 | //开始计时 256 | timer.start(); 257 | 258 | var timer:egret.Timer = new egret.Timer(3500,5); 259 | timer.addEventListener(egret.TimerEvent.TIMER, function(){ 260 | egret.Tween.get( batman1 ).to( { x:-700 }, 300, egret.Ease.circIn ); 261 | }, this ); 262 | timer.start(); 263 | 264 | var timer:egret.Timer = new egret.Timer(5000,5); 265 | timer.addEventListener(egret.TimerEvent.TIMER, function(){ 266 | egret.Tween.get( batman2 ).to( { y:800 }, 300, egret.Ease.circIn ); 267 | }, this ); 268 | timer.start(); 269 | 270 | var timer:egret.Timer = new egret.Timer(6500,5); 271 | timer.addEventListener(egret.TimerEvent.TIMER, function(){ 272 | egret.Tween.get( batman3 ).to( { y:-800 }, 300, egret.Ease.circIn ); 273 | }, this ); 274 | timer.start(); 275 | 276 | var timer:egret.Timer = new egret.Timer(8000,5); 277 | timer.addEventListener(egret.TimerEvent.TIMER, function(){ 278 | egret.Tween.get( batman4 ).to( { x:700 }, 300, egret.Ease.circIn ); 279 | }, this ); 280 | timer.start(); 281 | 282 | var timer:egret.Timer = new egret.Timer(9500,5); 283 | timer.addEventListener(egret.TimerEvent.TIMER, function(){ 284 | egret.Tween.get( batman5 ).to( { x:-700 }, 300, egret.Ease.circIn ); 285 | }, this ); 286 | timer.start(); 287 | 288 | /* 289 | var timer:egret.Timer = new egret.Timer(10500,5); 290 | timer.addEventListener(egret.TimerEvent.TIMER, function(){ 291 | egret.Tween.get( batman6 ).to( { y:800 }, 300, egret.Ease.circIn ); 292 | }, this ); 293 | timer.start(); 294 | */ 295 | 296 | this.stage.addEventListener( egret.TouchEvent.TOUCH_TAP, function(){ 297 | egret.Tween.get( batman6 ).to( { y:800 }, 300, egret.Ease.circIn ); 298 | }, this ); 299 | } 300 | } 301 | 302 | 303 | -------------------------------------------------------------------------------- /libs/modules/res/res.min.js: -------------------------------------------------------------------------------- 1 | var __reflect=this&&this.__reflect||function(e,t,r){e.__class__=t,r?r.push(t):r=[t],e.__types__=e.__types__?r.concat(e.__types__):r},__extends=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},RES;!function(e){var t=function(t){function r(){var r=t.call(this)||this;return r.resourceConfig=null,r.resourceConfig=e.configInstance,r}return __extends(r,t),r.prototype.addSubkey=function(e,t){this.resourceConfig.addSubkey(e,t)},r.prototype.loadFile=function(e,t,r){},r.prototype.getRes=function(e){},r.prototype.destroyRes=function(e){return!1},r.getStringPrefix=function(e){if(!e)return"";var t=e.indexOf(".");return-1!=t?e.substring(0,t):""},r.getStringTail=function(e){if(!e)return"";var t=e.indexOf(".");return-1!=t?e.substring(t+1):""},r}(egret.HashObject);e.AnalyzerBase=t,__reflect(t.prototype,"RES.AnalyzerBase")}(RES||(RES={}));var RES;!function(e){var t=function(t){function r(){var e=t.call(this)||this;return e.fileDic={},e.resItemDic=[],e._dataFormat=egret.HttpResponseType.ARRAY_BUFFER,e.recycler=[],e}return __extends(r,t),r.prototype.loadFile=function(t,r,i){if(this.fileDic[t.name])return void r.call(i,t);var n=this.getRequest();this.resItemDic[n.hashCode]={item:t,func:r,thisObject:i},n.open(e.$getVirtualUrl(t.url)),n.send()},r.prototype.getRequest=function(){var e=this.recycler.pop();return e||(e=new egret.HttpRequest,e.addEventListener(egret.Event.COMPLETE,this.onLoadFinish,this),e.addEventListener(egret.IOErrorEvent.IO_ERROR,this.onLoadFinish,this)),e.responseType=this._dataFormat,e},r.prototype.onLoadFinish=function(e){var t=e.target,r=this.resItemDic[t.hashCode];delete this.resItemDic[t.hashCode];var i=r.item,n=r.func;i.loaded=e.type==egret.Event.COMPLETE,i.loaded&&this.analyzeData(i,t.response),this.recycler.push(t),n.call(r.thisObject,i)},r.prototype.analyzeData=function(e,t){var r=e.name;this.fileDic[r]||""!=t&&!t||(this.fileDic[r]=t)},r.prototype.getRes=function(e){return this.fileDic[e]},r.prototype.hasRes=function(e){var t=this.getRes(e);return null!=t},r.prototype.destroyRes=function(e){return this.fileDic[e]?(this.onResourceDestroy(this.fileDic[e]),delete this.fileDic[e],!0):!1},r.prototype.onResourceDestroy=function(e){},r}(e.AnalyzerBase);e.BinAnalyzer=t,__reflect(t.prototype,"RES.BinAnalyzer")}(RES||(RES={}));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}return 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}();t.TYPE_XML="xml",t.TYPE_IMAGE="image",t.TYPE_BIN="bin",t.TYPE_TEXT="text",t.TYPE_JSON="json",t.TYPE_SHEET="sheet",t.TYPE_FONT="font",t.TYPE_SOUND="sound",e.ResourceItem=t,__reflect(t.prototype,"RES.ResourceItem")}(RES||(RES={}));var RES;!function(e){var t=function(t){function r(){var e=t.call(this)||this;return e.sheetMap={},e.textureMap={},e.recyclerIamge=[],e._dataFormat=egret.HttpResponseType.TEXT,e}return __extends(r,t),r.prototype.getRes=function(t){var r=this.fileDic[t];if(r||(r=this.textureMap[t]),!r){var i=e.AnalyzerBase.getStringPrefix(t);if(r=this.fileDic[i]){var n=e.AnalyzerBase.getStringTail(t);r=r.getTexture(n)}}return r},r.prototype.onLoadFinish=function(e){var t=e.target,r=this.resItemDic[t.$hashCode];delete this.resItemDic[t.hashCode];var i=r.item,n=r.func;if(i.loaded=e.type==egret.Event.COMPLETE,i.loaded)if(t instanceof egret.HttpRequest){i.loaded=!1;var o=this.analyzeConfig(i,t.response);if(o)return this.loadImage(o,r),void this.recycler.push(t)}else{var s=new egret.Texture;s._setBitmapData(t.data),this.analyzeBitmap(i,s)}t instanceof egret.HttpRequest?this.recycler.push(t):this.recyclerIamge.push(t),n.call(r.thisObject,i)},r.prototype.analyzeConfig=function(e,t){var r,i=e.name,n="";try{var o=t;r=JSON.parse(o)}catch(s){egret.$warn(1017,e.url,t)}return r&&(this.sheetMap[i]=r,n=this.getRelativePath(e.url,r.file)),n},r.prototype.analyzeBitmap=function(e,t){var r=e.name;if(!this.fileDic[r]&&t){var i=this.sheetMap[r];delete this.sheetMap[r];var n=e.data&&e.data.subkeys?"":r,o=this.parseSpriteSheet(t,i,n);this.fileDic[r]=o}},r.prototype.getRelativePath=function(e,t){e=e.split("\\").join("/");var r=e.match(/#.*|\?.*/),i="";r&&(i=r[0]);var n=e.lastIndexOf("/");return e=-1!=n?e.substring(0,n+1)+t:t,e+i},r.prototype.parseSpriteSheet=function(e,t,r){var i=t.frames;if(!i)return null;var n=new egret.SpriteSheet(e),o=this.textureMap;for(var s in i){var a=i[s],u=n.createTexture(s,a.x,a.y,a.w,a.h,a.offX,a.offY,a.sourceW,a.sourceH);if(a.scale9grid){var c=a.scale9grid,l=c.split(",");u.scale9Grid=new egret.Rectangle(parseInt(l[0]),parseInt(l[1]),parseInt(l[2]),parseInt(l[3]))}null==o[s]&&(o[s]=u,r&&this.addSubkey(s,r))}return n},r.prototype.destroyRes=function(e){var t=this.fileDic[e];if(t){delete this.fileDic[e];var r=void 0;for(var i in t._textureMap)null==r&&(r=t._textureMap[i],this.onResourceDestroy(r),r=null),delete this.textureMap[i];return t.dispose&&t.dispose(),!0}return!1},r.prototype.loadImage=function(t,r){var i=this.getImageLoader();this.resItemDic[i.hashCode]=r,i.load(e.$getVirtualUrl(t))},r.prototype.getImageLoader=function(){var e=this.recyclerIamge.pop();return e||(e=new egret.ImageLoader,e.addEventListener(egret.Event.COMPLETE,this.onLoadFinish,this),e.addEventListener(egret.IOErrorEvent.IO_ERROR,this.onLoadFinish,this)),e},r.prototype.onResourceDestroy=function(e){e&&e.dispose()},r}(e.BinAnalyzer);e.SheetAnalyzer=t,__reflect(t.prototype,"RES.SheetAnalyzer")}(RES||(RES={}));var RES;!function(e){}(RES||(RES={}));var RES;!function(e){var t=function(t){function r(){var e=t.call(this)||this;return e.fileDic={},e.resItemDic=[],e.recycler=[],e}return __extends(r,t),r.prototype.loadFile=function(t,r,i){if(this.fileDic[t.name])return void r.call(i,t);var n=this.getLoader();this.resItemDic[n.$hashCode]={item:t,func:r,thisObject:i},n.load(e.$getVirtualUrl(t.url))},r.prototype.getLoader=function(){var e=this.recycler.pop();return e||(e=new egret.ImageLoader,e.addEventListener(egret.Event.COMPLETE,this.onLoadFinish,this),e.addEventListener(egret.IOErrorEvent.IO_ERROR,this.onLoadFinish,this)),e},r.prototype.onLoadFinish=function(e){var t=e.$target,r=this.resItemDic[t.$hashCode];delete this.resItemDic[t.$hashCode];var i=r.item,n=r.func;if(i.loaded=e.$type==egret.Event.COMPLETE,i.loaded){var o=new egret.Texture;o._setBitmapData(t.data),this.analyzeData(i,o)}this.recycler.push(t),n.call(r.thisObject,i)},r.prototype.analyzeData=function(e,t){var r=e.name;if(!this.fileDic[r]&&t){this.fileDic[r]=t;var i=e.data;if(i&&i.scale9grid){var n=i.scale9grid,o=n.split(",");t.scale9Grid=new egret.Rectangle(parseInt(o[0]),parseInt(o[1]),parseInt(o[2]),parseInt(o[3]))}}},r.prototype.getRes=function(e){return this.fileDic[e]},r.prototype.hasRes=function(e){var t=this.getRes(e);return null!=t},r.prototype.destroyRes=function(e){return this.fileDic[e]?(this.onResourceDestroy(this.fileDic[e]),delete this.fileDic[e],!0):!1},r.prototype.onResourceDestroy=function(e){e.dispose()},r}(e.AnalyzerBase);e.ImageAnalyzer=t,__reflect(t.prototype,"RES.ImageAnalyzer")}(RES||(RES={}));var RES;!function(e){var t=function(e){function t(){var t=e.call(this)||this;return t._dataFormat=egret.HttpResponseType.TEXT,t}return __extends(t,e),t}(e.BinAnalyzer);e.TextAnalyzer=t,__reflect(t.prototype,"RES.TextAnalyzer")}(RES||(RES={}));var RES;!function(e){var t=function(e){function t(){var t=e.call(this)||this;return t._dataFormat=egret.HttpResponseType.TEXT,t}return __extends(t,e),t.prototype.analyzeData=function(e,t){var r=e.name;if(!this.fileDic[r]&&t)try{var i=t;this.fileDic[r]=JSON.parse(i)}catch(n){egret.$warn(1017,e.url,t)}},t}(e.BinAnalyzer);e.JsonAnalyzer=t,__reflect(t.prototype,"RES.JsonAnalyzer")}(RES||(RES={}));var RES;!function(e){var t=function(t){function r(){var e=t.call(this)||this;return e.thread=2,e.loadingCount=0,e.callBack=null,e.resInstance=null,e.groupTotalDic={},e.numLoadedDic={},e.itemListDic={},e.groupErrorDic={},e.retryTimesDic={},e.maxRetryTimes=3,e.failedList=new Array,e.priorityQueue={},e.lazyLoadList=new Array,e.analyzerDic={},e.queueIndex=0,e}return __extends(r,t),r.prototype.isGroupInLoading=function(e){return void 0!==this.itemListDic[e]},r.prototype.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 o=t.length,s=0;o>s;s++){var a=t[s];a.groupName=r}this.groupTotalDic[r]=t.length,this.numLoadedDic[r]=0,this.next()}},r.prototype.loadItem=function(e){this.lazyLoadList.push(e),e.groupName="",this.next()},r.prototype.next=function(){for(;this.loadingCount0)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,o=0;n>o&&(this.queueIndex>=n&&(this.queueIndex=0),i=this.itemListDic[r[this.queueIndex]],!(i.length>0));o++)this.queueIndex++;return 0==i.length?null:i.shift()},r.prototype.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],o=this.groupTotalDic[r];if(t.loaded||(this.groupErrorDic[r]=!0),e.ResourceEvent.dispatchResourceEvent(this.resInstance,e.ResourceEvent.GROUP_PROGRESS,r,t,n,o),n==o){var s=this.groupErrorDic[r];this.removeGroupName(r),delete this.groupTotalDic[r],delete this.numLoadedDic[r],delete this.itemListDic[r],delete this.groupErrorDic[r],s?e.ResourceEvent.dispatchResourceEvent(this,e.ResourceEvent.GROUP_LOAD_ERROR,r):e.ResourceEvent.dispatchResourceEvent(this,e.ResourceEvent.GROUP_COMPLETE,r)}}else this.callBack.call(this.resInstance,t);this.next()},r.prototype.removeGroupName=function(e){for(var t in this.priorityQueue){for(var r=this.priorityQueue[t],i=0,n=!1,o=r.length,s=0;o>s;s++){var a=r[s];if(a==e){r.splice(i,1),n=!0;break}i++}if(n){0==r.length&&delete this.priorityQueue[t];break}}},r}(egret.EventDispatcher);e.ResourceLoader=t,__reflect(t.prototype,"RES.ResourceLoader")}(RES||(RES={}));var RES;!function(e){var t=function(e){function t(){return e.call(this)||this}return __extends(t,e),t.prototype.analyzeConfig=function(e,t){var r,i=e.name,n="";try{var o=t;r=JSON.parse(o)}catch(s){}return r?n=this.getRelativePath(e.url,r.file):(r=t,n=this.getTexturePath(e.url,r)),this.sheetMap[i]=r,n},t.prototype.analyzeBitmap=function(e,t){var r=e.name;if(!this.fileDic[r]&&t){var i=this.sheetMap[r];delete this.sheetMap[r];var n=new egret.BitmapFont(t,i);this.fileDic[r]=n}},t.prototype.getTexturePath=function(e,t){var r="",i=t.split("\n"),n=i[2],o=n.indexOf('file="');return-1!=o&&(n=n.substring(o+6),o=n.indexOf('"'),r=n.substring(0,o)),e=e.split("\\").join("/"),o=e.lastIndexOf("/"),e=-1!=o?e.substring(0,o+1)+r:r},t.prototype.onResourceDestroy=function(e){e&&e.dispose()},t}(e.SheetAnalyzer);e.FontAnalyzer=t,__reflect(t.prototype,"RES.FontAnalyzer")}(RES||(RES={}));var RES;!function(e){var t=function(){function t(){this.keyMap={},this.groupDic={},e.configInstance=this}return t.prototype.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 o=r[n];t.push(this.parseResourceItem(o))}return t},t.prototype.getRawGroupByName=function(e){return this.groupDic[e]?this.groupDic[e]:[]},t.prototype.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=[],o=t.length,s=0;o>s;s++){var a=t[s],u=i[a];if(u)for(var c=u.length,l=0;c>l;l++){var p=u[l];-1==n.indexOf(p)&&n.push(p)}else{var p=this.keyMap[a];p?-1==n.indexOf(p)&&n.push(p):egret.$warn(3200,a)}}return 0==n.length?!1:(this.groupDic[e]=n,!0)},t.prototype.parseConfig=function(e,t){if(e){var r=e.resources;if(r)for(var i=r.length,n=0;i>n;n++){var o=r[n],s=o.url;s&&-1==s.indexOf("://")&&(o.url=t+s),this.addItemToKeyMap(o)}var a=e.groups;if(a)for(var u=a.length,n=0;u>n;n++){for(var c=a[n],l=[],p=c.keys.split(","),h=p.length,f=0;h>f;f++){var d=p[f].trim(),o=this.keyMap[d];o&&-1==l.indexOf(o)&&l.push(o)}this.groupDic[c.name]=l}}},t.prototype.addSubkey=function(e,t){var r=this.keyMap[t];r&&!this.keyMap[e]&&(this.keyMap[e]=r)},t.prototype.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)}}},t.prototype.getName=function(e){var t=this.keyMap[e];return t?t.name:""},t.prototype.getType=function(e){var t=this.keyMap[e];return t?t.type:""},t.prototype.getRawResourceItem=function(e){return this.keyMap[e]},t.prototype.getResourceItem=function(e){var t=this.keyMap[e];return t?this.parseResourceItem(t):null},t.prototype.parseResourceItem=function(t){var r=new e.ResourceItem(t.name,t.url,t.type);return r.data=t,r},t}();e.ResourceConfig=t,__reflect(t.prototype,"RES.ResourceConfig")}(RES||(RES={}));var RES;!function(e){var t=function(e){function t(){var t=e.call(this)||this;return t._dataFormat=egret.HttpResponseType.TEXT,t}return __extends(t,e),t.prototype.analyzeData=function(e,t){var r=e.name;if(!this.fileDic[r]&&t)try{var i=t,n=egret.XML.parse(i);this.fileDic[r]=n}catch(o){}},t}(e.BinAnalyzer);e.XMLAnalyzer=t,__reflect(t.prototype,"RES.XMLAnalyzer")}(RES||(RES={}));var RES;!function(e){var t=function(e){function t(t,r,i){void 0===r&&(r=!1),void 0===i&&(i=!1);var n=e.call(this,t,r,i)||this;return n.itemsLoaded=0,n.itemsTotal=0,n.groupName="",n.resItem=null,n}return __extends(t,e),t.dispatchResourceEvent=function(e,r,i,n,o,s){void 0===i&&(i=""),void 0===n&&(n=null),void 0===o&&(o=0),void 0===s&&(s=0);var a=egret.Event.create(t,r);a.groupName=i,a.resItem=n,a.itemsLoaded=o,a.itemsTotal=s;var u=e.dispatchEvent(a);return egret.Event.release(a),u},t}(egret.Event);t.ITEM_LOAD_ERROR="itemLoadError",t.CONFIG_COMPLETE="configComplete",t.CONFIG_LOAD_ERROR="configLoadError",t.GROUP_PROGRESS="groupProgress",t.GROUP_COMPLETE="groupComplete",t.GROUP_LOAD_ERROR="groupLoadError",e.ResourceEvent=t,__reflect(t.prototype,"RES.ResourceEvent")}(RES||(RES={}));var RES;!function(e){var t;!function(t){var r=function(e){function t(){var t=e.call(this)||this;return t._versionInfo={},t}return __extends(t,e),t.prototype.fetchVersion=function(e){e.onSuccess(null)},t.prototype.getChangeList=function(){return[]},t.prototype.getVirtualUrl=function(e){return e},t}(egret.EventDispatcher);t.Html5VersionController=r,__reflect(r.prototype,"RES.web.Html5VersionController",["RES.VersionController","RES.IVersionController"]),egret.Capabilities.runtimeType==egret.RuntimeType.WEB&&(e.VersionController=r)}(t=e.web||(e.web={}))}(RES||(RES={}));var RES;!function(e){var t;!function(t){var r=function(){function e(){this._versionInfo={},this._versionPath="",this._localFileArr=[]}return e.prototype.fetchVersion=function(e){var t=this;if(t._versionPath="all.manifest",t._versionInfo=t.getLocalData(t._versionPath),null==t._versionInfo)return void egret.callLater(function(){e.onFail(1,null)},t);var r=0,i=function(i){if(i)for(var n=0;ns;s++){var a=i[s],u=new e.ResourceItem(a.url,a.url,a.type);o.push(u)}var c={onSuccess:function(e){t.resLoader.loadGroup(o,r.GROUP_CONFIG,Number.MAX_VALUE)},onFail:function(r,i){e.ResourceEvent.dispatchResourceEvent(t,e.ResourceEvent.CONFIG_LOAD_ERROR)}};this.vcs?this.vcs.fetchVersion(c):this.resLoader.loadGroup(o,r.GROUP_CONFIG,Number.MAX_VALUE)},r.prototype.isGroupLoaded=function(e){return-1!=this.loadedGroups.indexOf(e)},r.prototype.getGroupByName=function(e){return this.resConfig.getGroupByName(e)},r.prototype.loadGroup=function(t,r){if(void 0===r&&(r=0),-1!=this.loadedGroups.indexOf(t))return void e.ResourceEvent.dispatchResourceEvent(this,e.ResourceEvent.GROUP_COMPLETE,t);if(!this.resLoader.isGroupInLoading(t))if(this.configComplete){var i=this.resConfig.getGroupByName(t);this.resLoader.loadGroup(i,t,r)}else this.groupNameList.push({name:t,priority:r})},r.prototype.createGroup=function(e,t,r){if(void 0===r&&(r=!1),r){var i=this.loadedGroups.indexOf(e);-1!=i&&this.loadedGroups.splice(i,1)}return this.resConfig.createGroup(e,t,r)},r.prototype.onGroupComp=function(t){if(t.groupName==r.GROUP_CONFIG){for(var i=this.loadingConfigList.length,n=0;i>n;n++){var o=this.loadingConfigList[n],s=this.$getAnalyzerByType(o.type),a=s.getRes(o.url);s.destroyRes(o.url),this.resConfig.parseConfig(a,o.resourceRoot)}this.configComplete=!0,this.loadingConfigList=null,e.ResourceEvent.dispatchResourceEvent(this,e.ResourceEvent.CONFIG_COMPLETE),this.loadDelayGroups()}else this.loadedGroups.push(t.groupName),this.dispatchEvent(t)},r.prototype.loadDelayGroups=function(){var e=this.groupNameList;this.groupNameList=[];for(var t=e.length,r=0;t>r;r++){var i=e[r];this.loadGroup(i.name,i.priority)}},r.prototype.onGroupError=function(t){t.groupName==r.GROUP_CONFIG?(this.loadingConfigList=null,e.ResourceEvent.dispatchResourceEvent(this,e.ResourceEvent.CONFIG_LOAD_ERROR)):this.dispatchEvent(t)},r.prototype.hasRes=function(t){var r=this.resConfig.getType(t);if(""==r){var i=e.AnalyzerBase.getStringTail(t);if(r=this.resConfig.getType(i),""==r)return!1}return!0},r.prototype.parseConfig=function(e,t){this.resConfig.parseConfig(e,t),this.configComplete||this.loadingConfigList||(this.configComplete=!0,this.loadDelayGroups())},r.prototype.getRes=function(t){var r=this.resConfig.getType(t);if(""==r){var i=e.AnalyzerBase.getStringPrefix(t);if(r=this.resConfig.getType(i),""==r)return null}var n=this.$getAnalyzerByType(r);return n.getRes(t)},r.prototype.getResAsync=function(t,r,i){var n=this.resConfig.getType(t),o=this.resConfig.getName(t);if(""==n&&(o=e.AnalyzerBase.getStringPrefix(t),n=this.resConfig.getType(o),""==n))return void egret.$callAsync(r,i);var s=this.$getAnalyzerByType(n),a=s.getRes(t);if(a)return void egret.$callAsync(r,i,a,t);var u={key:t,compFunc:r,thisObject:i};if(this.asyncDic[o])this.asyncDic[o].push(u);else{this.asyncDic[o]=[u];var c=this.resConfig.getResourceItem(o);this.resLoader.loadItem(c)}},r.prototype.getResByUrl=function(t,r,i,n){if(void 0===n&&(n=""),!t)return void egret.$callAsync(r,i);n||(n=this.getTypeByUrl(t)),null!=this._loadedUrlTypes[t]&&this._loadedUrlTypes[t]!=n&&egret.$warn(3202),this._loadedUrlTypes[t]=n;var o=this.$getAnalyzerByType(n),s=t,a=o.getRes(s);if(a)return void egret.$callAsync(r,i,a,t);var u={key:s,compFunc:r,thisObject:i};if(this.asyncDic[s])this.asyncDic[s].push(u);else{this.asyncDic[s]=[u];var c=new e.ResourceItem(s,t,n);this.resLoader.loadItem(c)}},r.prototype.getTypeByUrl=function(t){var r=t.substr(t.lastIndexOf(".")+1);r&&(r=r.toLowerCase());var i;switch(r){case e.ResourceItem.TYPE_XML:case e.ResourceItem.TYPE_JSON:case e.ResourceItem.TYPE_SHEET:i=r;break;case"png":case"jpg":case"gif":case"jpeg":case"bmp":i=e.ResourceItem.TYPE_IMAGE;break;case"fnt":i=e.ResourceItem.TYPE_FONT;break;case"txt":i=e.ResourceItem.TYPE_TEXT;break;case"mp3":case"ogg":case"mpeg":case"wav":case"m4a":case"mp4":case"aiff":case"wma":case"mid":i=e.ResourceItem.TYPE_SOUND;break;default:i=e.ResourceItem.TYPE_BIN}return i},r.prototype.onResourceItemComp=function(e){var t=this.asyncDic[e.name];delete this.asyncDic[e.name];for(var r=this.$getAnalyzerByType(e.type),i=t.length,n=0;i>n;n++){var o=t[n],s=r.getRes(o.key);o.compFunc.call(o.thisObject,s,o.key)}},r.prototype.destroyRes=function(e,t){void 0===t&&(t=!0);var r=this.resConfig.getRawGroupByName(e);if(r&&r.length>0){var i=this.loadedGroups.indexOf(e);-1!=i&&this.loadedGroups.splice(i,1);for(var n=r.length,o=0;n>o;o++){var s=r[o];if(!t&&this.isResInLoadedGroup(s.name));else{s.loaded=!1;var a=this.$getAnalyzerByType(s.type);a.destroyRes(s.name),this.removeLoadedGroupsByItemName(s.name)}}return!0}var u=this.resConfig.getType(e);if(""==u){if(u=this._loadedUrlTypes[e],null==u||""==u)return!1;delete this._loadedUrlTypes[e];var c=this.$getAnalyzerByType(u);return c.destroyRes(e),!0}var s=this.resConfig.getRawResourceItem(e);s.loaded=!1;var a=this.$getAnalyzerByType(u),l=a.destroyRes(e);return this.removeLoadedGroupsByItemName(s.name),l},r.prototype.removeLoadedGroupsByItemName=function(e){for(var t=this.loadedGroups,r=t.length,i=0;r>i;i++)for(var n=this.resConfig.getRawGroupByName(t[i]),o=n.length,s=0;o>s;s++){var a=n[s];if(a.name==e){t.splice(i,1),i--,r=t.length;break}}},r.prototype.isResInLoadedGroup=function(e){for(var t=this.loadedGroups,r=t.length,i=0;r>i;i++)for(var n=this.resConfig.getRawGroupByName(t[i]),o=n.length,s=0;o>s;s++){var a=n[s];if(a.name==e)return!0}return!1},r.prototype.setMaxLoadingThread=function(e){1>e&&(e=1),this.resLoader.thread=e},r.prototype.setMaxRetryTimes=function(e){e=Math.max(e,0),this.resLoader.maxRetryTimes=e},r}(egret.EventDispatcher);_.GROUP_CONFIG="RES__CONFIG",__reflect(_.prototype,"Resource");var I=new _}(RES||(RES={}));var RES;!function(e){var t=function(t){function r(){var e=t.call(this)||this;return e.sheetMap={},e.recyclerIamge=[],e._dataFormat=egret.HttpResponseType.TEXT,e}return __extends(r,t),r.prototype.onLoadFinish=function(e){var t=e.target,r=this.resItemDic[t.$hashCode];delete this.resItemDic[t.hashCode];var i=r.item,n=r.func;if(i.loaded=e.type==egret.Event.COMPLETE,i.loaded)if(t instanceof egret.HttpRequest){i.loaded=!1;var o=this.analyzeConfig(i,t.response);if(o)return this.loadImage(o,r),void this.recycler.push(t)}else this.analyzeBitmap(i,t.data);t instanceof egret.HttpRequest?this.recycler.push(t):this.recyclerIamge.push(t),n.call(r.thisObject,i)},r.prototype.analyzeConfig=function(e,t){var r,i=e.name,n="";try{var o=t;r=JSON.parse(o)}catch(s){egret.$warn(1017,e.url,t)}if(r)if(this.sheetMap[i]=r,r.file)n=this.getRelativePath(e.url,r.file);else{var a=e.url.split("?"),u=a[0].split("/");u[u.length-1]=u[u.length-1].split(".")[0]+".png",n="";for(var c=0;cu;u++){i=t.res[o[u].res];var c=new egret.Texture;c._bitmapData=e,c.$initData(i.x,i.y,i.w,i.h,o[u].x,o[u].y,o[u].sourceW,o[u].sourceH,e.width,e.height)}return a},r.prototype.destroyRes=function(e){var t=this.fileDic[e];return t?(delete this.fileDic[e],!0):!1},r.prototype.loadImage=function(t,r){var i=this.getImageLoader();this.resItemDic[i.hashCode]=r,i.load(e.$getVirtualUrl(t))},r.prototype.getImageLoader=function(){var e=this.recyclerIamge.pop();return e||(e=new egret.ImageLoader,e.addEventListener(egret.Event.COMPLETE,this.onLoadFinish,this),e.addEventListener(egret.IOErrorEvent.IO_ERROR,this.onLoadFinish,this)),e},r}(e.BinAnalyzer);e.AnimationAnalyzer=t,__reflect(t.prototype,"RES.AnimationAnalyzer")}(RES||(RES={}));var egret;!function(e){e.$locale_strings=e.$locale_strings||{},e.$locale_strings.en_US=e.$locale_strings.en_US||{};var t=e.$locale_strings.en_US;t[3200]="RES.createGroup() passed in non-existed key value in configuration: {0}",t[3201]='RES loaded non-existed or empty resource group:"{0}"',t[3202]="Do not use the different types of ways to load the same material!",t[3203]="Can't find the analyzer of the specified file type:{0}。 Please register the specified analyzer in the initialization of the project first,then start the resource loading process。"}(egret||(egret={}));var egret;!function(e){e.$locale_strings=e.$locale_strings||{},e.$locale_strings.zh_CN=e.$locale_strings.zh_CN||{};var t=e.$locale_strings.zh_CN;t[3200]="RES.createGroup()传入了配置中不存在的键值: {0}",t[3201]='RES加载了不存在或空的资源组:"{0}"',t[3202]="请不要使用不同的类型方式来加载同一个素材!",t[3203]="找不到指定文件类型的解析器:{0}。 请先在项目初始化里注册指定文件类型的解析器,再启动资源加载。"}(egret||(egret={})); -------------------------------------------------------------------------------- /promise/bin/promise.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * @overview es6-promise - a tiny implementation of Promises/A+. 3 | * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald) 4 | * @license Licensed under MIT license 5 | * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE 6 | * @version 4.0.5 7 | */ 8 | 9 | (function (global, factory) { 10 | typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : 11 | typeof define === 'function' && define.amd ? define(factory) : 12 | (global.ES6Promise = factory()); 13 | }(this, (function () { 'use strict'; 14 | 15 | function objectOrFunction(x) { 16 | return typeof x === 'function' || typeof x === 'object' && x !== null; 17 | } 18 | 19 | function isFunction(x) { 20 | return typeof x === 'function'; 21 | } 22 | 23 | var _isArray = undefined; 24 | if (!Array.isArray) { 25 | _isArray = function (x) { 26 | return Object.prototype.toString.call(x) === '[object Array]'; 27 | }; 28 | } else { 29 | _isArray = Array.isArray; 30 | } 31 | 32 | var isArray = _isArray; 33 | 34 | var len = 0; 35 | var vertxNext = undefined; 36 | var customSchedulerFn = undefined; 37 | 38 | var asap = function asap(callback, arg) { 39 | queue[len] = callback; 40 | queue[len + 1] = arg; 41 | len += 2; 42 | if (len === 2) { 43 | // If len is 2, that means that we need to schedule an async flush. 44 | // If additional callbacks are queued before the queue is flushed, they 45 | // will be processed by this flush that we are scheduling. 46 | if (customSchedulerFn) { 47 | customSchedulerFn(flush); 48 | } else { 49 | scheduleFlush(); 50 | } 51 | } 52 | }; 53 | 54 | function setScheduler(scheduleFn) { 55 | customSchedulerFn = scheduleFn; 56 | } 57 | 58 | function setAsap(asapFn) { 59 | asap = asapFn; 60 | } 61 | 62 | var browserWindow = typeof window !== 'undefined' ? window : undefined; 63 | var browserGlobal = browserWindow || {}; 64 | var BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver; 65 | var isNode = typeof self === 'undefined' && typeof process !== 'undefined' && ({}).toString.call(process) === '[object process]'; 66 | 67 | // test for web worker but not in IE10 68 | var isWorker = typeof Uint8ClampedArray !== 'undefined' && typeof importScripts !== 'undefined' && typeof MessageChannel !== 'undefined'; 69 | 70 | // node 71 | function useNextTick() { 72 | // node version 0.10.x displays a deprecation warning when nextTick is used recursively 73 | // see https://github.com/cujojs/when/issues/410 for details 74 | return function () { 75 | return process.nextTick(flush); 76 | }; 77 | } 78 | 79 | // vertx 80 | function useVertxTimer() { 81 | if (typeof vertxNext !== 'undefined') { 82 | return function () { 83 | vertxNext(flush); 84 | }; 85 | } 86 | 87 | return useSetTimeout(); 88 | } 89 | 90 | function useMutationObserver() { 91 | var iterations = 0; 92 | var observer = new BrowserMutationObserver(flush); 93 | var node = document.createTextNode(''); 94 | observer.observe(node, { characterData: true }); 95 | 96 | return function () { 97 | node.data = iterations = ++iterations % 2; 98 | }; 99 | } 100 | 101 | // web worker 102 | function useMessageChannel() { 103 | var channel = new MessageChannel(); 104 | channel.port1.onmessage = flush; 105 | return function () { 106 | return channel.port2.postMessage(0); 107 | }; 108 | } 109 | 110 | function useSetTimeout() { 111 | // Store setTimeout reference so es6-promise will be unaffected by 112 | // other code modifying setTimeout (like sinon.useFakeTimers()) 113 | var globalSetTimeout = setTimeout; 114 | return function () { 115 | return globalSetTimeout(flush, 1); 116 | }; 117 | } 118 | 119 | var queue = new Array(1000); 120 | function flush() { 121 | for (var i = 0; i < len; i += 2) { 122 | var callback = queue[i]; 123 | var arg = queue[i + 1]; 124 | 125 | callback(arg); 126 | 127 | queue[i] = undefined; 128 | queue[i + 1] = undefined; 129 | } 130 | 131 | len = 0; 132 | } 133 | 134 | function attemptVertx() { 135 | try { 136 | var r = require; 137 | var vertx = r('vertx'); 138 | vertxNext = vertx.runOnLoop || vertx.runOnContext; 139 | return useVertxTimer(); 140 | } catch (e) { 141 | return useSetTimeout(); 142 | } 143 | } 144 | 145 | var scheduleFlush = undefined; 146 | // Decide what async method to use to triggering processing of queued callbacks: 147 | if (isNode) { 148 | scheduleFlush = useNextTick(); 149 | } else if (BrowserMutationObserver) { 150 | scheduleFlush = useMutationObserver(); 151 | } else if (isWorker) { 152 | scheduleFlush = useMessageChannel(); 153 | } else if (browserWindow === undefined && typeof require === 'function') { 154 | scheduleFlush = attemptVertx(); 155 | } else { 156 | scheduleFlush = useSetTimeout(); 157 | } 158 | 159 | function then(onFulfillment, onRejection) { 160 | var _arguments = arguments; 161 | 162 | var parent = this; 163 | 164 | var child = new this.constructor(noop); 165 | 166 | if (child[PROMISE_ID] === undefined) { 167 | makePromise(child); 168 | } 169 | 170 | var _state = parent._state; 171 | 172 | if (_state) { 173 | (function () { 174 | var callback = _arguments[_state - 1]; 175 | asap(function () { 176 | return invokeCallback(_state, child, callback, parent._result); 177 | }); 178 | })(); 179 | } else { 180 | subscribe(parent, child, onFulfillment, onRejection); 181 | } 182 | 183 | return child; 184 | } 185 | 186 | /** 187 | `Promise.resolve` returns a promise that will become resolved with the 188 | passed `value`. It is shorthand for the following: 189 | 190 | ```javascript 191 | let promise = new Promise(function(resolve, reject){ 192 | resolve(1); 193 | }); 194 | 195 | promise.then(function(value){ 196 | // value === 1 197 | }); 198 | ``` 199 | 200 | Instead of writing the above, your code now simply becomes the following: 201 | 202 | ```javascript 203 | let promise = Promise.resolve(1); 204 | 205 | promise.then(function(value){ 206 | // value === 1 207 | }); 208 | ``` 209 | 210 | @method resolve 211 | @static 212 | @param {Any} value value that the returned promise will be resolved with 213 | Useful for tooling. 214 | @return {Promise} a promise that will become fulfilled with the given 215 | `value` 216 | */ 217 | function resolve(object) { 218 | /*jshint validthis:true */ 219 | var Constructor = this; 220 | 221 | if (object && typeof object === 'object' && object.constructor === Constructor) { 222 | return object; 223 | } 224 | 225 | var promise = new Constructor(noop); 226 | _resolve(promise, object); 227 | return promise; 228 | } 229 | 230 | var PROMISE_ID = Math.random().toString(36).substring(16); 231 | 232 | function noop() {} 233 | 234 | var PENDING = void 0; 235 | var FULFILLED = 1; 236 | var REJECTED = 2; 237 | 238 | var GET_THEN_ERROR = new ErrorObject(); 239 | 240 | function selfFulfillment() { 241 | return new TypeError("You cannot resolve a promise with itself"); 242 | } 243 | 244 | function cannotReturnOwn() { 245 | return new TypeError('A promises callback cannot return that same promise.'); 246 | } 247 | 248 | function getThen(promise) { 249 | try { 250 | return promise.then; 251 | } catch (error) { 252 | GET_THEN_ERROR.error = error; 253 | return GET_THEN_ERROR; 254 | } 255 | } 256 | 257 | function tryThen(then, value, fulfillmentHandler, rejectionHandler) { 258 | try { 259 | then.call(value, fulfillmentHandler, rejectionHandler); 260 | } catch (e) { 261 | return e; 262 | } 263 | } 264 | 265 | function handleForeignThenable(promise, thenable, then) { 266 | asap(function (promise) { 267 | var sealed = false; 268 | var error = tryThen(then, thenable, function (value) { 269 | if (sealed) { 270 | return; 271 | } 272 | sealed = true; 273 | if (thenable !== value) { 274 | _resolve(promise, value); 275 | } else { 276 | fulfill(promise, value); 277 | } 278 | }, function (reason) { 279 | if (sealed) { 280 | return; 281 | } 282 | sealed = true; 283 | 284 | _reject(promise, reason); 285 | }, 'Settle: ' + (promise._label || ' unknown promise')); 286 | 287 | if (!sealed && error) { 288 | sealed = true; 289 | _reject(promise, error); 290 | } 291 | }, promise); 292 | } 293 | 294 | function handleOwnThenable(promise, thenable) { 295 | if (thenable._state === FULFILLED) { 296 | fulfill(promise, thenable._result); 297 | } else if (thenable._state === REJECTED) { 298 | _reject(promise, thenable._result); 299 | } else { 300 | subscribe(thenable, undefined, function (value) { 301 | return _resolve(promise, value); 302 | }, function (reason) { 303 | return _reject(promise, reason); 304 | }); 305 | } 306 | } 307 | 308 | function handleMaybeThenable(promise, maybeThenable, then$$) { 309 | if (maybeThenable.constructor === promise.constructor && then$$ === then && maybeThenable.constructor.resolve === resolve) { 310 | handleOwnThenable(promise, maybeThenable); 311 | } else { 312 | if (then$$ === GET_THEN_ERROR) { 313 | _reject(promise, GET_THEN_ERROR.error); 314 | } else if (then$$ === undefined) { 315 | fulfill(promise, maybeThenable); 316 | } else if (isFunction(then$$)) { 317 | handleForeignThenable(promise, maybeThenable, then$$); 318 | } else { 319 | fulfill(promise, maybeThenable); 320 | } 321 | } 322 | } 323 | 324 | function _resolve(promise, value) { 325 | if (promise === value) { 326 | _reject(promise, selfFulfillment()); 327 | } else if (objectOrFunction(value)) { 328 | handleMaybeThenable(promise, value, getThen(value)); 329 | } else { 330 | fulfill(promise, value); 331 | } 332 | } 333 | 334 | function publishRejection(promise) { 335 | if (promise._onerror) { 336 | promise._onerror(promise._result); 337 | } 338 | 339 | publish(promise); 340 | } 341 | 342 | function fulfill(promise, value) { 343 | if (promise._state !== PENDING) { 344 | return; 345 | } 346 | 347 | promise._result = value; 348 | promise._state = FULFILLED; 349 | 350 | if (promise._subscribers.length !== 0) { 351 | asap(publish, promise); 352 | } 353 | } 354 | 355 | function _reject(promise, reason) { 356 | if (promise._state !== PENDING) { 357 | return; 358 | } 359 | promise._state = REJECTED; 360 | promise._result = reason; 361 | 362 | asap(publishRejection, promise); 363 | } 364 | 365 | function subscribe(parent, child, onFulfillment, onRejection) { 366 | var _subscribers = parent._subscribers; 367 | var length = _subscribers.length; 368 | 369 | parent._onerror = null; 370 | 371 | _subscribers[length] = child; 372 | _subscribers[length + FULFILLED] = onFulfillment; 373 | _subscribers[length + REJECTED] = onRejection; 374 | 375 | if (length === 0 && parent._state) { 376 | asap(publish, parent); 377 | } 378 | } 379 | 380 | function publish(promise) { 381 | var subscribers = promise._subscribers; 382 | var settled = promise._state; 383 | 384 | if (subscribers.length === 0) { 385 | return; 386 | } 387 | 388 | var child = undefined, 389 | callback = undefined, 390 | detail = promise._result; 391 | 392 | for (var i = 0; i < subscribers.length; i += 3) { 393 | child = subscribers[i]; 394 | callback = subscribers[i + settled]; 395 | 396 | if (child) { 397 | invokeCallback(settled, child, callback, detail); 398 | } else { 399 | callback(detail); 400 | } 401 | } 402 | 403 | promise._subscribers.length = 0; 404 | } 405 | 406 | function ErrorObject() { 407 | this.error = null; 408 | } 409 | 410 | var TRY_CATCH_ERROR = new ErrorObject(); 411 | 412 | function tryCatch(callback, detail) { 413 | try { 414 | return callback(detail); 415 | } catch (e) { 416 | TRY_CATCH_ERROR.error = e; 417 | return TRY_CATCH_ERROR; 418 | } 419 | } 420 | 421 | function invokeCallback(settled, promise, callback, detail) { 422 | var hasCallback = isFunction(callback), 423 | value = undefined, 424 | error = undefined, 425 | succeeded = undefined, 426 | failed = undefined; 427 | 428 | if (hasCallback) { 429 | value = tryCatch(callback, detail); 430 | 431 | if (value === TRY_CATCH_ERROR) { 432 | failed = true; 433 | error = value.error; 434 | value = null; 435 | } else { 436 | succeeded = true; 437 | } 438 | 439 | if (promise === value) { 440 | _reject(promise, cannotReturnOwn()); 441 | return; 442 | } 443 | } else { 444 | value = detail; 445 | succeeded = true; 446 | } 447 | 448 | if (promise._state !== PENDING) { 449 | // noop 450 | } else if (hasCallback && succeeded) { 451 | _resolve(promise, value); 452 | } else if (failed) { 453 | _reject(promise, error); 454 | } else if (settled === FULFILLED) { 455 | fulfill(promise, value); 456 | } else if (settled === REJECTED) { 457 | _reject(promise, value); 458 | } 459 | } 460 | 461 | function initializePromise(promise, resolver) { 462 | try { 463 | resolver(function resolvePromise(value) { 464 | _resolve(promise, value); 465 | }, function rejectPromise(reason) { 466 | _reject(promise, reason); 467 | }); 468 | } catch (e) { 469 | _reject(promise, e); 470 | } 471 | } 472 | 473 | var id = 0; 474 | function nextId() { 475 | return id++; 476 | } 477 | 478 | function makePromise(promise) { 479 | promise[PROMISE_ID] = id++; 480 | promise._state = undefined; 481 | promise._result = undefined; 482 | promise._subscribers = []; 483 | } 484 | 485 | function Enumerator(Constructor, input) { 486 | this._instanceConstructor = Constructor; 487 | this.promise = new Constructor(noop); 488 | 489 | if (!this.promise[PROMISE_ID]) { 490 | makePromise(this.promise); 491 | } 492 | 493 | if (isArray(input)) { 494 | this._input = input; 495 | this.length = input.length; 496 | this._remaining = input.length; 497 | 498 | this._result = new Array(this.length); 499 | 500 | if (this.length === 0) { 501 | fulfill(this.promise, this._result); 502 | } else { 503 | this.length = this.length || 0; 504 | this._enumerate(); 505 | if (this._remaining === 0) { 506 | fulfill(this.promise, this._result); 507 | } 508 | } 509 | } else { 510 | _reject(this.promise, validationError()); 511 | } 512 | } 513 | 514 | function validationError() { 515 | return new Error('Array Methods must be provided an Array'); 516 | }; 517 | 518 | Enumerator.prototype._enumerate = function () { 519 | var length = this.length; 520 | var _input = this._input; 521 | 522 | for (var i = 0; this._state === PENDING && i < length; i++) { 523 | this._eachEntry(_input[i], i); 524 | } 525 | }; 526 | 527 | Enumerator.prototype._eachEntry = function (entry, i) { 528 | var c = this._instanceConstructor; 529 | var resolve$$ = c.resolve; 530 | 531 | if (resolve$$ === resolve) { 532 | var _then = getThen(entry); 533 | 534 | if (_then === then && entry._state !== PENDING) { 535 | this._settledAt(entry._state, i, entry._result); 536 | } else if (typeof _then !== 'function') { 537 | this._remaining--; 538 | this._result[i] = entry; 539 | } else if (c === Promise) { 540 | var promise = new c(noop); 541 | handleMaybeThenable(promise, entry, _then); 542 | this._willSettleAt(promise, i); 543 | } else { 544 | this._willSettleAt(new c(function (resolve$$) { 545 | return resolve$$(entry); 546 | }), i); 547 | } 548 | } else { 549 | this._willSettleAt(resolve$$(entry), i); 550 | } 551 | }; 552 | 553 | Enumerator.prototype._settledAt = function (state, i, value) { 554 | var promise = this.promise; 555 | 556 | if (promise._state === PENDING) { 557 | this._remaining--; 558 | 559 | if (state === REJECTED) { 560 | _reject(promise, value); 561 | } else { 562 | this._result[i] = value; 563 | } 564 | } 565 | 566 | if (this._remaining === 0) { 567 | fulfill(promise, this._result); 568 | } 569 | }; 570 | 571 | Enumerator.prototype._willSettleAt = function (promise, i) { 572 | var enumerator = this; 573 | 574 | subscribe(promise, undefined, function (value) { 575 | return enumerator._settledAt(FULFILLED, i, value); 576 | }, function (reason) { 577 | return enumerator._settledAt(REJECTED, i, reason); 578 | }); 579 | }; 580 | 581 | /** 582 | `Promise.all` accepts an array of promises, and returns a new promise which 583 | is fulfilled with an array of fulfillment values for the passed promises, or 584 | rejected with the reason of the first passed promise to be rejected. It casts all 585 | elements of the passed iterable to promises as it runs this algorithm. 586 | 587 | Example: 588 | 589 | ```javascript 590 | let promise1 = resolve(1); 591 | let promise2 = resolve(2); 592 | let promise3 = resolve(3); 593 | let promises = [ promise1, promise2, promise3 ]; 594 | 595 | Promise.all(promises).then(function(array){ 596 | // The array here would be [ 1, 2, 3 ]; 597 | }); 598 | ``` 599 | 600 | If any of the `promises` given to `all` are rejected, the first promise 601 | that is rejected will be given as an argument to the returned promises's 602 | rejection handler. For example: 603 | 604 | Example: 605 | 606 | ```javascript 607 | let promise1 = resolve(1); 608 | let promise2 = reject(new Error("2")); 609 | let promise3 = reject(new Error("3")); 610 | let promises = [ promise1, promise2, promise3 ]; 611 | 612 | Promise.all(promises).then(function(array){ 613 | // Code here never runs because there are rejected promises! 614 | }, function(error) { 615 | // error.message === "2" 616 | }); 617 | ``` 618 | 619 | @method all 620 | @static 621 | @param {Array} entries array of promises 622 | @param {String} label optional string for labeling the promise. 623 | Useful for tooling. 624 | @return {Promise} promise that is fulfilled when all `promises` have been 625 | fulfilled, or rejected if any of them become rejected. 626 | @static 627 | */ 628 | function all(entries) { 629 | return new Enumerator(this, entries).promise; 630 | } 631 | 632 | /** 633 | `Promise.race` returns a new promise which is settled in the same way as the 634 | first passed promise to settle. 635 | 636 | Example: 637 | 638 | ```javascript 639 | let promise1 = new Promise(function(resolve, reject){ 640 | setTimeout(function(){ 641 | resolve('promise 1'); 642 | }, 200); 643 | }); 644 | 645 | let promise2 = new Promise(function(resolve, reject){ 646 | setTimeout(function(){ 647 | resolve('promise 2'); 648 | }, 100); 649 | }); 650 | 651 | Promise.race([promise1, promise2]).then(function(result){ 652 | // result === 'promise 2' because it was resolved before promise1 653 | // was resolved. 654 | }); 655 | ``` 656 | 657 | `Promise.race` is deterministic in that only the state of the first 658 | settled promise matters. For example, even if other promises given to the 659 | `promises` array argument are resolved, but the first settled promise has 660 | become rejected before the other promises became fulfilled, the returned 661 | promise will become rejected: 662 | 663 | ```javascript 664 | let promise1 = new Promise(function(resolve, reject){ 665 | setTimeout(function(){ 666 | resolve('promise 1'); 667 | }, 200); 668 | }); 669 | 670 | let promise2 = new Promise(function(resolve, reject){ 671 | setTimeout(function(){ 672 | reject(new Error('promise 2')); 673 | }, 100); 674 | }); 675 | 676 | Promise.race([promise1, promise2]).then(function(result){ 677 | // Code here never runs 678 | }, function(reason){ 679 | // reason.message === 'promise 2' because promise 2 became rejected before 680 | // promise 1 became fulfilled 681 | }); 682 | ``` 683 | 684 | An example real-world use case is implementing timeouts: 685 | 686 | ```javascript 687 | Promise.race([ajax('foo.json'), timeout(5000)]) 688 | ``` 689 | 690 | @method race 691 | @static 692 | @param {Array} promises array of promises to observe 693 | Useful for tooling. 694 | @return {Promise} a promise which settles in the same way as the first passed 695 | promise to settle. 696 | */ 697 | function race(entries) { 698 | /*jshint validthis:true */ 699 | var Constructor = this; 700 | 701 | if (!isArray(entries)) { 702 | return new Constructor(function (_, reject) { 703 | return reject(new TypeError('You must pass an array to race.')); 704 | }); 705 | } else { 706 | return new Constructor(function (resolve, reject) { 707 | var length = entries.length; 708 | for (var i = 0; i < length; i++) { 709 | Constructor.resolve(entries[i]).then(resolve, reject); 710 | } 711 | }); 712 | } 713 | } 714 | 715 | /** 716 | `Promise.reject` returns a promise rejected with the passed `reason`. 717 | It is shorthand for the following: 718 | 719 | ```javascript 720 | let promise = new Promise(function(resolve, reject){ 721 | reject(new Error('WHOOPS')); 722 | }); 723 | 724 | promise.then(function(value){ 725 | // Code here doesn't run because the promise is rejected! 726 | }, function(reason){ 727 | // reason.message === 'WHOOPS' 728 | }); 729 | ``` 730 | 731 | Instead of writing the above, your code now simply becomes the following: 732 | 733 | ```javascript 734 | let promise = Promise.reject(new Error('WHOOPS')); 735 | 736 | promise.then(function(value){ 737 | // Code here doesn't run because the promise is rejected! 738 | }, function(reason){ 739 | // reason.message === 'WHOOPS' 740 | }); 741 | ``` 742 | 743 | @method reject 744 | @static 745 | @param {Any} reason value that the returned promise will be rejected with. 746 | Useful for tooling. 747 | @return {Promise} a promise rejected with the given `reason`. 748 | */ 749 | function reject(reason) { 750 | /*jshint validthis:true */ 751 | var Constructor = this; 752 | var promise = new Constructor(noop); 753 | _reject(promise, reason); 754 | return promise; 755 | } 756 | 757 | function needsResolver() { 758 | throw new TypeError('You must pass a resolver function as the first argument to the promise constructor'); 759 | } 760 | 761 | function needsNew() { 762 | throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function."); 763 | } 764 | 765 | /** 766 | Promise objects represent the eventual result of an asynchronous operation. The 767 | primary way of interacting with a promise is through its `then` method, which 768 | registers callbacks to receive either a promise's eventual value or the reason 769 | why the promise cannot be fulfilled. 770 | 771 | Terminology 772 | ----------- 773 | 774 | - `promise` is an object or function with a `then` method whose behavior conforms to this specification. 775 | - `thenable` is an object or function that defines a `then` method. 776 | - `value` is any legal JavaScript value (including undefined, a thenable, or a promise). 777 | - `exception` is a value that is thrown using the throw statement. 778 | - `reason` is a value that indicates why a promise was rejected. 779 | - `settled` the final resting state of a promise, fulfilled or rejected. 780 | 781 | A promise can be in one of three states: pending, fulfilled, or rejected. 782 | 783 | Promises that are fulfilled have a fulfillment value and are in the fulfilled 784 | state. Promises that are rejected have a rejection reason and are in the 785 | rejected state. A fulfillment value is never a thenable. 786 | 787 | Promises can also be said to *resolve* a value. If this value is also a 788 | promise, then the original promise's settled state will match the value's 789 | settled state. So a promise that *resolves* a promise that rejects will 790 | itself reject, and a promise that *resolves* a promise that fulfills will 791 | itself fulfill. 792 | 793 | 794 | Basic Usage: 795 | ------------ 796 | 797 | ```js 798 | let promise = new Promise(function(resolve, reject) { 799 | // on success 800 | resolve(value); 801 | 802 | // on failure 803 | reject(reason); 804 | }); 805 | 806 | promise.then(function(value) { 807 | // on fulfillment 808 | }, function(reason) { 809 | // on rejection 810 | }); 811 | ``` 812 | 813 | Advanced Usage: 814 | --------------- 815 | 816 | Promises shine when abstracting away asynchronous interactions such as 817 | `XMLHttpRequest`s. 818 | 819 | ```js 820 | function getJSON(url) { 821 | return new Promise(function(resolve, reject){ 822 | let xhr = new XMLHttpRequest(); 823 | 824 | xhr.open('GET', url); 825 | xhr.onreadystatechange = handler; 826 | xhr.responseType = 'json'; 827 | xhr.setRequestHeader('Accept', 'application/json'); 828 | xhr.send(); 829 | 830 | function handler() { 831 | if (this.readyState === this.DONE) { 832 | if (this.status === 200) { 833 | resolve(this.response); 834 | } else { 835 | reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']')); 836 | } 837 | } 838 | }; 839 | }); 840 | } 841 | 842 | getJSON('/posts.json').then(function(json) { 843 | // on fulfillment 844 | }, function(reason) { 845 | // on rejection 846 | }); 847 | ``` 848 | 849 | Unlike callbacks, promises are great composable primitives. 850 | 851 | ```js 852 | Promise.all([ 853 | getJSON('/posts'), 854 | getJSON('/comments') 855 | ]).then(function(values){ 856 | values[0] // => postsJSON 857 | values[1] // => commentsJSON 858 | 859 | return values; 860 | }); 861 | ``` 862 | 863 | @class Promise 864 | @param {function} resolver 865 | Useful for tooling. 866 | @constructor 867 | */ 868 | function Promise(resolver) { 869 | this[PROMISE_ID] = nextId(); 870 | this._result = this._state = undefined; 871 | this._subscribers = []; 872 | 873 | if (noop !== resolver) { 874 | typeof resolver !== 'function' && needsResolver(); 875 | this instanceof Promise ? initializePromise(this, resolver) : needsNew(); 876 | } 877 | } 878 | 879 | Promise.all = all; 880 | Promise.race = race; 881 | Promise.resolve = resolve; 882 | Promise.reject = reject; 883 | Promise._setScheduler = setScheduler; 884 | Promise._setAsap = setAsap; 885 | Promise._asap = asap; 886 | 887 | Promise.prototype = { 888 | constructor: Promise, 889 | 890 | /** 891 | The primary way of interacting with a promise is through its `then` method, 892 | which registers callbacks to receive either a promise's eventual value or the 893 | reason why the promise cannot be fulfilled. 894 | 895 | ```js 896 | findUser().then(function(user){ 897 | // user is available 898 | }, function(reason){ 899 | // user is unavailable, and you are given the reason why 900 | }); 901 | ``` 902 | 903 | Chaining 904 | -------- 905 | 906 | The return value of `then` is itself a promise. This second, 'downstream' 907 | promise is resolved with the return value of the first promise's fulfillment 908 | or rejection handler, or rejected if the handler throws an exception. 909 | 910 | ```js 911 | findUser().then(function (user) { 912 | return user.name; 913 | }, function (reason) { 914 | return 'default name'; 915 | }).then(function (userName) { 916 | // If `findUser` fulfilled, `userName` will be the user's name, otherwise it 917 | // will be `'default name'` 918 | }); 919 | 920 | findUser().then(function (user) { 921 | throw new Error('Found user, but still unhappy'); 922 | }, function (reason) { 923 | throw new Error('`findUser` rejected and we're unhappy'); 924 | }).then(function (value) { 925 | // never reached 926 | }, function (reason) { 927 | // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'. 928 | // If `findUser` rejected, `reason` will be '`findUser` rejected and we're unhappy'. 929 | }); 930 | ``` 931 | If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream. 932 | 933 | ```js 934 | findUser().then(function (user) { 935 | throw new PedagogicalException('Upstream error'); 936 | }).then(function (value) { 937 | // never reached 938 | }).then(function (value) { 939 | // never reached 940 | }, function (reason) { 941 | // The `PedgagocialException` is propagated all the way down to here 942 | }); 943 | ``` 944 | 945 | Assimilation 946 | ------------ 947 | 948 | Sometimes the value you want to propagate to a downstream promise can only be 949 | retrieved asynchronously. This can be achieved by returning a promise in the 950 | fulfillment or rejection handler. The downstream promise will then be pending 951 | until the returned promise is settled. This is called *assimilation*. 952 | 953 | ```js 954 | findUser().then(function (user) { 955 | return findCommentsByAuthor(user); 956 | }).then(function (comments) { 957 | // The user's comments are now available 958 | }); 959 | ``` 960 | 961 | If the assimliated promise rejects, then the downstream promise will also reject. 962 | 963 | ```js 964 | findUser().then(function (user) { 965 | return findCommentsByAuthor(user); 966 | }).then(function (comments) { 967 | // If `findCommentsByAuthor` fulfills, we'll have the value here 968 | }, function (reason) { 969 | // If `findCommentsByAuthor` rejects, we'll have the reason here 970 | }); 971 | ``` 972 | 973 | Simple Example 974 | -------------- 975 | 976 | Synchronous Example 977 | 978 | ```javascript 979 | let result; 980 | 981 | try { 982 | result = findResult(); 983 | // success 984 | } catch(reason) { 985 | // failure 986 | } 987 | ``` 988 | 989 | Errback Example 990 | 991 | ```js 992 | findResult(function(result, err){ 993 | if (err) { 994 | // failure 995 | } else { 996 | // success 997 | } 998 | }); 999 | ``` 1000 | 1001 | Promise Example; 1002 | 1003 | ```javascript 1004 | findResult().then(function(result){ 1005 | // success 1006 | }, function(reason){ 1007 | // failure 1008 | }); 1009 | ``` 1010 | 1011 | Advanced Example 1012 | -------------- 1013 | 1014 | Synchronous Example 1015 | 1016 | ```javascript 1017 | let author, books; 1018 | 1019 | try { 1020 | author = findAuthor(); 1021 | books = findBooksByAuthor(author); 1022 | // success 1023 | } catch(reason) { 1024 | // failure 1025 | } 1026 | ``` 1027 | 1028 | Errback Example 1029 | 1030 | ```js 1031 | 1032 | function foundBooks(books) { 1033 | 1034 | } 1035 | 1036 | function failure(reason) { 1037 | 1038 | } 1039 | 1040 | findAuthor(function(author, err){ 1041 | if (err) { 1042 | failure(err); 1043 | // failure 1044 | } else { 1045 | try { 1046 | findBoooksByAuthor(author, function(books, err) { 1047 | if (err) { 1048 | failure(err); 1049 | } else { 1050 | try { 1051 | foundBooks(books); 1052 | } catch(reason) { 1053 | failure(reason); 1054 | } 1055 | } 1056 | }); 1057 | } catch(error) { 1058 | failure(err); 1059 | } 1060 | // success 1061 | } 1062 | }); 1063 | ``` 1064 | 1065 | Promise Example; 1066 | 1067 | ```javascript 1068 | findAuthor(). 1069 | then(findBooksByAuthor). 1070 | then(function(books){ 1071 | // found books 1072 | }).catch(function(reason){ 1073 | // something went wrong 1074 | }); 1075 | ``` 1076 | 1077 | @method then 1078 | @param {Function} onFulfilled 1079 | @param {Function} onRejected 1080 | Useful for tooling. 1081 | @return {Promise} 1082 | */ 1083 | then: then, 1084 | 1085 | /** 1086 | `catch` is simply sugar for `then(undefined, onRejection)` which makes it the same 1087 | as the catch block of a try/catch statement. 1088 | 1089 | ```js 1090 | function findAuthor(){ 1091 | throw new Error('couldn't find that author'); 1092 | } 1093 | 1094 | // synchronous 1095 | try { 1096 | findAuthor(); 1097 | } catch(reason) { 1098 | // something went wrong 1099 | } 1100 | 1101 | // async with promises 1102 | findAuthor().catch(function(reason){ 1103 | // something went wrong 1104 | }); 1105 | ``` 1106 | 1107 | @method catch 1108 | @param {Function} onRejection 1109 | Useful for tooling. 1110 | @return {Promise} 1111 | */ 1112 | 'catch': function _catch(onRejection) { 1113 | return this.then(null, onRejection); 1114 | } 1115 | }; 1116 | 1117 | function polyfill() { 1118 | var local = undefined; 1119 | 1120 | if (typeof global !== 'undefined') { 1121 | local = global; 1122 | } else if (typeof self !== 'undefined') { 1123 | local = self; 1124 | } else { 1125 | try { 1126 | local = Function('return this')(); 1127 | } catch (e) { 1128 | throw new Error('polyfill failed because global object is unavailable in this environment'); 1129 | } 1130 | } 1131 | 1132 | var P = local.Promise; 1133 | 1134 | if (P) { 1135 | var promiseToString = null; 1136 | try { 1137 | promiseToString = Object.prototype.toString.call(P.resolve()); 1138 | } catch (e) { 1139 | // silently ignored 1140 | } 1141 | 1142 | if (promiseToString === '[object Promise]' && !P.cast) { 1143 | return; 1144 | } 1145 | } 1146 | 1147 | local.Promise = Promise; 1148 | } 1149 | 1150 | // Strange compat.. 1151 | Promise.polyfill = polyfill; 1152 | Promise.Promise = Promise; 1153 | 1154 | return Promise; 1155 | 1156 | }))); 1157 | 1158 | ES6Promise.polyfill(); -------------------------------------------------------------------------------- /libs/modules/game/game.min.js: -------------------------------------------------------------------------------- 1 | var __reflect=this&&this.__reflect||function(t,e,r){t.__class__=e,r?r.push(e):r=[e],t.__types__=t.__types__?r.concat(t.__types__):r},__extends=this&&this.__extends||function(t,e){function r(){this.constructor=t}for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},egret;!function(t){var e=function(){function t(){}return t}();e.BINARY="binary",e.TEXT="text",e.VARIABLES="variables",e.TEXTURE="texture",e.SOUND="sound",t.URLLoaderDataFormat=e,__reflect(e.prototype,"egret.URLLoaderDataFormat")}(egret||(egret={}));var egret;!function(t){var e=function(t){function e(e,r,i){var o=t.call(this)||this;return o._name=e,o._frame=0|r,i&&(o._end=0|i),o}return __extends(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return this._name},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"frame",{get:function(){return this._frame},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"end",{get:function(){return this._end},enumerable:!0,configurable:!0}),e.prototype.clone=function(){return new e(this._name,this._frame,this._end)},e}(t.EventDispatcher);t.FrameLabel=e,__reflect(e.prototype,"egret.FrameLabel")}(egret||(egret={}));var egret;!function(t){var e=function(e){function r(){var t=e.call(this)||this;return t.$mcData=null,t.numFrames=1,t.frames=[],t.labels=null,t.events=[],t.frameRate=0,t.textureData=null,t.spriteSheet=null,t}return __extends(r,e),r.prototype.$init=function(t,e,r){this.textureData=e,this.spriteSheet=r,this.setMCData(t)},r.prototype.getKeyFrameData=function(t){var e=this.frames[t-1];return e.frame&&(e=this.frames[e.frame-1]),e},r.prototype.getTextureByFrame=function(t){var e=this.getKeyFrameData(t);if(e.res){var r=this.getTextureByResName(e.res);return r}return null},r.prototype.$getOffsetByFrame=function(t,e){var r=this.getKeyFrameData(t);r.res&&e.setTo(0|r.x,0|r.y)},r.prototype.getTextureByResName=function(t){if(null==this.spriteSheet)return null;var e=this.spriteSheet.getTexture(t);if(!e){var r=this.textureData[t];e=this.spriteSheet.createTexture(t,r.x,r.y,r.w,r.h)}return e},r.prototype.$isDataValid=function(){return this.frames.length>0},r.prototype.$isTextureValid=function(){return null!=this.textureData&&null!=this.spriteSheet},r.prototype.$fillMCData=function(t){this.frameRate=t.frameRate||24,this.fillFramesData(t.frames),this.fillFrameLabelsData(t.labels),this.fillFrameEventsData(t.events)},r.prototype.fillFramesData=function(t){for(var e,r=this.frames,i=t?t.length:0,o=0;i>o;o++){var n=t[o];if(r.push(n),n.duration){var s=parseInt(n.duration);if(s>1){e=r.length;for(var a=1;s>a;a++)r.push({frame:e})}}}this.numFrames=r.length},r.prototype.fillFrameLabelsData=function(e){if(e){var r=e.length;if(r>0){this.labels=[];for(var i=0;r>i;i++){var o=e[i];this.labels.push(new t.FrameLabel(o.name,o.frame,o.end))}}}},r.prototype.fillFrameEventsData=function(t){if(t){var e=t.length;if(e>0){this.events=[];for(var r=0;e>r;r++){var i=t[r];this.events[i.frame]=i.name}}}},Object.defineProperty(r.prototype,"mcData",{get:function(){return this.$mcData},set:function(t){this.setMCData(t)},enumerable:!0,configurable:!0}),r.prototype.setMCData=function(t){this.$mcData!=t&&(this.$mcData=t,t&&this.$fillMCData(t))},r}(t.HashObject);t.MovieClipData=e,__reflect(e.prototype,"egret.MovieClipData")}(egret||(egret={}));var egret;!function(t){var e=function(e){function r(t,r){var i=e.call(this)||this;return i.enableCache=!0,i.$mcDataCache={},i.$mcDataSet=t,i.setTexture(r),i}return __extends(r,e),r.prototype.clearCache=function(){this.$mcDataCache={}},r.prototype.generateMovieClipData=function(e){if(void 0===e&&(e=""),""==e&&this.$mcDataSet)for(e in this.$mcDataSet.mc)break;if(""==e)return null;var r=this.findFromCache(e,this.$mcDataCache);return r||(r=new t.MovieClipData,this.fillData(e,r,this.$mcDataCache)),r},r.prototype.findFromCache=function(t,e){return this.enableCache&&e[t]?e[t]:null},r.prototype.fillData=function(t,e,r){if(this.$mcDataSet){var i=this.$mcDataSet.mc[t];i&&(e.$init(i,this.$mcDataSet.res,this.$spriteSheet),this.enableCache&&(r[t]=e))}},Object.defineProperty(r.prototype,"mcDataSet",{get:function(){return this.$mcDataSet},set:function(t){this.$mcDataSet=t},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"texture",{set:function(t){this.setTexture(t)},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"spriteSheet",{get:function(){return this.$spriteSheet},enumerable:!0,configurable:!0}),r.prototype.setTexture=function(e){this.$spriteSheet=e?new t.SpriteSheet(e):null},r}(t.EventDispatcher);t.MovieClipDataFactory=e,__reflect(e.prototype,"egret.MovieClipDataFactory")}(egret||(egret={}));var egret;!function(t){var e=function(e){function r(t,r,i,o){void 0===r&&(r=!1),void 0===i&&(i=!1),void 0===o&&(o=null);var n=e.call(this,t,r,i)||this;return n.frameLabel=null,n.frameLabel=o,n}return __extends(r,e),r.dispatchMovieClipEvent=function(e,i,o){void 0===o&&(o=null);var n=t.Event.create(r,i);n.frameLabel=o;var s=e.dispatchEvent(n);return t.Event.release(n),s},r}(t.Event);e.FRAME_LABEL="frame_label",t.MovieClipEvent=e,__reflect(e.prototype,"egret.MovieClipEvent")}(egret||(egret={}));var egret;!function(t){var e=function(){function e(){t.$error(1014)}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.getPowOut=function(t){return function(e){return 1-Math.pow(1-e,t)}},e}();e.quintOut=e.getPowOut(5),e.quartOut=e.getPowOut(4),t.ScrollEase=e,__reflect(e.prototype,"egret.ScrollEase");var r=function(e){function r(t,r,i){var o=e.call(this)||this;return o._target=null,o._useTicks=!1,o.ignoreGlobalPause=!1,o.loop=!1,o.pluginData=null,o._steps=null,o._actions=null,o.paused=!1,o.duration=0,o._prevPos=-1,o.position=null,o._prevPosition=0,o._stepPosition=0,o.passive=!1,o.initialize(t,r,i),o}return __extends(r,e),r.get=function(t,e,i,o){return void 0===e&&(e=null),void 0===i&&(i=null),void 0===o&&(o=!1),o&&r.removeTweens(t),new r(t,e,i)},r.removeTweens=function(t){if(t.tween_count){for(var e=r._tweens,i=e.length-1;i>=0;i--)e[i]._target==t&&(e[i].paused=!0,e.splice(i,1));t.tween_count=0}},r.tick=function(t,e){void 0===e&&(e=!1);var i=t-r._lastTime;r._lastTime=t;for(var o=r._tweens.concat(),n=o.length-1;n>=0;n--){var s=o[n];e&&!s.ignoreGlobalPause||s.paused||s.tick(s._useTicks?1:i)}return!1},r._register=function(e,i){var o=e._target,n=r._tweens;if(i)o&&(o.tween_count=o.tween_count>0?o.tween_count+1:1),n.push(e),r._inited||(r._lastTime=t.getTimer(),t.ticker.$startTick(r.tick,null),r._inited=!0);else{o&&o.tween_count--;for(var s=n.length;s--;)if(n[s]==e)return void n.splice(s,1)}},r.prototype.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&&r.removeTweens(t)),this.pluginData=i||{},this._curQueueProps={},this._initQueueProps={},this._steps=[],this._actions=[],e&&e.paused?this.paused=!0:r._register(this,!0),e&&null!=e.position&&this.setPosition(e.position)},r.prototype.setPosition=function(t,e){void 0===e&&(e=1),0>t&&(t=0);var r=t,i=!1;if(r>=this.duration&&(this.loop?r%=this.duration:(r=this.duration,i=!0)),r==this._prevPos)return i;var o=this._prevPos;if(this.position=this._prevPos=r,this._prevPosition=t,this._target)if(i)this._updateTargetProps(null,1);else if(this._steps.length>0){var n=void 0,s=this._steps.length;for(n=0;s>n&&!(this._steps[n].t>r);n++);var a=this._steps[n-1];this._updateTargetProps(a,(this._stepPosition=r-a.t)/a.d)}return i&&this.setPaused(!0),0!=e&&this._actions.length>0&&(this._useTicks?this._runActions(r,r):1==e&&o>r?(o!=this.duration&&this._runActions(o,this.duration),this._runActions(0,r,!0)):this._runActions(o,r)),this.dispatchEventWith("change"),i},r.prototype._runActions=function(t,e,r){void 0===r&&(r=!1);var i=t,o=e,n=-1,s=this._actions.length,a=1;for(t>e&&(i=e,o=t,n=s,s=a=-1);(n+=a)!=s;){var l=this._actions[n],c=l.t;(c==o||c>i&&o>c||r&&c==t)&&l.f.apply(l.o,l.p)}},r.prototype._updateTargetProps=function(t,e){var i,o,n,s,a,l;if(t||1!=e){if(this.passive=!!t.v,this.passive)return;t.e&&(e=t.e(e,0,1,1)),i=t.p0,o=t.p1}else this.passive=!1,i=o=this._curQueueProps;for(var c in this._initQueueProps){null==(s=i[c])&&(i[c]=s=this._initQueueProps[c]),null==(a=o[c])&&(o[c]=a=s),n=s==a||0==e||1==e||"number"!=typeof s?1==e?a:s:s+(a-s)*e;var h=!1;if(l=r._plugins[c])for(var u=0,p=l.length;p>u;u++){var _=l[u].tween(this,c,n,i,o,e,!!t&&i==o,!t);_==r.IGNORE?h=!0:n=_}h||(this._target[c]=n)}},r.prototype.setPaused=function(t){return this.paused=t,r._register(this,!t),this},r.prototype._cloneProps=function(t){var e={};for(var r in t)e[r]=t[r];return e},r.prototype._addStep=function(t){return t.d>0&&(this._steps.push(t),t.t=this.duration,this.duration+=t.d),this},r.prototype._appendQueueProps=function(t){var e,i,o,n,s;for(var a in t)if(void 0===this._initQueueProps[a]){if(i=this._target[a],e=r._plugins[a])for(o=0,n=e.length;n>o;o++)i=e[o].init(this,a,i);this._initQueueProps[a]=this._curQueueProps[a]=void 0===i?null:i}else i=this._curQueueProps[a];for(var a in t){if(i=this._curQueueProps[a],e=r._plugins[a])for(s=s||{},o=0,n=e.length;n>o;o++)e[o].step&&e[o].step(this,a,i,t[a],s);this._curQueueProps[a]=t[a]}return s&&this._appendQueueProps(s),this._curQueueProps},r.prototype._addAction=function(t){return t.t=this.duration,this._actions.push(t),this},r.prototype.to=function(t,e,r){return void 0===r&&(r=void 0),(isNaN(e)||0>e)&&(e=0),this._addStep({d:e||0,p0:this._cloneProps(this._curQueueProps),e:r,p1:this._cloneProps(this._appendQueueProps(t))})},r.prototype.call=function(t,e,r){return void 0===e&&(e=void 0),void 0===r&&(r=void 0),this._addAction({f:t,p:r?r:[],o:e?e:this._target})},r.prototype.tick=function(t){this.paused||this.setPosition(this._prevPosition+t)},r}(t.EventDispatcher);r._tweens=[],r.IGNORE={},r._plugins={},r._inited=!1,r._lastTime=0,t.ScrollTween=r,__reflect(r.prototype,"egret.ScrollTween")}(egret||(egret={}));var egret;!function(t){var e=function(e){function r(r){void 0===r&&(r=null);var i=e.call(this)||this;return i.scrollBeginThreshold=10,i.scrollSpeed=1,i._content=null,i.delayTouchBeginEvent=null,i.touchBeginTimer=null,i.touchEnabled=!0,i._ScrV_Props_=new t.ScrollViewProperties,r&&i.setContent(r),i}return __extends(r,e),Object.defineProperty(r.prototype,"bounces",{get:function(){return this._ScrV_Props_._bounces},set:function(t){this._ScrV_Props_._bounces=!!t},enumerable:!0,configurable:!0}),r.prototype.setContent=function(t){this._content!==t&&(this.removeContent(),t&&(this._content=t,e.prototype.addChild.call(this,t),this._addEvents()))},r.prototype.removeContent=function(){this._content&&(this._removeEvents(),e.prototype.removeChildAt.call(this,0)),this._content=null},Object.defineProperty(r.prototype,"verticalScrollPolicy",{get:function(){return this._ScrV_Props_._verticalScrollPolicy},set:function(t){t!=this._ScrV_Props_._verticalScrollPolicy&&(this._ScrV_Props_._verticalScrollPolicy=t)},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"horizontalScrollPolicy",{get:function(){return this._ScrV_Props_._horizontalScrollPolicy},set:function(t){t!=this._ScrV_Props_._horizontalScrollPolicy&&(this._ScrV_Props_._horizontalScrollPolicy=t)},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"scrollLeft",{get:function(){return this._ScrV_Props_._scrollLeft},set:function(t){t!=this._ScrV_Props_._scrollLeft&&(this._ScrV_Props_._scrollLeft=t,this._validatePosition(!1,!0),this._updateContentPosition())},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"scrollTop",{get:function(){return this._ScrV_Props_._scrollTop},set:function(t){t!=this._ScrV_Props_._scrollTop&&(this._ScrV_Props_._scrollTop=t,this._validatePosition(!0,!1),this._updateContentPosition())},enumerable:!0,configurable:!0}),r.prototype.setScrollPosition=function(t,e,r){if(void 0===r&&(r=!1),(!r||0!=t||0!=e)&&(r||this._ScrV_Props_._scrollTop!=t||this._ScrV_Props_._scrollLeft!=e)){var i=this._ScrV_Props_._scrollTop,o=this._ScrV_Props_._scrollLeft;if(r){var n=this.getMaxScrollLeft(),s=this.getMaxScrollTop();(0>=i||i>=s)&&(t/=2),(0>=o||o>=n)&&(e/=2);var a=i+t,l=o+e,c=this._ScrV_Props_._bounces;c||((0>=a||a>=s)&&(a=Math.max(0,Math.min(a,s))),(0>=l||l>=n)&&(l=Math.max(0,Math.min(l,n)))),this._ScrV_Props_._scrollTop=a,this._ScrV_Props_._scrollLeft=l}else this._ScrV_Props_._scrollTop=t,this._ScrV_Props_._scrollLeft=e;this._validatePosition(!0,!0),this._updateContentPosition()}},r.prototype._validatePosition=function(t,e){if(void 0===t&&(t=!1),void 0===e&&(e=!1),t){var r=this.height,i=this._getContentHeight();this._ScrV_Props_._scrollTop=Math.max(this._ScrV_Props_._scrollTop,(0-r)/2),this._ScrV_Props_._scrollTop=Math.min(this._ScrV_Props_._scrollTop,i>r?i-r/2:r/2)}if(e){var o=this.width,n=this._getContentWidth();this._ScrV_Props_._scrollLeft=Math.max(this._ScrV_Props_._scrollLeft,(0-o)/2),this._ScrV_Props_._scrollLeft=Math.min(this._ScrV_Props_._scrollLeft,n>o?n-o/2:o/2)}},r.prototype.$setWidth=function(t){if(this.$getExplicitWidth()==t)return!1;var r=e.prototype.$setWidth.call(this,t);return this._updateContentPosition(),r},r.prototype.$setHeight=function(t){if(this.$getExplicitHeight()==t)return!1;e.prototype.$setHeight.call(this,t);return this._updateContentPosition(),!0},r.prototype._updateContentPosition=function(){var e=this.height,r=this.width;this.scrollRect=new t.Rectangle(Math.round(this._ScrV_Props_._scrollLeft),Math.round(this._ScrV_Props_._scrollTop),r,e),this.dispatchEvent(new t.Event(t.Event.CHANGE))},r.prototype._checkScrollPolicy=function(){var t=this._ScrV_Props_._horizontalScrollPolicy,e=this.__checkScrollPolicy(t,this._getContentWidth(),this.width);this._ScrV_Props_._hCanScroll=e;var r=this._ScrV_Props_._verticalScrollPolicy,i=this.__checkScrollPolicy(r,this._getContentHeight(),this.height);return this._ScrV_Props_._vCanScroll=i,e||i},r.prototype.__checkScrollPolicy=function(t,e,r){return"on"==t?!0:"off"==t?!1:e>r},r.prototype._addEvents=function(){this.addEventListener(t.TouchEvent.TOUCH_BEGIN,this._onTouchBegin,this),this.addEventListener(t.TouchEvent.TOUCH_BEGIN,this._onTouchBeginCapture,this,!0),this.addEventListener(t.TouchEvent.TOUCH_END,this._onTouchEndCapture,this,!0)},r.prototype._removeEvents=function(){this.removeEventListener(t.TouchEvent.TOUCH_BEGIN,this._onTouchBegin,this),this.removeEventListener(t.TouchEvent.TOUCH_BEGIN,this._onTouchBeginCapture,this,!0),this.removeEventListener(t.TouchEvent.TOUCH_END,this._onTouchEndCapture,this,!0)},r.prototype._onTouchBegin=function(e){if(!e.$isDefaultPrevented){var r=this._checkScrollPolicy();r&&(this._ScrV_Props_._touchStartPosition.x=e.stageX,this._ScrV_Props_._touchStartPosition.y=e.stageY,(this._ScrV_Props_._isHTweenPlaying||this._ScrV_Props_._isVTweenPlaying)&&this._onScrollFinished(),this._tempStage=this.stage,this._tempStage.addEventListener(t.TouchEvent.TOUCH_MOVE,this._onTouchMove,this),this._tempStage.addEventListener(t.TouchEvent.TOUCH_END,this._onTouchEnd,this),this._tempStage.addEventListener(t.TouchEvent.LEAVE_STAGE,this._onTouchEnd,this),this.addEventListener(t.Event.ENTER_FRAME,this._onEnterFrame,this),this._logTouchEvent(e),e.preventDefault())}},r.prototype._onTouchBeginCapture=function(e){var r=this._checkScrollPolicy();if(r){for(var i=e.target;i!=this;){if("_checkScrollPolicy"in i&&(r=i._checkScrollPolicy()))return;i=i.parent}e.stopPropagation();var o=this.cloneTouchEvent(e);this.delayTouchBeginEvent=o,this.touchBeginTimer||(this.touchBeginTimer=new t.Timer(100,1),this.touchBeginTimer.addEventListener(t.TimerEvent.TIMER_COMPLETE,this._onTouchBeginTimer,this)),this.touchBeginTimer.start(),this._onTouchBegin(e)}},r.prototype._onTouchEndCapture=function(e){var r=this;if(this.delayTouchBeginEvent){this._onTouchBeginTimer(),e.stopPropagation();var i=this.cloneTouchEvent(e);t.callLater(function(){r.stage&&r.dispatchPropagationEvent(i)},this)}},r.prototype._onTouchBeginTimer=function(){this.touchBeginTimer.stop();var t=this.delayTouchBeginEvent;this.delayTouchBeginEvent=null,this.stage&&this.dispatchPropagationEvent(t)},r.prototype.dispatchPropagationEvent=function(e){for(var r=e.$target,i=this.$getPropagationList(r),o=i.length,n=.5*i.length,s=-1,a=0;o>a;a++)if(i[a]===this._content){s=a;break}i.splice(0,s+1),n-=s+1,this.$dispatchPropagationEvent(e,i,n),t.Event.release(e)},r.prototype._onTouchMove=function(t){if(this._ScrV_Props_._lastTouchPosition.x!=t.stageX||this._ScrV_Props_._lastTouchPosition.y!=t.stageY){if(!this._ScrV_Props_._scrollStarted){var e=t.stageX-this._ScrV_Props_._touchStartPosition.x,r=t.stageY-this._ScrV_Props_._touchStartPosition.y,i=Math.sqrt(e*e+r*r);if(i100&&r-this._ScrV_Props_._lastTouchTime<300&&this._calcVelocitys(this._ScrV_Props_._lastTouchEvent)},r.prototype._logTouchEvent=function(e){this._ScrV_Props_._lastTouchPosition.x=e.stageX,this._ScrV_Props_._lastTouchPosition.y=e.stageY,this._ScrV_Props_._lastTouchEvent=this.cloneTouchEvent(e),this._ScrV_Props_._lastTouchTime=t.getTimer()},r.prototype._getPointChange=function(t){return{x:this._ScrV_Props_._hCanScroll===!1?0:this._ScrV_Props_._lastTouchPosition.x-t.stageX,y:this._ScrV_Props_._vCanScroll===!1?0:this._ScrV_Props_._lastTouchPosition.y-t.stageY}},r.prototype._calcVelocitys=function(e){var r=t.getTimer();if(0==this._ScrV_Props_._lastTouchTime)return void(this._ScrV_Props_._lastTouchTime=r);var i=this._getPointChange(e),o=r-this._ScrV_Props_._lastTouchTime;i.x/=o,i.y/=o,this._ScrV_Props_._velocitys.push(i),this._ScrV_Props_._velocitys.length>5&&this._ScrV_Props_._velocitys.shift(),this._ScrV_Props_._lastTouchPosition.x=e.stageX,this._ScrV_Props_._lastTouchPosition.y=e.stageY},r.prototype._getContentWidth=function(){return this._content.$getExplicitWidth()||this._content.width},r.prototype._getContentHeight=function(){return this._content.$getExplicitHeight()||this._content.height},r.prototype.getMaxScrollLeft=function(){var t=this._getContentWidth()-this.width;return Math.max(0,t)},r.prototype.getMaxScrollTop=function(){var t=this._getContentHeight()-this.height;return Math.max(0,t)},r.prototype._moveAfterTouchEnd=function(){if(0!=this._ScrV_Props_._velocitys.length){for(var t={x:0,y:0},e=0,i=0;i.02?this.getAnimationDatas(s,this._ScrV_Props_._scrollLeft,h):{position:this._ScrV_Props_._scrollLeft,duration:1},_=c>.02?this.getAnimationDatas(a,this._ScrV_Props_._scrollTop,u):{position:this._ScrV_Props_._scrollTop,duration:1};this.setScrollLeft(p.position,p.duration),this.setScrollTop(_.position,_.duration)}},r.prototype.onTweenFinished=function(t){t==this._ScrV_Props_._vScrollTween&&(this._ScrV_Props_._isVTweenPlaying=!1),t==this._ScrV_Props_._hScrollTween&&(this._ScrV_Props_._isHTweenPlaying=!1),0==this._ScrV_Props_._isHTweenPlaying&&0==this._ScrV_Props_._isVTweenPlaying&&this._onScrollFinished()},r.prototype._onScrollStarted=function(){},r.prototype._onScrollFinished=function(){t.ScrollTween.removeTweens(this),this._ScrV_Props_._hScrollTween=null,this._ScrV_Props_._vScrollTween=null,this._ScrV_Props_._isHTweenPlaying=!1,this._ScrV_Props_._isVTweenPlaying=!1,this.dispatchEvent(new t.Event(t.Event.COMPLETE))},r.prototype.setScrollTop=function(e,r){void 0===r&&(r=0);var i=Math.min(this.getMaxScrollTop(),Math.max(e,0));if(0==r)return void(this.scrollTop=i);0==this._ScrV_Props_._bounces&&(e=i);var o=t.ScrollTween.get(this).to({scrollTop:e},r,t.ScrollEase.quartOut);i!=e&&o.to({scrollTop:i},300,t.ScrollEase.quintOut),this._ScrV_Props_._isVTweenPlaying=!0,this._ScrV_Props_._vScrollTween=o,o.call(this.onTweenFinished,this,[o]),this._ScrV_Props_._isHTweenPlaying||this._onScrollStarted()},r.prototype.setScrollLeft=function(e,r){void 0===r&&(r=0);var i=Math.min(this.getMaxScrollLeft(),Math.max(e,0));if(0==r)return void(this.scrollLeft=i);0==this._ScrV_Props_._bounces&&(e=i);var o=t.ScrollTween.get(this).to({scrollLeft:e},r,t.ScrollEase.quartOut);i!=e&&o.to({scrollLeft:i},300,t.ScrollEase.quintOut),this._ScrV_Props_._isHTweenPlaying=!0,this._ScrV_Props_._hScrollTween=o,o.call(this.onTweenFinished,this,[o]),this._ScrV_Props_._isVTweenPlaying||this._onScrollStarted()},r.prototype.getAnimationDatas=function(t,e,r){var i=Math.abs(t),o=.95,n=0,s=.998,a=.02,l=e+500*t;if(0>l||l>r)for(l=e;Math.abs(t)!=1/0&&Math.abs(t)>a;)l+=t,t*=0>l||l>r?s*o:s,n++;else n=500*-Math.log(a/i);var c={position:Math.min(r+50,Math.max(l,-50)),duration:n};return c},r.prototype.cloneTouchEvent=function(e){var r=new t.TouchEvent(e.type,e.bubbles,e.cancelable);return r.touchPointID=e.touchPointID,r.$stageX=e.stageX,r.$stageY=e.stageY,r.touchDown=e.touchDown,r.$isDefaultPrevented=!1,r.$target=e.target,r},r.prototype.throwNotSupportedError=function(){t.$error(1023)},r.prototype.addChild=function(t){return this.throwNotSupportedError(),null},r.prototype.addChildAt=function(t,e){return this.throwNotSupportedError(),null},r.prototype.removeChild=function(t){return this.throwNotSupportedError(),null},r.prototype.removeChildAt=function(t){return this.throwNotSupportedError(),null},r.prototype.setChildIndex=function(t,e){this.throwNotSupportedError()},r.prototype.swapChildren=function(t,e){this.throwNotSupportedError()},r.prototype.swapChildrenAt=function(t,e){this.throwNotSupportedError()},r}(t.DisplayObjectContainer);e.weight=[1,1.33,1.66,2,2.33],t.ScrollView=e,__reflect(e.prototype,"egret.ScrollView")}(egret||(egret={}));var egret;!function(t){var e=function(){function e(){this._verticalScrollPolicy="auto",this._horizontalScrollPolicy="auto",this._scrollLeft=0,this._scrollTop=0,this._hCanScroll=!1,this._vCanScroll=!1,this._lastTouchPosition=new t.Point(0,0),this._touchStartPosition=new t.Point(0,0),this._scrollStarted=!1,this._lastTouchTime=0,this._lastTouchEvent=null,this._velocitys=[],this._isHTweenPlaying=!1,this._isVTweenPlaying=!1,this._hScrollTween=null,this._vScrollTween=null,this._bounces=!0}return e}();t.ScrollViewProperties=e,__reflect(e.prototype,"egret.ScrollViewProperties")}(egret||(egret={}));var egret;!function(t){function e(e){var r=e.url;return-1==r.indexOf("?")&&e.method==t.URLRequestMethod.GET&&e.data&&e.data instanceof t.URLVariables&&(r=r+"?"+e.data.toString()),r}var r=function(r){function i(e){void 0===e&&(e=null);var i=r.call(this)||this;return i.dataFormat=t.URLLoaderDataFormat.TEXT,i.data=null,i._request=null,i._status=-1,e&&i.load(e),i}return __extends(i,r),i.prototype.load=function(r){this._request=r,this.data=null;var i=this;if(i.dataFormat==t.URLLoaderDataFormat.TEXTURE)return void this.loadTexture(i);if(i.dataFormat==t.URLLoaderDataFormat.SOUND)return void this.loadSound(i);var o=e(r),n=new t.HttpRequest;n.open(o,r.method==t.URLRequestMethod.POST?t.HttpMethod.POST:t.HttpMethod.GET);var s;if(r.method!=t.URLRequestMethod.GET&&r.data)if(r.data instanceof t.URLVariables){t.Capabilities.runtimeType==t.RuntimeType.WEB&&n.setRequestHeader("Content-Type","application/x-www-form-urlencoded");var a=r.data;s=a.toString()}else t.Capabilities.runtimeType==t.RuntimeType.WEB&&n.setRequestHeader("Content-Type","multipart/form-data"),s=r.data;else;for(var l=r.requestHeaders.length,c=0;l>c;c++){var h=r.requestHeaders[c];n.setRequestHeader(h.name,h.value)}n.addEventListener(t.Event.COMPLETE,function(){i.data=n.response,t.Event.dispatchEvent(i,t.Event.COMPLETE)},this),n.addEventListener(t.IOErrorEvent.IO_ERROR,function(){t.IOErrorEvent.dispatchIOErrorEvent(i)},this),n.responseType=i.dataFormat==t.URLLoaderDataFormat.BINARY?t.HttpResponseType.ARRAY_BUFFER:t.HttpResponseType.TEXT,n.send(s)},i.prototype.getResponseType=function(e){switch(e){case t.URLLoaderDataFormat.TEXT:case t.URLLoaderDataFormat.VARIABLES:return t.URLLoaderDataFormat.TEXT;case t.URLLoaderDataFormat.BINARY:return"arraybuffer";default:return e}},i.prototype.loadSound=function(e){function r(t){e.dispatchEvent(t)}function i(t){n(),e.dispatchEvent(t)}function o(r){n(),e.data=l,window.setTimeout(function(){e.dispatchEventWith(t.Event.COMPLETE)},0)}function n(){l.removeEventListener(t.Event.COMPLETE,o,s),l.removeEventListener(t.IOErrorEvent.IO_ERROR,i,s),l.removeEventListener(t.ProgressEvent.PROGRESS,r,s)}var s=this,a=e._request.url,l=new t.Sound;l.addEventListener(t.Event.COMPLETE,o,s),l.addEventListener(t.IOErrorEvent.IO_ERROR,i,s),l.addEventListener(t.ProgressEvent.PROGRESS,r,s),l.load(a)},i.prototype.loadTexture=function(e){function r(t){e.dispatchEvent(t)}function i(t){n(),e.dispatchEvent(t)}function o(r){n();var i=l.data;t.Capabilities.runtimeType==t.RuntimeType.WEB&&i.source.setAttribute("bitmapSrc",a);var o=new t.Texture;o._setBitmapData(i),e.data=o,window.setTimeout(function(){e.dispatchEventWith(t.Event.COMPLETE)},s)}function n(){l.removeEventListener(t.Event.COMPLETE,o,s),l.removeEventListener(t.IOErrorEvent.IO_ERROR,i,s),l.removeEventListener(t.ProgressEvent.PROGRESS,r,s)}var s=this,a=e._request.url,l=new t.ImageLoader;l.addEventListener(t.Event.COMPLETE,o,s),l.addEventListener(t.IOErrorEvent.IO_ERROR,i,s),l.addEventListener(t.ProgressEvent.PROGRESS,r,s),l.load(a)},i.prototype.__recycle=function(){this._request=null,this.data=null},i}(t.EventDispatcher);t.URLLoader=r,__reflect(r.prototype,"egret.URLLoader")}(egret||(egret={}));var egret;!function(t){var e=function(e){function r(r){var i=e.call(this)||this;return i.$bitmapData=null,i.offsetPoint=t.Point.create(0,0),i.$movieClipData=null,i.frames=null,i.$totalFrames=0,i.frameLabels=null,i.$frameLabelStart=0,i.$frameLabelEnd=0,i.frameEvents=null,i.frameIntervalTime=0,i.$eventPool=null,i.$isPlaying=!1,i.isStopped=!0,i.playTimes=0,i.$currentFrameNum=0,i.$nextFrameNum=1,i.displayedKeyFrameNum=0,i.passedTime=0,i.$frameRate=0/0,i.lastTime=0,i.$smoothing=t.Bitmap.defaultSmoothing,i.$renderNode=new t.sys.BitmapNode,i.setMovieClipData(r),i}return __extends(r,e),Object.defineProperty(r.prototype,"smoothing",{get:function(){return this.$smoothing},set:function(t){t=!!t,t!=this.$smoothing&&(this.$smoothing=t,this.$invalidate())},enumerable:!0,configurable:!0}),r.prototype.$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=t.frameRate,this.frameIntervalTime=1e3/this.$frameRate,this._initFrame())},r.prototype.$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=[]},r.prototype._initFrame=function(){this.$movieClipData.$isTextureValid()&&(this.advanceFrame(),this.constructFrame())},r.prototype.$render=function(){var e=this.$bitmapData;if(e){var r=Math.round(this.offsetPoint.x),i=Math.round(this.offsetPoint.y),o=e._bitmapWidth,n=e._bitmapHeight,s=e.$getTextureWidth(),a=e.$getTextureHeight(),l=Math.round(e.$getScaleBitmapWidth()),c=Math.round(e.$getScaleBitmapHeight()),h=e._sourceWidth,u=e._sourceHeight;t.sys.BitmapNode.$updateTextureData(this.$renderNode,e._bitmapData,e._bitmapX,e._bitmapY,o,n,r,i,s,a,l,c,h,u,null,t.BitmapFillMode.SCALE,this.$smoothing)}},r.prototype.$measureContentBounds=function(t){var e=this.$bitmapData;if(e){var r=this.offsetPoint.x,i=this.offsetPoint.y,o=e.$getTextureWidth(),n=e.$getTextureHeight();t.setTo(r,i,o,n)}else t.setEmpty()},r.prototype.$onAddToStage=function(t,r){e.prototype.$onAddToStage.call(this,t,r),this.$isPlaying&&this.$totalFrames>1&&this.setIsStopped(!1)},r.prototype.$onRemoveFromStage=function(){e.prototype.$onRemoveFromStage.call(this),this.setIsStopped(!0)},r.prototype.getFrameLabelByName=function(t,e){void 0===e&&(e=!1),e&&(t=t.toLowerCase());var r=this.frameLabels;if(r)for(var i=null,o=0;ot)return e;e=r}return e},r.prototype.play=function(t){void 0===t&&(t=0),this.$isPlaying=!0,this.setPlayTimes(t),this.$totalFrames>1&&this.$stage&&this.setIsStopped(!1)},r.prototype.stop=function(){this.$isPlaying=!1,this.setIsStopped(!0)},r.prototype.prevFrame=function(){this.gotoAndStop(this.$currentFrameNum-1)},r.prototype.nextFrame=function(){this.gotoAndStop(this.$currentFrameNum+1)},r.prototype.gotoAndPlay=function(e,r){void 0===r&&(r=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(r),this.gotoFrame(e)},r.prototype.gotoAndStop=function(e){1!=arguments.length&&t.$error(1022,"MovieClip.gotoAndStop()"),this.stop(),this.gotoFrame(e)},r.prototype.gotoFrame=function(e){var r;"string"==typeof e?r=this.getFrameLabelByName(e).frame:(r=parseInt(e+"",10),r!=e&&t.$error(1022,"Frame Label Not Found")),1>r?r=1:r>this.$totalFrames&&(r=this.$totalFrames),r!=this.$nextFrameNum&&(this.$nextFrameNum=r,this.advanceFrame(),this.constructFrame(),this.handlePendingEvent())},r.prototype.advanceTime=function(e){var r=this,i=e-r.lastTime;r.lastTime=e;var o=r.frameIntervalTime,n=r.passedTime+i;r.passedTime=n%o;var s=n/o;if(1>s)return!1;for(;s>=1;){if(s--,r.$nextFrameNum++,r.$nextFrameNum>r.$totalFrames||r.$frameLabelStart>0&&r.$nextFrameNum>r.$frameLabelEnd)if(-1==r.playTimes)r.$eventPool.push(t.Event.LOOP_COMPLETE),r.$nextFrameNum=1;else{if(r.playTimes--,!(r.playTimes>0)){r.$nextFrameNum=r.$totalFrames,r.$eventPool.push(t.Event.COMPLETE),r.stop();break}r.$eventPool.push(t.Event.LOOP_COMPLETE),r.$nextFrameNum=1}r.$currentFrameNum==r.$frameLabelEnd&&(r.$nextFrameNum=r.$frameLabelStart),r.advanceFrame()}return r.constructFrame(),r.handlePendingEvent(),!1},r.prototype.advanceFrame=function(){this.$currentFrameNum=this.$nextFrameNum;var e=this.frameEvents[this.$nextFrameNum];e&&""!=e&&t.MovieClipEvent.dispatchMovieClipEvent(this,t.MovieClipEvent.FRAME_LABEL,e)},r.prototype.constructFrame=function(){var t=this.$currentFrameNum;this.displayedKeyFrameNum!=t&&(this.$bitmapData=this.$movieClipData.getTextureByFrame(t),this.$movieClipData.$getOffsetByFrame(t,this.offsetPoint),this.$invalidateContentBounds(),this.displayedKeyFrameNum=t)},r.prototype.$renderFrame=function(){this.$bitmapData=this.$movieClipData.getTextureByFrame(this.$currentFrameNum),this.$invalidateContentBounds()},r.prototype.handlePendingEvent=function(){if(0!=this.$eventPool.length){this.$eventPool.reverse();for(var e=this.$eventPool,r=e.length,i=!1,o=!1,n=0;r>n;n++){var s=e.pop();s==t.Event.LOOP_COMPLETE?o=!0:s==t.Event.COMPLETE?i=!0:this.dispatchEventWith(s) 2 | }o&&this.dispatchEventWith(t.Event.LOOP_COMPLETE),i&&this.dispatchEventWith(t.Event.COMPLETE)}},Object.defineProperty(r.prototype,"totalFrames",{get:function(){return this.$totalFrames},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"currentFrame",{get:function(){return this.$currentFrameNum},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"currentFrameLabel",{get:function(){var t=this.getFrameLabelByFrame(this.$currentFrameNum);return t&&t.name},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"currentLabel",{get:function(){var t=this.getFrameLabelForFrame(this.$currentFrameNum);return t?t.name:null},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"frameRate",{get:function(){return this.$frameRate},set:function(t){t!=this.$frameRate&&(this.$frameRate=t,this.frameIntervalTime=1e3/this.$frameRate)},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"isPlaying",{get:function(){return this.$isPlaying},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"movieClipData",{get:function(){return this.$movieClipData},set:function(t){this.setMovieClipData(t)},enumerable:!0,configurable:!0}),r.prototype.setMovieClipData=function(t){this.$movieClipData!=t&&(this.$movieClipData=t,this.$init())},r.prototype.setPlayTimes=function(t){(0>t||t>=1)&&(this.playTimes=0>t?-1:Math.floor(t))},r.prototype.setIsStopped=function(e){this.isStopped!=e&&(this.isStopped=e,e?t.ticker.$stopTick(this.advanceTime,this):(this.playTimes=0==this.playTimes?1:this.playTimes,this.lastTime=t.getTimer(),t.ticker.$startTick(this.advanceTime,this)))},r}(t.DisplayObject);t.MovieClip=e,__reflect(e.prototype,"egret.MovieClip")}(egret||(egret={}));var egret;!function(t){var e=function(e){function r(r){void 0===r&&(r=null);var i=e.call(this)||this;return i.data=null,i.method=t.URLRequestMethod.GET,i.url="",i.requestHeaders=[],i.url=r,i}return __extends(r,e),r}(t.HashObject);t.URLRequest=e,__reflect(e.prototype,"egret.URLRequest")}(egret||(egret={}));var egret;!function(t){var e=function(){function t(t,e){this.name="",this.value="",this.name=t,this.value=e}return t}();t.URLRequestHeader=e,__reflect(e.prototype,"egret.URLRequestHeader")}(egret||(egret={}));var egret;!function(t){var e=function(){function t(){}return t}();e.GET="get",e.POST="post",t.URLRequestMethod=e,__reflect(e.prototype,"egret.URLRequestMethod")}(egret||(egret={}));var egret;!function(t){var e=function(t){function e(e){void 0===e&&(e=null);var r=t.call(this)||this;return r.variables=null,null!==e&&r.decode(e),r}return __extends(e,t),e.prototype.decode=function(t){this.variables||(this.variables={}),t=t.split("+").join(" ");for(var e,r=/[?&]?([^=]+)=([^&]*)/g;e=r.exec(t);){var i=decodeURIComponent(e[1]),o=decodeURIComponent(e[2]);if(i in this.variables!=0){var n=this.variables[i];n instanceof Array?n.push(o):this.variables[i]=[n,o]}else this.variables[i]=o}},e.prototype.toString=function(){if(!this.variables)return"";var t=this.variables,e=[];for(var r in t)e.push(this.encodeValue(r,t[r]));return e.join("&")},e.prototype.encodeValue=function(t,e){return e instanceof Array?this.encodeArray(t,e):encodeURIComponent(t)+"="+encodeURIComponent(e)},e.prototype.encodeArray=function(t,e){return t?0==e.length?encodeURIComponent(t)+"=":e.map(function(e){return encodeURIComponent(t)+"="+encodeURIComponent(e)}).join("&"):""},e}(t.HashObject);t.URLVariables=e,__reflect(e.prototype,"egret.URLVariables")}(egret||(egret={}));var egret;!function(t){var e=function(e){function r(){var i=e.call(this)||this;return i._timeScale=1,i._paused=!1,i._callIndex=-1,i._lastTime=0,i.callBackList=[],null!=r.instance,t.ticker.$startTick(i.update,i),i._lastTime=t.getTimer(),i}return __extends(r,e),r.prototype.update=function(t){var e=t-this._lastTime;if(this._lastTime=t,this._paused)return!1;var r=e*this._timeScale;for(this._callList=this.callBackList.concat(),this._callIndex=0;this._callIndext&&(t=1),r.autoDisposeTime=t,r.frameCount=0,r}return __extends(r,e),r.$init=function(){t.ticker.$startTick(r.onUpdate,r)},r.onUpdate=function(t){for(var e=r._callBackList,i=e.length-1;i>=0;i--)e[i].$checkFrame();return!1},r.prototype.$checkFrame=function(){this.frameCount--,this.frameCount<=0&&this.dispose()},Object.defineProperty(r.prototype,"length",{get:function(){return this._length},enumerable:!0,configurable:!0}),r.prototype.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,r._callBackList.push(this)))},r.prototype.pop=function(){return 0==this._length?null:(this._length--,this.objectPool.pop())},r.prototype.dispose=function(){this._length>0&&(this.objectPool=[],this._length=0),this.frameCount=0;var t=r._callBackList,e=t.indexOf(this);-1!=e&&t.splice(e,1)},r}(t.HashObject);e._callBackList=[],t.Recycler=e,__reflect(e.prototype,"egret.Recycler"),e.$init()}(egret||(egret={}));var egret;!function(t){function e(e,r,l){for(var c=[],h=3;h number; 35 | /** 36 | * get pow in.See example. 37 | * @version Egret 2.4 38 | * @platform Web,Native 39 | * @language en_US 40 | */ 41 | /** 42 | * get pow in。请查看示例 43 | * @version Egret 2.4 44 | * @platform Web,Native 45 | * @language zh_CN 46 | */ 47 | static getPowIn(pow: number): (t: number) => number; 48 | /** 49 | * get pow out.See example. 50 | * @version Egret 2.4 51 | * @platform Web,Native 52 | * @language en_US 53 | */ 54 | /** 55 | * get pow out。请查看示例 56 | * @version Egret 2.4 57 | * @platform Web,Native 58 | * @language zh_CN 59 | */ 60 | static getPowOut(pow: number): (t: number) => number; 61 | /** 62 | * get pow in out.See example. 63 | * @version Egret 2.4 64 | * @platform Web,Native 65 | * @language en_US 66 | */ 67 | /** 68 | * get pow in out。请查看示例 69 | * @version Egret 2.4 70 | * @platform Web,Native 71 | * @language zh_CN 72 | */ 73 | static getPowInOut(pow: number): (t: number) => number; 74 | /** 75 | * quad in.See example. 76 | * @version Egret 2.4 77 | * @platform Web,Native 78 | * @language en_US 79 | */ 80 | /** 81 | * quad in。请查看示例 82 | * @version Egret 2.4 83 | * @platform Web,Native 84 | * @language zh_CN 85 | */ 86 | static quadIn: (t: number) => number; 87 | /** 88 | * quad out.See example. 89 | * @version Egret 2.4 90 | * @platform Web,Native 91 | * @language en_US 92 | */ 93 | /** 94 | * quad out。请查看示例 95 | * @version Egret 2.4 96 | * @platform Web,Native 97 | * @language zh_CN 98 | */ 99 | static quadOut: (t: number) => number; 100 | /** 101 | * quad in out.See example. 102 | * @version Egret 2.4 103 | * @platform Web,Native 104 | * @language en_US 105 | */ 106 | /** 107 | * quad in out。请查看示例 108 | * @version Egret 2.4 109 | * @platform Web,Native 110 | * @language zh_CN 111 | */ 112 | static quadInOut: (t: number) => number; 113 | /** 114 | * cubic in.See example. 115 | * @version Egret 2.4 116 | * @platform Web,Native 117 | * @language en_US 118 | */ 119 | /** 120 | * cubic in。请查看示例 121 | * @version Egret 2.4 122 | * @platform Web,Native 123 | * @language zh_CN 124 | */ 125 | static cubicIn: (t: number) => number; 126 | /** 127 | * cubic out.See example. 128 | * @version Egret 2.4 129 | * @platform Web,Native 130 | * @language en_US 131 | */ 132 | /** 133 | * cubic out。请查看示例 134 | * @version Egret 2.4 135 | * @platform Web,Native 136 | * @language zh_CN 137 | */ 138 | static cubicOut: (t: number) => number; 139 | /** 140 | * cubic in out.See example. 141 | * @version Egret 2.4 142 | * @platform Web,Native 143 | * @language en_US 144 | */ 145 | /** 146 | * cubic in out。请查看示例 147 | * @version Egret 2.4 148 | * @platform Web,Native 149 | * @language zh_CN 150 | */ 151 | static cubicInOut: (t: number) => number; 152 | /** 153 | * quart in.See example. 154 | * @version Egret 2.4 155 | * @platform Web,Native 156 | * @language en_US 157 | */ 158 | /** 159 | * quart in。请查看示例 160 | * @version Egret 2.4 161 | * @platform Web,Native 162 | * @language zh_CN 163 | */ 164 | static quartIn: (t: number) => number; 165 | /** 166 | * quart out.See example. 167 | * @version Egret 2.4 168 | * @platform Web,Native 169 | * @language en_US 170 | */ 171 | /** 172 | * quart out。请查看示例 173 | * @version Egret 2.4 174 | * @platform Web,Native 175 | * @language zh_CN 176 | */ 177 | static quartOut: (t: number) => number; 178 | /** 179 | * quart in out.See example. 180 | * @version Egret 2.4 181 | * @platform Web,Native 182 | * @language en_US 183 | */ 184 | /** 185 | * quart in out。请查看示例 186 | * @version Egret 2.4 187 | * @platform Web,Native 188 | * @language zh_CN 189 | */ 190 | static quartInOut: (t: number) => number; 191 | /** 192 | * quint in.See example. 193 | * @version Egret 2.4 194 | * @platform Web,Native 195 | * @language en_US 196 | */ 197 | /** 198 | * quint in。请查看示例 199 | * @version Egret 2.4 200 | * @platform Web,Native 201 | * @language zh_CN 202 | */ 203 | static quintIn: (t: number) => number; 204 | /** 205 | * quint out.See example. 206 | * @version Egret 2.4 207 | * @platform Web,Native 208 | * @language en_US 209 | */ 210 | /** 211 | * quint out。请查看示例 212 | * @version Egret 2.4 213 | * @platform Web,Native 214 | * @language zh_CN 215 | */ 216 | static quintOut: (t: number) => number; 217 | /** 218 | * quint in out.See example. 219 | * @version Egret 2.4 220 | * @platform Web,Native 221 | * @language en_US 222 | */ 223 | /** 224 | * quint in out。请查看示例 225 | * @version Egret 2.4 226 | * @platform Web,Native 227 | * @language zh_CN 228 | */ 229 | static quintInOut: (t: number) => number; 230 | /** 231 | * sine in.See example. 232 | * @version Egret 2.4 233 | * @platform Web,Native 234 | * @language en_US 235 | */ 236 | /** 237 | * sine in。请查看示例 238 | * @version Egret 2.4 239 | * @platform Web,Native 240 | * @language zh_CN 241 | */ 242 | static sineIn(t: number): number; 243 | /** 244 | * sine out.See example. 245 | * @version Egret 2.4 246 | * @platform Web,Native 247 | * @language en_US 248 | */ 249 | /** 250 | * sine out。请查看示例 251 | * @version Egret 2.4 252 | * @platform Web,Native 253 | * @language zh_CN 254 | */ 255 | static sineOut(t: number): number; 256 | /** 257 | * sine in out.See example. 258 | * @version Egret 2.4 259 | * @platform Web,Native 260 | * @language en_US 261 | */ 262 | /** 263 | * sine in out。请查看示例 264 | * @version Egret 2.4 265 | * @platform Web,Native 266 | * @language zh_CN 267 | */ 268 | static sineInOut(t: number): number; 269 | /** 270 | * get back in.See example. 271 | * @version Egret 2.4 272 | * @platform Web,Native 273 | * @language en_US 274 | */ 275 | /** 276 | * get back in。请查看示例 277 | * @version Egret 2.4 278 | * @platform Web,Native 279 | * @language zh_CN 280 | */ 281 | static getBackIn(amount: number): (t: number) => number; 282 | /** 283 | * back in.See example. 284 | * @version Egret 2.4 285 | * @platform Web,Native 286 | * @language en_US 287 | */ 288 | /** 289 | * back in。请查看示例 290 | * @version Egret 2.4 291 | * @platform Web,Native 292 | * @language zh_CN 293 | */ 294 | static backIn: (t: number) => number; 295 | /** 296 | * get back out.See example. 297 | * @version Egret 2.4 298 | * @platform Web,Native 299 | * @language en_US 300 | */ 301 | /** 302 | * get back out。请查看示例 303 | * @version Egret 2.4 304 | * @platform Web,Native 305 | * @language zh_CN 306 | */ 307 | static getBackOut(amount: number): (t: any) => number; 308 | /** 309 | * back out.See example. 310 | * @version Egret 2.4 311 | * @platform Web,Native 312 | * @language en_US 313 | */ 314 | /** 315 | * back out。请查看示例 316 | * @version Egret 2.4 317 | * @platform Web,Native 318 | * @language zh_CN 319 | */ 320 | static backOut: (t: any) => number; 321 | /** 322 | * get back in out.See example. 323 | * @version Egret 2.4 324 | * @platform Web,Native 325 | * @language en_US 326 | */ 327 | /** 328 | * get back in out。请查看示例 329 | * @version Egret 2.4 330 | * @platform Web,Native 331 | * @language zh_CN 332 | */ 333 | static getBackInOut(amount: number): (t: number) => number; 334 | /** 335 | * back in out.See example. 336 | * @version Egret 2.4 337 | * @platform Web,Native 338 | * @language en_US 339 | */ 340 | /** 341 | * back in out。请查看示例 342 | * @version Egret 2.4 343 | * @platform Web,Native 344 | * @language zh_CN 345 | */ 346 | static backInOut: (t: number) => number; 347 | /** 348 | * circ in.See example. 349 | * @version Egret 2.4 350 | * @platform Web,Native 351 | * @language en_US 352 | */ 353 | /** 354 | * circ in。请查看示例 355 | * @version Egret 2.4 356 | * @platform Web,Native 357 | * @language zh_CN 358 | */ 359 | static circIn(t: number): number; 360 | /** 361 | * circ out.See example. 362 | * @version Egret 2.4 363 | * @platform Web,Native 364 | * @language en_US 365 | */ 366 | /** 367 | * circ out。请查看示例 368 | * @version Egret 2.4 369 | * @platform Web,Native 370 | * @language zh_CN 371 | */ 372 | static circOut(t: number): number; 373 | /** 374 | * circ in out.See example. 375 | * @version Egret 2.4 376 | * @platform Web,Native 377 | * @language en_US 378 | */ 379 | /** 380 | * circ in out。请查看示例 381 | * @version Egret 2.4 382 | * @platform Web,Native 383 | * @language zh_CN 384 | */ 385 | static circInOut(t: number): number; 386 | /** 387 | * bounce in.See example. 388 | * @version Egret 2.4 389 | * @platform Web,Native 390 | * @language en_US 391 | */ 392 | /** 393 | * bounce in。请查看示例 394 | * @version Egret 2.4 395 | * @platform Web,Native 396 | * @language zh_CN 397 | */ 398 | static bounceIn(t: number): number; 399 | /** 400 | * bounce out.See example. 401 | * @version Egret 2.4 402 | * @platform Web,Native 403 | * @language en_US 404 | */ 405 | /** 406 | * bounce out。请查看示例 407 | * @version Egret 2.4 408 | * @platform Web,Native 409 | * @language zh_CN 410 | */ 411 | static bounceOut(t: number): number; 412 | /** 413 | * bounce in out.See example. 414 | * @version Egret 2.4 415 | * @platform Web,Native 416 | * @language en_US 417 | */ 418 | /** 419 | * bounce in out。请查看示例 420 | * @version Egret 2.4 421 | * @platform Web,Native 422 | * @language zh_CN 423 | */ 424 | static bounceInOut(t: number): number; 425 | /** 426 | * get elastic in.See example. 427 | * @version Egret 2.4 428 | * @platform Web,Native 429 | * @language en_US 430 | */ 431 | /** 432 | * get elastic in。请查看示例 433 | * @version Egret 2.4 434 | * @platform Web,Native 435 | * @language zh_CN 436 | */ 437 | static getElasticIn(amplitude: number, period: number): (t: number) => number; 438 | /** 439 | * elastic in.See example. 440 | * @version Egret 2.4 441 | * @platform Web,Native 442 | * @language en_US 443 | */ 444 | /** 445 | * elastic in。请查看示例 446 | * @version Egret 2.4 447 | * @platform Web,Native 448 | * @language zh_CN 449 | */ 450 | static elasticIn: (t: number) => number; 451 | /** 452 | * get elastic out.See example. 453 | * @version Egret 2.4 454 | * @platform Web,Native 455 | * @language en_US 456 | */ 457 | /** 458 | * get elastic out。请查看示例 459 | * @version Egret 2.4 460 | * @platform Web,Native 461 | * @language zh_CN 462 | */ 463 | static getElasticOut(amplitude: number, period: number): (t: number) => number; 464 | /** 465 | * elastic out.See example. 466 | * @version Egret 2.4 467 | * @platform Web,Native 468 | * @language en_US 469 | */ 470 | /** 471 | * elastic out。请查看示例 472 | * @version Egret 2.4 473 | * @platform Web,Native 474 | * @language zh_CN 475 | */ 476 | static elasticOut: (t: number) => number; 477 | /** 478 | * get elastic in out.See example. 479 | * @version Egret 2.4 480 | * @platform Web,Native 481 | * @language en_US 482 | */ 483 | /** 484 | * get elastic in out。请查看示例 485 | * @version Egret 2.4 486 | * @platform Web,Native 487 | * @language zh_CN 488 | */ 489 | static getElasticInOut(amplitude: number, period: number): (t: number) => number; 490 | /** 491 | * elastic in out.See example. 492 | * @version Egret 2.4 493 | * @platform Web,Native 494 | * @language en_US 495 | */ 496 | /** 497 | * elastic in out。请查看示例 498 | * @version Egret 2.4 499 | * @platform Web,Native 500 | * @language zh_CN 501 | */ 502 | static elasticInOut: (t: number) => number; 503 | } 504 | } 505 | declare namespace egret { 506 | /** 507 | * Tween is the animation easing class of Egret 508 | * @see http://edn.egret.com/cn/docs/page/576 Tween ease animation 509 | * @version Egret 2.4 510 | * @platform Web,Native 511 | * @includeExample extension/tween/Tween.ts 512 | * @language en_US 513 | */ 514 | /** 515 | * Tween是Egret的动画缓动类 516 | * @see http://edn.egret.com/cn/docs/page/576 Tween缓动动画 517 | * @version Egret 2.4 518 | * @platform Web,Native 519 | * @includeExample extension/tween/Tween.ts 520 | * @language zh_CN 521 | */ 522 | class Tween extends EventDispatcher { 523 | /** 524 | * 不做特殊处理 525 | * @constant {number} egret.Tween.NONE 526 | * @private 527 | */ 528 | private static NONE; 529 | /** 530 | * 循环 531 | * @constant {number} egret.Tween.LOOP 532 | * @private 533 | */ 534 | private static LOOP; 535 | /** 536 | * 倒序 537 | * @constant {number} egret.Tween.REVERSE 538 | * @private 539 | */ 540 | private static REVERSE; 541 | /** 542 | * @private 543 | */ 544 | private static _tweens; 545 | /** 546 | * @private 547 | */ 548 | private static IGNORE; 549 | /** 550 | * @private 551 | */ 552 | private static _plugins; 553 | /** 554 | * @private 555 | */ 556 | private static _inited; 557 | /** 558 | * @private 559 | */ 560 | private _target; 561 | /** 562 | * @private 563 | */ 564 | private _useTicks; 565 | /** 566 | * @private 567 | */ 568 | private ignoreGlobalPause; 569 | /** 570 | * @private 571 | */ 572 | private loop; 573 | /** 574 | * @private 575 | */ 576 | private pluginData; 577 | /** 578 | * @private 579 | */ 580 | private _curQueueProps; 581 | /** 582 | * @private 583 | */ 584 | private _initQueueProps; 585 | /** 586 | * @private 587 | */ 588 | private _steps; 589 | /** 590 | * @private 591 | */ 592 | private paused; 593 | /** 594 | * @private 595 | */ 596 | private duration; 597 | /** 598 | * @private 599 | */ 600 | private _prevPos; 601 | /** 602 | * @private 603 | */ 604 | private position; 605 | /** 606 | * @private 607 | */ 608 | private _prevPosition; 609 | /** 610 | * @private 611 | */ 612 | private _stepPosition; 613 | /** 614 | * @private 615 | */ 616 | private passive; 617 | /** 618 | * Activate an object and add a Tween animation to the object 619 | * @param target {any} The object to be activated 620 | * @param props {any} Parameters, support loop onChange onChangeObj 621 | * @param pluginData {any} Write realized 622 | * @param override {boolean} Whether to remove the object before adding a tween, the default value false 623 | * Not recommended, you can use Tween.removeTweens(target) instead. 624 | * @version Egret 2.4 625 | * @platform Web,Native 626 | * @language en_US 627 | */ 628 | /** 629 | * 激活一个对象,对其添加 Tween 动画 630 | * @param target {any} 要激活 Tween 的对象 631 | * @param props {any} 参数,支持loop(循环播放) onChange(变化函数) onChangeObj(变化函数作用域) 632 | * @param pluginData {any} 暂未实现 633 | * @param override {boolean} 是否移除对象之前添加的tween,默认值false。 634 | * 不建议使用,可使用 Tween.removeTweens(target) 代替。 635 | * @version Egret 2.4 636 | * @platform Web,Native 637 | * @language zh_CN 638 | */ 639 | static get(target: any, props?: { 640 | loop?: boolean; 641 | onChange?: Function; 642 | onChangeObj?: any; 643 | }, pluginData?: any, override?: boolean): Tween; 644 | /** 645 | * Delete all Tween animations from an object 646 | * @param target The object whose Tween to be deleted 647 | * @version Egret 2.4 648 | * @platform Web,Native 649 | * @language en_US 650 | */ 651 | /** 652 | * 删除一个对象上的全部 Tween 动画 653 | * @param target 需要移除 Tween 的对象 654 | * @version Egret 2.4 655 | * @platform Web,Native 656 | * @language zh_CN 657 | */ 658 | static removeTweens(target: any): void; 659 | /** 660 | * Pause all Tween animations of a certain object 661 | * @param target The object whose Tween to be paused 662 | * @version Egret 2.4 663 | * @platform Web,Native 664 | * @language en_US 665 | */ 666 | /** 667 | * 暂停某个对象的所有 Tween 668 | * @param target 要暂停 Tween 的对象 669 | * @version Egret 2.4 670 | * @platform Web,Native 671 | * @language zh_CN 672 | */ 673 | static pauseTweens(target: any): void; 674 | /** 675 | * Resume playing all easing of a certain object 676 | * @param target The object whose Tween to be resumed 677 | * @version Egret 2.4 678 | * @platform Web,Native 679 | * @language en_US 680 | */ 681 | /** 682 | * 继续播放某个对象的所有缓动 683 | * @param target 要继续播放 Tween 的对象 684 | * @version Egret 2.4 685 | * @platform Web,Native 686 | * @language zh_CN 687 | */ 688 | static resumeTweens(target: any): void; 689 | /** 690 | * @private 691 | * 692 | * @param delta 693 | * @param paused 694 | */ 695 | private static tick(timeStamp, paused?); 696 | private static _lastTime; 697 | /** 698 | * @private 699 | * 700 | * @param tween 701 | * @param value 702 | */ 703 | private static _register(tween, value); 704 | /** 705 | * Delete all Tween 706 | * @version Egret 2.4 707 | * @platform Web,Native 708 | * @language en_US 709 | */ 710 | /** 711 | * 删除所有 Tween 712 | * @version Egret 2.4 713 | * @platform Web,Native 714 | * @language zh_CN 715 | */ 716 | static removeAllTweens(): void; 717 | /** 718 | * 创建一个 egret.Tween 对象 719 | * @private 720 | * @version Egret 2.4 721 | * @platform Web,Native 722 | */ 723 | constructor(target: any, props: any, pluginData: any); 724 | /** 725 | * @private 726 | * 727 | * @param target 728 | * @param props 729 | * @param pluginData 730 | */ 731 | private initialize(target, props, pluginData); 732 | /** 733 | * @private 734 | * 735 | * @param value 736 | * @param actionsMode 737 | * @returns 738 | */ 739 | setPosition(value: number, actionsMode?: number): boolean; 740 | /** 741 | * @private 742 | * 743 | * @param startPos 744 | * @param endPos 745 | * @param includeStart 746 | */ 747 | private _runAction(action, startPos, endPos, includeStart?); 748 | /** 749 | * @private 750 | * 751 | * @param step 752 | * @param ratio 753 | */ 754 | private _updateTargetProps(step, ratio); 755 | /** 756 | * Whether setting is paused 757 | * @param value {boolean} Whether to pause 758 | * @returns Tween object itself 759 | * @version Egret 2.4 760 | * @platform Web,Native 761 | * @language en_US 762 | */ 763 | /** 764 | * 设置是否暂停 765 | * @param value {boolean} 是否暂停 766 | * @returns Tween对象本身 767 | * @version Egret 2.4 768 | * @platform Web,Native 769 | * @language zh_CN 770 | */ 771 | setPaused(value: boolean): Tween; 772 | /** 773 | * @private 774 | * 775 | * @param props 776 | * @returns 777 | */ 778 | private _cloneProps(props); 779 | /** 780 | * @private 781 | * 782 | * @param o 783 | * @returns 784 | */ 785 | private _addStep(o); 786 | /** 787 | * @private 788 | * 789 | * @param o 790 | * @returns 791 | */ 792 | private _appendQueueProps(o); 793 | /** 794 | * @private 795 | * 796 | * @param o 797 | * @returns 798 | */ 799 | private _addAction(o); 800 | /** 801 | * @private 802 | * 803 | * @param props 804 | * @param o 805 | */ 806 | private _set(props, o); 807 | /** 808 | * Wait the specified milliseconds before the execution of the next animation 809 | * @param duration {number} Waiting time, in milliseconds 810 | * @param passive {boolean} Whether properties are updated during the waiting time 811 | * @returns Tween object itself 812 | * @version Egret 2.4 813 | * @platform Web,Native 814 | * @language en_US 815 | */ 816 | /** 817 | * 等待指定毫秒后执行下一个动画 818 | * @param duration {number} 要等待的时间,以毫秒为单位 819 | * @param passive {boolean} 等待期间属性是否会更新 820 | * @returns Tween对象本身 821 | * @version Egret 2.4 822 | * @platform Web,Native 823 | * @language zh_CN 824 | */ 825 | wait(duration: number, passive?: boolean): Tween; 826 | /** 827 | * Modify the property of the specified object to a specified value 828 | * @param props {Object} Property set of an object 829 | * @param duration {number} Duration 830 | * @param ease {egret.Ease} Easing algorithm 831 | * @returns {egret.Tween} Tween object itself 832 | * @version Egret 2.4 833 | * @platform Web,Native 834 | * @language en_US 835 | */ 836 | /** 837 | * 将指定对象的属性修改为指定值 838 | * @param props {Object} 对象的属性集合 839 | * @param duration {number} 持续时间 840 | * @param ease {egret.Ease} 缓动算法 841 | * @returns {egret.Tween} Tween对象本身 842 | * @version Egret 2.4 843 | * @platform Web,Native 844 | * @language zh_CN 845 | */ 846 | to(props: any, duration?: number, ease?: Function): Tween; 847 | /** 848 | * Execute callback function 849 | * @param callback {Function} Callback method 850 | * @param thisObj {any} this action scope of the callback method 851 | * @param params {any[]} Parameter of the callback method 852 | * @returns {egret.Tween} Tween object itself 853 | * @version Egret 2.4 854 | * @platform Web,Native 855 | * @example 856 | *
 857 |          *  egret.Tween.get(display).call(function (a:number, b:string) {
 858 |          *      console.log("a: " + a); // the first parameter passed 233
 859 |          *      console.log("b: " + b); // the second parameter passed “hello”
 860 |          *  }, this, [233, "hello"]);
 861 |          * 
862 | * @language en_US 863 | */ 864 | /** 865 | * 执行回调函数 866 | * @param callback {Function} 回调方法 867 | * @param thisObj {any} 回调方法this作用域 868 | * @param params {any[]} 回调方法参数 869 | * @returns {egret.Tween} Tween对象本身 870 | * @version Egret 2.4 871 | * @platform Web,Native 872 | * @example 873 | *
 874 |          *  egret.Tween.get(display).call(function (a:number, b:string) {
 875 |          *      console.log("a: " + a); //对应传入的第一个参数 233
 876 |          *      console.log("b: " + b); //对应传入的第二个参数 “hello”
 877 |          *  }, this, [233, "hello"]);
 878 |          * 
879 | * @language zh_CN 880 | */ 881 | call(callback: Function, thisObj?: any, params?: any[]): Tween; 882 | /** 883 | * Now modify the properties of the specified object to the specified value 884 | * @param props {Object} Property set of an object 885 | * @param target The object whose Tween to be resumed 886 | * @returns {egret.Tween} Tween object itself 887 | * @version Egret 2.4 888 | * @platform Web,Native 889 | */ 890 | /** 891 | * 立即将指定对象的属性修改为指定值 892 | * @param props {Object} 对象的属性集合 893 | * @param target 要继续播放 Tween 的对象 894 | * @returns {egret.Tween} Tween对象本身 895 | * @version Egret 2.4 896 | * @platform Web,Native 897 | */ 898 | set(props: any, target?: any): Tween; 899 | /** 900 | * Execute 901 | * @param tween {egret.Tween} The Tween object to be operated. Default: this 902 | * @returns {egret.Tween} Tween object itself 903 | * @version Egret 2.4 904 | * @platform Web,Native 905 | * @language en_US 906 | */ 907 | /** 908 | * 执行 909 | * @param tween {egret.Tween} 需要操作的 Tween 对象,默认this 910 | * @returns {egret.Tween} Tween对象本身 911 | * @version Egret 2.4 912 | * @platform Web,Native 913 | * @language zh_CN 914 | */ 915 | play(tween?: Tween): Tween; 916 | /** 917 | * Pause 918 | * @param tween {egret.Tween} The Tween object to be operated. Default: this 919 | * @returns {egret.Tween} Tween object itself 920 | * @version Egret 2.4 921 | * @platform Web,Native 922 | * @language en_US 923 | */ 924 | /** 925 | * 暂停 926 | * @param tween {egret.Tween} 需要操作的 Tween 对象,默认this 927 | * @returns {egret.Tween} Tween对象本身 928 | * @version Egret 2.4 929 | * @platform Web,Native 930 | * @language zh_CN 931 | */ 932 | pause(tween?: Tween): Tween; 933 | /** 934 | * @method egret.Tween#tick 935 | * @param delta {number} 936 | * @private 937 | * @version Egret 2.4 938 | * @platform Web,Native 939 | */ 940 | $tick(delta: number): void; 941 | } 942 | } 943 | declare namespace egret.tween { 944 | type EaseType = 'quadIn' | 'quadOut' | 'quadOut' | 'quadInOut' | 'cubicIn' | 'cubicOut' | 'cubicInOut' | 'quartIn' | 'quartOut' | 'quartInOut' | 'quintIn' | 'quintOut' | 'quintInOut' | 'sineIn' | 'sineOut' | 'sineInOut' | 'backIn' | 'backOut' | 'backInOut' | 'circIn' | 'circOut' | 'circInOut' | 'bounceIn' | 'bounceOut' | 'bounceInOut' | 'elasticIn' | 'elasticOut' | 'elasticInOut'; 945 | /** 946 | * Abstract class, Indicate the base action. 947 | * @version Egret 3.1.8 948 | * @platform Web,Native 949 | * @language en_US 950 | */ 951 | /** 952 | * 抽象类,表示一个基本动作 953 | * @version Egret 3.1.8 954 | * @platform Web,Native 955 | * @language zh_CN 956 | */ 957 | abstract class BasePath extends EventDispatcher { 958 | /** 959 | * the name of this action. 960 | * @version Egret 3.1.8 961 | * @platform Web,Native 962 | * @language en_US 963 | */ 964 | /** 965 | * 动作的名称 966 | * @version Egret 3.1.8 967 | * @platform Web,Native 968 | * @language zh_CN 969 | */ 970 | name: string; 971 | } 972 | /** 973 | * Indicate the to action. See Tween.to 974 | * @version Egret 3.1.8 975 | * @platform Web,Native 976 | * @language en_US 977 | */ 978 | /** 979 | * 表示一个to动作,参见Tween.to 980 | * @version Egret 3.1.8 981 | * @platform Web,Native 982 | * @language zh_CN 983 | */ 984 | class To extends BasePath { 985 | /** 986 | * Property set of an object 987 | * @version Egret 3.1.8 988 | * @platform Web,Native 989 | * @language en_US 990 | */ 991 | /** 992 | * 对象的属性集合 993 | * @version Egret 3.1.8 994 | * @platform Web,Native 995 | * @language zh_CN 996 | */ 997 | props: Object; 998 | /** 999 | * Duration 1000 | * @version Egret 3.1.8 1001 | * @platform Web,Native 1002 | * @language en_US 1003 | */ 1004 | /** 1005 | * 持续时间 1006 | * @version Egret 3.1.8 1007 | * @platform Web,Native 1008 | * @language zh_CN 1009 | */ 1010 | duration: number; 1011 | /** 1012 | * Easing algorithm 1013 | * @version Egret 3.1.8 1014 | * @platform Web,Native 1015 | * @language en_US 1016 | */ 1017 | /** 1018 | * 缓动算法 1019 | * @version Egret 3.1.8 1020 | * @platform Web,Native 1021 | * @language zh_CN 1022 | */ 1023 | ease: EaseType | Function; 1024 | } 1025 | /** 1026 | * Indicate the wait action. See Tween.wait 1027 | * @version Egret 3.1.8 1028 | * @platform Web,Native 1029 | * @language en_US 1030 | */ 1031 | /** 1032 | * 表示一个wait动作,参见Tween.wait 1033 | * @version Egret 3.1.8 1034 | * @platform Web,Native 1035 | * @language zh_CN 1036 | */ 1037 | class Wait extends BasePath { 1038 | /** 1039 | * Duration 1040 | * @version Egret 3.1.8 1041 | * @platform Web,Native 1042 | * @language en_US 1043 | */ 1044 | /** 1045 | * 持续时间 1046 | * @version Egret 3.1.8 1047 | * @platform Web,Native 1048 | * @language zh_CN 1049 | */ 1050 | duration: number; 1051 | /** 1052 | * Whether properties are updated during the waiting time 1053 | * @version Egret 3.1.8 1054 | * @platform Web,Native 1055 | * @language en_US 1056 | */ 1057 | /** 1058 | * 等待期间属性是否会更新 1059 | * @version Egret 3.1.8 1060 | * @platform Web,Native 1061 | * @language zh_CN 1062 | */ 1063 | passive: boolean; 1064 | } 1065 | /** 1066 | * Indicate the set action. See Tween.set 1067 | * @version Egret 3.1.8 1068 | * @platform Web,Native 1069 | * @language en_US 1070 | */ 1071 | /** 1072 | * 表示一个set动作,参见Tween.set 1073 | * @version Egret 3.1.8 1074 | * @platform Web,Native 1075 | * @language zh_CN 1076 | */ 1077 | class Set extends BasePath { 1078 | /** 1079 | * Property set of an object 1080 | * @version Egret 3.1.8 1081 | * @platform Web,Native 1082 | * @language en_US 1083 | */ 1084 | /** 1085 | * 对象的属性集合 1086 | * @version Egret 3.1.8 1087 | * @platform Web,Native 1088 | * @language zh_CN 1089 | */ 1090 | props: Object; 1091 | } 1092 | /** 1093 | * Indicate the tick action. See Tween.tick 1094 | * @version Egret 3.1.8 1095 | * @platform Web,Native 1096 | * @language en_US 1097 | */ 1098 | /** 1099 | * 表示一个tick动作,参见Tween.tick 1100 | * @version Egret 3.1.8 1101 | * @platform Web,Native 1102 | * @language zh_CN 1103 | */ 1104 | class Tick extends BasePath { 1105 | /** 1106 | * Delta time 1107 | * @version Egret 3.1.8 1108 | * @platform Web,Native 1109 | * @language en_US 1110 | */ 1111 | /** 1112 | * 增加的时间 1113 | * @version Egret 3.1.8 1114 | * @platform Web,Native 1115 | * @language zh_CN 1116 | */ 1117 | delta: number; 1118 | } 1119 | /** 1120 | * TweenItem is a wrapper for Tween, which can set the behavior of Tween by setting attributes and adding Path. 1121 | * 1122 | * @event pathComplete Dispatched when some Path has complete. 1123 | * @event complete Dispatched when all Paths has complete. 1124 | * 1125 | * @defaultProperty props 1126 | * @version Egret 3.1.8 1127 | * @platform Web,Native 1128 | * @language en_US 1129 | */ 1130 | /** 1131 | * TweenItem是对Tween的包装器,能通过设置属性和添加Path的方式设置Tween的行为。 1132 | * 通常用于使用在EXML中定义组件的动画。 1133 | * 1134 | * @event pathComplete 当某个Path执行完毕时会派发此事件。 1135 | * @event complete 当所有Path执行完毕时会派发此事件。 1136 | * 1137 | * @defaultProperty props 1138 | * @version Egret 3.1.8 1139 | * @platform Web,Native 1140 | * @language zh_CN 1141 | */ 1142 | /** 1143 | * Use in exml: 1144 | * ``` 1145 | * 1146 | * 1147 | * 1148 | * 1149 | * 1150 | * 1151 | * 1152 | * 1153 | * 1154 | * 1155 | * 1156 | * 1157 | * 1158 | * 1159 | * 1160 | * 1161 | * 1162 | * 1163 | * 1164 | * 1165 | * ``` 1166 | */ 1167 | class TweenItem extends EventDispatcher { 1168 | private tween; 1169 | constructor(); 1170 | /** 1171 | * @private 1172 | */ 1173 | private _props; 1174 | /** 1175 | * The Tween's props. 1176 | * @version Egret 3.1.8 1177 | * @platform Web,Native 1178 | * @language en_US 1179 | */ 1180 | /** 1181 | * Tween的props参数。 1182 | * @version Egret 3.1.8 1183 | * @platform Web,Native 1184 | * @language zh_CN 1185 | */ 1186 | props: any; 1187 | /** 1188 | * @private 1189 | */ 1190 | private _target; 1191 | /** 1192 | * The Tween's target. 1193 | * @version Egret 3.1.8 1194 | * @platform Web,Native 1195 | * @language en_US 1196 | */ 1197 | /** 1198 | * Tween的target参数。 1199 | * @version Egret 3.1.8 1200 | * @platform Web,Native 1201 | * @language zh_CN 1202 | */ 1203 | target: any; 1204 | /** 1205 | * @private 1206 | */ 1207 | private _paths; 1208 | /** 1209 | * The Actions in Tween. 1210 | * @version Egret 3.1.8 1211 | * @platform Web,Native 1212 | * @language en_US 1213 | */ 1214 | /** 1215 | * TweenItem中添加的行为。 1216 | * @version Egret 3.1.8 1217 | * @platform Web,Native 1218 | * @language zh_CN 1219 | */ 1220 | paths: BasePath[]; 1221 | /** 1222 | * Play the Tween 1223 | * @time The starting position, the default is from the last position to play 1224 | * @version Egret 3.1.8 1225 | * @platform Web,Native 1226 | * @language en_US 1227 | */ 1228 | /** 1229 | * 播放Tween 1230 | * @time 播放的起始位置, 默认为从上次位置继续播放 1231 | * @version Egret 3.1.8 1232 | * @platform Web,Native 1233 | * @language zh_CN 1234 | */ 1235 | play(time?: number): void; 1236 | /** 1237 | * Pause the Tween 1238 | * @version Egret 3.1.8 1239 | * @platform Web,Native 1240 | * @language en_US 1241 | */ 1242 | /** 1243 | * 暂停Tween 1244 | * @version Egret 3.1.8 1245 | * @platform Web,Native 1246 | * @language zh_CN 1247 | */ 1248 | pause(): void; 1249 | /** 1250 | * Stop the Tween 1251 | * @version Egret 3.1.8 1252 | * @platform Web,Native 1253 | * @language en_US 1254 | */ 1255 | /** 1256 | * 停止Tween 1257 | * @version Egret 3.1.8 1258 | * @platform Web,Native 1259 | * @language zh_CN 1260 | */ 1261 | stop(): void; 1262 | private createTween(); 1263 | private applyPaths(); 1264 | private applyPath(path); 1265 | private pathComplete(path); 1266 | } 1267 | /** 1268 | * TweenGroup is a collection of TweenItem that can be played in parallel with each Item 1269 | * 1270 | * @event itemComplete Dispatched when some TweenItem has complete. 1271 | * @event complete Dispatched when all TweenItems has complete. 1272 | * 1273 | * @version Egret 3.1.8 1274 | * @platform Web,Native 1275 | * @includeExample extension/tween/TweenWrapper.ts 1276 | * @language en_US 1277 | */ 1278 | /** 1279 | * TweenGroup是TweenItem的集合,可以并行播放每一个Item 1280 | * @version Egret 3.1.8 1281 | * @platform Web,Native 1282 | * @includeExample extension/tween/TweenWrapper.ts 1283 | * @language zh_CN 1284 | */ 1285 | class TweenGroup extends EventDispatcher { 1286 | private completeCount; 1287 | constructor(); 1288 | /** 1289 | * @private 1290 | */ 1291 | private _items; 1292 | /** 1293 | * The Array that TweenItems in TweenGroup. 1294 | * @version Egret 3.1.8 1295 | * @platform Web,Native 1296 | * @language en_US 1297 | */ 1298 | /** 1299 | * TweenGroup要控制的TweenItem集合。 1300 | * @version Egret 3.1.8 1301 | * @platform Web,Native 1302 | * @language zh_CN 1303 | */ 1304 | items: TweenItem[]; 1305 | private registerEvent(add); 1306 | /** 1307 | * Play the all TweenItems 1308 | * @time The starting position, the default is from the last position to play。If use 0, the group will play from the start position. 1309 | * @version Egret 3.1.8 1310 | * @platform Web,Native 1311 | * @language en_US 1312 | */ 1313 | /** 1314 | * 播放所有的TweenItem 1315 | * @time 播放的起始位置, 默认为从上次位置继续播放。如果为0,则从起始位置开始播放。 1316 | * @version Egret 3.1.8 1317 | * @platform Web,Native 1318 | * @language zh_CN 1319 | */ 1320 | play(time?: number): void; 1321 | /** 1322 | * Pause the all TweenItems 1323 | * @version Egret 3.1.8 1324 | * @platform Web,Native 1325 | * @language en_US 1326 | */ 1327 | /** 1328 | * 暂停播放所有的TweenItem 1329 | * @version Egret 3.1.8 1330 | * @platform Web,Native 1331 | * @language zh_CN 1332 | */ 1333 | pause(): void; 1334 | /** 1335 | * Stop the all TweenItems 1336 | * @version Egret 3.1.8 1337 | * @platform Web,Native 1338 | * @language en_US 1339 | */ 1340 | /** 1341 | * 停止所有的TweenItem 1342 | * @version Egret 3.1.8 1343 | * @platform Web,Native 1344 | * @language zh_CN 1345 | */ 1346 | stop(): void; 1347 | private itemComplete(e); 1348 | } 1349 | } 1350 | --------------------------------------------------------------------------------